From e1041e9b420dfff039fe296f798535ab36cf0fe2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Aug 2026 09:53:05 +0000 Subject: [PATCH 1/2] feat(deps-dev): bump @seamapi/types in the seam group Bumps the seam group with 1 update: [@seamapi/types](https://github.com/seamapi/types). Updates `@seamapi/types` from 1.1006.0 to 1.1016.0 - [Release notes](https://github.com/seamapi/types/releases) - [Commits](https://github.com/seamapi/types/compare/v1.1006.0...v1.1016.0) --- updated-dependencies: - dependency-name: "@seamapi/types" dependency-version: 1.1016.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: seam ... Signed-off-by: dependabot[bot] --- 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 22af807..f2c35ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "@seamapi/blueprint": "^1.8.0", "@seamapi/fake-seam-connect": "2.0.4", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1006.0", + "@seamapi/types": "1.1016.0", "change-case": "^5.4.4", "prettier": "^3.2.5" }, @@ -853,9 +853,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1006.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1006.0.tgz", - "integrity": "sha512-UI3lxJxc2Hm/vVtD5oTF8PVEvOuTkDEdfhl+DSTNUz/qqfP8TXy6uXTf792glX0sK5ihuO7CokGIUpnR4CSzgg==", + "version": "1.1016.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1016.0.tgz", + "integrity": "sha512-yMVKcpA8NK+PVrSxvvqEDnsBdzXJ5A0LBPclYqNynt+BPIw93ZNLDStViKEmpY7PvWRzXUhe//1il2tkhSpkYw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index b504afa..26a8cc1 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@seamapi/blueprint": "^1.8.0", "@seamapi/fake-seam-connect": "2.0.4", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1006.0", + "@seamapi/types": "1.1016.0", "change-case": "^5.4.4", "prettier": "^3.2.5" } From 11370c292528a7b2ffbb48cacf3bff57277857e3 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Fri, 21 Aug 2026 09:53:42 +0000 Subject: [PATCH 2/2] ci: Generate code --- seam/resources/access_code.py | 29 ++++ seam/resources/connect_webview.py | 2 +- seam/resources/connected_account.py | 2 +- seam/resources/device.py | 2 +- seam/resources/seam_event.py | 6 +- seam/resources/unmanaged_access_code.py | 29 ++++ seam/resources/unmanaged_device.py | 2 +- seam/resources/unmanaged_user_identity.py | 8 ++ seam/resources/user_identity.py | 8 ++ seam/routes/connect_webviews.py | 16 +-- seam/routes/connected_accounts.py | 16 +-- seam/routes/devices.py | 16 +-- seam/routes/devices_unmanaged.py | 8 +- seam/routes/user_identities.py | 156 ++++++++++++++++++++++ 14 files changed, 267 insertions(+), 33 deletions(-) diff --git a/seam/resources/access_code.py b/seam/resources/access_code.py index 8961c77..ce1dccd 100644 --- a/seam/resources/access_code.py +++ b/seam/resources/access_code.py @@ -345,6 +345,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class CodeConstraintsViolatedError(ResourceMapping): + """The code cannot be set on the device because it violates the device's code constraints (for example, its length, digits, or a too-simple value). The code will not be retried until you change it. See the device's ``code_constraints`` and ``supported_code_lengths``. + + :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_access_code_error: Indicates that this is an access code error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: Optional[str] + error_code: Literal["code_constraints_violated"] + is_access_code_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_access_code_error=d.get("is_access_code_error", None), + message=d.get("message", None), + ) + @dataclass class AccountDisconnectedError(ResourceMapping): """Indicates that the account is disconnected. @@ -1304,6 +1331,7 @@ def from_dict(cls, d: Any): NoSpaceForAccessCodeOnDeviceError, ConflictingExternalModificationError, AccessCodeInactiveError, + CodeConstraintsViolatedError, AccountDisconnectedError, SaltoKsSubscriptionLimitExceededError, InsufficientPermissionsError, @@ -1327,6 +1355,7 @@ def from_dict(cls, d: Any): "no_space_for_access_code_on_device": NoSpaceForAccessCodeOnDeviceError, "conflicting_external_modification": ConflictingExternalModificationError, "access_code_inactive": AccessCodeInactiveError, + "code_constraints_violated": CodeConstraintsViolatedError, "account_disconnected": AccountDisconnectedError, "salto_ks_subscription_limit_exceeded": SaltoKsSubscriptionLimitExceededError, "insufficient_permissions": InsufficientPermissionsError, diff --git a/seam/resources/connect_webview.py b/seam/resources/connect_webview.py index 3484381..eeec8d1 100644 --- a/seam/resources/connect_webview.py +++ b/seam/resources/connect_webview.py @@ -34,7 +34,7 @@ class ConnectWebview: :ivar created_at: Date and time at which the Connect Webview was created. - :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. + :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. Keys set to ``null`` or to an empty string are omitted. :ivar custom_redirect_failure_url: URL to which the Connect Webview should redirect when an unexpected error occurs. diff --git a/seam/resources/connected_account.py b/seam/resources/connected_account.py index 6491853..8e723b5 100644 --- a/seam/resources/connected_account.py +++ b/seam/resources/connected_account.py @@ -27,7 +27,7 @@ class ConnectedAccount: :ivar created_at: Date and time at which the connected account was created. - :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. + :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. Keys set to ``null`` or to an empty string are omitted. :ivar customer_key: Your unique key for the customer associated with this connected account. diff --git a/seam/resources/device.py b/seam/resources/device.py index 34f0ab0..8dd1cf7 100644 --- a/seam/resources/device.py +++ b/seam/resources/device.py @@ -61,7 +61,7 @@ class Device: :ivar created_at: Date and time at which the device object was created. - :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. + :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. Keys set to ``null`` or to an empty string are omitted. :ivar device_id: ID of the device. diff --git a/seam/resources/seam_event.py b/seam/resources/seam_event.py index 2b74398..c85a4ed 100644 --- a/seam/resources/seam_event.py +++ b/seam/resources/seam_event.py @@ -1296,7 +1296,11 @@ class AccessCodeDelayInRemovingFromDeviceEvent: :ivar occurred_at: Date and time at which the event occurred. - :ivar workspace_id: ID of the workspace associated with the event.""" + :ivar workspace_id: ID of the workspace associated with the event. + + .. deprecated:: + Seam no longer emits this event. Use ``access_code.failed_to_remove_from_device`` instead. + """ @dataclass class AccessCodeErrors(ResourceMapping): diff --git a/seam/resources/unmanaged_access_code.py b/seam/resources/unmanaged_access_code.py index bd7ada1..4b3d550 100644 --- a/seam/resources/unmanaged_access_code.py +++ b/seam/resources/unmanaged_access_code.py @@ -331,6 +331,33 @@ def from_dict(cls, d: Any): message=d.get("message", None), ) + @dataclass + class CodeConstraintsViolatedError(ResourceMapping): + """The code cannot be set on the device because it violates the device's code constraints (for example, its length, digits, or a too-simple value). The code will not be retried until you change it. See the device's ``code_constraints`` and ``supported_code_lengths``. + + :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_access_code_error: Indicates that this is an access code error. + + :ivar message: Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + """ + + created_at: Optional[str] + error_code: Literal["code_constraints_violated"] + is_access_code_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_access_code_error=d.get("is_access_code_error", None), + message=d.get("message", None), + ) + @dataclass class AccountDisconnectedError(ResourceMapping): """Indicates that the account is disconnected. @@ -1023,6 +1050,7 @@ def from_dict(cls, d: Any): NoSpaceForAccessCodeOnDeviceError, ConflictingExternalModificationError, AccessCodeInactiveError, + CodeConstraintsViolatedError, AccountDisconnectedError, SaltoKsSubscriptionLimitExceededError, InsufficientPermissionsError, @@ -1046,6 +1074,7 @@ def from_dict(cls, d: Any): "no_space_for_access_code_on_device": NoSpaceForAccessCodeOnDeviceError, "conflicting_external_modification": ConflictingExternalModificationError, "access_code_inactive": AccessCodeInactiveError, + "code_constraints_violated": CodeConstraintsViolatedError, "account_disconnected": AccountDisconnectedError, "salto_ks_subscription_limit_exceeded": SaltoKsSubscriptionLimitExceededError, "insufficient_permissions": InsufficientPermissionsError, diff --git a/seam/resources/unmanaged_device.py b/seam/resources/unmanaged_device.py index a43429a..aa1f4f3 100644 --- a/seam/resources/unmanaged_device.py +++ b/seam/resources/unmanaged_device.py @@ -61,7 +61,7 @@ class UnmanagedDevice: :ivar created_at: Date and time at which the device object was created. - :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. + :ivar custom_metadata: Set of key:value pairs. Adding custom metadata to a resource, such as a `Connect Webview `_, `connected account `_, or `device `_, enables you to store custom information, like customer details or internal IDs from your application. Keys set to ``null`` or to an empty string are omitted. :ivar device_id: ID of the device. diff --git a/seam/resources/unmanaged_user_identity.py b/seam/resources/unmanaged_user_identity.py index e17be7e..92d1a79 100644 --- a/seam/resources/unmanaged_user_identity.py +++ b/seam/resources/unmanaged_user_identity.py @@ -27,6 +27,10 @@ class UnmanagedUserIdentity: :ivar full_name: Full name of the user associated with the user identity. + :ivar merged_user_identity_ids: IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + + :ivar merged_user_identity_keys: Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + :ivar phone_number: Unique phone number for the user identity in `E.164 format `_ (for example, +15555550100). :ivar user_identity_id: ID of the user identity. @@ -129,6 +133,8 @@ def from_dict(cls, d: Any): email_address: Optional[str] errors: List[Errors] full_name: Optional[str] + merged_user_identity_ids: List[str] + merged_user_identity_keys: List[str] phone_number: Optional[str] user_identity_id: str warnings: List[Warnings] @@ -146,6 +152,8 @@ def from_dict(cls, d: Any): for i in d.get("errors") or [] ], full_name=d.get("full_name", None), + merged_user_identity_ids=d.get("merged_user_identity_ids", None), + merged_user_identity_keys=d.get("merged_user_identity_keys", None), phone_number=d.get("phone_number", None), user_identity_id=d.get("user_identity_id", None), warnings=[ diff --git a/seam/resources/user_identity.py b/seam/resources/user_identity.py index 04718d2..88641dd 100644 --- a/seam/resources/user_identity.py +++ b/seam/resources/user_identity.py @@ -27,6 +27,10 @@ class UserIdentity: :ivar full_name: Full name of the user associated with the user identity. + :ivar merged_user_identity_ids: IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + + :ivar merged_user_identity_keys: Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity. + :ivar phone_number: Unique phone number for the user identity in `E.164 format `_ (for example, +15555550100). :ivar user_identity_id: ID of the user identity. @@ -131,6 +135,8 @@ def from_dict(cls, d: Any): email_address: Optional[str] errors: List[Errors] full_name: Optional[str] + merged_user_identity_ids: List[str] + merged_user_identity_keys: List[str] phone_number: Optional[str] user_identity_id: str user_identity_key: Optional[str] @@ -149,6 +155,8 @@ def from_dict(cls, d: Any): for i in d.get("errors") or [] ], full_name=d.get("full_name", None), + merged_user_identity_ids=d.get("merged_user_identity_ids", None), + merged_user_identity_keys=d.get("merged_user_identity_keys", None), phone_number=d.get("phone_number", None), user_identity_id=d.get("user_identity_id", None), user_identity_key=d.get("user_identity_key", None), diff --git a/seam/routes/connect_webviews.py b/seam/routes/connect_webviews.py index 4458843..25855a6 100644 --- a/seam/routes/connect_webviews.py +++ b/seam/routes/connect_webviews.py @@ -128,7 +128,7 @@ def create( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. See also: `Customize the Behavior Settings of Your Connect Webviews `_. - :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param custom_redirect_failure_url: Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the ``custom_redirect_url``. @@ -182,7 +182,7 @@ def list( ) -> List[ConnectWebview]: """Returns a list of all `Connect Webviews `_. - :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list connect webviews. @@ -320,7 +320,7 @@ async def create( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. See also: `Customize the Behavior Settings of Your Connect Webviews `_. - :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param custom_redirect_failure_url: Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the ``custom_redirect_url``. @@ -374,7 +374,7 @@ async def list( ) -> List[ConnectWebview]: """Returns a list of all `Connect Webviews `_. - :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list connect webviews. @@ -519,7 +519,7 @@ def create( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. See also: `Customize the Behavior Settings of Your Connect Webviews `_. - :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param custom_redirect_failure_url: Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the ``custom_redirect_url``. @@ -634,7 +634,7 @@ def list( ) -> List[ConnectWebview]: """Returns a list of all `Connect Webviews `_. - :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list connect webviews. @@ -796,7 +796,7 @@ async def create( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. See also: `Customize the Behavior Settings of Your Connect Webviews `_. - :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a Connect Webview `_ enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any `connected accounts `_ that were connected using the Connect Webview, making it easy to find and filter these resources in your `workspace `_. You can also `filter Connect Webviews by custom metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param custom_redirect_failure_url: Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the ``custom_redirect_url``. @@ -911,7 +911,7 @@ async def list( ) -> List[ConnectWebview]: """Returns a list of all `Connect Webviews `_. - :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to `filter Connect Webviews `_. Returns Connect Webviews with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list connect webviews. diff --git a/seam/routes/connected_accounts.py b/seam/routes/connected_accounts.py index 4856a68..db3ccfb 100644 --- a/seam/routes/connected_accounts.py +++ b/seam/routes/connected_accounts.py @@ -61,7 +61,7 @@ def list( ) -> List[ConnectedAccount]: """Returns a list of all `connected accounts `_. - :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key by which you want to filter connected accounts. @@ -112,7 +112,7 @@ def update( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. - :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param customer_key: The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. @@ -171,7 +171,7 @@ async def list( ) -> List[ConnectedAccount]: """Returns a list of all `connected accounts `_. - :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key by which you want to filter connected accounts. @@ -222,7 +222,7 @@ async def update( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. - :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param customer_key: The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. @@ -322,7 +322,7 @@ def list( ) -> List[ConnectedAccount]: """Returns a list of all `connected accounts `_. - :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key by which you want to filter connected accounts. @@ -412,7 +412,7 @@ def update( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. - :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param customer_key: The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. @@ -538,7 +538,7 @@ async def list( ) -> List[ConnectedAccount]: """Returns a list of all `connected accounts `_. - :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. + :param custom_metadata_has: Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with ``custom_metadata`` that contains all of the provided key:value pairs. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key by which you want to filter connected accounts. @@ -628,7 +628,7 @@ async def update( :param automatically_manage_new_devices: Indicates whether newly-added devices should appear as `managed devices `_. - :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a connected account `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter connected accounts by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param customer_key: The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. diff --git a/seam/routes/devices.py b/seam/routes/devices.py index d0499d0..8519d43 100644 --- a/seam/routes/devices.py +++ b/seam/routes/devices.py @@ -227,7 +227,7 @@ def list( :param created_before: Timestamp by which to limit returned devices. Returns devices created before this timestamp. - :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. + :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list devices. @@ -310,7 +310,7 @@ def update( :param backup_access_code_pool_enabled: Indicates whether the device's `backup access code pool `_ is enabled. Set to ``false`` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. @@ -531,7 +531,7 @@ async def list( :param created_before: Timestamp by which to limit returned devices. Returns devices created before this timestamp. - :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. + :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list devices. @@ -614,7 +614,7 @@ async def update( :param backup_access_code_pool_enabled: Indicates whether the device's `backup access code pool `_ is enabled. Set to ``false`` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. @@ -854,7 +854,7 @@ def list( :param created_before: Timestamp by which to limit returned devices. Returns devices created before this timestamp. - :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. + :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list devices. @@ -1003,7 +1003,7 @@ def update( :param backup_access_code_pool_enabled: Indicates whether the device's `backup access code pool `_ is enabled. Set to ``false`` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. @@ -1265,7 +1265,7 @@ async def list( :param created_before: Timestamp by which to limit returned devices. Returns devices created before this timestamp. - :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. + :param custom_metadata_has: Set of key:value `custom metadata `_ pairs for which you want to list devices. Key names cannot contain a period (.). Specify an empty string to match a key that is unset or set to an empty string. :param customer_key: Customer key for which you want to list devices. @@ -1414,7 +1414,7 @@ async def update( :param backup_access_code_pool_enabled: Indicates whether the device's `backup access code pool `_ is enabled. Set to ``false`` to disable the pool: Seam stops refilling it and removes any backup codes that have not yet been pulled into active use. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). `Adding custom metadata to a device `_ enables you to store custom information, like customer details or internal IDs from your application. Then, you can `filter devices by the desired metadata `_. Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. diff --git a/seam/routes/devices_unmanaged.py b/seam/routes/devices_unmanaged.py index 50f8d65..0da140c 100644 --- a/seam/routes/devices_unmanaged.py +++ b/seam/routes/devices_unmanaged.py @@ -238,7 +238,7 @@ def update( :param device_id: ID of the unmanaged device that you want to update. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. @@ -478,7 +478,7 @@ async def update( :param device_id: ID of the unmanaged device that you want to update. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. @@ -776,7 +776,7 @@ def update( :param device_id: ID of the unmanaged device that you want to update. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. @@ -1090,7 +1090,7 @@ async def update( :param device_id: ID of the unmanaged device that you want to update. - :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs. + :param custom_metadata: Custom metadata that you want to associate with the device. Supports up to 50 JSON key:value pairs, with key names up to 40 characters long that cannot contain a period (.). Set a key to ``null`` or to an empty string to remove that key from the custom metadata. :param is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. diff --git a/seam/routes/user_identities.py b/seam/routes/user_identities.py index 6d9902a..ebd50ae 100644 --- a/seam/routes/user_identities.py +++ b/seam/routes/user_identities.py @@ -205,6 +205,34 @@ def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() + @abc.abstractmethod + 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_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. + + The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as ``merged_user_identity_ids`` and ``merged_user_identity_keys``. + + Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + + Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. + + :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_key: Key of the primary user identity to keep. + + :raises ValueError: At least one parameter must be provided.""" + raise NotImplementedError() + @abc.abstractmethod def remove_acs_user(self, *, acs_user_id: str, user_identity_id: str) -> None: """Removes a specified `access system user `_ from a specified `user identity `_. @@ -443,6 +471,34 @@ async def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: :raises ValueError: At least one parameter must be provided.""" raise NotImplementedError() + @abc.abstractmethod + 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_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. + + The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as ``merged_user_identity_ids`` and ``merged_user_identity_keys``. + + Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + + Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. + + :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_key: Key of the primary user identity to keep. + + :raises ValueError: At least one parameter must be provided.""" + raise NotImplementedError() + @abc.abstractmethod async def remove_acs_user(self, *, acs_user_id: str, user_identity_id: str) -> None: """Removes a specified `access system user `_ from a specified `user identity `_. @@ -880,6 +936,56 @@ def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: return [AcsUser.from_dict(item) for item in res["acs_users"]] + @route_metadata( + path="/user_identities/merge", + has_required_parameters=True, + has_pagination=False, + ) + 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_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. + + The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as ``merged_user_identity_ids`` and ``merged_user_identity_keys``. + + Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + + Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. + + :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_key: Key of the primary user identity to keep. + + :raises ValueError: At least one parameter must be provided.""" + json_payload: Dict[str, Any] = {} + + 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_key is not None: + json_payload["user_identity_key"] = user_identity_key + + if not json_payload: + raise ValueError( + "At least one parameter is required for /user_identities/merge" + ) + + self.client.post("/user_identities/merge", json=json_payload) + + return None + @route_metadata( path="/user_identities/remove_acs_user", has_required_parameters=True, @@ -1383,6 +1489,56 @@ async def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: return [AcsUser.from_dict(item) for item in res["acs_users"]] + @route_metadata( + path="/user_identities/merge", + has_required_parameters=True, + has_pagination=False, + ) + 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_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. + + The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as ``merged_user_identity_ids`` and ``merged_user_identity_keys``. + + Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + + Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes. + + :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_key: Key of the primary user identity to keep. + + :raises ValueError: At least one parameter must be provided.""" + json_payload: Dict[str, Any] = {} + + 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_key is not None: + json_payload["user_identity_key"] = user_identity_key + + if not json_payload: + raise ValueError( + "At least one parameter is required for /user_identities/merge" + ) + + await self.client.post("/user_identities/merge", json=json_payload) + + return None + @route_metadata( path="/user_identities/remove_acs_user", has_required_parameters=True,