mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
o11y: the check-in model stops dropping the field it exists to carry
One regenerated file. o11y.GettableAgentCheckIn declares eight properties and
this client had six: `integration_config`/`integrationConfig` and
`removed_at`/`removedAt` each snake_case to one attribute, so the second
shadowed the first and the survivor kept the camel alias.
That is not cosmetic. The snake_case spellings exist because hanzoai/o11y
publishes them so older AWS agents keep working, and this client read such an
agent's value and then threw it away without raising: from_dict with
{"removed_at": 2020, "removedAt": 2030} returned 2030, and
to_dict()["removed_at"] was None. `to_dict` also wrote one value under both
keys, under two different declared types.
The mapping lives in hanzoai/openapi sdks.yaml, where this client's invocation
is declared; nothing here is hand-edited. Eight fields now, both wire names
carried as aliases, and each value round-trips under its own key. Gate unchanged:
182 api and 2172 model modules import, pytest 6 passed with the same
pre-existing test_zap_transport error.
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -32,10 +32,10 @@ class O11yGettableAgentCheckIn(BaseModel):
|
||||
account_id: Optional[StrictStr] = Field(default=None, description="Older fields for backward compatibility with existing AWS agents")
|
||||
cloud_account_id: Optional[StrictStr] = None
|
||||
cloud_integration_id: Optional[StrictStr] = Field(default=None, alias="cloudIntegrationId")
|
||||
integration_config: Optional[O11yIntegrationConfig] = None
|
||||
integration_config_legacy: Optional[O11yIntegrationConfig] = Field(default=None, alias="integration_config")
|
||||
integration_config: Optional[O11yProviderIntegrationConfig] = Field(default=None, alias="integrationConfig")
|
||||
provider_account_id: Optional[StrictStr] = Field(default=None, alias="providerAccountId")
|
||||
removed_at: Optional[datetime] = None
|
||||
removed_at_legacy: Optional[datetime] = Field(default=None, alias="removed_at")
|
||||
removed_at: Optional[datetime] = Field(default=None, alias="removedAt")
|
||||
__properties: ClassVar[List[str]] = ["account_id", "cloud_account_id", "cloudIntegrationId", "integration_config", "integrationConfig", "providerAccountId", "removed_at", "removedAt"]
|
||||
|
||||
@@ -78,9 +78,9 @@ class O11yGettableAgentCheckIn(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of integration_config
|
||||
if self.integration_config:
|
||||
_dict['integration_config'] = self.integration_config.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of integration_config_legacy
|
||||
if self.integration_config_legacy:
|
||||
_dict['integration_config'] = self.integration_config_legacy.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of integration_config
|
||||
if self.integration_config:
|
||||
_dict['integrationConfig'] = self.integration_config.to_dict()
|
||||
|
||||
Reference in New Issue
Block a user