From b8a8a4cc13c15d959b1843ffad7450cabe9f1f92 Mon Sep 17 00:00:00 2001 From: Sy Bohy Date: Mon, 23 Nov 2026 19:24:51 -0800 Subject: [PATCH 1/2] feat: Update to @seamapi/types@1.1231.0 Co-Authored-By: Claude Fable 5.1 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index e92f1208..f44067df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "@seamapi/blueprint": "^1.13.4", "@seamapi/fake-seam-connect": "2.0.10", "@seamapi/smith": "^1.2.1", - "@seamapi/types": "1.1219.0", + "@seamapi/types": "1.1231.0", "change-case": "^5.4.4", "prettier": "^3.2.5" }, @@ -860,9 +860,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1219.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1219.0.tgz", - "integrity": "sha512-Kkvyj/nx9BA+WthNZquD0Q9YatLhnHs06N1Cnieb/EsvoAx3aDZi08uNGmJ8xuYIF+EYZqKk0GdGhyZn6nrTnQ==", + "version": "1.1231.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1231.0.tgz", + "integrity": "sha512-TLJY/435QDNZzGVg5ALdUkV3Xs77SpnyGP1oHBES+EXW1PYaep1TxwmYFzaow4kEjPAmupuXgq9Pr4h++S/d8Q==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 5a42cc62..fd50c1bf 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@seamapi/blueprint": "^1.13.4", "@seamapi/fake-seam-connect": "2.0.10", "@seamapi/smith": "^1.2.1", - "@seamapi/types": "1.1219.0", + "@seamapi/types": "1.1231.0", "change-case": "^5.4.4", "prettier": "^3.2.5" } From f74f94ce81e4169fff5eb104bc13e8a2da4cae70 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Tue, 24 Nov 2026 03:25:55 +0000 Subject: [PATCH 2/2] ci: Generate code --- seam/resources/__init__.py | 1 + seam/resources/access_code.py | 33 ++- seam/resources/access_grant.py | 25 ++ seam/resources/device.py | 68 +++++ seam/resources/phone.py | 54 ++++ seam/resources/seam_event.py | 237 ++++++++++++++++++ seam/resources/unmanaged_access_code.py | 33 ++- seam/resources/unmanaged_access_grant.py | 25 ++ seam/resources/unmanaged_device.py | 58 +++++ seam/routes/access_methods.py | 24 +- seam/routes/noise_sensors_noise_thresholds.py | 24 ++ 11 files changed, 574 insertions(+), 8 deletions(-) diff --git a/seam/resources/__init__.py b/seam/resources/__init__.py index 76424651..b85a253d 100644 --- a/seam/resources/__init__.py +++ b/seam/resources/__init__.py @@ -132,6 +132,7 @@ AccessCodeRemovedFromDeviceEvent, AccessCodeDelayInSettingOnDeviceEvent, AccessCodeFailedToSetOnDeviceEvent, + AccessCodeFailedToDeleteEvent, AccessCodeDeletedEvent, AccessCodeDelayInRemovingFromDeviceEvent, AccessCodeFailedToRemoveFromDeviceEvent, diff --git a/seam/resources/access_code.py b/seam/resources/access_code.py index 5796df33..bebccfe2 100644 --- a/seam/resources/access_code.py +++ b/seam/resources/access_code.py @@ -430,7 +430,7 @@ def from_dict(cls, d: Any): @dataclass class FailedToDeleteError(ResourceMapping): - """This access code is still active on the device even though its ``ends_at`` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to delete it, and this error clears automatically once the access code is no longer active. + """Seam was unable to remove this access code from the device in time after it was deleted or its ``ends_at`` passed, so the recipient may still be able to unlock the device. Seam keeps trying to delete it, and this error clears automatically once the access code is no longer usable on the device. :ivar created_at: Date and time at which Seam created the error. @@ -741,6 +741,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class LowBatteryError(ResourceMapping): + """Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar is_device_error: Indicates that the error is a device error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: Literal["low_battery"] + is_device_error: Literal[True] + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + is_device_error=d.get("is_device_error", None), + message=d.get("message", None), + ) + @dataclass class MissingDeviceCredentialsError(ResourceMapping): """Indicates that device credentials are missing. @@ -1389,7 +1416,7 @@ def from_dict(cls, d: Any): @dataclass class BeingDeletedWarning(ResourceMapping): - """Access code is being deleted. + """Access code is being deleted, because it was deleted or passed its ``ends_at``. It can no longer be updated. :ivar created_at: Date and time at which Seam created the warning. @@ -1482,6 +1509,7 @@ def from_dict(cls, d: Any): DeviceDisconnectedError, EmptyBackupAccessCodePoolError, AugustLockNotAuthorizedError, + LowBatteryError, MissingDeviceCredentialsError, AuxiliaryHeatRunningError, SubscriptionRequiredError, @@ -1509,6 +1537,7 @@ def from_dict(cls, d: Any): "device_disconnected": DeviceDisconnectedError, "empty_backup_access_code_pool": EmptyBackupAccessCodePoolError, "august_lock_not_authorized": AugustLockNotAuthorizedError, + "low_battery": LowBatteryError, "missing_device_credentials": MissingDeviceCredentialsError, "auxiliary_heat_running": AuxiliaryHeatRunningError, "subscription_required": SubscriptionRequiredError, diff --git a/seam/resources/access_grant.py b/seam/resources/access_grant.py index d34fe83a..4ee2bb1d 100644 --- a/seam/resources/access_grant.py +++ b/seam/resources/access_grant.py @@ -531,6 +531,29 @@ def from_dict(cls, d: Any): warning_code=d.get("warning_code", None), ) + @dataclass + class MobileKeyWithheldWarning(ResourceMapping): + """Indicates that Seam did not issue the mobile key requested for this access grant, because the user's email address or phone number belongs to other user identities and Seam cannot tell which person's app should receive it. The other requested access methods were issued. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: Literal["mobile_key_withheld"] + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + Errors = Union[CannotCreateRequestedAccessMethodsError, AccessNotProvisionedError] _ErrorsVariants = { "cannot_create_requested_access_methods": CannotCreateRequestedAccessMethodsError, @@ -554,6 +577,7 @@ def from_dict(cls, d: Any): DeviceDoesNotSupportAccessCodesWarning, DeviceTimeConstraintsViolatedWarning, AccessRevokedWarning, + MobileKeyWithheldWarning, ] _WarningsVariants = { "being_deleted": BeingDeletedWarning, @@ -564,6 +588,7 @@ def from_dict(cls, d: Any): "device_does_not_support_access_codes": DeviceDoesNotSupportAccessCodesWarning, "device_time_constraints_violated": DeviceTimeConstraintsViolatedWarning, "access_revoked": AccessRevokedWarning, + "mobile_key_withheld": MobileKeyWithheldWarning, } access_grant_id: str diff --git a/seam/resources/device.py b/seam/resources/device.py index 2d4583f2..24e0ae3f 100644 --- a/seam/resources/device.py +++ b/seam/resources/device.py @@ -87,10 +87,16 @@ class Device: :ivar estimated_occupant_count: Estimated number of occupants detected by the device. + :ivar is_casing_tampered_with: Indicates whether the device was last reported as having its casing opened or tampered with. Omitted when the provider reports no casing state, including when the device does not support casing tamper detection. This is independent of ``is_detached_from_mounting_plate``. + + :ivar is_detached_from_mounting_plate: Indicates whether the device was last reported as detached from its mounting plate. Omitted when Seam has no accepted observation, including when the device does not support mounting plate detection, reports an unknown status, or is offline. This is the last accepted provider observation, not a guarantee of current hardware state; check ``is_online`` before acting on it. + :ivar is_managed: Indicates whether Seam manages the device. See also `Managed and Unmanaged Devices `_. :ivar is_occupancy_detected: Indicates whether the device detects occupancy. + :ivar is_online: Indicates whether the device is online. + :ivar is_smoking_detected: Indicates whether the device detects smoking, if the device measures it. :ivar location: Location information for the device. @@ -456,6 +462,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class LowBatteryError(ResourceMapping): + """Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar is_device_error: Indicates that the error is a device error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: Literal["low_battery"] + is_device_error: Literal[True] + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + is_device_error=d.get("is_device_error", None), + message=d.get("message", None), + ) + @dataclass class MissingDeviceCredentialsError(ResourceMapping): """Indicates that device credentials are missing. @@ -4456,6 +4489,29 @@ def from_dict(cls, d: Any): warning_code=d.get("warning_code", None), ) + @dataclass + class BatteryReplacementRecommendedWarning(ResourceMapping): + """Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: Literal["battery_replacement_recommended"] + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + @dataclass class UnreliableOnlineStatusWarning(ResourceMapping): """Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status. @@ -4569,6 +4625,7 @@ def from_dict(cls, d: Any): DeviceDisconnectedError, EmptyBackupAccessCodePoolError, AugustLockNotAuthorizedError, + LowBatteryError, MissingDeviceCredentialsError, AuxiliaryHeatRunningError, SubscriptionRequiredError, @@ -4585,6 +4642,7 @@ def from_dict(cls, d: Any): "device_disconnected": DeviceDisconnectedError, "empty_backup_access_code_pool": EmptyBackupAccessCodePoolError, "august_lock_not_authorized": AugustLockNotAuthorizedError, + "low_battery": LowBatteryError, "missing_device_credentials": MissingDeviceCredentialsError, "auxiliary_heat_running": AuxiliaryHeatRunningError, "subscription_required": SubscriptionRequiredError, @@ -4619,6 +4677,7 @@ def from_dict(cls, d: Any): KeynestUnsupportedLockerWarning, AccessoryKeypadSetupRequiredWarning, AccessoryKeypadLowBatteryWarning, + BatteryReplacementRecommendedWarning, UnreliableOnlineStatusWarning, MaxAccessCodesReachedWarning, SubscriptionRequiredForAdditionalCapabilitiesWarning, @@ -4652,6 +4711,7 @@ def from_dict(cls, d: Any): "keynest_unsupported_locker": KeynestUnsupportedLockerWarning, "accessory_keypad_setup_required": AccessoryKeypadSetupRequiredWarning, "accessory_keypad_low_battery": AccessoryKeypadLowBatteryWarning, + "battery_replacement_recommended": BatteryReplacementRecommendedWarning, "unreliable_online_status": UnreliableOnlineStatusWarning, "max_access_codes_reached": MaxAccessCodesReachedWarning, "subscription_required_for_additional_capabilities": SubscriptionRequiredForAdditionalCapabilitiesWarning, @@ -4763,8 +4823,11 @@ def from_dict(cls, d: Any): display_name: str errors: List[Errors] estimated_occupant_count: Optional[float] + is_casing_tampered_with: Optional[bool] + is_detached_from_mounting_plate: Optional[bool] is_managed: Literal[True] is_occupancy_detected: Optional[bool] + is_online: bool is_smoking_detected: Optional[bool] location: Optional[Location] mold_risk_level: Optional[str] @@ -4844,8 +4907,13 @@ def from_dict(cls, d: Any): for i in d.get("errors") or [] ], estimated_occupant_count=d.get("estimated_occupant_count", None), + is_casing_tampered_with=d.get("is_casing_tampered_with", None), + is_detached_from_mounting_plate=d.get( + "is_detached_from_mounting_plate", None + ), is_managed=d.get("is_managed", None), is_occupancy_detected=d.get("is_occupancy_detected", None), + is_online=d.get("is_online", None), is_smoking_detected=d.get("is_smoking_detected", None), location=( cls.Location.from_dict(d.get("location")) diff --git a/seam/resources/phone.py b/seam/resources/phone.py index 092fd896..badf7bfc 100644 --- a/seam/resources/phone.py +++ b/seam/resources/phone.py @@ -321,6 +321,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class LowBatteryError(ResourceMapping): + """Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar is_device_error: Indicates that the error is a device error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: Literal["low_battery"] + is_device_error: Literal[True] + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + is_device_error=d.get("is_device_error", None), + message=d.get("message", None), + ) + @dataclass class MissingDeviceCredentialsError(ResourceMapping): """Indicates that device credentials are missing. @@ -1143,6 +1170,29 @@ def from_dict(cls, d: Any): warning_code=d.get("warning_code", None), ) + @dataclass + class BatteryReplacementRecommendedWarning(ResourceMapping): + """Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: Literal["battery_replacement_recommended"] + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + @dataclass class UnreliableOnlineStatusWarning(ResourceMapping): """Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status. @@ -1256,6 +1306,7 @@ def from_dict(cls, d: Any): DeviceDisconnectedError, EmptyBackupAccessCodePoolError, AugustLockNotAuthorizedError, + LowBatteryError, MissingDeviceCredentialsError, AuxiliaryHeatRunningError, SubscriptionRequiredError, @@ -1272,6 +1323,7 @@ def from_dict(cls, d: Any): "device_disconnected": DeviceDisconnectedError, "empty_backup_access_code_pool": EmptyBackupAccessCodePoolError, "august_lock_not_authorized": AugustLockNotAuthorizedError, + "low_battery": LowBatteryError, "missing_device_credentials": MissingDeviceCredentialsError, "auxiliary_heat_running": AuxiliaryHeatRunningError, "subscription_required": SubscriptionRequiredError, @@ -1306,6 +1358,7 @@ def from_dict(cls, d: Any): KeynestUnsupportedLockerWarning, AccessoryKeypadSetupRequiredWarning, AccessoryKeypadLowBatteryWarning, + BatteryReplacementRecommendedWarning, UnreliableOnlineStatusWarning, MaxAccessCodesReachedWarning, SubscriptionRequiredForAdditionalCapabilitiesWarning, @@ -1339,6 +1392,7 @@ def from_dict(cls, d: Any): "keynest_unsupported_locker": KeynestUnsupportedLockerWarning, "accessory_keypad_setup_required": AccessoryKeypadSetupRequiredWarning, "accessory_keypad_low_battery": AccessoryKeypadLowBatteryWarning, + "battery_replacement_recommended": BatteryReplacementRecommendedWarning, "unreliable_online_status": UnreliableOnlineStatusWarning, "max_access_codes_reached": MaxAccessCodesReachedWarning, "subscription_required_for_additional_capabilities": SubscriptionRequiredForAdditionalCapabilitiesWarning, diff --git a/seam/resources/seam_event.py b/seam/resources/seam_event.py index fbab002c..35ad0a75 100644 --- a/seam/resources/seam_event.py +++ b/seam/resources/seam_event.py @@ -1199,6 +1199,241 @@ def from_dict(cls, d: Any): ) +@dataclass +class AccessCodeFailedToDeleteEvent: + """Seam was unable to remove an `access code `_ from the device in time after it was deleted or its ``ends_at`` passed, so the recipient may still be able to unlock the device. Seam keeps trying to delete it, and the accompanying ``failed_to_delete`` error clears automatically once the access code is no longer usable on the device. + + :ivar access_code_errors: Errors associated with the access code. + + :ivar access_code_id: ID of the affected access code. + + :ivar access_code_warnings: Warnings associated with the access code. + + :ivar connected_account_custom_metadata: Custom metadata of the connected account, present when connected_account_id is provided. + + :ivar connected_account_errors: Errors associated with the connected account. + + :ivar connected_account_id: ID of the connected account associated with the affected access code. + + :ivar connected_account_warnings: Warnings associated with the connected account. + + :ivar created_at: Date and time at which the event was created. + + :ivar device_custom_metadata: Custom metadata of the device, present when device_id is provided. + + :ivar device_errors: Errors associated with the device. + + :ivar device_id: ID of the device associated with the affected access code. + + :ivar device_warnings: Warnings associated with the device. + + :ivar event_description: Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. + + :ivar event_id: ID of the event. + + :ivar event_type: + + :ivar occurred_at: Date and time at which the event occurred. + + :ivar workspace_id: ID of the workspace associated with the event.""" + + @dataclass + class AccessCodeErrors(ResourceMapping): + """Errors associated with the access code. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: str + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + message=d.get("message", None), + ) + + @dataclass + class AccessCodeWarnings(ResourceMapping): + """Warnings associated with the access code. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + + @dataclass + class ConnectedAccountErrors(ResourceMapping): + """Errors associated with the connected account. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: str + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + message=d.get("message", None), + ) + + @dataclass + class ConnectedAccountWarnings(ResourceMapping): + """Warnings associated with the connected account. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + + @dataclass + class DeviceErrors(ResourceMapping): + """Errors associated with the device. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: str + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + message=d.get("message", None), + ) + + @dataclass + class DeviceWarnings(ResourceMapping): + """Warnings associated with the device. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + + access_code_errors: List[AccessCodeErrors] + access_code_id: str + access_code_warnings: List[AccessCodeWarnings] + connected_account_custom_metadata: Optional[Dict[str, Union[str, bool]]] + connected_account_errors: List[ConnectedAccountErrors] + connected_account_id: str + connected_account_warnings: List[ConnectedAccountWarnings] + created_at: str + device_custom_metadata: Optional[Dict[str, Union[str, bool]]] + device_errors: List[DeviceErrors] + device_id: str + device_warnings: List[DeviceWarnings] + event_description: str + event_id: str + event_type: Literal["access_code.failed_to_delete"] + occurred_at: str + workspace_id: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + access_code_errors=[ + cls.AccessCodeErrors.from_dict(i) + for i in d.get("access_code_errors") or [] + ], + access_code_id=d.get("access_code_id", None), + access_code_warnings=[ + cls.AccessCodeWarnings.from_dict(i) + for i in d.get("access_code_warnings") or [] + ], + connected_account_custom_metadata=DeepAttrDict( + d.get("connected_account_custom_metadata", None) + ), + connected_account_errors=[ + cls.ConnectedAccountErrors.from_dict(i) + for i in d.get("connected_account_errors") or [] + ], + connected_account_id=d.get("connected_account_id", None), + connected_account_warnings=[ + cls.ConnectedAccountWarnings.from_dict(i) + for i in d.get("connected_account_warnings") or [] + ], + created_at=d.get("created_at", None), + device_custom_metadata=DeepAttrDict(d.get("device_custom_metadata", None)), + device_errors=[ + cls.DeviceErrors.from_dict(i) for i in d.get("device_errors") or [] + ], + device_id=d.get("device_id", None), + device_warnings=[ + cls.DeviceWarnings.from_dict(i) for i in d.get("device_warnings") or [] + ], + event_description=d.get("event_description", None), + event_id=d.get("event_id", None), + event_type=d.get("event_type", None), + occurred_at=d.get("occurred_at", None), + workspace_id=d.get("workspace_id", None), + ) + + @dataclass class AccessCodeDeletedEvent: """An `access code `_ was deleted. @@ -8083,6 +8318,7 @@ def from_dict(cls, d: Any): AccessCodeRemovedFromDeviceEvent, AccessCodeDelayInSettingOnDeviceEvent, AccessCodeFailedToSetOnDeviceEvent, + AccessCodeFailedToDeleteEvent, AccessCodeDeletedEvent, AccessCodeDelayInRemovingFromDeviceEvent, AccessCodeFailedToRemoveFromDeviceEvent, @@ -8196,6 +8432,7 @@ def from_dict(cls, d: Any): "access_code.removed_from_device": AccessCodeRemovedFromDeviceEvent, "access_code.delay_in_setting_on_device": AccessCodeDelayInSettingOnDeviceEvent, "access_code.failed_to_set_on_device": AccessCodeFailedToSetOnDeviceEvent, + "access_code.failed_to_delete": AccessCodeFailedToDeleteEvent, "access_code.deleted": AccessCodeDeletedEvent, "access_code.delay_in_removing_from_device": AccessCodeDelayInRemovingFromDeviceEvent, "access_code.failed_to_remove_from_device": AccessCodeFailedToRemoveFromDeviceEvent, diff --git a/seam/resources/unmanaged_access_code.py b/seam/resources/unmanaged_access_code.py index eb4d308b..4c67e6c3 100644 --- a/seam/resources/unmanaged_access_code.py +++ b/seam/resources/unmanaged_access_code.py @@ -416,7 +416,7 @@ def from_dict(cls, d: Any): @dataclass class FailedToDeleteError(ResourceMapping): - """This access code is still active on the device even though its ``ends_at`` has passed, so the recipient may still be able to unlock the device after their access window ended. Seam is attempting to delete it, and this error clears automatically once the access code is no longer active. + """Seam was unable to remove this access code from the device in time after it was deleted or its ``ends_at`` passed, so the recipient may still be able to unlock the device. Seam keeps trying to delete it, and this error clears automatically once the access code is no longer usable on the device. :ivar created_at: Date and time at which Seam created the error. @@ -727,6 +727,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class LowBatteryError(ResourceMapping): + """Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar is_device_error: Indicates that the error is a device error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: Literal["low_battery"] + is_device_error: Literal[True] + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + is_device_error=d.get("is_device_error", None), + message=d.get("message", None), + ) + @dataclass class MissingDeviceCredentialsError(ResourceMapping): """Indicates that device credentials are missing. @@ -1104,7 +1131,7 @@ def from_dict(cls, d: Any): @dataclass class BeingDeletedWarning(ResourceMapping): - """Access code is being deleted. + """Access code is being deleted, because it was deleted or passed its ``ends_at``. It can no longer be updated. :ivar created_at: Date and time at which Seam created the warning. @@ -1197,6 +1224,7 @@ def from_dict(cls, d: Any): DeviceDisconnectedError, EmptyBackupAccessCodePoolError, AugustLockNotAuthorizedError, + LowBatteryError, MissingDeviceCredentialsError, AuxiliaryHeatRunningError, SubscriptionRequiredError, @@ -1224,6 +1252,7 @@ def from_dict(cls, d: Any): "device_disconnected": DeviceDisconnectedError, "empty_backup_access_code_pool": EmptyBackupAccessCodePoolError, "august_lock_not_authorized": AugustLockNotAuthorizedError, + "low_battery": LowBatteryError, "missing_device_credentials": MissingDeviceCredentialsError, "auxiliary_heat_running": AuxiliaryHeatRunningError, "subscription_required": SubscriptionRequiredError, diff --git a/seam/resources/unmanaged_access_grant.py b/seam/resources/unmanaged_access_grant.py index 2fb52035..cd4f03cc 100644 --- a/seam/resources/unmanaged_access_grant.py +++ b/seam/resources/unmanaged_access_grant.py @@ -521,6 +521,29 @@ def from_dict(cls, d: Any): warning_code=d.get("warning_code", None), ) + @dataclass + class MobileKeyWithheldWarning(ResourceMapping): + """Indicates that Seam did not issue the mobile key requested for this access grant, because the user's email address or phone number belongs to other user identities and Seam cannot tell which person's app should receive it. The other requested access methods were issued. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: Literal["mobile_key_withheld"] + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + Errors = Union[CannotCreateRequestedAccessMethodsError, AccessNotProvisionedError] _ErrorsVariants = { "cannot_create_requested_access_methods": CannotCreateRequestedAccessMethodsError, @@ -544,6 +567,7 @@ def from_dict(cls, d: Any): DeviceDoesNotSupportAccessCodesWarning, DeviceTimeConstraintsViolatedWarning, AccessRevokedWarning, + MobileKeyWithheldWarning, ] _WarningsVariants = { "being_deleted": BeingDeletedWarning, @@ -554,6 +578,7 @@ def from_dict(cls, d: Any): "device_does_not_support_access_codes": DeviceDoesNotSupportAccessCodesWarning, "device_time_constraints_violated": DeviceTimeConstraintsViolatedWarning, "access_revoked": AccessRevokedWarning, + "mobile_key_withheld": MobileKeyWithheldWarning, } access_grant_id: str diff --git a/seam/resources/unmanaged_device.py b/seam/resources/unmanaged_device.py index 783d531b..498c8830 100644 --- a/seam/resources/unmanaged_device.py +++ b/seam/resources/unmanaged_device.py @@ -77,6 +77,8 @@ class UnmanagedDevice: :ivar is_managed: Indicates that Seam does not manage the device. + :ivar is_online: Indicates whether the device is online. + :ivar location: Location information for the device. :ivar properties: properties of the device. @@ -372,6 +374,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class LowBatteryError(ResourceMapping): + """Indicates that the lock has about one week, two days, or a critically low amount of battery life remaining. Replace the lock's batteries promptly to avoid losing access. + + :ivar created_at: Date and time at which Seam created the error. + + :ivar error_code: Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + + :ivar is_device_error: Indicates that the error is a device error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: str + error_code: Literal["low_battery"] + is_device_error: Literal[True] + message: str + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + error_code=d.get("error_code", None), + is_device_error=d.get("is_device_error", None), + message=d.get("message", None), + ) + @dataclass class MissingDeviceCredentialsError(ResourceMapping): """Indicates that device credentials are missing. @@ -1270,6 +1299,29 @@ def from_dict(cls, d: Any): warning_code=d.get("warning_code", None), ) + @dataclass + class BatteryReplacementRecommendedWarning(ResourceMapping): + """Indicates that the lock has about two weeks of battery life remaining or the provider otherwise recommends replacing the lock's batteries soon. + + :ivar created_at: Date and time at which Seam created the warning. + + :ivar message: Detailed description of the warning. Provides insights into the issue and potentially how to rectify it. + + :ivar warning_code: Unique identifier of the type of warning. Enables quick recognition and categorization of the issue. + """ + + created_at: str + message: str + warning_code: Literal["battery_replacement_recommended"] + + @classmethod + def from_dict(cls, d: Any): + return cls( + created_at=d.get("created_at", None), + message=d.get("message", None), + warning_code=d.get("warning_code", None), + ) + @dataclass class UnreliableOnlineStatusWarning(ResourceMapping): """Indicates that the device may optimistically be reported as online because the provider does not reliably report its online status. @@ -1383,6 +1435,7 @@ def from_dict(cls, d: Any): DeviceDisconnectedError, EmptyBackupAccessCodePoolError, AugustLockNotAuthorizedError, + LowBatteryError, MissingDeviceCredentialsError, AuxiliaryHeatRunningError, SubscriptionRequiredError, @@ -1399,6 +1452,7 @@ def from_dict(cls, d: Any): "device_disconnected": DeviceDisconnectedError, "empty_backup_access_code_pool": EmptyBackupAccessCodePoolError, "august_lock_not_authorized": AugustLockNotAuthorizedError, + "low_battery": LowBatteryError, "missing_device_credentials": MissingDeviceCredentialsError, "auxiliary_heat_running": AuxiliaryHeatRunningError, "subscription_required": SubscriptionRequiredError, @@ -1433,6 +1487,7 @@ def from_dict(cls, d: Any): KeynestUnsupportedLockerWarning, AccessoryKeypadSetupRequiredWarning, AccessoryKeypadLowBatteryWarning, + BatteryReplacementRecommendedWarning, UnreliableOnlineStatusWarning, MaxAccessCodesReachedWarning, SubscriptionRequiredForAdditionalCapabilitiesWarning, @@ -1466,6 +1521,7 @@ def from_dict(cls, d: Any): "keynest_unsupported_locker": KeynestUnsupportedLockerWarning, "accessory_keypad_setup_required": AccessoryKeypadSetupRequiredWarning, "accessory_keypad_low_battery": AccessoryKeypadLowBatteryWarning, + "battery_replacement_recommended": BatteryReplacementRecommendedWarning, "unreliable_online_status": UnreliableOnlineStatusWarning, "max_access_codes_reached": MaxAccessCodesReachedWarning, "subscription_required_for_additional_capabilities": SubscriptionRequiredForAdditionalCapabilitiesWarning, @@ -1572,6 +1628,7 @@ def from_dict(cls, d: Any): display_name: str errors: List[Errors] is_managed: Literal[False] + is_online: bool location: Optional[Location] properties: Optional[Properties] warnings: List[Warnings] @@ -1628,6 +1685,7 @@ def from_dict(cls, d: Any): for i in d.get("errors") or [] ], is_managed=d.get("is_managed", None), + is_online=d.get("is_online", None), location=( cls.Location.from_dict(d.get("location")) if d.get("location") is not None diff --git a/seam/routes/access_methods.py b/seam/routes/access_methods.py index d21eadb0..35d6ea46 100644 --- a/seam/routes/access_methods.py +++ b/seam/routes/access_methods.py @@ -61,7 +61,11 @@ def delete( :param reservation_key: Reservation key of the access grant whose access methods should be deleted. - :raises ValueError: At least one parameter must be provided.""" + :raises ValueError: At least one parameter must be provided. + + .. deprecated:: + Access methods are managed by their access grant. Some workflows still need this endpoint today; access grant routes will replace it for them soon. + """ raise NotImplementedError() @abc.abstractmethod @@ -238,7 +242,11 @@ async def delete( :param reservation_key: Reservation key of the access grant whose access methods should be deleted. - :raises ValueError: At least one parameter must be provided.""" + :raises ValueError: At least one parameter must be provided. + + .. deprecated:: + Access methods are managed by their access grant. Some workflows still need this endpoint today; access grant routes will replace it for them soon. + """ raise NotImplementedError() @abc.abstractmethod @@ -450,7 +458,11 @@ def delete( :param reservation_key: Reservation key of the access grant whose access methods should be deleted. - :raises ValueError: At least one parameter must be provided.""" + :raises ValueError: At least one parameter must be provided. + + .. deprecated:: + Access methods are managed by their access grant. Some workflows still need this endpoint today; access grant routes will replace it for them soon. + """ params: Dict[str, Any] = {} if access_grant_id is not None: @@ -786,7 +798,11 @@ async def delete( :param reservation_key: Reservation key of the access grant whose access methods should be deleted. - :raises ValueError: At least one parameter must be provided.""" + :raises ValueError: At least one parameter must be provided. + + .. deprecated:: + Access methods are managed by their access grant. Some workflows still need this endpoint today; access grant routes will replace it for them soon. + """ params: Dict[str, Any] = {} if access_grant_id is not None: diff --git a/seam/routes/noise_sensors_noise_thresholds.py b/seam/routes/noise_sensors_noise_thresholds.py index 34750dda..4590cbe2 100644 --- a/seam/routes/noise_sensors_noise_thresholds.py +++ b/seam/routes/noise_sensors_noise_thresholds.py @@ -22,6 +22,8 @@ def create( ) -> NoiseThreshold: """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the request fails with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the request fails with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device for which you want to create a noise threshold. :param ends_daily_at: Time at which the new noise threshold should become inactive daily. @@ -41,6 +43,8 @@ def create( def delete(self, *, device_id: str, noise_threshold_id: str) -> None: """Deletes a `noise threshold `_ from a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to delete. :param noise_threshold_id: ID of the noise threshold that you want to delete.""" @@ -78,6 +82,8 @@ def update( ) -> None: """Updates a `noise threshold `_ for a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to update. :param noise_threshold_id: ID of the noise threshold that you want to update. @@ -110,6 +116,8 @@ async def create( ) -> NoiseThreshold: """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the request fails with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the request fails with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device for which you want to create a noise threshold. :param ends_daily_at: Time at which the new noise threshold should become inactive daily. @@ -129,6 +137,8 @@ async def create( async def delete(self, *, device_id: str, noise_threshold_id: str) -> None: """Deletes a `noise threshold `_ from a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to delete. :param noise_threshold_id: ID of the noise threshold that you want to delete.""" @@ -166,6 +176,8 @@ async def update( ) -> None: """Updates a `noise threshold `_ for a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to update. :param noise_threshold_id: ID of the noise threshold that you want to update. @@ -205,6 +217,8 @@ def create( ) -> NoiseThreshold: """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the request fails with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the request fails with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device for which you want to create a noise threshold. :param ends_daily_at: Time at which the new noise threshold should become inactive daily. @@ -248,6 +262,8 @@ def create( def delete(self, *, device_id: str, noise_threshold_id: str) -> None: """Deletes a `noise threshold `_ from a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to delete. :param noise_threshold_id: ID of the noise threshold that you want to delete.""" @@ -324,6 +340,8 @@ def update( ) -> None: """Updates a `noise threshold `_ for a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to update. :param noise_threshold_id: ID of the noise threshold that you want to update. @@ -381,6 +399,8 @@ async def create( ) -> NoiseThreshold: """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the request fails with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the request fails with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device for which you want to create a noise threshold. :param ends_daily_at: Time at which the new noise threshold should become inactive daily. @@ -424,6 +444,8 @@ async def create( async def delete(self, *, device_id: str, noise_threshold_id: str) -> None: """Deletes a `noise threshold `_ from a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to delete. :param noise_threshold_id: ID of the noise threshold that you want to delete.""" @@ -506,6 +528,8 @@ async def update( ) -> None: """Updates a `noise threshold `_ for a `noise sensor `_. + For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a ``noise_threshold_managed_by_noise_profile`` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a ``noise_profile_assignment_unverified`` error and nothing is changed; try again. + :param device_id: ID of the device that contains the noise threshold that you want to update. :param noise_threshold_id: ID of the noise threshold that you want to update.