diff --git a/package-lock.json b/package-lock.json index 2cb6e40d..71372b48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,10 +6,10 @@ "": { "name": "@seamapi/python", "devDependencies": { - "@seamapi/blueprint": "^1.8.0", + "@seamapi/blueprint": "^1.9.1", "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1037.0", + "@seamapi/types": "1.1047.0", "change-case": "^5.4.4", "prettier": "^3.2.5" }, @@ -787,9 +787,9 @@ "license": "MIT" }, "node_modules/@seamapi/blueprint": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-1.8.0.tgz", - "integrity": "sha512-NUghBmYaKreBeBxwPIB2O9hjIFZtEjVj73tAsuKdJR8t4BxlKK1I0XDQXxo3ZsH2QezNlbdo9/0MoX/33VXuhQ==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@seamapi/blueprint/-/blueprint-1.9.1.tgz", + "integrity": "sha512-A9H3dZE9f+ZEEnOAlMl5jSlL5F/RIKkjOF8NDFbnuahAiu/trDz/RzHOGhbQd6sd0RErIyx3eG1p4HCOJDKDCA==", "dev": true, "license": "MIT", "dependencies": { @@ -853,9 +853,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1037.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1037.0.tgz", - "integrity": "sha512-3HbkUbACvkQsybIOdmDslMHRXPePrPgZ6WwX6pXO8MyO8o3hMsxy5qTr+HJZbG6tTSqMHQ8HP1uVLZIk+WrN5A==", + "version": "1.1047.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1047.0.tgz", + "integrity": "sha512-S3A3FcQ4fWJ1IsxVjHaE14k7WlQt0iKJsb3oPF/YVUZHJAmHnFg6riAF6LghlMig7prLf6C2uxaTDairw5dCJQ==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index ec4363c4..c42fcef3 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ }, "packageManager": "npm@11.19.0", "devDependencies": { - "@seamapi/blueprint": "^1.8.0", + "@seamapi/blueprint": "^1.9.1", "@seamapi/fake-seam-connect": "2.0.5", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1037.0", + "@seamapi/types": "1.1047.0", "change-case": "^5.4.4", "prettier": "^3.2.5" } diff --git a/seam/resources/access_grant.py b/seam/resources/access_grant.py index e5cb40d6..8e52b3e4 100644 --- a/seam/resources/access_grant.py +++ b/seam/resources/access_grant.py @@ -29,7 +29,7 @@ class AccessGrant: :ivar display_name: Display name of the Access Grant. - :ivar display_status: Human-readable sentence answering whether the user can currently get in, for example ``Awaiting encoding`` on an access method or ``Upcoming`` here. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read ``starts_at``, ``ends_at``, ``errors``, and the access methods' own fields. + :ivar display_status: Human-readable sentence answering whether the user can currently get in, for example ``Active``, ``Awaiting issuance``, or ``Upcoming``. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read ``starts_at``, ``ends_at``, ``errors``, and the access methods' own fields. :ivar ends_at: Date and time at which the Access Grant ends. diff --git a/seam/resources/seam_event.py b/seam/resources/seam_event.py index f271d788..d843dd82 100644 --- a/seam/resources/seam_event.py +++ b/seam/resources/seam_event.py @@ -5556,9 +5556,9 @@ def from_dict(cls, d: Any): class DeviceLowBatteryEvent: """A device battery level dropped below the low threshold. - :ivar battery_level: Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. + :ivar accessory_keypad_battery_level: Number in the range 0 to 1.0 indicating the battery level of the affected device's paired accessory keypad, when the device has one and its level is known. - :ivar battery_source: Battery that dropped below the low threshold. ``lock``: the lock's own battery. ``accessory_keypad``: a paired accessory keypad's battery. Omitted for events emitted before this field existed, which always refer to the lock's own battery. + :ivar battery_level: Deprecated: Use device_battery_level and accessory_keypad_battery_level, which distinguish the device's own battery from a paired accessory keypad's battery. Number in the range 0 to 1.0 indicating the level of the battery whose drop triggered this event. :ivar connected_account_custom_metadata: Custom metadata of the connected account, present when connected_account_id is provided. @@ -5568,6 +5568,8 @@ class DeviceLowBatteryEvent: :ivar customer_key: The customer key associated with the device, if any. + :ivar device_battery_level: Number in the range 0 to 1.0 indicating the affected device's own battery level, when known. + :ivar device_custom_metadata: Custom metadata of the device, present when device_id is provided. :ivar device_id: ID of the affected device. @@ -5582,12 +5584,13 @@ class DeviceLowBatteryEvent: :ivar workspace_id: ID of the workspace associated with the event.""" + accessory_keypad_battery_level: Optional[float] battery_level: float - battery_source: Optional[Literal["lock", "accessory_keypad"]] connected_account_custom_metadata: Optional[Dict[str, Union[str, bool]]] connected_account_id: str created_at: str customer_key: Optional[str] + device_battery_level: Optional[float] device_custom_metadata: Optional[Dict[str, Union[str, bool]]] device_id: str event_description: Optional[str] @@ -5599,14 +5602,17 @@ class DeviceLowBatteryEvent: @classmethod def from_dict(cls, d: Any): return cls( + accessory_keypad_battery_level=d.get( + "accessory_keypad_battery_level", None + ), battery_level=d.get("battery_level", None), - battery_source=d.get("battery_source", None), connected_account_custom_metadata=DeepAttrDict( d.get("connected_account_custom_metadata", None) ), connected_account_id=d.get("connected_account_id", None), created_at=d.get("created_at", None), customer_key=d.get("customer_key", None), + device_battery_level=d.get("device_battery_level", None), device_custom_metadata=DeepAttrDict(d.get("device_custom_metadata", None)), device_id=d.get("device_id", None), event_description=d.get("event_description", None), diff --git a/seam/routes/access_codes.py b/seam/routes/access_codes.py index c8cf0b2f..b9b4e92e 100644 --- a/seam/routes/access_codes.py +++ b/seam/routes/access_codes.py @@ -1310,7 +1310,7 @@ def update( "At least one parameter is required for /access_codes/update" ) - self.client.put("/access_codes/update", json=json_payload) + self.client.patch("/access_codes/update", json=json_payload) return None @@ -1943,7 +1943,7 @@ async def update( "At least one parameter is required for /access_codes/update" ) - await self.client.put("/access_codes/update", json=json_payload) + await self.client.patch("/access_codes/update", json=json_payload) return None diff --git a/seam/routes/access_grants.py b/seam/routes/access_grants.py index 525fff80..850c98e6 100644 --- a/seam/routes/access_grants.py +++ b/seam/routes/access_grants.py @@ -24,8 +24,6 @@ def create( self, *, requested_access_methods: List[Dict[str, Any]], - user_identity_id: Optional[str] = None, - user_identity: Optional[Dict[str, Any]] = None, access_grant_key: Optional[str] = None, acs_entrance_ids: Optional[List[str]] = None, customization_profile_id: Optional[str] = None, @@ -38,15 +36,13 @@ def create( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None, + user_identity: Optional[Dict[str, Any]] = None, + user_identity_id: Optional[str] = None, ) -> AccessGrant: """Creates a new `Access Grant `_. Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using ``device_ids``) and access control systems (using ``acs_entrance_ids`` or ``space_ids``), and can issue PIN codes, key cards, and mobile keys through a single request. :param requested_access_methods: - :param user_identity_id: ID of user identity for whom access is being granted. - - :param user_identity: When used, creates a new user identity with the given details, and grants them access. - :param access_grant_key: Unique key for the access grant within the workspace. :param acs_entrance_ids: Set of IDs of the `entrances `_ to which access is being granted. @@ -71,6 +67,10 @@ def create( :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + :param user_identity: When used, creates a new user identity with the given details, and grants them access. + + :param user_identity_id: ID of user identity for whom access is being granted. + :returns: OK :raises ValueError: At least one parameter must be provided.""" @@ -255,8 +255,6 @@ async def create( self, *, requested_access_methods: List[Dict[str, Any]], - user_identity_id: Optional[str] = None, - user_identity: Optional[Dict[str, Any]] = None, access_grant_key: Optional[str] = None, acs_entrance_ids: Optional[List[str]] = None, customization_profile_id: Optional[str] = None, @@ -269,15 +267,13 @@ async def create( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None, + user_identity: Optional[Dict[str, Any]] = None, + user_identity_id: Optional[str] = None, ) -> AccessGrant: """Creates a new `Access Grant `_. Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using ``device_ids``) and access control systems (using ``acs_entrance_ids`` or ``space_ids``), and can issue PIN codes, key cards, and mobile keys through a single request. :param requested_access_methods: - :param user_identity_id: ID of user identity for whom access is being granted. - - :param user_identity: When used, creates a new user identity with the given details, and grants them access. - :param access_grant_key: Unique key for the access grant within the workspace. :param acs_entrance_ids: Set of IDs of the `entrances `_ to which access is being granted. @@ -302,6 +298,10 @@ async def create( :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + :param user_identity: When used, creates a new user identity with the given details, and grants them access. + + :param user_identity_id: ID of user identity for whom access is being granted. + :returns: OK :raises ValueError: At least one parameter must be provided.""" @@ -491,8 +491,6 @@ def create( self, *, requested_access_methods: List[Dict[str, Any]], - user_identity_id: Optional[str] = None, - user_identity: Optional[Dict[str, Any]] = None, access_grant_key: Optional[str] = None, acs_entrance_ids: Optional[List[str]] = None, customization_profile_id: Optional[str] = None, @@ -505,15 +503,13 @@ def create( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None, + user_identity: Optional[Dict[str, Any]] = None, + user_identity_id: Optional[str] = None, ) -> AccessGrant: """Creates a new `Access Grant `_. Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using ``device_ids``) and access control systems (using ``acs_entrance_ids`` or ``space_ids``), and can issue PIN codes, key cards, and mobile keys through a single request. :param requested_access_methods: - :param user_identity_id: ID of user identity for whom access is being granted. - - :param user_identity: When used, creates a new user identity with the given details, and grants them access. - :param access_grant_key: Unique key for the access grant within the workspace. :param acs_entrance_ids: Set of IDs of the `entrances `_ to which access is being granted. @@ -538,6 +534,10 @@ def create( :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + :param user_identity: When used, creates a new user identity with the given details, and grants them access. + + :param user_identity_id: ID of user identity for whom access is being granted. + :returns: OK :raises ValueError: At least one parameter must be provided.""" @@ -545,10 +545,6 @@ def create( if requested_access_methods is not None: json_payload["requested_access_methods"] = requested_access_methods - if user_identity_id is not None: - json_payload["user_identity_id"] = user_identity_id - if user_identity is not None: - json_payload["user_identity"] = user_identity if access_grant_key is not None: json_payload["access_grant_key"] = access_grant_key if acs_entrance_ids is not None: @@ -573,6 +569,10 @@ def create( json_payload["space_keys"] = space_keys if starts_at is not None: json_payload["starts_at"] = starts_at + if user_identity is not None: + json_payload["user_identity"] = user_identity + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id if not json_payload: raise ValueError( @@ -894,8 +894,6 @@ async def create( self, *, requested_access_methods: List[Dict[str, Any]], - user_identity_id: Optional[str] = None, - user_identity: Optional[Dict[str, Any]] = None, access_grant_key: Optional[str] = None, acs_entrance_ids: Optional[List[str]] = None, customization_profile_id: Optional[str] = None, @@ -908,15 +906,13 @@ async def create( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None, starts_at: Optional[str] = None, + user_identity: Optional[Dict[str, Any]] = None, + user_identity_id: Optional[str] = None, ) -> AccessGrant: """Creates a new `Access Grant `_. Access Grants are the default and recommended way to grant a user access to any physical space, irrespective of the locking hardware. They work with both standalone smart locks (using ``device_ids``) and access control systems (using ``acs_entrance_ids`` or ``space_ids``), and can issue PIN codes, key cards, and mobile keys through a single request. :param requested_access_methods: - :param user_identity_id: ID of user identity for whom access is being granted. - - :param user_identity: When used, creates a new user identity with the given details, and grants them access. - :param access_grant_key: Unique key for the access grant within the workspace. :param acs_entrance_ids: Set of IDs of the `entrances `_ to which access is being granted. @@ -941,6 +937,10 @@ async def create( :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + :param user_identity: When used, creates a new user identity with the given details, and grants them access. + + :param user_identity_id: ID of user identity for whom access is being granted. + :returns: OK :raises ValueError: At least one parameter must be provided.""" @@ -948,10 +948,6 @@ async def create( if requested_access_methods is not None: json_payload["requested_access_methods"] = requested_access_methods - if user_identity_id is not None: - json_payload["user_identity_id"] = user_identity_id - if user_identity is not None: - json_payload["user_identity"] = user_identity if access_grant_key is not None: json_payload["access_grant_key"] = access_grant_key if acs_entrance_ids is not None: @@ -976,6 +972,10 @@ async def create( json_payload["space_keys"] = space_keys if starts_at is not None: json_payload["starts_at"] = starts_at + if user_identity is not None: + json_payload["user_identity"] = user_identity + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id if not json_payload: raise ValueError( diff --git a/seam/routes/access_methods.py b/seam/routes/access_methods.py index c8e9cc2a..2d447f97 100644 --- a/seam/routes/access_methods.py +++ b/seam/routes/access_methods.py @@ -48,16 +48,16 @@ def assign_card( def delete( self, *, - access_method_id: Optional[str] = None, access_grant_id: Optional[str] = None, + access_method_id: Optional[str] = None, reservation_key: Optional[str] = None, ) -> None: """Deletes an access method. - :param access_method_id: ID of access method to delete. - :param access_grant_id: ID of access grant whose access methods should be deleted. + :param access_method_id: ID of access method to 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.""" @@ -232,16 +232,16 @@ async def assign_card( async def delete( self, *, - access_method_id: Optional[str] = None, access_grant_id: Optional[str] = None, + access_method_id: Optional[str] = None, reservation_key: Optional[str] = None, ) -> None: """Deletes an access method. - :param access_method_id: ID of access method to delete. - :param access_grant_id: ID of access grant whose access methods should be deleted. + :param access_method_id: ID of access method to 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.""" @@ -451,25 +451,25 @@ def assign_card( def delete( self, *, - access_method_id: Optional[str] = None, access_grant_id: Optional[str] = None, + access_method_id: Optional[str] = None, reservation_key: Optional[str] = None, ) -> None: """Deletes an access method. - :param access_method_id: ID of access method to delete. - :param access_grant_id: ID of access grant whose access methods should be deleted. + :param access_method_id: ID of access method to 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.""" params: Dict[str, Any] = {} - if access_method_id is not None: - params["access_method_id"] = access_method_id if access_grant_id is not None: params["access_grant_id"] = access_grant_id + if access_method_id is not None: + params["access_method_id"] = access_method_id if reservation_key is not None: params["reservation_key"] = reservation_key @@ -804,25 +804,25 @@ async def assign_card( async def delete( self, *, - access_method_id: Optional[str] = None, access_grant_id: Optional[str] = None, + access_method_id: Optional[str] = None, reservation_key: Optional[str] = None, ) -> None: """Deletes an access method. - :param access_method_id: ID of access method to delete. - :param access_grant_id: ID of access grant whose access methods should be deleted. + :param access_method_id: ID of access method to 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.""" params: Dict[str, Any] = {} - if access_method_id is not None: - params["access_method_id"] = access_method_id if access_grant_id is not None: params["access_grant_id"] = access_grant_id + if access_method_id is not None: + params["access_method_id"] = access_method_id if reservation_key is not None: params["reservation_key"] = reservation_key diff --git a/seam/routes/acs_encoders_simulate.py b/seam/routes/acs_encoders_simulate.py index 9739794a..29269de8 100644 --- a/seam/routes/acs_encoders_simulate.py +++ b/seam/routes/acs_encoders_simulate.py @@ -11,6 +11,7 @@ def next_credential_encode_will_fail( self, *, acs_encoder_id: str, + acs_credential_id: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -19,16 +20,15 @@ def next_credential_encode_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id: Optional[str] = None, ) -> None: """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will be used in the next request to encode the ``acs_credential``. - :param error_code: Code of the error to simulate. - :param acs_credential_id: ID of the ``acs_credential`` that will fail to be encoded onto a card in the next request. + :param error_code: Code of the error to simulate. + :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() @@ -53,6 +53,7 @@ def next_credential_scan_will_fail( self, *, acs_encoder_id: str, + acs_credential_id_on_seam: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -60,16 +61,15 @@ def next_credential_scan_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id_on_seam: Optional[str] = None, ) -> None: """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will fail to scan the ``acs_credential`` in the next request. - :param error_code: - :param acs_credential_id_on_seam: + :param error_code: + :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() @@ -107,6 +107,7 @@ async def next_credential_encode_will_fail( self, *, acs_encoder_id: str, + acs_credential_id: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -115,16 +116,15 @@ async def next_credential_encode_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id: Optional[str] = None, ) -> None: """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will be used in the next request to encode the ``acs_credential``. - :param error_code: Code of the error to simulate. - :param acs_credential_id: ID of the ``acs_credential`` that will fail to be encoded onto a card in the next request. + :param error_code: Code of the error to simulate. + :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() @@ -149,6 +149,7 @@ async def next_credential_scan_will_fail( self, *, acs_encoder_id: str, + acs_credential_id_on_seam: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -156,16 +157,15 @@ async def next_credential_scan_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id_on_seam: Optional[str] = None, ) -> None: """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will fail to scan the ``acs_credential`` in the next request. - :param error_code: - :param acs_credential_id_on_seam: + :param error_code: + :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() @@ -210,6 +210,7 @@ def next_credential_encode_will_fail( self, *, acs_encoder_id: str, + acs_credential_id: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -218,25 +219,24 @@ def next_credential_encode_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id: Optional[str] = None, ) -> None: """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will be used in the next request to encode the ``acs_credential``. - :param error_code: Code of the error to simulate. - :param acs_credential_id: ID of the ``acs_credential`` that will fail to be encoded onto a card in the next request. + :param error_code: Code of the error to simulate. + :raises ValueError: At least one parameter must be provided.""" json_payload: Dict[str, Any] = {} if acs_encoder_id is not None: json_payload["acs_encoder_id"] = acs_encoder_id - if error_code is not None: - json_payload["error_code"] = error_code if acs_credential_id is not None: json_payload["acs_credential_id"] = acs_credential_id + if error_code is not None: + json_payload["error_code"] = error_code if not json_payload: raise ValueError( @@ -295,6 +295,7 @@ def next_credential_scan_will_fail( self, *, acs_encoder_id: str, + acs_credential_id_on_seam: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -302,25 +303,24 @@ def next_credential_scan_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id_on_seam: Optional[str] = None, ) -> None: """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will fail to scan the ``acs_credential`` in the next request. - :param error_code: - :param acs_credential_id_on_seam: + :param error_code: + :raises ValueError: At least one parameter must be provided.""" json_payload: Dict[str, Any] = {} if acs_encoder_id is not None: json_payload["acs_encoder_id"] = acs_encoder_id - if error_code is not None: - json_payload["error_code"] = error_code if acs_credential_id_on_seam is not None: json_payload["acs_credential_id_on_seam"] = acs_credential_id_on_seam + if error_code is not None: + json_payload["error_code"] = error_code if not json_payload: raise ValueError( @@ -397,6 +397,7 @@ async def next_credential_encode_will_fail( self, *, acs_encoder_id: str, + acs_credential_id: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -405,25 +406,24 @@ async def next_credential_encode_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id: Optional[str] = None, ) -> None: """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will be used in the next request to encode the ``acs_credential``. - :param error_code: Code of the error to simulate. - :param acs_credential_id: ID of the ``acs_credential`` that will fail to be encoded onto a card in the next request. + :param error_code: Code of the error to simulate. + :raises ValueError: At least one parameter must be provided.""" json_payload: Dict[str, Any] = {} if acs_encoder_id is not None: json_payload["acs_encoder_id"] = acs_encoder_id - if error_code is not None: - json_payload["error_code"] = error_code if acs_credential_id is not None: json_payload["acs_credential_id"] = acs_credential_id + if error_code is not None: + json_payload["error_code"] = error_code if not json_payload: raise ValueError( @@ -482,6 +482,7 @@ async def next_credential_scan_will_fail( self, *, acs_encoder_id: str, + acs_credential_id_on_seam: Optional[str] = None, error_code: Optional[ Literal[ "no_credential_on_encoder", @@ -489,25 +490,24 @@ async def next_credential_scan_will_fail( "action_attempt_expired", ] ] = None, - acs_credential_id_on_seam: Optional[str] = None, ) -> None: """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will fail. You can only perform this action within a `sandbox workspace `_. :param acs_encoder_id: ID of the ``acs_encoder`` that will fail to scan the ``acs_credential`` in the next request. - :param error_code: - :param acs_credential_id_on_seam: + :param error_code: + :raises ValueError: At least one parameter must be provided.""" json_payload: Dict[str, Any] = {} if acs_encoder_id is not None: json_payload["acs_encoder_id"] = acs_encoder_id - if error_code is not None: - json_payload["error_code"] = error_code if acs_credential_id_on_seam is not None: json_payload["acs_credential_id_on_seam"] = acs_credential_id_on_seam + if error_code is not None: + json_payload["error_code"] = error_code if not json_payload: raise ValueError( diff --git a/seam/routes/customers.py b/seam/routes/customers.py index 2877a35c..9343a110 100644 --- a/seam/routes/customers.py +++ b/seam/routes/customers.py @@ -11,6 +11,7 @@ class AbstractCustomers(abc.ABC): def create_portal( self, *, + customer_data: Optional[Dict[str, Any]] = None, customer_resources_filters: Optional[List[Dict[str, Any]]] = None, customization_profile_id: Optional[str] = None, deep_link: Optional[Dict[str, Any]] = None, @@ -34,10 +35,11 @@ def create_portal( ] = None, navigation_mode: Optional[Literal["full", "restricted"]] = None, read_only: Optional[bool] = None, - customer_data: Optional[Dict[str, Any]] = None, ) -> CustomerPortal: """Creates a new customer portal magic link with configurable features. + :param customer_data: + :param customer_resources_filters: Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. :param customization_profile_id: The ID of the customization profile to use for the portal. @@ -58,8 +60,6 @@ def create_portal( :param read_only: Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. - :param customer_data: - :returns: OK""" raise NotImplementedError() @@ -206,6 +206,7 @@ class AbstractAsyncCustomers(abc.ABC): async def create_portal( self, *, + customer_data: Optional[Dict[str, Any]] = None, customer_resources_filters: Optional[List[Dict[str, Any]]] = None, customization_profile_id: Optional[str] = None, deep_link: Optional[Dict[str, Any]] = None, @@ -229,10 +230,11 @@ async def create_portal( ] = None, navigation_mode: Optional[Literal["full", "restricted"]] = None, read_only: Optional[bool] = None, - customer_data: Optional[Dict[str, Any]] = None, ) -> CustomerPortal: """Creates a new customer portal magic link with configurable features. + :param customer_data: + :param customer_resources_filters: Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. :param customization_profile_id: The ID of the customization profile to use for the portal. @@ -253,8 +255,6 @@ async def create_portal( :param read_only: Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. - :param customer_data: - :returns: OK""" raise NotImplementedError() @@ -408,6 +408,7 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): def create_portal( self, *, + customer_data: Optional[Dict[str, Any]] = None, customer_resources_filters: Optional[List[Dict[str, Any]]] = None, customization_profile_id: Optional[str] = None, deep_link: Optional[Dict[str, Any]] = None, @@ -431,10 +432,11 @@ def create_portal( ] = None, navigation_mode: Optional[Literal["full", "restricted"]] = None, read_only: Optional[bool] = None, - customer_data: Optional[Dict[str, Any]] = None, ) -> CustomerPortal: """Creates a new customer portal magic link with configurable features. + :param customer_data: + :param customer_resources_filters: Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. :param customization_profile_id: The ID of the customization profile to use for the portal. @@ -455,11 +457,11 @@ def create_portal( :param read_only: Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. - :param customer_data: - :returns: OK""" json_payload: Dict[str, Any] = {} + if customer_data is not None: + json_payload["customer_data"] = customer_data if customer_resources_filters is not None: json_payload["customer_resources_filters"] = customer_resources_filters if customization_profile_id is not None: @@ -480,8 +482,6 @@ def create_portal( json_payload["navigation_mode"] = navigation_mode if read_only is not None: json_payload["read_only"] = read_only - if customer_data is not None: - json_payload["customer_data"] = customer_data res = self.client.post("/customers/create_portal", json=json_payload) @@ -736,6 +736,7 @@ def __init__(self, client: AsyncSeamHttpClient, defaults: Dict[str, Any]): async def create_portal( self, *, + customer_data: Optional[Dict[str, Any]] = None, customer_resources_filters: Optional[List[Dict[str, Any]]] = None, customization_profile_id: Optional[str] = None, deep_link: Optional[Dict[str, Any]] = None, @@ -759,10 +760,11 @@ async def create_portal( ] = None, navigation_mode: Optional[Literal["full", "restricted"]] = None, read_only: Optional[bool] = None, - customer_data: Optional[Dict[str, Any]] = None, ) -> CustomerPortal: """Creates a new customer portal magic link with configurable features. + :param customer_data: + :param customer_resources_filters: Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata. :param customization_profile_id: The ID of the customization profile to use for the portal. @@ -783,11 +785,11 @@ async def create_portal( :param read_only: Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected. - :param customer_data: - :returns: OK""" json_payload: Dict[str, Any] = {} + if customer_data is not None: + json_payload["customer_data"] = customer_data if customer_resources_filters is not None: json_payload["customer_resources_filters"] = customer_resources_filters if customization_profile_id is not None: @@ -808,8 +810,6 @@ async def create_portal( json_payload["navigation_mode"] = navigation_mode if read_only is not None: json_payload["read_only"] = read_only - if customer_data is not None: - json_payload["customer_data"] = customer_data res = await self.client.post("/customers/create_portal", json=json_payload) diff --git a/seam/routes/noise_sensors_noise_thresholds.py b/seam/routes/noise_sensors_noise_thresholds.py index 8bf54786..46e12eb5 100644 --- a/seam/routes/noise_sensors_noise_thresholds.py +++ b/seam/routes/noise_sensors_noise_thresholds.py @@ -400,7 +400,7 @@ def update( "At least one parameter is required for /noise_sensors/noise_thresholds/update" ) - self.client.put("/noise_sensors/noise_thresholds/update", json=json_payload) + self.client.patch("/noise_sensors/noise_thresholds/update", json=json_payload) return None @@ -612,7 +612,7 @@ async def update( "At least one parameter is required for /noise_sensors/noise_thresholds/update" ) - await self.client.put( + await self.client.patch( "/noise_sensors/noise_thresholds/update", json=json_payload ) diff --git a/seam/routes/user_identities.py b/seam/routes/user_identities.py index ebd50ae6..a13f4c62 100644 --- a/seam/routes/user_identities.py +++ b/seam/routes/user_identities.py @@ -210,8 +210,8 @@ def merge( self, *, merged_user_identity_ids: Optional[List[str]] = None, - user_identity_id: Optional[str] = None, merged_user_identity_keys: Optional[List[str]] = None, + user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None, ) -> None: """Merges one or more `user identities `_ into a primary user identity, for when the same person ended up with more than one user identity. @@ -224,10 +224,10 @@ def merge( :param merged_user_identity_ids: IDs of the user identities to merge into the primary user identity. These user identities are deleted. - :param user_identity_id: ID of the primary user identity to keep. - :param merged_user_identity_keys: Keys of the user identities to merge into the primary user identity. These user identities are deleted. + :param user_identity_id: ID of the primary user identity to keep. + :param user_identity_key: Key of the primary user identity to keep. :raises ValueError: At least one parameter must be provided.""" @@ -476,8 +476,8 @@ async def merge( self, *, merged_user_identity_ids: Optional[List[str]] = None, - user_identity_id: Optional[str] = None, merged_user_identity_keys: Optional[List[str]] = None, + user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None, ) -> None: """Merges one or more `user identities `_ into a primary user identity, for when the same person ended up with more than one user identity. @@ -490,10 +490,10 @@ async def merge( :param merged_user_identity_ids: IDs of the user identities to merge into the primary user identity. These user identities are deleted. - :param user_identity_id: ID of the primary user identity to keep. - :param merged_user_identity_keys: Keys of the user identities to merge into the primary user identity. These user identities are deleted. + :param user_identity_id: ID of the primary user identity to keep. + :param user_identity_key: Key of the primary user identity to keep. :raises ValueError: At least one parameter must be provided.""" @@ -945,8 +945,8 @@ def merge( self, *, merged_user_identity_ids: Optional[List[str]] = None, - user_identity_id: Optional[str] = None, merged_user_identity_keys: Optional[List[str]] = None, + user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None, ) -> None: """Merges one or more `user identities `_ into a primary user identity, for when the same person ended up with more than one user identity. @@ -959,10 +959,10 @@ def merge( :param merged_user_identity_ids: IDs of the user identities to merge into the primary user identity. These user identities are deleted. - :param user_identity_id: ID of the primary user identity to keep. - :param merged_user_identity_keys: Keys of the user identities to merge into the primary user identity. These user identities are deleted. + :param user_identity_id: ID of the primary user identity to keep. + :param user_identity_key: Key of the primary user identity to keep. :raises ValueError: At least one parameter must be provided.""" @@ -970,10 +970,10 @@ def merge( if merged_user_identity_ids is not None: json_payload["merged_user_identity_ids"] = merged_user_identity_ids - if user_identity_id is not None: - json_payload["user_identity_id"] = user_identity_id if merged_user_identity_keys is not None: json_payload["merged_user_identity_keys"] = merged_user_identity_keys + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id if user_identity_key is not None: json_payload["user_identity_key"] = user_identity_key @@ -1498,8 +1498,8 @@ async def merge( self, *, merged_user_identity_ids: Optional[List[str]] = None, - user_identity_id: Optional[str] = None, merged_user_identity_keys: Optional[List[str]] = None, + user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None, ) -> None: """Merges one or more `user identities `_ into a primary user identity, for when the same person ended up with more than one user identity. @@ -1512,10 +1512,10 @@ async def merge( :param merged_user_identity_ids: IDs of the user identities to merge into the primary user identity. These user identities are deleted. - :param user_identity_id: ID of the primary user identity to keep. - :param merged_user_identity_keys: Keys of the user identities to merge into the primary user identity. These user identities are deleted. + :param user_identity_id: ID of the primary user identity to keep. + :param user_identity_key: Key of the primary user identity to keep. :raises ValueError: At least one parameter must be provided.""" @@ -1523,10 +1523,10 @@ async def merge( if merged_user_identity_ids is not None: json_payload["merged_user_identity_ids"] = merged_user_identity_ids - if user_identity_id is not None: - json_payload["user_identity_id"] = user_identity_id if merged_user_identity_keys is not None: json_payload["merged_user_identity_keys"] = merged_user_identity_keys + if user_identity_id is not None: + json_payload["user_identity_id"] = user_identity_id if user_identity_key is not None: json_payload["user_identity_key"] = user_identity_key diff --git a/seam/routes/workspaces.py b/seam/routes/workspaces.py index 26106b93..1831687b 100644 --- a/seam/routes/workspaces.py +++ b/seam/routes/workspaces.py @@ -39,7 +39,7 @@ def create( :param is_sandbox: Indicates whether the new workspace is a `sandbox workspace `_. - :param organization_id: ID of the organization to associate with the new workspace. + :param organization_id: ID of the organization to associate with the new workspace. If omitted, the new workspace is associated with the organization that you administer, if you administer exactly one. :param webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead. @@ -136,7 +136,7 @@ async def create( :param is_sandbox: Indicates whether the new workspace is a `sandbox workspace `_. - :param organization_id: ID of the organization to associate with the new workspace. + :param organization_id: ID of the organization to associate with the new workspace. If omitted, the new workspace is associated with the organization that you administer, if you administer exactly one. :param webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead. @@ -238,7 +238,7 @@ def create( :param is_sandbox: Indicates whether the new workspace is a `sandbox workspace `_. - :param organization_id: ID of the organization to associate with the new workspace. + :param organization_id: ID of the organization to associate with the new workspace. If omitted, the new workspace is associated with the organization that you administer, if you administer exactly one. :param webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead. @@ -427,7 +427,7 @@ async def create( :param is_sandbox: Indicates whether the new workspace is a `sandbox workspace `_. - :param organization_id: ID of the organization to associate with the new workspace. + :param organization_id: ID of the organization to associate with the new workspace. If omitted, the new workspace is associated with the organization that you administer, if you administer exactly one. :param webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead.