diff --git a/codegen/layouts/partials/abstract-route-class.hbs b/codegen/layouts/partials/abstract-route-class.hbs index 7fd5ab5..25e7513 100644 --- a/codegen/layouts/partials/abstract-route-class.hbs +++ b/codegen/layouts/partials/abstract-route-class.hbs @@ -1,4 +1,7 @@ class {{className}}(abc.ABC): +{{#if docstring}} + """{{{docstring}}}""" +{{/if}} {{#if showPass}} pass {{/if}} @@ -13,5 +16,6 @@ class {{className}}(abc.ABC): @abc.abstractmethod def {{name}}(self,{{#if hasParams}} *,{{/if}} {{signatureParams}}) -> {{returnType}}: + """{{{docstring}}}""" raise NotImplementedError() {{/each}} diff --git a/codegen/layouts/partials/resource-dataclass.hbs b/codegen/layouts/partials/resource-dataclass.hbs index cae5fdc..f856b1e 100644 --- a/codegen/layouts/partials/resource-dataclass.hbs +++ b/codegen/layouts/partials/resource-dataclass.hbs @@ -1,5 +1,6 @@ @dataclass class {{className}}: + """{{{docstring}}}""" {{#each properties}} {{safeName}}: {{type}} {{/each}} diff --git a/codegen/layouts/partials/route-method.hbs b/codegen/layouts/partials/route-method.hbs index 80b78dd..746c824 100644 --- a/codegen/layouts/partials/route-method.hbs +++ b/codegen/layouts/partials/route-method.hbs @@ -1,4 +1,5 @@ def {{name}}(self,{{#if hasParams}} *,{{/if}} {{signatureParams}}) -> {{returnType}}: + """{{{docstring}}}""" json_payload = {} {{#each params}} diff --git a/codegen/layouts/route.hbs b/codegen/layouts/route.hbs index 8ab8b8d..79e4150 100644 --- a/codegen/layouts/route.hbs +++ b/codegen/layouts/route.hbs @@ -16,6 +16,9 @@ from ..modules.action_attempts import resolve_action_attempt class {{className}}({{abstractClassName}}): +{{#if docstring}} + """{{{docstring}}}""" +{{/if}} def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.client = client self.defaults = defaults diff --git a/codegen/lib/class-model.ts b/codegen/lib/class-model.ts index 2b7832a..464803d 100644 --- a/codegen/lib/class-model.ts +++ b/codegen/lib/class-model.ts @@ -4,6 +4,9 @@ export interface ClassMethodParameter { name: string type: string + description: string + isDeprecated: boolean + deprecationMessage: string position?: number | undefined required?: boolean | undefined } @@ -11,6 +14,10 @@ export interface ClassMethodParameter { export interface ClassMethod { methodName: string path: string + description: string + responseDescription: string + isDeprecated: boolean + deprecationMessage: string parameters: ClassMethodParameter[] returnPath: string[] returnResource: string @@ -24,6 +31,7 @@ export interface ChildClassIdentifier { export interface ClassModel { name: string namespace: string + isDeprecated: boolean methods: ClassMethod[] childClassIdentifiers: ChildClassIdentifier[] } diff --git a/codegen/lib/layouts/resources.ts b/codegen/lib/layouts/resources.ts index 0a07b6b..8cc9d8a 100644 --- a/codegen/lib/layouts/resources.ts +++ b/codegen/lib/layouts/resources.ts @@ -6,6 +6,7 @@ import type { Blueprint, Property, Resource } from '@seamapi/blueprint' import { pascalCase, snakeCase } from 'change-case' import { convertCustomResourceName } from '../custom-resource-name-conversions.js' +import { formatPythonDoc } from '../python-docstring.js' import { mapPropertyToPythonType } from '../python-type.js' // Python hard keywords cannot be used as identifiers. When a property name @@ -56,6 +57,7 @@ const toSafeIdentifier = (name: string): string => export interface ResourceLayoutContext { className: string moduleName: string + docstring: string properties: Array<{ name: string safeName: string @@ -64,6 +66,40 @@ export interface ResourceLayoutContext { }> } +const createResourceDocstring = ( + description: string, + isDeprecated: boolean, + deprecationMessage: string, + properties: Property[], +): string => { + const lines = [formatPythonDoc(description)] + for (const property of properties) { + const deprecated = property.isDeprecated + ? `Deprecated${property.deprecationMessage === '' ? '.' : `: ${formatPythonDoc(property.deprecationMessage)}`}` + : '' + lines.push( + '', + `:ivar ${toSafeIdentifier(property.name)}: ${[ + deprecated, + formatPythonDoc(property.description), + ] + .filter(Boolean) + .join(' ')}`, + ) + } + if (isDeprecated) { + lines.push( + '', + '.. deprecated::', + ` ${formatPythonDoc(deprecationMessage) || 'This resource is deprecated.'}`, + ) + } + return lines + .filter((line, index) => line !== '' || index !== 0) + .join('\n') + .replaceAll('\n', '\n ') +} + export interface ResourcesIndexLayoutContext { resources: Array<{ className: string; moduleName: string }> } @@ -84,29 +120,61 @@ const mergeResourceProperties = (resources: Resource[]): Property[] => { export const getResourceLayoutContexts = ( blueprint: Blueprint, ): ResourceLayoutContext[] => { - const models = new Map() + const models = new Map< + string, + { + properties: Property[] + description: string + isDeprecated: boolean + deprecationMessage: string + } + >() for (const resource of blueprint.resources) { - models.set(resource.resourceType, resource.properties) + models.set(resource.resourceType, resource) } // The event and action attempt variants merge into a single dataclass with // the union of the variant properties, overriding the base resource schema. - models.set( - 'action_attempt', - mergeResourceProperties(blueprint.actionAttempts), - ) - models.set('event', mergeResourceProperties(blueprint.events)) + const actionAttemptModel = models.get('action_attempt') + models.set('action_attempt', { + properties: mergeResourceProperties(blueprint.actionAttempts), + description: + actionAttemptModel?.description ?? + 'An attempt to perform an action in the Seam API.', + isDeprecated: actionAttemptModel?.isDeprecated ?? false, + deprecationMessage: actionAttemptModel?.deprecationMessage ?? '', + }) + const eventModel = models.get('event') + models.set('event', { + properties: mergeResourceProperties(blueprint.events), + description: eventModel?.description ?? 'An event emitted by the Seam API.', + isDeprecated: eventModel?.isDeprecated ?? false, + deprecationMessage: eventModel?.deprecationMessage ?? '', + }) if (blueprint.pagination != null) { - models.set('pagination', blueprint.pagination.properties) + models.set('pagination', { + properties: blueprint.pagination.properties, + description: blueprint.pagination.description, + isDeprecated: false, + deprecationMessage: '', + }) } return [...models.entries()] - .map(([name, properties]) => { + .map(([name, model]) => { + const { properties, description, isDeprecated, deprecationMessage } = + model const className = pascalCase(convertCustomResourceName(name)) return { className, + docstring: createResourceDocstring( + description, + isDeprecated, + deprecationMessage, + properties, + ), // Derived from the class name rather than the resource type so the // module always matches the dataclass it exports (e.g. the "event" // resource becomes SeamEvent in seam_event.py). diff --git a/codegen/lib/layouts/route.ts b/codegen/lib/layouts/route.ts index 34c971f..d664cc9 100644 --- a/codegen/lib/layouts/route.ts +++ b/codegen/lib/layouts/route.ts @@ -8,10 +8,12 @@ import { type ClassModel, sortClassMethodParameters, } from '../class-model.js' +import { formatPythonDoc } from '../python-docstring.js' export interface MethodLayoutContext { name: string path: string + docstring: string hasParams: boolean signatureParams: string params: Array<{ name: string }> @@ -25,6 +27,7 @@ export interface MethodLayoutContext { export interface AbstractClassLayoutContext { className: string + docstring: string showPass: boolean childProperties: Array<{ namespace: string; abstractClassName: string }> methods: Array<{ @@ -32,12 +35,14 @@ export interface AbstractClassLayoutContext { hasParams: boolean signatureParams: string returnType: string + docstring: string }> } export interface RouteLayoutContext { className: string abstractClassName: string + docstring: string abstractClass: AbstractClassLayoutContext resourceImportList: string childClasses: Array<{ @@ -53,6 +58,48 @@ export interface RouteLayoutContext { const waitForActionAttemptParameter = 'wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None' +const indentDoc = (value: string, spaces: number): string => + value.replaceAll('\n', `\n${' '.repeat(spaces)}`) + +const methodDocstring = ( + method: ClassMethod, + sortedParameters: ClassMethod['parameters'], +): string => { + const lines = [formatPythonDoc(method.description)] + + for (const parameter of sortedParameters) { + const deprecated = parameter.isDeprecated + ? `Deprecated${parameter.deprecationMessage === '' ? '.' : `: ${formatPythonDoc(parameter.deprecationMessage)}`}` + : '' + const description = formatPythonDoc(parameter.description) + lines.push( + '', + `:param ${parameter.name}: ${[deprecated, description].filter(Boolean).join(' ')}`, + ) + } + + if (method.returnResource === 'ActionAttempt') { + lines.push( + '', + ':param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish.', + ) + } + + if (method.returnResource !== 'None') { + lines.push('', `:returns: ${formatPythonDoc(method.responseDescription)}`) + } + + if (method.isDeprecated) { + lines.push( + '', + '.. deprecated::', + ` ${formatPythonDoc(method.deprecationMessage) || 'This method is deprecated.'}`, + ) + } + + return lines.filter((line, index) => line !== '' || index !== 0).join('\n') +} + export const getMethodLayoutContext = ( method: ClassMethod, ): MethodLayoutContext => { @@ -83,6 +130,7 @@ export const getMethodLayoutContext = ( return { name: methodName, path, + docstring: indentDoc(methodDocstring(method, sortedParameters), 8), hasParams, signatureParams, params: sortedParameters.map(({ name }) => ({ name })), @@ -110,12 +158,17 @@ export const setRouteLayoutContext = (cls: ClassModel): RouteLayoutContext => { ) const abstractClassName = `Abstract${cls.name}` + const classDocstring = cls.isDeprecated + ? indentDoc('.. deprecated::\n This route is deprecated.', 4) + : '' return { className: cls.name, abstractClassName, + docstring: classDocstring, abstractClass: { className: abstractClassName, + docstring: classDocstring, showPass: cls.methods.length === 0 && cls.childClassIdentifiers.length === 0, childProperties: cls.childClassIdentifiers.map((i) => ({ @@ -123,9 +176,9 @@ export const setRouteLayoutContext = (cls: ClassModel): RouteLayoutContext => { abstractClassName: `Abstract${i.className}`, })), methods: cls.methods.map((method) => { - const { name, hasParams, signatureParams, returnType } = + const { name, hasParams, signatureParams, returnType, docstring } = getMethodLayoutContext(method) - return { name, hasParams, signatureParams, returnType } + return { name, hasParams, signatureParams, returnType, docstring } }), }, resourceImportList: resourceClasses.join(','), diff --git a/codegen/lib/python-docstring.ts b/codegen/lib/python-docstring.ts new file mode 100644 index 0000000..f5dad2f --- /dev/null +++ b/codegen/lib/python-docstring.ts @@ -0,0 +1,9 @@ +// Blueprint descriptions use Markdown, while the generated Python docstrings +// use Sphinx/reStructuredText fields. Normalize the Markdown constructs that +// would otherwise be displayed literally (or interpreted as invalid roles). +export const formatPythonDoc = (value: string): string => + value + .trim() + .replaceAll('"""', '\\"\\"\\"') + .replaceAll(/(?`_') diff --git a/codegen/lib/routes.ts b/codegen/lib/routes.ts index 4b82eff..0cd065d 100644 --- a/codegen/lib/routes.ts +++ b/codegen/lib/routes.ts @@ -42,7 +42,11 @@ export const routes = ( // Namespaces group routes without endpoints of their own (e.g. /acs) but // still produce a route class so their child classes are reachable. const classEntries = [...blueprint.namespaces, ...blueprint.routes] - .map(({ path, parentPath }) => ({ path, parentPath })) + .map(({ path, parentPath, isDeprecated }) => ({ + path, + parentPath, + isDeprecated, + })) .sort((a, b) => (a.path < b.path ? -1 : 1)) const classMap = new Map() @@ -55,6 +59,7 @@ export const routes = ( classMap.set(className, { name: className, namespace, + isDeprecated: entry.isDeprecated, methods: [], childClassIdentifiers: classEntries .filter((child) => child.parentPath === entry.path) @@ -84,9 +89,16 @@ export const routes = ( cls.methods.push({ methodName: endpoint.name, path: endpoint.path, + description: endpoint.description, + responseDescription: endpoint.response.description, + isDeprecated: endpoint.isDeprecated, + deprecationMessage: endpoint.deprecationMessage, parameters: endpoint.request.parameters.map((parameter) => ({ name: parameter.name, type: mapParameterToPythonType(parameter), + description: parameter.description, + isDeprecated: parameter.isDeprecated, + deprecationMessage: parameter.deprecationMessage, position: parameter.name === idParameterName ? 0 : undefined, required: parameter.isRequired, })), diff --git a/seam/resources/access_code.py b/seam/resources/access_code.py index 549d246..ead1a49 100644 --- a/seam/resources/access_code.py +++ b/seam/resources/access_code.py @@ -5,6 +5,65 @@ @dataclass class AccessCode: + """Represents a smart lock `access code `_. + + An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate. + + Seam supports programming two types of access codes: `ongoing `_ and `time-bound `_. To differentiate between the two, refer to the ``type`` property of the access code. Ongoing codes display as ``ongoing``, whereas time-bound codes are labeled ``time_bound``. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both ``starts_at`` and ``ends_at`` empty. A time-bound access code will be programmed at the ``starts_at`` time and removed at the ``ends_at`` time. + + In addition, for certain devices, Seam also supports `offline access codes `_. Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + + :ivar access_code_id: Unique identifier for the access code. + + :ivar code: Code used for access. Typically, a numeric or alphanumeric string. + + :ivar common_code_key: Unique identifier for a group of access codes that share the same code. + + :ivar created_at: Date and time at which the access code was created. + + :ivar device_id: Unique identifier for the device associated with the access code. + + :ivar dormakaba_oracode_metadata: Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices. + + :ivar ends_at: Date and time after which the time-bound access code becomes inactive. + + :ivar errors: Errors associated with the `access code `_. + + :ivar is_backup: Indicates whether the access code is a backup code. + + :ivar is_backup_access_code_available: Indicates whether a backup access code is available for use if the primary access code is lost or compromised. + + :ivar is_external_modification_allowed: Indicates whether changes to the access code from external sources are permitted. + + :ivar is_managed: Indicates whether Seam manages the access code. + + :ivar is_offline_access_code: Indicates whether the access code is intended for use in offline scenarios. If ``true``, this code can be created on a device without a network connection. + + :ivar is_one_time_use: Indicates whether the access code can only be used once. If ``true``, the code becomes invalid after the first use. + + :ivar is_scheduled_on_device: Indicates whether the code is set on the device according to a preconfigured schedule. + + :ivar is_waiting_for_code_assignment: Indicates whether the access code is waiting for a code assignment. + + :ivar name: Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :ivar pending_mutations: Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device. + + :ivar pulled_backup_access_code_id: Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. + + :ivar starts_at: Date and time at which the time-bound access code becomes active. + + :ivar status: Current status of the access code within the operational lifecycle. Values are ``setting``, a transitional phase that indicates that the code is being configured or activated; ``set``, which indicates that the code is active and operational; ``unset``, which indicates a deactivated or unused state, either before activation or after deliberate deactivation; ``removing``, which indicates a transitional period in which the code is being deleted or made inactive; and ``unknown``, which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting. See also `Lifecycle of Access Codes `_. + + :ivar type: Type of the access code. ``ongoing`` access codes are active continuously until deactivated manually. ``time_bound`` access codes have a specific duration. + + :ivar warnings: Warnings associated with the `access code `_. + + :ivar workspace_id: Unique identifier for the Seam workspace associated with the access code. + """ + access_code_id: str code: str common_code_key: str diff --git a/seam/resources/access_grant.py b/seam/resources/access_grant.py index 5b0977f..ad2b742 100644 --- a/seam/resources/access_grant.py +++ b/seam/resources/access_grant.py @@ -5,6 +5,48 @@ @dataclass class AccessGrant: + """Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant. + + :ivar access_grant_id: ID of the Access Grant. + + :ivar access_grant_key: Unique key for the access grant within the workspace. + + :ivar access_method_ids: IDs of the access methods created for the Access Grant. + + :ivar client_session_token: Client Session Token. Only returned if the Access Grant has a mobile_key access method. + + :ivar created_at: Date and time at which the Access Grant was created. + + :ivar customization_profile_id: ID of the customization profile associated with the Access Grant. + + :ivar display_name: Display name of the Access Grant. + + :ivar ends_at: Date and time at which the Access Grant ends. + + :ivar errors: Errors associated with the `access grant `_. + + :ivar instant_key_url: Instant Key URL. Only returned if the Access Grant has a single mobile_key access_method. + + :ivar location_ids: Deprecated: Use ``space_ids``. + + :ivar name: Name of the Access Grant. If not provided, the display name will be computed. + + :ivar pending_mutations: List of pending mutations for the access grant. This shows updates that are in progress. + + :ivar requested_access_methods: Access methods that the user requested for the Access Grant. + + :ivar reservation_key: Reservation key for the access grant. + + :ivar space_ids: IDs of the spaces to which the Access Grant gives access. + + :ivar starts_at: Date and time at which the Access Grant starts. + + :ivar user_identity_id: ID of user identity to which the Access Grant gives access. + + :ivar warnings: Warnings associated with the `access grant `_. + + :ivar workspace_id: ID of the Seam workspace associated with the Access Grant.""" + access_grant_id: str access_grant_key: str access_method_ids: List[str] diff --git a/seam/resources/access_method.py b/seam/resources/access_method.py index 8347e77..415f0ff 100644 --- a/seam/resources/access_method.py +++ b/seam/resources/access_method.py @@ -5,6 +5,44 @@ @dataclass class AccessMethod: + """Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key. + + :ivar access_method_id: ID of the access method. + + :ivar client_session_token: Token of the client session associated with the access method. + + :ivar code: The actual PIN code for code access methods. + + :ivar created_at: Date and time at which the access method was created. + + :ivar customization_profile_id: ID of the customization profile associated with the access method. + + :ivar display_name: Display name of the access method. + + :ivar errors: Errors associated with the `access method `_. + + :ivar instant_key_url: URL of the Instant Key for mobile key access methods. + + :ivar is_assignment_required: Indicates whether an existing card credential must be assigned to this access method before it can be issued. Only applies to card-mode access methods on systems that support credential assignment. + + :ivar is_encoding_required: Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + + :ivar is_issued: Indicates whether the access method has been issued. + + :ivar is_ready_for_assignment: Indicates whether the access method is ready for card assignment. This is true when the access method is in card mode, has not yet been issued, and the system supports credential assignment. + + :ivar is_ready_for_encoding: Indicates whether the access method is ready to be encoded. This is true when the credential has been created and the card has not yet been issued. + + :ivar issued_at: Date and time at which the access method was issued. + + :ivar mode: Access method mode. Supported values: ``code``, ``card``, ``mobile_key``, ``cloud_key``. + + :ivar pending_mutations: Pending mutations for the `access method `_. Indicates operations that are in progress. + + :ivar warnings: Warnings associated with the `access method `_. + + :ivar workspace_id: ID of the Seam workspace associated with the access method.""" + access_method_id: str client_session_token: str code: str diff --git a/seam/resources/acs_access_group.py b/seam/resources/acs_access_group.py index 099a8fd..a11b946 100644 --- a/seam/resources/acs_access_group.py +++ b/seam/resources/acs_access_group.py @@ -5,6 +5,44 @@ @dataclass class AcsAccessGroup: + """Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. + + Some access control systems use `access group `_, which are sets of users, combined with sets of permissions. These permissions include both the set of areas or assets that the users can access and the schedule during which the users can access these areas or assets. Instead of assigning access rights individually to each access control system user, which can be time-consuming and error-prone, administrators can assign users to an access group, thereby ensuring that the users inherit all the permissions associated with the access group. Using access groups streamlines the process of managing large numbers of access control system users, especially in bigger organizations or complexes. + + To learn whether your access control system supports access groups, see the corresponding `system integration guide `_. + + :ivar access_group_type: Deprecated: Use ``external_type``. + + :ivar access_group_type_display_name: Deprecated: Use ``external_type_display_name``. + + :ivar access_schedule: ``starts_at`` and ``ends_at`` timestamps for the access group's access. + + :ivar acs_access_group_id: ID of the access group. + + :ivar acs_system_id: ID of the access control system that contains the access group. + + :ivar connected_account_id: ID of the connected account that contains the access group. + + :ivar created_at: Date and time at which the access group was created. + + :ivar display_name: Display name for the access group. + + :ivar errors: Errors associated with the ``acs_access_group``. + + :ivar external_type: Brand-specific terminology for the access group type. + + :ivar external_type_display_name: Display name that corresponds to the brand-specific terminology for the access group type. + + :ivar is_managed: Indicates whether Seam manages the access group. + + :ivar name: Name of the access group. + + :ivar pending_mutations: Collection of pending mutations for the access group. Represents operations that have been requested but not yet completed on the integrated access system. + + :ivar warnings: Warnings associated with the ``acs_access_group``. + + :ivar workspace_id: ID of the workspace that contains the access group.""" + access_group_type: str access_group_type_display_name: str access_schedule: Dict[str, Any] diff --git a/seam/resources/acs_credential.py b/seam/resources/acs_credential.py index 0e9e463..64356dd 100644 --- a/seam/resources/acs_credential.py +++ b/seam/resources/acs_credential.py @@ -5,6 +5,71 @@ @dataclass class AcsCredential: + """Means by which an `access control system user `_ gains access at an `entrance `_. The ``acs_credential`` object represents a `credential `_ that provides an ACS user access within an `access control system `_. + + An access control system generally uses digital means of access to authorize a user trying to get through a specific entrance. Examples of credentials include plastic key cards, mobile keys, biometric identifiers, and PIN codes. The electronic nature of these credentials, as well as the fact that access is centralized, enables both the rapid provisioning and rescinding of access and the ability to compile access audit logs. + + For each ``acs_credential``, you define the access method. You can also specify additional properties, such as a PIN code, depending on the credential type. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. + + :ivar access_method: Access method for the `credential `_. Supported values: ``code``, ``card``, ``mobile_key``, ``cloud_key``. + + :ivar acs_credential_id: ID of the `credential `_. + + :ivar acs_credential_pool_id: ID of the credential pool to which the credential belongs. + + :ivar acs_system_id: ID of the `access control system `_ that contains the `credential `_. + + :ivar acs_user_id: ID of the `ACS user `_ to whom the `credential `_ belongs. + + :ivar assa_abloy_vostio_metadata: Vostio-specific metadata for the `credential `_. + + :ivar card_number: Number of the card associated with the `credential `_. + + :ivar code: Access (PIN) code for the `credential `_. + + :ivar connected_account_id: ID of the `connected account `_ to which the `credential `_ belongs. + + :ivar created_at: Date and time at which the `credential `_ was created. + + :ivar display_name: Display name that corresponds to the `credential `_ type. + + :ivar ends_at: Date and time at which the `credential `_ validity ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :ivar errors: Errors associated with the `credential `_. + + :ivar external_type: Brand-specific terminology for the `credential `_ type. Supported values: ``pti_card``, ``brivo_credential``, ``hid_credential``, ``visionline_card``. + + :ivar external_type_display_name: Display name that corresponds to the brand-specific terminology for the `credential `_ type. + + :ivar is_issued: Indicates whether the `credential `_ has been encoded onto a card. + + :ivar is_latest_desired_state_synced_with_provider: Indicates whether the latest state of the `credential `_ has been synced from Seam to the provider. + + :ivar is_managed: Indicates whether Seam manages the credential. + + :ivar is_multi_phone_sync_credential: Indicates whether the `credential `_ is a `multi-phone sync credential `_. + + :ivar is_one_time_use: Indicates whether the `credential `_ can only be used once. If ``true``, the code becomes invalid after the first use. + + :ivar issued_at: Date and time at which the `credential `_ was encoded onto a card. + + :ivar latest_desired_state_synced_with_provider_at: Date and time at which the state of the `credential `_ was most recently synced from Seam to the provider. + + :ivar parent_acs_credential_id: ID of the parent `credential `_. + + :ivar starts_at: Date and time at which the `credential `_ validity starts, in `ISO 8601 `_ format. + + :ivar user_identity_id: ID of the `user identity `_ to whom the `credential `_ belongs. + + :ivar visionline_metadata: Visionline-specific metadata for the `credential `_. + + :ivar warnings: Warnings associated with the `credential `_. + + :ivar workspace_id: ID of the workspace that contains the `credential `_. + """ + access_method: str acs_credential_id: str acs_credential_pool_id: str diff --git a/seam/resources/acs_encoder.py b/seam/resources/acs_encoder.py index a5d3df0..f27c4b2 100644 --- a/seam/resources/acs_encoder.py +++ b/seam/resources/acs_encoder.py @@ -5,6 +5,36 @@ @dataclass class AcsEncoder: + """Represents a hardware device that encodes `credential `_ data onto physical cards within an `access control system `_. + + Some access control systems require credentials to be encoded onto plastic key cards using a card encoder. This process involves the following two key steps: + + 1. Credential creation + Configure the access parameters for the credential. + 2. Card encoding + Write the credential data onto the card using a compatible card encoder. + + Separately, the Seam API also supports card scanning, which enables you to scan and read the encoded data on a card. You can use this action to confirm consistency with access control system records or diagnose discrepancies if needed. + + See `Working with Card Encoders and Scanners `_. + + To verify if your access control system requires a card encoder, see the corresponding `system integration guide `_. + + :ivar acs_encoder_id: ID of the `encoder `_. + + :ivar acs_system_id: ID of the `access control system `_ that contains the `encoder `_. + + :ivar connected_account_id: ID of the connected account that contains the `encoder `_. + + :ivar created_at: Date and time at which the `encoder `_ was created. + + :ivar display_name: Display name for the `encoder `_. + + :ivar errors: Errors associated with the `encoder `_. + + :ivar workspace_id: ID of the workspace that contains the `encoder `_. + """ + acs_encoder_id: str acs_system_id: str connected_account_id: str diff --git a/seam/resources/acs_entrance.py b/seam/resources/acs_entrance.py index 99c712b..02b7657 100644 --- a/seam/resources/acs_entrance.py +++ b/seam/resources/acs_entrance.py @@ -5,6 +5,61 @@ @dataclass class AcsEntrance: + """Represents an `entrance `_ within an `access control system `_. + + In an access control system, an entrance is a secured door, gate, zone, or other method of entry. You can list details for all the ``acs_entrance`` resources in your workspace or get these details for a specific ``acs_entrance``. You can also list all entrances associated with a specific credential, and you can list all credentials associated with a specific entrance. + + :ivar acs_entrance_id: ID of the `entrance `_. + + :ivar acs_system_id: ID of the `access control system `_ that contains the `entrance `_. + + :ivar akiles_metadata: Akiles-specific metadata associated with the `entrance `_. + + :ivar assa_abloy_vostio_metadata: ASSA ABLOY Vostio-specific metadata associated with the `entrance `_. + + :ivar avigilon_alta_metadata: Avigilon Alta-specific metadata associated with the `entrance `_. + + :ivar brivo_metadata: Brivo-specific metadata associated with the `entrance `_. + + :ivar can_belong_to_reservation: Indicates whether the ACS entrance can belong to a reservation via an access_grant.reservation_key. + + :ivar can_unlock_with_card: Indicates whether the ACS entrance can be unlocked with card credentials. + + :ivar can_unlock_with_cloud_key: Indicates whether the ACS entrance can be unlocked with cloud key credentials. + + :ivar can_unlock_with_code: Indicates whether the ACS entrance can be unlocked with pin codes. + + :ivar can_unlock_with_mobile_key: Indicates whether the ACS entrance can be unlocked with mobile key credentials. + + :ivar connected_account_id: ID of the `connected account `_ associated with the `entrance `_. + + :ivar created_at: Date and time at which the `entrance `_ was created. + + :ivar display_name: Display name for the `entrance `_. + + :ivar dormakaba_ambiance_metadata: dormakaba Ambiance-specific metadata associated with the `entrance `_. + + :ivar dormakaba_community_metadata: dormakaba Community-specific metadata associated with the `entrance `_. + + :ivar errors: Errors associated with the `entrance `_. + + :ivar hotek_metadata: Hotek-specific metadata associated with the `entrance `_. + + :ivar is_locked: Indicates whether the `entrance `_ is currently locked. + + :ivar latch_metadata: Latch-specific metadata associated with the `entrance `_. + + :ivar salto_ks_metadata: Salto KS-specific metadata associated with the `entrance `_. + + :ivar salto_space_metadata: Salto Space-specific metadata associated with the `entrance `_. + + :ivar space_ids: IDs of the spaces that the entrance is in. + + :ivar visionline_metadata: Visionline-specific metadata associated with the `entrance `_. + + :ivar warnings: Warnings associated with the `entrance `_. + """ + acs_entrance_id: str acs_system_id: str akiles_metadata: Dict[str, Any] diff --git a/seam/resources/acs_system.py b/seam/resources/acs_system.py index 4051ff2..6b9d6b3 100644 --- a/seam/resources/acs_system.py +++ b/seam/resources/acs_system.py @@ -5,6 +5,53 @@ @dataclass class AcsSystem: + """Represents an `access control system `_. + + Within an ``acs_system``, create ```acs_user``s `_ and ```acs_credential``s `_ to grant access to the ``acs_user``s. + + For details about the resources associated with an access control system, see the `access control systems namespace `_. + + :ivar acs_access_group_count: Number of access groups in the `access control system `_. + + :ivar acs_system_id: ID of the `access control system `_. + + :ivar acs_user_count: Number of users in the `access control system `_. + + :ivar connected_account_id: ID of the connected account associated with the `access control system `_. + + :ivar connected_account_ids: Deprecated: Use ``connected_account_id``. IDs of the `connected accounts `_ associated with the `access control system `_. + + :ivar created_at: Date and time at which the `access control system `_ was created. + + :ivar default_credential_manager_acs_system_id: ID of the default credential manager ``acs_system`` for this `access control system `_. + + :ivar errors: Errors associated with the `access control system `_. + + :ivar external_type: Brand-specific terminology for the `access control system `_ type. + + :ivar external_type_display_name: Display name that corresponds to the brand-specific terminology for the `access control system `_ type. + + :ivar image_alt_text: Alternative text for the `access control system `_ image. + + :ivar image_url: URL for the image that represents the `access control system `_. + + :ivar is_credential_manager: Indicates whether the ``acs_system`` is a credential manager. + + :ivar location: Location information for the `access control system `_. + + :ivar name: Name of the `access control system `_. + + :ivar system_type: Deprecated: Use ``external_type``. + + :ivar system_type_display_name: Deprecated: Use ``external_type_display_name``. + + :ivar visionline_metadata: Visionline-specific metadata for the `access control system `_. + + :ivar warnings: Warnings associated with the `access control system `_. + + :ivar workspace_id: ID of the workspace that contains the `access control system `_. + """ + acs_access_group_count: float acs_system_id: str acs_user_count: float diff --git a/seam/resources/acs_user.py b/seam/resources/acs_user.py index c0b43b0..6be4dac 100644 --- a/seam/resources/acs_user.py +++ b/seam/resources/acs_user.py @@ -5,6 +5,63 @@ @dataclass class AcsUser: + """Represents a `user `_ in an `access system `_. + + An access system user typically refers to an individual who requires access, like an employee or resident. Each user can possess multiple credentials that serve as their keys or identifiers for access. The type of credential can vary widely. For example, in the Salto system, a user can have a PIN code, a mobile app account, and a fob. In other platforms, it is not uncommon for a user to have more than one of the same credential type, such as multiple key cards. Additionally, these credentials can have a schedule or validity period. + + For details about how to configure users in your access system, see the corresponding `system integration guide `_. + + :ivar access_schedule: ``starts_at`` and ``ends_at`` timestamps for the `access system user's `_ access. + + :ivar acs_system_id: ID of the `access system `_ that contains the `access system user `_. + + :ivar acs_user_id: ID of the `access system user `_. + + :ivar connected_account_id: The ID of the connected account that is associated with the `access system user `_. + + :ivar created_at: Date and time at which the `access system user `_ was created. + + :ivar display_name: Display name for the `access system user `_. + + :ivar email: Deprecated: use email_address. + + :ivar email_address: Email address of the `access system user `_. + + :ivar errors: Errors associated with the `access system user `_. + + :ivar external_type: Brand-specific terminology for the `access system user `_ type. + + :ivar external_type_display_name: Display name that corresponds to the brand-specific terminology for the `access system user `_ type. + + :ivar full_name: Full name of the `access system user `_. + + :ivar hid_acs_system_id: ID of the HID access control system associated with the user. + + :ivar is_managed: Indicates whether Seam manages the access system user. + + :ivar is_suspended: Indicates whether the `access system user `_ is currently `suspended `_. + + :ivar pending_mutations: Pending mutations associated with the `access system user `_. Seam is in the process of pushing these mutations to the integrated access system. + + :ivar phone_number: Phone number of the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :ivar salto_ks_metadata: Salto KS-specific metadata associated with the `access system user `_. + + :ivar salto_space_metadata: Salto Space-specific metadata associated with the `access system user `_. + + :ivar user_identity_email_address: Email address of the user identity associated with the `access system user `_. + + :ivar user_identity_full_name: Full name of the user identity associated with the `access system user `_. + + :ivar user_identity_id: ID of the user identity associated with the `access system user `_. + + :ivar user_identity_phone_number: Phone number of the user identity associated with the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :ivar warnings: Warnings associated with the `access system user `_. + + :ivar workspace_id: ID of the workspace that contains the `access system user `_. + """ + access_schedule: Dict[str, Any] acs_system_id: str acs_user_id: str diff --git a/seam/resources/action_attempt.py b/seam/resources/action_attempt.py index 59025c6..0dd38a6 100644 --- a/seam/resources/action_attempt.py +++ b/seam/resources/action_attempt.py @@ -5,6 +5,18 @@ @dataclass class ActionAttempt: + """An attempt to perform an action in the Seam API. + + :ivar action_attempt_id: ID of the action attempt. + + :ivar action_type: Action attempt to track the status of locking a door. + + :ivar error: Error associated with the action. + + :ivar result: Result of the action. + + :ivar status:""" + action_attempt_id: str action_type: str error: Dict[str, Any] diff --git a/seam/resources/batch.py b/seam/resources/batch.py index 0318672..2321659 100644 --- a/seam/resources/batch.py +++ b/seam/resources/batch.py @@ -5,6 +5,134 @@ @dataclass class Batch: + """A batch of workspace resources. + + :ivar access_codes: Represents a smart lock `access code `_. + + An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. Using the Seam Access Code API, you can easily generate access codes on the hundreds of door lock models with which we integrate. + + Seam supports programming two types of access codes: `ongoing `_ and `time-bound `_. To differentiate between the two, refer to the ``type`` property of the access code. Ongoing codes display as ``ongoing``, whereas time-bound codes are labeled ``time_bound``. An ongoing access code is active, until it has been removed from the device. To specify an ongoing access code, leave both ``starts_at`` and ``ends_at`` empty. A time-bound access code will be programmed at the ``starts_at`` time and removed at the ``ends_at`` time. + + In addition, for certain devices, Seam also supports `offline access codes `_. Offline access (PIN) codes are designed for door locks that might not always maintain an internet connection. For this type of access code, the device manufacturer uses encryption keys (tokens) to create server-based registries of algorithmically-generated offline PIN codes. Because the tokens remain synchronized with the managed devices, the locks do not require an active internet connection—and you do not need to be near the locks—to create an offline access code. Then, owners or managers can share these offline codes with users through a variety of mechanisms, such as messaging applications. That is, lock users do not need to install a smartphone application to receive an offline access code. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + + :ivar access_grants: Represents an Access Grant. Access Grants enable you to grant a user identity access to spaces, entrances, and devices through one or more access methods, such as mobile keys, plastic cards, and PIN codes. You can create an Access Grant for an existing user identity, or you can create a new user identity *while* creating the new Access Grant. + + :ivar access_methods: Represents an access method for an Access Grant. Access methods describe the modes of access, such as PIN codes, plastic cards, and mobile keys. For a mobile key, the access method also stores the URL for the associated Instant Key. + + :ivar acs_access_groups: Group that defines the entrances to which a set of users has access and, in some cases, the access schedule for these entrances and users. + + Some access control systems use `access group `_, which are sets of users, combined with sets of permissions. These permissions include both the set of areas or assets that the users can access and the schedule during which the users can access these areas or assets. Instead of assigning access rights individually to each access control system user, which can be time-consuming and error-prone, administrators can assign users to an access group, thereby ensuring that the users inherit all the permissions associated with the access group. Using access groups streamlines the process of managing large numbers of access control system users, especially in bigger organizations or complexes. + + To learn whether your access control system supports access groups, see the corresponding `system integration guide `_. + + :ivar acs_credentials: Means by which an `access control system user `_ gains access at an `entrance `_. The ``acs_credential`` object represents a `credential `_ that provides an ACS user access within an `access control system `_. + + An access control system generally uses digital means of access to authorize a user trying to get through a specific entrance. Examples of credentials include plastic key cards, mobile keys, biometric identifiers, and PIN codes. The electronic nature of these credentials, as well as the fact that access is centralized, enables both the rapid provisioning and rescinding of access and the ability to compile access audit logs. + + For each ``acs_credential``, you define the access method. You can also specify additional properties, such as a PIN code, depending on the credential type. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. + + :ivar acs_encoders: Represents a hardware device that encodes `credential `_ data onto physical cards within an `access control system `_. + + Some access control systems require credentials to be encoded onto plastic key cards using a card encoder. This process involves the following two key steps: + + 1. Credential creation + Configure the access parameters for the credential. + 2. Card encoding + Write the credential data onto the card using a compatible card encoder. + + Separately, the Seam API also supports card scanning, which enables you to scan and read the encoded data on a card. You can use this action to confirm consistency with access control system records or diagnose discrepancies if needed. + + See `Working with Card Encoders and Scanners `_. + + To verify if your access control system requires a card encoder, see the corresponding `system integration guide `_. + + :ivar acs_entrances: Represents an `entrance `_ within an `access control system `_. + + In an access control system, an entrance is a secured door, gate, zone, or other method of entry. You can list details for all the ``acs_entrance`` resources in your workspace or get these details for a specific ``acs_entrance``. You can also list all entrances associated with a specific credential, and you can list all credentials associated with a specific entrance. + + :ivar acs_systems: Represents an `access control system `_. + + Within an ``acs_system``, create ```acs_user``s `_ and ```acs_credential``s `_ to grant access to the ``acs_user``s. + + For details about the resources associated with an access control system, see the `access control systems namespace `_. + + :ivar acs_users: Represents a `user `_ in an `access system `_. + + An access system user typically refers to an individual who requires access, like an employee or resident. Each user can possess multiple credentials that serve as their keys or identifiers for access. The type of credential can vary widely. For example, in the Salto system, a user can have a PIN code, a mobile app account, and a fob. In other platforms, it is not uncommon for a user to have more than one of the same credential type, such as multiple key cards. Additionally, these credentials can have a schedule or validity period. + + For details about how to configure users in your access system, see the corresponding `system integration guide `_. + + :ivar action_attempts: Represents an action attempt that enables you to keep track of the progress of your action that affects a physical device or system.actions against a device. Action attempts are useful because the physical world is intrinsically asynchronous. + + When you request for a device to perform an action, the Seam API immediately returns an action attempt object. In the background, the Seam API performs the action. + + See also `Action Attempts `_. + + :ivar client_sessions: Represents a `client session `_. If you want to restrict your users' access to their own devices, use client sessions. + + You create each client session with a custom ``user_identifier_key``. Normally, the ``user_identifier_key`` is a user ID that your application provides. + + When calling the Seam API from your backend using an API key, you can pass the ``user_identifier_key`` as a parameter to limit results to the associated client session. For example, ``/devices/list?user_identifier_key=123`` only returns devices associated with the client session created with the ``user_identifier_key`` ``123``. + + A client session has a token that you can use with the Seam JavaScript SDK to make requests from the client (browser) directly to the Seam API. The token restricts the user's access to only the devices that they own. + + See also `Get Started with React `_. + + :ivar connect_webviews: Represents a `Connect Webview `_. + + Connect Webviews are fully-embedded client-side components that you add to your app. Your users interact with your embedded Connect Webviews to link their IoT device or system accounts to Seam. That is, Connect Webviews walk your users through the process of logging in to their device or system accounts. Seam handles all the authentication steps, and—once your user has completed the authorization through your app—you can access and control their devices or systems using the Seam API. + + Connect Webviews perform credential validation, multifactor authentication (when applicable), and error handling for each brand that Seam supports. Further, Connect Webviews work across all modern browsers and platforms, including Chrome, Safari, and Firefox. + + To enable a user to connect their device or system account to Seam through your app, first create a ``connect_webview``. Once created, this ``connect_webview`` includes a URL that you can use to open an `iframe `_ or new window containing the Connect Webview for your user. + + When you create a Connect Webview, specify the desired provider category key in the ``provider_category`` parameter. Alternately, to specify a list of providers explicitly, use the ``accepted_providers`` parameter with a list of device provider keys. + + To list all providers within a category, use ``/devices/list_device_providers`` with the desired ``provider_category`` filter. To list all provider keys, use ``/devices/list_device_providers`` with no filters. + + :ivar connected_accounts: Represents a `connected account `_. A connected account is an external third-party account to which your user has authorized Seam to get access, for example, an August account with a list of door locks. + + :ivar devices: Represents a `device `_ that has been connected to Seam. + + :ivar events: Represents an event. Events let you know when something interesting happens in your workspace. For example, when a lock is unlocked, Seam creates a ``lock.unlocked`` event. When a device's battery level is low, Seam creates a ``device.battery_low`` event. + + As with other API resources, you can retrieve an individual event or a list of events. Seam also provides a separate webhook system for sending the event objects directly to an endpoint on your sever. Manage webhooks through `Seam Console `_. You can also use the webhooks sandbox in Seam Console to see the different payloads for each event and test them against your own endpoints. + + :ivar instant_keys: Represents a Seam Instant Key. For issuing Bluetooth mobile keys, Instant Keys are the fastest way to share access. With a single API call, you can create a mobile key and send it through text or email or embed it in your own app. + + There’s no app to install, nor account to create. Your user just taps a link and gets a lightweight, native-feeling experience using iOS App Clip or Instant Apps on Android. Further, Instant Keys work offline, so even in areas with poor cellular or Wi-Fi, like elevator banks or concrete-walled hallways, the Instant Keys still work. + + :ivar noise_thresholds: Represents a `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + + :ivar spaces: Represents a space that is a logical grouping of devices and entrances. You can assign access to an entire space, thereby making granting access more efficient. + + :ivar thermostat_daily_programs: Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time. + + :ivar thermostat_schedules: Represents a `thermostat schedule `_ that activates a configured `climate preset `_ on a `thermostat `_ at a specified starting time and deactivates the climate preset at a specified ending time. + + :ivar unmanaged_access_codes: Represents an `unmanaged smart lock access code `_. + + An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. + + When you create an access code on a device in Seam, it is created as a managed access code. Access codes that exist on a device that were not created through Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes. + + Prior to using Seam to manage your devices, you may have used another lock management system to manage the access codes on your devices. Where possible, we help you keep any existing access codes on devices and transition those codes to ones managed by your Seam workspace. + + Not all providers support unmanaged access codes. The following providers do not support unmanaged access codes: + + - `Kwikset `_ + + :ivar unmanaged_devices: Represents an `unmanaged device `_. An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :ivar user_identities: Represents a `user identity `_ associated with an application user account. + + :ivar workspaces: Represents a Seam `workspace `_. A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A `sandbox workspace `_ is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a `production workspace `_. + """ + access_codes: List[Dict[str, Any]] access_grants: List[Dict[str, Any]] access_methods: List[Dict[str, Any]] diff --git a/seam/resources/client_session.py b/seam/resources/client_session.py index 7756936..a23ebcd 100644 --- a/seam/resources/client_session.py +++ b/seam/resources/client_session.py @@ -5,6 +5,40 @@ @dataclass class ClientSession: + """Represents a `client session `_. If you want to restrict your users' access to their own devices, use client sessions. + + You create each client session with a custom ``user_identifier_key``. Normally, the ``user_identifier_key`` is a user ID that your application provides. + + When calling the Seam API from your backend using an API key, you can pass the ``user_identifier_key`` as a parameter to limit results to the associated client session. For example, ``/devices/list?user_identifier_key=123`` only returns devices associated with the client session created with the ``user_identifier_key`` ``123``. + + A client session has a token that you can use with the Seam JavaScript SDK to make requests from the client (browser) directly to the Seam API. The token restricts the user's access to only the devices that they own. + + See also `Get Started with React `_. + + :ivar client_session_id: ID of the client session. + + :ivar connect_webview_ids: IDs of the `Connect Webviews `_ associated with the `client session `_. + + :ivar connected_account_ids: IDs of the `connected accounts `_ associated with the `client session `_. + + :ivar created_at: Date and time at which the `client session `_ was created. + + :ivar customer_key: Customer key associated with the `client session `_. + + :ivar device_count: Number of devices associated with the `client session `_. + + :ivar expires_at: Date and time at which the `client session `_ expires. + + :ivar token: Client session token associated with the `client session `_. + + :ivar user_identifier_key: Your user ID for the user associated with the `client session `_. + + :ivar user_identity_id: ID of the `user identity `_ associated with the client session. + + :ivar user_identity_ids: Deprecated: Use ``user_identity_id`` instead. IDs of the `user identities `_ associated with the client session. + + :ivar workspace_id: ID of the workspace associated with the client session.""" + client_session_id: str connect_webview_ids: List[str] connected_account_ids: List[str] diff --git a/seam/resources/connect_webview.py b/seam/resources/connect_webview.py index 7de83e0..bb436eb 100644 --- a/seam/resources/connect_webview.py +++ b/seam/resources/connect_webview.py @@ -5,6 +5,56 @@ @dataclass class ConnectWebview: + """Represents a `Connect Webview `_. + + Connect Webviews are fully-embedded client-side components that you add to your app. Your users interact with your embedded Connect Webviews to link their IoT device or system accounts to Seam. That is, Connect Webviews walk your users through the process of logging in to their device or system accounts. Seam handles all the authentication steps, and—once your user has completed the authorization through your app—you can access and control their devices or systems using the Seam API. + + Connect Webviews perform credential validation, multifactor authentication (when applicable), and error handling for each brand that Seam supports. Further, Connect Webviews work across all modern browsers and platforms, including Chrome, Safari, and Firefox. + + To enable a user to connect their device or system account to Seam through your app, first create a ``connect_webview``. Once created, this ``connect_webview`` includes a URL that you can use to open an `iframe `_ or new window containing the Connect Webview for your user. + + When you create a Connect Webview, specify the desired provider category key in the ``provider_category`` parameter. Alternately, to specify a list of providers explicitly, use the ``accepted_providers`` parameter with a list of device provider keys. + + To list all providers within a category, use ``/devices/list_device_providers`` with the desired ``provider_category`` filter. To list all provider keys, use ``/devices/list_device_providers`` with no filters. + + :ivar accepted_capabilities: High-level device capabilities that the Connect Webview can accept. When creating a Connect Webview, you can specify the types of devices that it can connect to Seam. If you do not set custom ``accepted_capabilities``, Seam uses a default set of ``accepted_capabilities`` for each provider. For example, if you create a Connect Webview that accepts SmartThing devices, without specifying ``accepted_capabilities``, Seam accepts only SmartThings locks. To connect SmartThings thermostats and locks to Seam, create a Connect Webview and include both ``thermostat`` and ``lock`` in the ``accepted_capabilities``. + + :ivar accepted_providers: List of accepted `provider keys `_. + + :ivar any_provider_allowed: Indicates whether any provider is allowed. + + :ivar authorized_at: Date and time at which the user authorized (through the Connect Webview) the management of their devices. + + :ivar automatically_manage_new_devices: Indicates whether Seam should `import all new devices `_ for the connected account to make these devices available for use and management by the Seam API. + + :ivar connect_webview_id: ID of the Connect Webview. + + :ivar connected_account_id: ID of the connected account associated with the Connect Webview. + + :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_redirect_failure_url: URL to which the Connect Webview should redirect when an unexpected error occurs. + + :ivar custom_redirect_url: URL to which the Connect Webview should redirect when the user successfully pairs a device or system. If you do not set the ``custom_redirect_failure_url``, the Connect Webview redirects to the ``custom_redirect_url`` when an unexpected error occurs. + + :ivar customer_key: The customer key associated with this webview, if any. + + :ivar device_selection_mode: Device selection mode of the Connect Webview. Supported values: ``none``, ``single``, ``multiple``. + + :ivar login_successful: Indicates whether the user logged in successfully using the Connect Webview. + + :ivar selected_provider: Selected provider of the Connect Webview, one of the `provider keys `_. + + :ivar status: Status of the Connect Webview. ``authorized`` indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview. + + :ivar url: URL for the Connect Webview. You use the URL to display the Connect Webview flow to your user. + + :ivar wait_for_device_creation: Indicates whether Seam should `finish syncing all devices `_ in a newly-connected account before completing the associated Connect Webview. + + :ivar workspace_id: ID of the workspace that contains the Connect Webview.""" + accepted_capabilities: List[str] accepted_providers: List[str] any_provider_allowed: bool diff --git a/seam/resources/connected_account.py b/seam/resources/connected_account.py index b6904ca..2a0e775 100644 --- a/seam/resources/connected_account.py +++ b/seam/resources/connected_account.py @@ -5,6 +5,44 @@ @dataclass class ConnectedAccount: + """Represents a `connected account `_. A connected account is an external third-party account to which your user has authorized Seam to get access, for example, an August account with a list of door locks. + + :ivar accepted_capabilities: List of capabilities that were accepted during the account connection process. + + :ivar account_type: Type of connected account. + + :ivar account_type_display_name: Display name for the connected account type. + + :ivar automatically_manage_new_devices: Indicates whether Seam should `import all new devices `_ for the connected account to make these devices available for management by the Seam API. + + :ivar connected_account_id: ID of the connected account. + + :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 customer_key: Your unique key for the customer associated with this connected account. + + :ivar default_checkin_time: Default reservation check-in time for this connected account, as ``HH:mm`` (24-hour). Sourced from the connector configuration — set during the connect_webview for providers like Lodgify whose API does not expose check-in times. + + :ivar default_checkout_time: Default reservation check-out time for this connected account, as ``HH:mm`` (24-hour). Sourced from the connector configuration. + + :ivar display_name: Display name for the connected account. + + :ivar errors: Errors associated with the connected account. + + :ivar ical_feed_origin: For iCal connected accounts, the platform that produced the feed (for example, ``airbnb``, ``vrbo``, or ``booking``), or ``unknown`` when it could not be determined. Intended for rendering the source platform's logo. + + :ivar ical_url: For iCal connected accounts, the feed URL for the connection. Sourced from the connector configuration. + + :ivar image_url: Logo URL for the connected account provider. + + :ivar time_zone: IANA time zone (e.g. America/Los_Angeles) for this connected account. Sourced from the connector configuration. + + :ivar user_identifier: Deprecated: Use ``display_name`` instead. User identifier associated with the connected account. + + :ivar warnings: Warnings associated with the connected account.""" + accepted_capabilities: List[str] account_type: str account_type_display_name: str diff --git a/seam/resources/customer_portal.py b/seam/resources/customer_portal.py index eafd6ac..3a62506 100644 --- a/seam/resources/customer_portal.py +++ b/seam/resources/customer_portal.py @@ -5,6 +5,22 @@ @dataclass class CustomerPortal: + """Represents a Customer Portal. Customer Portal is a hosted, customizable interface for managing device access. It enables you to embed secure, pre-authenticated access flows into your product—either by sharing a link with users or embedding a view in an iframe. + + With Customer Portal, you no longer need to build out frontend experiences for physical access, thermostats, and sensors. Instead, you can ship enterprise-grade access control experiences in a fraction of the time, while maintaining your product's branding and user experience. + + Seam hosts these flows, handling everything from account connection and device mapping to full-featured device control. + + :ivar created_at: Date and time at which the customer portal link was created. + + :ivar customer_key: Customer key for the customer portal. + + :ivar expires_at: Date and time at which the customer portal link expires. + + :ivar url: URL for the customer portal. + + :ivar workspace_id: ID of the workspace associated with the customer portal.""" + created_at: str customer_key: str expires_at: str diff --git a/seam/resources/device.py b/seam/resources/device.py index e55bd6c..7813fd1 100644 --- a/seam/resources/device.py +++ b/seam/resources/device.py @@ -5,6 +5,83 @@ @dataclass class Device: + """Represents a `device `_ that has been connected to Seam. + + :ivar can_configure_auto_lock: Indicates whether the lock supports configuring automatic locking. + + :ivar can_hvac_cool: Indicates whether the thermostat supports cooling. + + :ivar can_hvac_heat: Indicates whether the thermostat supports heating. + + :ivar can_hvac_heat_cool: Indicates whether the thermostat supports simultaneous heating and cooling. + + :ivar can_program_offline_access_codes: Indicates whether the device supports programming offline access codes. + + :ivar can_program_online_access_codes: Indicates whether the device supports programming online access codes. + + :ivar can_program_thermostat_programs_as_different_each_day: Indicates whether the thermostat supports different climate programs for each day of the week. + + :ivar can_program_thermostat_programs_as_same_each_day: Indicates whether the thermostat supports a single climate program applied to every day. + + :ivar can_program_thermostat_programs_as_weekday_weekend: Indicates whether the thermostat supports weekday/weekend climate programs. + + :ivar can_remotely_lock: Indicates whether the device supports remote locking. + + :ivar can_remotely_unlock: Indicates whether the device supports remote unlocking. + + :ivar can_run_thermostat_programs: Indicates whether the thermostat supports running climate programs. + + :ivar can_simulate_connection: Indicates whether the device supports simulating connection in a sandbox. + + :ivar can_simulate_disconnection: Indicates whether the device supports simulating disconnection in a sandbox. + + :ivar can_simulate_hub_connection: Indicates whether the hub supports simulating connection in a sandbox. + + :ivar can_simulate_hub_disconnection: Indicates whether the hub supports simulating disconnection in a sandbox. + + :ivar can_simulate_paid_subscription: Indicates whether the device supports simulating a paid subscription in a sandbox. + + :ivar can_simulate_removal: Indicates whether the device supports simulating removal in a sandbox. + + :ivar can_turn_off_hvac: Indicates whether the thermostat can be turned off. + + :ivar can_unlock_with_code: Indicates whether the lock supports unlocking with an access code. + + :ivar capabilities_supported: Collection of capabilities that the device supports when connected to Seam. Values are ``access_code``, which indicates that the device can manage and utilize digital PIN codes for secure access; ``lock``, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; ``noise_detection``, which indicates that the device supports monitoring and responding to ambient noise levels; ``thermostat``, which indicates that the device can regulate and adjust indoor temperatures; ``battery``, which indicates that the device can manage battery life and health; and ``phone``, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by `capability flags `_. + + :ivar connected_account_id: Unique identifier for the account associated with the 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 device_id: ID of the device. + + :ivar device_manufacturer: Manufacturer of the device. Represents the hardware brand, which may differ from the provider. + + :ivar device_provider: Provider of the device. Represents the third-party service through which the device is controlled. + + :ivar device_type: Type of the device. + + :ivar display_name: Display name of the device, defaults to nickname (if it is set) or ``properties.appearance.name``, otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices. + + :ivar errors: Array of errors associated with the device. Each error object within the array contains two fields: ``error_code`` and ``message``. ``error_code`` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. ``message`` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + + :ivar is_managed: Indicates whether Seam manages the device. See also `Managed and Unmanaged Devices `_. + + :ivar location: Location information for the device. + + :ivar nickname: Optional nickname to describe the device, settable through Seam. + + :ivar properties: Properties of the device. + + :ivar space_ids: IDs of the spaces the device is in. + + :ivar warnings: Array of warnings associated with the device. Each warning object within the array contains two fields: ``warning_code`` and ``message``. ``warning_code`` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. ``message`` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + + :ivar workspace_id: Unique identifier for the Seam workspace associated with the device. + """ + can_configure_auto_lock: bool can_hvac_cool: bool can_hvac_heat: bool diff --git a/seam/resources/device_provider.py b/seam/resources/device_provider.py index 29ea7c9..b1fe461 100644 --- a/seam/resources/device_provider.py +++ b/seam/resources/device_provider.py @@ -5,6 +5,56 @@ @dataclass class DeviceProvider: + """ + :ivar can_configure_auto_lock: Indicates whether the lock supports configuring automatic locking. + + :ivar can_hvac_cool: Indicates whether the thermostat supports cooling. + + :ivar can_hvac_heat: Indicates whether the thermostat supports heating. + + :ivar can_hvac_heat_cool: Indicates whether the thermostat supports simultaneous heating and cooling. + + :ivar can_program_offline_access_codes: Indicates whether the device supports programming offline access codes. + + :ivar can_program_online_access_codes: Indicates whether the device supports programming online access codes. + + :ivar can_program_thermostat_programs_as_different_each_day: Indicates whether the thermostat supports different climate programs for each day of the week. + + :ivar can_program_thermostat_programs_as_same_each_day: Indicates whether the thermostat supports a single climate program applied to every day. + + :ivar can_program_thermostat_programs_as_weekday_weekend: Indicates whether the thermostat supports weekday/weekend climate programs. + + :ivar can_remotely_lock: Indicates whether the device supports remote locking. + + :ivar can_remotely_unlock: Indicates whether the device supports remote unlocking. + + :ivar can_run_thermostat_programs: Indicates whether the thermostat supports running climate programs. + + :ivar can_simulate_connection: Indicates whether the device supports simulating connection in a sandbox. + + :ivar can_simulate_disconnection: Indicates whether the device supports simulating disconnection in a sandbox. + + :ivar can_simulate_hub_connection: Indicates whether the hub supports simulating connection in a sandbox. + + :ivar can_simulate_hub_disconnection: Indicates whether the hub supports simulating disconnection in a sandbox. + + :ivar can_simulate_paid_subscription: Indicates whether the device supports simulating a paid subscription in a sandbox. + + :ivar can_simulate_removal: Indicates whether the device supports simulating removal in a sandbox. + + :ivar can_turn_off_hvac: Indicates whether the thermostat can be turned off. + + :ivar can_unlock_with_code: Indicates whether the lock supports unlocking with an access code. + + :ivar device_provider_name: Name of the device provider. + + :ivar display_name: Display name for the device provider. + + :ivar image_url: Image URL for the device provider. + + :ivar provider_categories: List of provider categories to which the device provider belongs, such as ``stable``, ``consumer_smartlocks``, ``thermostats``, and so on. + """ + can_configure_auto_lock: bool can_hvac_cool: bool can_hvac_heat: bool diff --git a/seam/resources/instant_key.py b/seam/resources/instant_key.py index 8ee16b2..a635069 100644 --- a/seam/resources/instant_key.py +++ b/seam/resources/instant_key.py @@ -5,6 +5,28 @@ @dataclass class InstantKey: + """Represents a Seam Instant Key. For issuing Bluetooth mobile keys, Instant Keys are the fastest way to share access. With a single API call, you can create a mobile key and send it through text or email or embed it in your own app. + + There’s no app to install, nor account to create. Your user just taps a link and gets a lightweight, native-feeling experience using iOS App Clip or Instant Apps on Android. Further, Instant Keys work offline, so even in areas with poor cellular or Wi-Fi, like elevator banks or concrete-walled hallways, the Instant Keys still work. + + :ivar client_session_id: ID of the client session associated with the Instant Key. + + :ivar created_at: Date and time at which the Instant Key was created. + + :ivar customization: Customization applied to the Instant Key UI. + + :ivar customization_profile_id: ID of the customization profile associated with the Instant Key. + + :ivar expires_at: Date and time at which the Instant Key expires. + + :ivar instant_key_id: ID of the Instant Key. + + :ivar instant_key_url: Shareable URL for the Instant Key. Use the URL to deliver the Instant Key to your user through a link in a text message or email or by embedding it in your web app. + + :ivar user_identity_id: ID of the user identity associated with the Instant Key. + + :ivar workspace_id: ID of the workspace that contains the Instant Key.""" + client_session_id: str created_at: str customization: Dict[str, Any] diff --git a/seam/resources/noise_threshold.py b/seam/resources/noise_threshold.py index 19f4a47..0c8eee1 100644 --- a/seam/resources/noise_threshold.py +++ b/seam/resources/noise_threshold.py @@ -5,6 +5,23 @@ @dataclass class NoiseThreshold: + """Represents a `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + + :ivar device_id: Unique identifier for the device that contains the noise threshold. + + :ivar ends_daily_at: Time at which the noise threshold should become inactive daily. + + :ivar name: Name of the noise threshold. + + :ivar noise_threshold_decibels: Noise level in decibels for the noise threshold. + + :ivar noise_threshold_id: Unique identifier for the noise threshold. + + :ivar noise_threshold_nrs: Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for `Noiseaware sensors `_. + + :ivar starts_daily_at: Time at which the noise threshold should become active daily. + """ + device_id: str ends_daily_at: str name: str diff --git a/seam/resources/pagination.py b/seam/resources/pagination.py index 4e5fda0..164cac4 100644 --- a/seam/resources/pagination.py +++ b/seam/resources/pagination.py @@ -5,6 +5,14 @@ @dataclass class Pagination: + """Information about the current page of results. + + :ivar has_next_page: Indicates whether there is another page of results after this one. + + :ivar next_page_cursor: Opaque value that can be used to select the next page of results via the ``page_cursor`` parameter. + + :ivar next_page_url: URL to get the next page of results.""" + has_next_page: bool next_page_cursor: str next_page_url: str diff --git a/seam/resources/phone.py b/seam/resources/phone.py index d80239b..a9830ef 100644 --- a/seam/resources/phone.py +++ b/seam/resources/phone.py @@ -5,6 +5,28 @@ @dataclass class Phone: + """Represents an app user's mobile phone. + + :ivar created_at: Date and time at which the phone was created. + + :ivar custom_metadata: Optional `custom metadata `_ for the phone. + + :ivar device_id: ID of the phone. + + :ivar device_type: Type of the phone device, such as ``ios_phone`` or ``android_phone``. + + :ivar display_name: Display name of the phone. Defaults to ``nickname`` (if it is set) or ``properties.appearance.name``, otherwise. Enables administrators and users to identify the phone easily, especially when there are numerous phones. + + :ivar errors: Errors associated with the phone. + + :ivar nickname: Optional nickname to describe the phone, settable through Seam. + + :ivar properties: Properties of the phone. + + :ivar warnings: Warnings associated with the phone. + + :ivar workspace_id: ID of the workspace that contains the phone.""" + created_at: str custom_metadata: Dict[str, Any] device_id: str diff --git a/seam/resources/seam_event.py b/seam/resources/seam_event.py index 614fdbf..e0b14e2 100644 --- a/seam/resources/seam_event.py +++ b/seam/resources/seam_event.py @@ -5,6 +5,191 @@ @dataclass class SeamEvent: + """ + :ivar access_code_id: ID of the affected access code. + + :ivar connected_account_custom_metadata: Custom metadata of the connected account, present when connected_account_id is provided. + + :ivar connected_account_id: ID of the connected account associated with the affected access code. + + :ivar created_at: Date and time at which the event was created. + + :ivar device_custom_metadata: Custom metadata of the device, present when device_id is provided. + + :ivar device_id: ID of the device associated with the affected access code. + + :ivar event_description: Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event. + + :ivar event_id: ID of the event. + + :ivar event_type: + + :ivar occurred_at: Date and time at which the event occurred. + + :ivar workspace_id: ID of the workspace associated with the event. + + :ivar change_reason: Human-readable reason for the change (e.g. ``ongoing code auto-renewed``). + + :ivar changed_properties: List of properties that changed on the access code. + + :ivar description: Human-readable description of the change and its source. + + :ivar from_: Previous access code name configuration. + + :ivar to: New access code name configuration. + + :ivar requested_mutations: Array of mutations requested on the access code, each containing the mutation type and from/to values. + + :ivar code: Code for the affected access code. + + :ivar access_code_errors: Errors associated with the access code. + + :ivar access_code_warnings: Warnings associated with the access code. + + :ivar connected_account_errors: Errors associated with the connected account. + + :ivar connected_account_warnings: Warnings associated with the connected account. + + :ivar device_errors: Errors associated with the device. + + :ivar device_warnings: Warnings associated with the device. + + :ivar backup_access_code_id: ID of the backup access code that was pulled from the pool. + + :ivar access_grant_id: ID of the affected Access Grant. + + :ivar acs_entrance_id: ID of the affected `entrance `_. + + :ivar access_grant_key: Key of the affected Access Grant (if present). + + :ivar ends_at: The new end time for the access grant. + + :ivar starts_at: The new start time for the access grant. + + :ivar error_message: Description of why the access methods could not be created. + + :ivar missing_device_ids: IDs of the devices that did not receive a requested access method. Use these to identify which specific devices failed without having to fetch the Access Grant. + + :ivar access_grant_ids: IDs of the access grants associated with this access method. + + :ivar access_grant_keys: Keys of the access grants associated with this access method (if present). + + :ivar access_method_id: ID of the affected access method. + + :ivar is_backup_code: Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). + + :ivar acs_system_id: ID of the access system. + + :ivar acs_system_errors: Errors associated with the access control system. + + :ivar acs_system_warnings: Warnings associated with the access control system. + + :ivar acs_credential_id: ID of the affected credential. + + :ivar acs_user_id: ID of the affected access system user. + + :ivar acs_encoder_id: ID of the affected encoder. + + :ivar acs_access_group_id: ID of the affected access group. + + :ivar client_session_id: ID of the affected client session. + + :ivar connect_webview_id: ID of the Connect Webview associated with the event. + + :ivar customer_key: The customer key associated with this connected account, if any. + + :ivar connected_account_type: undocumented: Unreleased. + + :ivar action_attempt_id: ID of the affected action attempt. + + :ivar action_type: Type of the action. + + :ivar status: Status of the action. + + :ivar error_code: Error code associated with the disconnection event, if any. + + :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 battery_status: Battery status of the affected device, calculated from the numeric ``battery_level`` value. + + :ivar device_name: Name of the deleted device, captured at deletion time. The device record no longer exists when this event fires, so the name is preserved here. Null when the device had no resolvable name. + + :ivar minut_metadata: Metadata from Minut. + + :ivar noise_level_decibels: Detected noise level in decibels. + + :ivar noise_level_nrs: Detected noise level in Noiseaware Noise Risk Score (NRS). + + :ivar noise_threshold_id: ID of the noise threshold that was triggered. + + :ivar noise_threshold_name: Name of the noise threshold that was triggered. + + :ivar noiseaware_metadata: Metadata from Noiseaware. + + :ivar access_code_is_managed: Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. + + :ivar is_via_bluetooth: Whether the lock action was performed over Bluetooth by a remote client (such as the provider's mobile app), rather than a direct physical interaction or a Seam-initiated remote action. + + :ivar is_via_nfc: Whether the lock action was performed by an NFC credential tap (such as an Apple Home Key or an NFC key fob) presented to the lock, rather than a direct physical interaction or a Seam-initiated remote action. + + :ivar method: Method by which the lock was locked. ``keycode``: an access code was used (see ``access_code_id``). ``manual``: a physical action such as a thumbturn or button press. ``remote``: a remote action via an app, Bluetooth, or the Seam API (see ``action_attempt_id`` if Seam-initiated; see ``is_via_bluetooth`` or ``is_via_nfc`` for the transport). ``automatic``: triggered automatically, for example by an auto-relock timer. ``unknown``: could not be determined. + + :ivar user_identity_id: undocumented: Unreleased. + --- + ID of the user identity associated with the lock event. + + :ivar reason: Why access was denied, when the provider reports a determinable cause. Omitted when unknown. + + :ivar climate_preset_key: Key of the climate preset that was activated. + + :ivar is_fallback_climate_preset: Indicates whether the climate preset that was activated is the fallback climate preset for the thermostat. + + :ivar thermostat_schedule_id: ID of the thermostat schedule that prompted the affected climate preset to be activated. + + :ivar cooling_set_point_celsius: Temperature to which the thermostat should cool (in °C). See also `Set Points `_. + + :ivar cooling_set_point_fahrenheit: Temperature to which the thermostat should cool (in °F). See also `Set Points `_. + + :ivar fan_mode_setting: Desired `fan mode setting `_, such as ``on``, ``auto``, or ``circulate``. + + :ivar heating_set_point_celsius: Temperature to which the thermostat should heat (in °C). See also `Set Points `_. + + :ivar heating_set_point_fahrenheit: Temperature to which the thermostat should heat (in °F). See also `Set Points `_. + + :ivar hvac_mode_setting: Desired `HVAC mode `_ setting, such as ``heat``, ``cool``, ``heat_cool``, or ``off``. + + :ivar lower_limit_celsius: Lower temperature limit, in °C, defined by the set threshold. + + :ivar lower_limit_fahrenheit: Lower temperature limit, in °F, defined by the set threshold. + + :ivar temperature_celsius: Temperature, in °C, reported by the affected thermostat. + + :ivar temperature_fahrenheit: Temperature, in °F, reported by the affected thermostat. + + :ivar upper_limit_celsius: Upper temperature limit, in °C, defined by the set threshold. + + :ivar upper_limit_fahrenheit: Upper temperature limit, in °F, defined by the set threshold. + + :ivar desired_temperature_celsius: Desired temperature, in °C, defined by the affected thermostat's cooling or heating set point. + + :ivar desired_temperature_fahrenheit: Desired temperature, in °F, defined by the affected thermostat's cooling or heating set point. + + :ivar activation_reason: The reason the camera was activated. + + :ivar image_url: URL to a thumbnail image captured at the time of activation. + + :ivar motion_sub_type: Sub-type of motion detected, if available. + + :ivar video_url: URL to a short video clip captured at the time of activation. + + :ivar acs_entrance_ids: IDs of all ACS entrances currently attached to the space. + + :ivar device_ids: IDs of all devices currently attached to the space. + + :ivar space_id: ID of the affected space. + + :ivar space_key: Unique key for the space within the workspace.""" + access_code_id: str connected_account_custom_metadata: Dict[str, Any] connected_account_id: str diff --git a/seam/resources/space.py b/seam/resources/space.py index 16222ee..4eaa901 100644 --- a/seam/resources/space.py +++ b/seam/resources/space.py @@ -5,6 +5,30 @@ @dataclass class Space: + """Represents a space that is a logical grouping of devices and entrances. You can assign access to an entire space, thereby making granting access more efficient. + + :ivar acs_entrance_count: Number of entrances in the space. + + :ivar created_at: Date and time at which the space was created. + + :ivar customer_data: Reservation/stay-related defaults for the space. Also carries the provider/PMS-supplied name under a ``_name`` key (e.g. ``guesty_name``), which Seam preserves when you rename the space (read-only — managed by Seam). + + :ivar customer_key: Customer key associated with the space. + + :ivar device_count: Number of devices in the space. + + :ivar display_name: Display name for the space. + + :ivar geolocation: Geographic coordinates (latitude and longitude) of the space. + + :ivar name: Name of the space. + + :ivar space_id: ID of the space. + + :ivar space_key: Unique key for the space within the workspace. + + :ivar workspace_id: ID of the workspace associated with the space.""" + acs_entrance_count: float created_at: str customer_data: Dict[str, Any] diff --git a/seam/resources/thermostat_daily_program.py b/seam/resources/thermostat_daily_program.py index 2476fec..dbc703f 100644 --- a/seam/resources/thermostat_daily_program.py +++ b/seam/resources/thermostat_daily_program.py @@ -5,6 +5,21 @@ @dataclass class ThermostatDailyProgram: + """Represents a thermostat daily program, consisting of a set of periods, each of which has a starting time and the key that identifies the climate preset to apply at the starting time. + + :ivar created_at: Date and time at which the thermostat daily program was created. + + :ivar device_id: ID of the thermostat device on which the thermostat daily program is configured. + + :ivar name: User-friendly name to identify the thermostat daily program. + + :ivar periods: Array of thermostat daily program periods. + + :ivar thermostat_daily_program_id: ID of the thermostat daily program. + + :ivar workspace_id: ID of the workspace that contains the thermostat daily program. + """ + created_at: str device_id: str name: str diff --git a/seam/resources/thermostat_schedule.py b/seam/resources/thermostat_schedule.py index 8c48bfa..13d9ae9 100644 --- a/seam/resources/thermostat_schedule.py +++ b/seam/resources/thermostat_schedule.py @@ -5,6 +5,30 @@ @dataclass class ThermostatSchedule: + """Represents a `thermostat schedule `_ that activates a configured `climate preset `_ on a `thermostat `_ at a specified starting time and deactivates the climate preset at a specified ending time. + + :ivar climate_preset_key: Key of the `climate preset `_ to use for the `thermostat schedule `_. + + :ivar created_at: Date and time at which the `thermostat schedule `_ was created. + + :ivar device_id: ID of the desired `thermostat `_ device. + + :ivar ends_at: Date and time at which the `thermostat schedule `_ ends, in `ISO 8601 `_ format. + + :ivar errors: Errors associated with the `thermostat schedule `_. + + :ivar is_override_allowed: Indicates whether a person at the thermostat can change the thermostat's settings after the `thermostat schedule `_ starts. + + :ivar max_override_period_minutes: Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled `climate preset `_. See also `Specifying Manual Override Permissions `_. + + :ivar name: User-friendly name to identify the `thermostat schedule `_. + + :ivar starts_at: Date and time at which the `thermostat schedule `_ starts, in `ISO 8601 `_ format. + + :ivar thermostat_schedule_id: ID of the `thermostat schedule `_. + + :ivar workspace_id: ID of the workspace that contains the thermostat schedule.""" + climate_preset_key: str created_at: str device_id: str diff --git a/seam/resources/unmanaged_access_code.py b/seam/resources/unmanaged_access_code.py index 60dce01..84b43d6 100644 --- a/seam/resources/unmanaged_access_code.py +++ b/seam/resources/unmanaged_access_code.py @@ -5,6 +5,51 @@ @dataclass class UnmanagedAccessCode: + """Represents an `unmanaged smart lock access code `_. + + An access code is a code used for a keypad or pinpad device. Unlike physical keys, which can easily be lost or duplicated, PIN codes can be customized, tracked, and altered on the fly. + + When you create an access code on a device in Seam, it is created as a managed access code. Access codes that exist on a device that were not created through Seam are considered unmanaged codes. We strictly limit the operations that can be performed on unmanaged codes. + + Prior to using Seam to manage your devices, you may have used another lock management system to manage the access codes on your devices. Where possible, we help you keep any existing access codes on devices and transition those codes to ones managed by your Seam workspace. + + Not all providers support unmanaged access codes. The following providers do not support unmanaged access codes: + + - `Kwikset `_ + + :ivar access_code_id: Unique identifier for the access code. + + :ivar cannot_be_managed: Indicates that Seam cannot convert this unmanaged access code to a managed access code. Some providers do not support management of unmanaged access codes through API integrations. + + :ivar cannot_delete_unmanaged_access_code: Indicates that Seam cannot delete this unmanaged access code through the provider. If this access code needs to be deleted, it will only be possible from the manufacturer app. + + :ivar code: Code used for access. Typically, a numeric or alphanumeric string. + + :ivar created_at: Date and time at which the access code was created. + + :ivar device_id: Unique identifier for the device associated with the access code. + + :ivar dormakaba_oracode_metadata: Metadata for a dormakaba Oracode unmanaged access code. Only present for unmanaged access codes from dormakaba Oracode devices. + + :ivar ends_at: Date and time after which the time-bound access code becomes inactive. + + :ivar errors: Errors associated with the `access code `_. + + :ivar is_managed: Indicates that Seam does not manage the access code. + + :ivar name: Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :ivar starts_at: Date and time at which the time-bound access code becomes active. + + :ivar status: Current status of the access code within the operational lifecycle. ``set`` indicates that the code is active and operational. ``unset`` indicates that the code exists on the provider but is not usable on the device. + + :ivar type: Type of the access code. ``ongoing`` access codes are active continuously until deactivated manually. ``time_bound`` access codes have a specific duration. + + :ivar warnings: Warnings associated with the `access code `_. + + :ivar workspace_id: Unique identifier for the Seam workspace associated with the access code. + """ + access_code_id: str cannot_be_managed: bool cannot_delete_unmanaged_access_code: bool diff --git a/seam/resources/unmanaged_device.py b/seam/resources/unmanaged_device.py index 85ca4b6..c6be5b7 100644 --- a/seam/resources/unmanaged_device.py +++ b/seam/resources/unmanaged_device.py @@ -5,6 +5,73 @@ @dataclass class UnmanagedDevice: + """Represents an `unmanaged device `_. An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :ivar can_configure_auto_lock: Indicates whether the lock supports configuring automatic locking. + + :ivar can_hvac_cool: Indicates whether the thermostat supports cooling. + + :ivar can_hvac_heat: Indicates whether the thermostat supports heating. + + :ivar can_hvac_heat_cool: Indicates whether the thermostat supports simultaneous heating and cooling. + + :ivar can_program_offline_access_codes: Indicates whether the device supports programming offline access codes. + + :ivar can_program_online_access_codes: Indicates whether the device supports programming online access codes. + + :ivar can_program_thermostat_programs_as_different_each_day: Indicates whether the thermostat supports different climate programs for each day of the week. + + :ivar can_program_thermostat_programs_as_same_each_day: Indicates whether the thermostat supports a single climate program applied to every day. + + :ivar can_program_thermostat_programs_as_weekday_weekend: Indicates whether the thermostat supports weekday/weekend climate programs. + + :ivar can_remotely_lock: Indicates whether the device supports remote locking. + + :ivar can_remotely_unlock: Indicates whether the device supports remote unlocking. + + :ivar can_run_thermostat_programs: Indicates whether the thermostat supports running climate programs. + + :ivar can_simulate_connection: Indicates whether the device supports simulating connection in a sandbox. + + :ivar can_simulate_disconnection: Indicates whether the device supports simulating disconnection in a sandbox. + + :ivar can_simulate_hub_connection: Indicates whether the hub supports simulating connection in a sandbox. + + :ivar can_simulate_hub_disconnection: Indicates whether the hub supports simulating disconnection in a sandbox. + + :ivar can_simulate_paid_subscription: Indicates whether the device supports simulating a paid subscription in a sandbox. + + :ivar can_simulate_removal: Indicates whether the device supports simulating removal in a sandbox. + + :ivar can_turn_off_hvac: Indicates whether the thermostat can be turned off. + + :ivar can_unlock_with_code: Indicates whether the lock supports unlocking with an access code. + + :ivar capabilities_supported: Collection of capabilities that the device supports when connected to Seam. Values are ``access_code``, which indicates that the device can manage and utilize digital PIN codes for secure access; ``lock``, which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; ``noise_detection``, which indicates that the device supports monitoring and responding to ambient noise levels; ``thermostat``, which indicates that the device can regulate and adjust indoor temperatures; ``battery``, which indicates that the device can manage battery life and health; and ``phone``, which indicates that the device is a mobile device, such as a smartphone. **Important:** Superseded by `capability flags `_. + + :ivar connected_account_id: Unique identifier for the account associated with the 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 device_id: ID of the device. + + :ivar device_type: Type of the device. + + :ivar errors: Array of errors associated with the device. Each error object within the array contains two fields: ``error_code`` and ``message``. ``error_code`` is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. ``message`` provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + + :ivar is_managed: Indicates that Seam does not manage the device. + + :ivar location: Location information for the device. + + :ivar properties: properties of the device. + + :ivar warnings: Array of warnings associated with the device. Each warning object within the array contains two fields: ``warning_code`` and ``message``. ``warning_code`` is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. ``message`` provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + + :ivar workspace_id: Unique identifier for the Seam workspace associated with the device. + """ + can_configure_auto_lock: bool can_hvac_cool: bool can_hvac_heat: bool diff --git a/seam/resources/user_identity.py b/seam/resources/user_identity.py index 36c3da7..d2d173d 100644 --- a/seam/resources/user_identity.py +++ b/seam/resources/user_identity.py @@ -5,6 +5,30 @@ @dataclass class UserIdentity: + """Represents a `user identity `_ associated with an application user account. + + :ivar acs_user_ids: Array of access system user IDs associated with the user identity. + + :ivar created_at: Date and time at which the user identity was created. + + :ivar display_name: Display name for the user identity. + + :ivar email_address: Unique email address for the user identity. + + :ivar errors: Array of errors associated with the user identity. Each error object within the array contains fields like "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it. + + :ivar full_name: Full name of the user associated with the 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. + + :ivar user_identity_key: Unique key for the user identity. + + :ivar warnings: Array of warnings associated with the user identity. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it. + + :ivar workspace_id: ID of the workspace that contains the user identity.""" + acs_user_ids: List[str] created_at: str display_name: str diff --git a/seam/resources/webhook.py b/seam/resources/webhook.py index 13adf82..9f78d13 100644 --- a/seam/resources/webhook.py +++ b/seam/resources/webhook.py @@ -5,6 +5,16 @@ @dataclass class Webhook: + """Represents a `webhook `_ that enables you to receive notifications of events. When you create a webhook, specify the endpoint URL at which you want to receive events and the set of event types that you want to receive. + + :ivar event_types: Types of events that the `webhook `_ should receive. + + :ivar secret: Secret associated with the `webhook `_. + + :ivar url: URL for the `webhook `_. + + :ivar webhook_id: ID of the webhook.""" + event_types: List[str] secret: str url: str diff --git a/seam/resources/workspace.py b/seam/resources/workspace.py index 497e095..1f2ddd7 100644 --- a/seam/resources/workspace.py +++ b/seam/resources/workspace.py @@ -5,6 +5,28 @@ @dataclass class Workspace: + """Represents a Seam `workspace `_. A workspace is a top-level entity that encompasses all other resources below it, such as devices, connected accounts, and Connect Webviews. Seam provides two types of workspaces. A `sandbox workspace `_ is a special type of workspace designed for testing code. Sandbox workspaces offer test device accounts and virtual devices that you can connect and control. This ability to work with virtual devices is quite handy because it removes the need to own physical devices from multiple brands. To connect real devices and systems to Seam, use a `production workspace `_. + + :ivar company_name: Company name associated with the `workspace `_. + + :ivar connect_partner_name: Deprecated: Use ``company_name`` instead. + + :ivar connect_webview_customization: + + :ivar is_publishable_key_auth_enabled: Indicates whether publishable key authentication is enabled for this workspace. + + :ivar is_sandbox: Indicates whether the workspace is a `sandbox workspace `_. + + :ivar is_suspended: Indicates whether the `sandbox workspace `_ is suspended. Seam suspends sandbox workspaces that have not been accessed in 14 days. + + :ivar name: Name of the `workspace `_. + + :ivar organization_id: ID of the organization to which the workspace belongs, or ``null`` if the workspace is not assigned to an organization. + + :ivar publishable_key: Publishable key for the `workspace `_. This key is used to identify the workspace in client-side applications. + + :ivar workspace_id: ID of the workspace.""" + company_name: str connect_partner_name: str connect_webview_customization: Dict[str, Any] diff --git a/seam/routes/access_codes.py b/seam/routes/access_codes.py index cdfb8d1..a194118 100644 --- a/seam/routes/access_codes.py +++ b/seam/routes/access_codes.py @@ -39,6 +39,47 @@ def create( use_backup_access_code_pool: Optional[bool] = None, use_offline_access_code: Optional[bool] = None ) -> AccessCode: + """Creates a new `access code `_. For granting access, we recommend `Access Grants `_ instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. + + :param device_id: ID of the device for which you want to create the new access code. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param code: Code to be used for access. + + :param common_code_key: Key to identify access codes that should have the same code. Any two access codes with the same ``common_code_key`` are guaranteed to have the same ``code``. See also `Creating and Updating Multiple Linked Access Codes `_. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param is_offline_access_code: Indicates whether the access code is an `offline access code `_. + + :param is_one_time_use: Indicates whether the `offline access code `_ is a single-use access code. + + :param max_time_rounding: Maximum rounding adjustment. To create a daily-bound `offline access code `_ for devices that support this feature, set this parameter to ``1d``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. Only applicable if you do not specify a ``code``. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :param use_offline_access_code: Deprecated: Use ``is_offline_access_code`` instead. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -58,14 +99,68 @@ def create_multiple( starts_at: Optional[str] = None, use_backup_access_code_pool: Optional[bool] = None ) -> List[AccessCode]: + """Creates new `access codes `_ that share a common code across multiple devices. + + Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. + + If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a ``common_code_key``. That is, ``common_code_key`` remains null for these access codes. + + If you want to change these access codes that are not linked by a ``common_code_key``, you cannot use ``/access_codes/update_multiple``. However, you can update each of these access codes individually, using ``/access_codes/update``. + + See also `Creating and Updating Multiple Linked Access Codes `_. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + + :param device_ids: IDs of the devices for which you want to create the new access codes. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param behavior_when_code_cannot_be_shared: Desired behavior if any device cannot share a code. If ``throw`` (default), no access codes will be created if any device cannot share a code. If ``create_random_code``, a random code will be created on devices that cannot share a code. + + :param code: Code to be used for access. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, access_code_id: str, device_id: Optional[str] = None) -> None: + """Deletes an `access code `_. + + :param access_code_id: ID of the access code that you want to delete. + + :param device_id: ID of the device for which you want to delete the access code. + """ raise NotImplementedError() @abc.abstractmethod def generate_code(self, *, device_id: str) -> AccessCode: + """Generates a code for an `access code `_, given a device ID. + + :param device_id: ID of the device for which you want to generate a code. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -76,6 +171,17 @@ def get( code: Optional[str] = None, device_id: Optional[str] = None ) -> AccessCode: + """Returns a specified `access code `_. + + You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param access_code_id: ID of the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param code: Code of the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param device_id: ID of the device containing the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -93,10 +199,48 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[AccessCode]: + """Returns a list of all `access codes `_. + + Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_code_ids: IDs of the access codes that you want to retrieve. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_grant_id: ID of the access grant for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_grant_key: Key of the access grant for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_method_id: ID of the access method for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param customer_key: Customer key for which you want to list access codes. + + :param device_id: ID of the device for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param limit: Numerical limit on the number of access codes to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access codes to include all records that satisfy a partial match using ``name``, ``code`` or ``access_code_id``. + + :param user_identifier_key: Your user ID for the user by which to filter access codes. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def pull_backup_access_code(self, *, access_code_id: str) -> AccessCode: + """Retrieves a backup access code for an `access code `_. See also `Managing Backup Access Codes `_. + + A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. + + You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. + + You can only pull backup access codes for time-bound access codes. + + Before pulling a backup access code, make sure that the device's ``properties.supports_backup_access_code_pool`` is ``true``. Then, to activate the backup pool, set ``use_backup_access_code_pool`` to ``true`` when creating an access code. + + :param access_code_id: ID of the access code for which you want to pull a backup access code. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -108,6 +252,18 @@ def report_device_constraints( min_code_length: Optional[int] = None, supported_code_lengths: Optional[List[float]] = None ) -> None: + """Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. + + Specify either ``supported_code_lengths`` or ``min_code_length``/``max_code_length``. + + :param device_id: ID of the device for which you want to report constraints. + + :param max_code_length: Maximum supported code length as an integer between 4 and 20, inclusive. You can specify either ``min_code_length``/``max_code_length`` or ``supported_code_lengths``. + + :param min_code_length: Minimum supported code length as an integer between 4 and 20, inclusive. You can specify either ``min_code_length``/``max_code_length`` or ``supported_code_lengths``. + + :param supported_code_lengths: Array of supported code lengths as integers between 4 and 20, inclusive. You can specify either ``supported_code_lengths`` or ``min_code_length``/``max_code_length``. + """ raise NotImplementedError() @abc.abstractmethod @@ -133,6 +289,52 @@ def update( use_backup_access_code_pool: Optional[bool] = None, use_offline_access_code: Optional[bool] = None ) -> None: + """Updates a specified active or upcoming `access code `_. + + See also `Modifying Access Codes `_. + + :param access_code_id: ID of the access code that you want to update. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param code: Code to be used for access. + + :param device_id: ID of the device containing the access code that you want to update. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param is_managed: Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use ``/access_codes/unmanaged/convert_to_managed``. + + :param is_offline_access_code: Indicates whether the access code is an `offline access code `_. + + :param is_one_time_use: Indicates whether the `offline access code `_ is a single-use access code. + + :param max_time_rounding: Maximum rounding adjustment. To create a daily-bound `offline access code `_ for devices that support this feature, set this parameter to ``1d``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. Only applicable if you do not specify a ``code``. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param type: Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set ``type`` to ``ongoing``. See also `Changing a time-bound access code to permanent access `_. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :param use_offline_access_code: Deprecated: Use ``is_offline_access_code`` instead. + """ raise NotImplementedError() @abc.abstractmethod @@ -144,6 +346,26 @@ def update_multiple( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates `access codes `_ that share a common code across multiple devices. + + Specify the ``common_code_key`` to identify the set of access codes that you want to update. + + See also `Update Linked Access Codes `_. + + :param common_code_key: Key that links the group of access codes, assigned on creation by ``/access_codes/create_multiple``. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + """ raise NotImplementedError() @@ -182,6 +404,47 @@ def create( use_backup_access_code_pool: Optional[bool] = None, use_offline_access_code: Optional[bool] = None ) -> AccessCode: + """Creates a new `access code `_. For granting access, we recommend `Access Grants `_ instead: they work across both standalone smart locks and access control systems and manage the underlying codes for you. Use this low-level endpoint only when you need direct control over a code on a single device, such as setting a custom PIN value. + + :param device_id: ID of the device for which you want to create the new access code. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param code: Code to be used for access. + + :param common_code_key: Key to identify access codes that should have the same code. Any two access codes with the same ``common_code_key`` are guaranteed to have the same ``code``. See also `Creating and Updating Multiple Linked Access Codes `_. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param is_offline_access_code: Indicates whether the access code is an `offline access code `_. + + :param is_one_time_use: Indicates whether the `offline access code `_ is a single-use access code. + + :param max_time_rounding: Maximum rounding adjustment. To create a daily-bound `offline access code `_ for devices that support this feature, set this parameter to ``1d``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. Only applicable if you do not specify a ``code``. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :param use_offline_access_code: Deprecated: Use ``is_offline_access_code`` instead. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -239,6 +502,49 @@ def create_multiple( starts_at: Optional[str] = None, use_backup_access_code_pool: Optional[bool] = None ) -> List[AccessCode]: + """Creates new `access codes `_ that share a common code across multiple devices. + + Users with more than one door lock in a property may want to create groups of linked access codes, all of which have the same code (PIN). For example, a short-term rental host may want to provide guests the same PIN for both a front door lock and a back door lock. + + If you specify a custom code, Seam assigns this custom code to each of the resulting access codes. However, in this case, Seam does not link these access codes together with a ``common_code_key``. That is, ``common_code_key`` remains null for these access codes. + + If you want to change these access codes that are not linked by a ``common_code_key``, you cannot use ``/access_codes/update_multiple``. However, you can update each of these access codes individually, using ``/access_codes/update``. + + See also `Creating and Updating Multiple Linked Access Codes `_. + + For granting a person access to a space, `Access Grants `_ are the default and recommended approach and work across both standalone smart locks and access systems. Use the lower-level Access Codes API directly only when you specifically need to manage individual PIN codes. + + :param device_ids: IDs of the devices for which you want to create the new access codes. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param behavior_when_code_cannot_be_shared: Desired behavior if any device cannot share a code. If ``throw`` (default), no access codes will be created if any device cannot share a code. If ``create_random_code``, a random code will be created on devices that cannot share a code. + + :param code: Code to be used for access. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :returns: OK""" json_payload = {} if device_ids is not None: @@ -275,6 +581,12 @@ def create_multiple( return [AccessCode.from_dict(item) for item in res["access_codes"]] def delete(self, *, access_code_id: str, device_id: Optional[str] = None) -> None: + """Deletes an `access code `_. + + :param access_code_id: ID of the access code that you want to delete. + + :param device_id: ID of the device for which you want to delete the access code. + """ json_payload = {} if access_code_id is not None: @@ -287,6 +599,11 @@ def delete(self, *, access_code_id: str, device_id: Optional[str] = None) -> Non return None def generate_code(self, *, device_id: str) -> AccessCode: + """Generates a code for an `access code `_, given a device ID. + + :param device_id: ID of the device for which you want to generate a code. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -303,6 +620,17 @@ def get( code: Optional[str] = None, device_id: Optional[str] = None ) -> AccessCode: + """Returns a specified `access code `_. + + You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param access_code_id: ID of the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param code: Code of the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param device_id: ID of the device containing the access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :returns: OK""" json_payload = {} if access_code_id is not None: @@ -330,6 +658,31 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[AccessCode]: + """Returns a list of all `access codes `_. + + Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_code_ids: IDs of the access codes that you want to retrieve. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_grant_id: ID of the access grant for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_grant_key: Key of the access grant for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param access_method_id: ID of the access method for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param customer_key: Customer key for which you want to list access codes. + + :param device_id: ID of the device for which you want to list access codes. Specify ``device_id``, ``access_code_ids``, ``access_method_id``, ``access_grant_id``, or ``access_grant_key``. + + :param limit: Numerical limit on the number of access codes to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access codes to include all records that satisfy a partial match using ``name``, ``code`` or ``access_code_id``. + + :param user_identifier_key: Your user ID for the user by which to filter access codes. + + :returns: OK""" json_payload = {} if access_code_ids is not None: @@ -358,6 +711,19 @@ def list( return [AccessCode.from_dict(item) for item in res["access_codes"]] def pull_backup_access_code(self, *, access_code_id: str) -> AccessCode: + """Retrieves a backup access code for an `access code `_. See also `Managing Backup Access Codes `_. + + A backup access code pool is a collection of pre-programmed access codes stored on a device, ready for use. These codes are programmed in addition to the regular access codes on Seam, serving as a safety net for any issues with the primary codes. If there's ever a complication with a primary access code—be it due to intermittent connectivity, manual removal from a device, or provider outages—a backup code can be retrieved. Its end time can then be adjusted to align with the original code, facilitating seamless and uninterrupted access. + + You can pull a backup access code from the pool at any time. These backup codes are guaranteed to work immediately and automatically programmed to be removed from the device after the access code ends. + + You can only pull backup access codes for time-bound access codes. + + Before pulling a backup access code, make sure that the device's ``properties.supports_backup_access_code_pool`` is ``true``. Then, to activate the backup pool, set ``use_backup_access_code_pool`` to ``true`` when creating an access code. + + :param access_code_id: ID of the access code for which you want to pull a backup access code. + + :returns: OK""" json_payload = {} if access_code_id is not None: @@ -377,6 +743,18 @@ def report_device_constraints( min_code_length: Optional[int] = None, supported_code_lengths: Optional[List[float]] = None ) -> None: + """Enables you to report access code-related constraints for a device. Currently, supports reporting supported code length constraints for SmartThings devices. + + Specify either ``supported_code_lengths`` or ``min_code_length``/``max_code_length``. + + :param device_id: ID of the device for which you want to report constraints. + + :param max_code_length: Maximum supported code length as an integer between 4 and 20, inclusive. You can specify either ``min_code_length``/``max_code_length`` or ``supported_code_lengths``. + + :param min_code_length: Minimum supported code length as an integer between 4 and 20, inclusive. You can specify either ``min_code_length``/``max_code_length`` or ``supported_code_lengths``. + + :param supported_code_lengths: Array of supported code lengths as integers between 4 and 20, inclusive. You can specify either ``supported_code_lengths`` or ``min_code_length``/``max_code_length``. + """ json_payload = {} if device_id is not None: @@ -414,6 +792,52 @@ def update( use_backup_access_code_pool: Optional[bool] = None, use_offline_access_code: Optional[bool] = None ) -> None: + """Updates a specified active or upcoming `access code `_. + + See also `Modifying Access Codes `_. + + :param access_code_id: ID of the access code that you want to update. + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param attempt_for_offline_device: + + :param code: Code to be used for access. + + :param device_id: ID of the device containing the access code that you want to update. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. Default: ``false``. + + :param is_managed: Indicates whether the access code is managed through Seam. Note that to convert an unmanaged access code into a managed access code, use ``/access_codes/unmanaged/convert_to_managed``. + + :param is_offline_access_code: Indicates whether the access code is an `offline access code `_. + + :param is_one_time_use: Indicates whether the `offline access code `_ is a single-use access code. + + :param max_time_rounding: Maximum rounding adjustment. To create a daily-bound `offline access code `_ for devices that support this feature, set this parameter to ``1d``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param prefer_native_scheduling: Indicates whether `native scheduling `_ should be used for time-bound codes when supported by the provider. Default: ``true``. + + :param preferred_code_length: Preferred code length. Only applicable if you do not specify a ``code``. If the affected device does not support the preferred code length, Seam reverts to using the shortest supported code length. + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + + :param type: Type to which you want to convert the access code. To convert a time-bound access code to an ongoing access code, set ``type`` to ``ongoing``. See also `Changing a time-bound access code to permanent access `_. + + :param use_backup_access_code_pool: Indicates whether to use a `backup access code pool `_ provided by Seam. If ``true``, you can use ```/access_codes/pull_backup_access_code`` `_. + + :param use_offline_access_code: Deprecated: Use ``is_offline_access_code`` instead. + """ json_payload = {} if access_code_id is not None: @@ -467,6 +891,26 @@ def update_multiple( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates `access codes `_ that share a common code across multiple devices. + + Specify the ``common_code_key`` to identify the set of access codes that you want to update. + + See also `Update Linked Access Codes `_. + + :param common_code_key: Key that links the group of access codes, assigned on creation by ``/access_codes/create_multiple``. + + :param ends_at: Date and time at which the validity of the new access code ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param name: Name of the new access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes. + + Note that the name provided on Seam is used to identify the code on Seam and is not necessarily the name that will appear in the lock provider's app or on the device. This is because lock providers may have constraints on names, such as length, uniqueness, or characters that can be used. In addition, some lock providers may break down names into components such as ``first_name`` and ``last_name``. + + To provide a consistent experience, Seam identifies the code on Seam by its name but may modify the name that appears on the lock provider's app or on the device. For example, Seam may add additional characters or truncate the name to meet provider constraints. + + To help your users identify codes set by Seam, Seam provides the name exactly as it appears on the lock provider's app or on the device as a separate property called ``appearance``. This is an object with a ``name`` property and, optionally, ``first_name`` and ``last_name`` properties (for providers that break down a name into components). + + :param starts_at: Date and time at which the validity of the new access code starts, in `ISO 8601 `_ format. + """ json_payload = {} if common_code_key is not None: diff --git a/seam/routes/access_codes_simulate.py b/seam/routes/access_codes_simulate.py index 303c347..048c13f 100644 --- a/seam/routes/access_codes_simulate.py +++ b/seam/routes/access_codes_simulate.py @@ -10,6 +10,15 @@ class AbstractAccessCodesSimulate(abc.ABC): def create_unmanaged_access_code( self, *, code: str, device_id: str, name: str ) -> UnmanagedAccessCode: + """Simulates the creation of an `unmanaged access code `_ in a `sandbox workspace `_. + + :param code: Code of the simulated unmanaged access code. + + :param device_id: ID of the device for which you want to simulate the creation of an unmanaged access code. + + :param name: Name of the simulated unmanaged access code. + + :returns: OK""" raise NotImplementedError() @@ -21,6 +30,15 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): def create_unmanaged_access_code( self, *, code: str, device_id: str, name: str ) -> UnmanagedAccessCode: + """Simulates the creation of an `unmanaged access code `_ in a `sandbox workspace `_. + + :param code: Code of the simulated unmanaged access code. + + :param device_id: ID of the device for which you want to simulate the creation of an unmanaged access code. + + :param name: Name of the simulated unmanaged access code. + + :returns: OK""" json_payload = {} if code is not None: diff --git a/seam/routes/access_codes_unmanaged.py b/seam/routes/access_codes_unmanaged.py index 3528666..ac90e4e 100644 --- a/seam/routes/access_codes_unmanaged.py +++ b/seam/routes/access_codes_unmanaged.py @@ -15,10 +15,28 @@ def convert_to_managed( force: Optional[bool] = None, is_external_modification_allowed: Optional[bool] = None ) -> None: + """Converts an `unmanaged access code `_ to an `access code managed through Seam `_. + + An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. + + Note that not all device providers support converting an unmanaged access code to a managed access code. + + :param access_code_id: ID of the unmanaged access code that you want to convert to a managed access code. + + :param allow_external_modification: Indicates whether `external modification `_ of the access code is allowed. + + :param force: Indicates whether to force the access code conversion. To switch management of an access code from one Seam workspace to another, set ``force`` to ``true``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the access code is allowed. + """ raise NotImplementedError() @abc.abstractmethod def delete(self, *, access_code_id: str) -> None: + """Deletes an `unmanaged access code `_. + + :param access_code_id: ID of the unmanaged access code that you want to delete. + """ raise NotImplementedError() @abc.abstractmethod @@ -29,6 +47,17 @@ def get( code: Optional[str] = None, device_id: Optional[str] = None ) -> UnmanagedAccessCode: + """Returns a specified `unmanaged access code `_. + + You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param access_code_id: ID of the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param code: Code of the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param device_id: ID of the device containing the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -41,6 +70,19 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[UnmanagedAccessCode]: + """Returns a list of all `unmanaged access codes `_. + + :param device_id: ID of the device for which you want to list unmanaged access codes. + + :param limit: Numerical limit on the number of unmanaged access codes to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access codes to include all records that satisfy a partial match using ``name``, ``code`` or ``access_code_id``. + + :param user_identifier_key: Your user ID for the user by which to filter unmanaged access codes. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -53,6 +95,18 @@ def update( force: Optional[bool] = None, is_external_modification_allowed: Optional[bool] = None ) -> None: + """Updates a specified `unmanaged access code `_. + + :param access_code_id: ID of the unmanaged access code that you want to update. + + :param is_managed: + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. + + :param force: Indicates whether to force the unmanaged access code update. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. + """ raise NotImplementedError() @@ -69,6 +123,20 @@ def convert_to_managed( force: Optional[bool] = None, is_external_modification_allowed: Optional[bool] = None ) -> None: + """Converts an `unmanaged access code `_ to an `access code managed through Seam `_. + + An unmanaged access code has a limited set of operations that you can perform on it. Once you convert an unmanaged access code to a managed access code, the full set of access code operations and lifecycle events becomes available for it. + + Note that not all device providers support converting an unmanaged access code to a managed access code. + + :param access_code_id: ID of the unmanaged access code that you want to convert to a managed access code. + + :param allow_external_modification: Indicates whether `external modification `_ of the access code is allowed. + + :param force: Indicates whether to force the access code conversion. To switch management of an access code from one Seam workspace to another, set ``force`` to ``true``. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the access code is allowed. + """ json_payload = {} if access_code_id is not None: @@ -89,6 +157,10 @@ def convert_to_managed( return None def delete(self, *, access_code_id: str) -> None: + """Deletes an `unmanaged access code `_. + + :param access_code_id: ID of the unmanaged access code that you want to delete. + """ json_payload = {} if access_code_id is not None: @@ -105,6 +177,17 @@ def get( code: Optional[str] = None, device_id: Optional[str] = None ) -> UnmanagedAccessCode: + """Returns a specified `unmanaged access code `_. + + You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param access_code_id: ID of the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param code: Code of the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :param device_id: ID of the device containing the unmanaged access code that you want to get. You must specify either ``access_code_id`` or both ``device_id`` and ``code``. + + :returns: OK""" json_payload = {} if access_code_id is not None: @@ -127,6 +210,19 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[UnmanagedAccessCode]: + """Returns a list of all `unmanaged access codes `_. + + :param device_id: ID of the device for which you want to list unmanaged access codes. + + :param limit: Numerical limit on the number of unmanaged access codes to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access codes to include all records that satisfy a partial match using ``name``, ``code`` or ``access_code_id``. + + :param user_identifier_key: Your user ID for the user by which to filter unmanaged access codes. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -153,6 +249,18 @@ def update( force: Optional[bool] = None, is_external_modification_allowed: Optional[bool] = None ) -> None: + """Updates a specified `unmanaged access code `_. + + :param access_code_id: ID of the unmanaged access code that you want to update. + + :param is_managed: + + :param allow_external_modification: Indicates whether `external modification `_ of the code is allowed. + + :param force: Indicates whether to force the unmanaged access code update. + + :param is_external_modification_allowed: Indicates whether `external modification `_ of the code is allowed. + """ json_payload = {} if access_code_id is not None: diff --git a/seam/routes/access_grants.py b/seam/routes/access_grants.py index 722f733..f6835eb 100644 --- a/seam/routes/access_grants.py +++ b/seam/routes/access_grants.py @@ -35,10 +35,46 @@ def create( space_keys: Optional[List[str]] = None, starts_at: 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. + + :param customization_profile_id: ID of the customization profile to apply to the Access Grant and its access methods. + + :param device_ids: Set of IDs of the `devices `_ to which access is being granted. + + :param ends_at: Date and time at which the validity of the new grant ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param location: Deprecated: Create a space first, then reference it using ``space_ids``. + + :param location_ids: Deprecated: Use ``space_ids``. + + :param name: Name for the access grant. + + :param reservation_key: Reservation key for the access grant. + + :param space_ids: Set of IDs of existing spaces to which access is being granted. + + :param space_keys: Set of keys of existing spaces to which access is being granted. + + :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, access_grant_id: str) -> None: + """Delete an Access Grant. + + :param access_grant_id: ID of Access Grant to delete.""" raise NotImplementedError() @abc.abstractmethod @@ -48,6 +84,13 @@ def get( access_grant_id: Optional[str] = None, access_grant_key: Optional[str] = None ) -> AccessGrant: + """Get an Access Grant. + + :param access_grant_id: ID of Access Grant to get. + + :param access_grant_key: Unique key of Access Grant to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -59,6 +102,17 @@ def get_related( exclude: Optional[List[str]] = None, include: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Access Grants. + + :param access_grant_ids: IDs of the access grants that you want to get along with their related resources. + + :param access_grant_keys: Keys of the access grants that you want to get along with their related resources. + + :param exclude: + + :param include: + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -79,12 +133,48 @@ def list( space_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AccessGrant]: + """Gets an Access Grant. + + :param access_code_id: ID of the access code by which you want to filter the list of Access Grants. + + :param access_grant_ids: IDs of the access grants to retrieve. + + :param access_grant_key: Filter Access Grants by access_grant_key. Use null to filter for Access Grants without an access_grant_key. + + :param acs_entrance_id: ID of the entrance by which you want to filter the list of Access Grants. + + :param acs_system_id: ID of the access system by which you want to filter the list of Access Grants. + + :param customer_key: Customer key for which you want to list access grants. + + :param device_id: ID of the device by which you want to filter the list of Access Grants. + + :param limit: Numerical limit on the number of access grants to return. + + :param location_id: Deprecated: Use ``space_id``. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param reservation_key: Filter Access Grants by reservation_key. + + :param space_id: ID of the space by which you want to filter the list of Access Grants. + + :param user_identity_id: ID of user identity by which you want to filter the list of Access Grants. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def request_access_methods( self, *, access_grant_id: str, requested_access_methods: List[Dict[str, Any]] ) -> AccessGrant: + """Adds additional requested access methods to an existing Access Grant. + + :param access_grant_id: ID of the Access Grant to add access methods to. + + :param requested_access_methods: Array of requested access methods to add to the access grant. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -97,6 +187,18 @@ def update( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates an existing Access Grant's time window. + + :param access_grant_id: ID of the Access Grant to update. Provide either ``access_grant_id`` or ``access_grant_key``. + + :param access_grant_key: Key of the Access Grant to update. Provide either ``access_grant_id`` or ``access_grant_key``. + + :param ends_at: Date and time at which the validity of the grant ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param name: Display name for the access grant. + + :param starts_at: Date and time at which the validity of the grant starts, in `ISO 8601 `_ format. + """ raise NotImplementedError() @@ -129,6 +231,39 @@ def create( space_keys: Optional[List[str]] = None, starts_at: 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. + + :param customization_profile_id: ID of the customization profile to apply to the Access Grant and its access methods. + + :param device_ids: Set of IDs of the `devices `_ to which access is being granted. + + :param ends_at: Date and time at which the validity of the new grant ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param location: Deprecated: Create a space first, then reference it using ``space_ids``. + + :param location_ids: Deprecated: Use ``space_ids``. + + :param name: Name for the access grant. + + :param reservation_key: Reservation key for the access grant. + + :param space_ids: Set of IDs of existing spaces to which access is being granted. + + :param space_keys: Set of keys of existing spaces to which access is being granted. + + :param starts_at: Date and time at which the validity of the new grant starts, in `ISO 8601 `_ format. + + :returns: OK""" json_payload = {} if requested_access_methods is not None: @@ -167,6 +302,9 @@ def create( return AccessGrant.from_dict(res["access_grant"]) def delete(self, *, access_grant_id: str) -> None: + """Delete an Access Grant. + + :param access_grant_id: ID of Access Grant to delete.""" json_payload = {} if access_grant_id is not None: @@ -182,6 +320,13 @@ def get( access_grant_id: Optional[str] = None, access_grant_key: Optional[str] = None ) -> AccessGrant: + """Get an Access Grant. + + :param access_grant_id: ID of Access Grant to get. + + :param access_grant_key: Unique key of Access Grant to get. + + :returns: OK""" json_payload = {} if access_grant_id is not None: @@ -201,6 +346,17 @@ def get_related( exclude: Optional[List[str]] = None, include: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Access Grants. + + :param access_grant_ids: IDs of the access grants that you want to get along with their related resources. + + :param access_grant_keys: Keys of the access grants that you want to get along with their related resources. + + :param exclude: + + :param include: + + :returns: OK""" json_payload = {} if access_grant_ids is not None: @@ -233,6 +389,35 @@ def list( space_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AccessGrant]: + """Gets an Access Grant. + + :param access_code_id: ID of the access code by which you want to filter the list of Access Grants. + + :param access_grant_ids: IDs of the access grants to retrieve. + + :param access_grant_key: Filter Access Grants by access_grant_key. Use null to filter for Access Grants without an access_grant_key. + + :param acs_entrance_id: ID of the entrance by which you want to filter the list of Access Grants. + + :param acs_system_id: ID of the access system by which you want to filter the list of Access Grants. + + :param customer_key: Customer key for which you want to list access grants. + + :param device_id: ID of the device by which you want to filter the list of Access Grants. + + :param limit: Numerical limit on the number of access grants to return. + + :param location_id: Deprecated: Use ``space_id``. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param reservation_key: Filter Access Grants by reservation_key. + + :param space_id: ID of the space by which you want to filter the list of Access Grants. + + :param user_identity_id: ID of user identity by which you want to filter the list of Access Grants. + + :returns: OK""" json_payload = {} if access_code_id is not None: @@ -269,6 +454,13 @@ def list( def request_access_methods( self, *, access_grant_id: str, requested_access_methods: List[Dict[str, Any]] ) -> AccessGrant: + """Adds additional requested access methods to an existing Access Grant. + + :param access_grant_id: ID of the Access Grant to add access methods to. + + :param requested_access_methods: Array of requested access methods to add to the access grant. + + :returns: OK""" json_payload = {} if access_grant_id is not None: @@ -291,6 +483,18 @@ def update( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates an existing Access Grant's time window. + + :param access_grant_id: ID of the Access Grant to update. Provide either ``access_grant_id`` or ``access_grant_key``. + + :param access_grant_key: Key of the Access Grant to update. Provide either ``access_grant_id`` or ``access_grant_key``. + + :param ends_at: Date and time at which the validity of the grant ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param name: Display name for the access grant. + + :param starts_at: Date and time at which the validity of the grant starts, in `ISO 8601 `_ format. + """ json_payload = {} if access_grant_id is not None: diff --git a/seam/routes/access_grants_unmanaged.py b/seam/routes/access_grants_unmanaged.py index c80ca66..c12cc2b 100644 --- a/seam/routes/access_grants_unmanaged.py +++ b/seam/routes/access_grants_unmanaged.py @@ -7,6 +7,9 @@ class AbstractAccessGrantsUnmanaged(abc.ABC): @abc.abstractmethod def get(self, *, access_grant_id: str) -> None: + """Get an unmanaged Access Grant (where is_managed = false). + + :param access_grant_id: ID of unmanaged Access Grant to get.""" raise NotImplementedError() @abc.abstractmethod @@ -20,6 +23,20 @@ def list( reservation_key: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Gets unmanaged Access Grants (where is_managed = false). + + :param acs_entrance_id: ID of the entrance by which you want to filter the list of unmanaged Access Grants. + + :param acs_system_id: ID of the access system by which you want to filter the list of unmanaged Access Grants. + + :param limit: Numerical limit on the number of unmanaged access grants to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param reservation_key: Filter unmanaged Access Grants by reservation_key. + + :param user_identity_id: ID of user identity by which you want to filter the list of unmanaged Access Grants. + """ raise NotImplementedError() @abc.abstractmethod @@ -30,6 +47,18 @@ def update( is_managed: bool, access_grant_key: Optional[str] = None ) -> None: + """Updates an unmanaged Access Grant to make it managed. + + This endpoint can only be used to convert unmanaged access grants to managed ones by setting ``is_managed`` to ``true``. It cannot be used to convert managed access grants back to unmanaged. + + When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. + + :param access_grant_id: ID of the unmanaged Access Grant to update. + + :param is_managed: Must be set to true to convert the unmanaged access grant to managed. + + :param access_grant_key: Unique key for the access grant. If not provided, the existing key will be preserved. + """ raise NotImplementedError() @@ -39,6 +68,9 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def get(self, *, access_grant_id: str) -> None: + """Get an unmanaged Access Grant (where is_managed = false). + + :param access_grant_id: ID of unmanaged Access Grant to get.""" json_payload = {} if access_grant_id is not None: @@ -58,6 +90,20 @@ def list( reservation_key: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Gets unmanaged Access Grants (where is_managed = false). + + :param acs_entrance_id: ID of the entrance by which you want to filter the list of unmanaged Access Grants. + + :param acs_system_id: ID of the access system by which you want to filter the list of unmanaged Access Grants. + + :param limit: Numerical limit on the number of unmanaged access grants to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param reservation_key: Filter unmanaged Access Grants by reservation_key. + + :param user_identity_id: ID of user identity by which you want to filter the list of unmanaged Access Grants. + """ json_payload = {} if acs_entrance_id is not None: @@ -84,6 +130,18 @@ def update( is_managed: bool, access_grant_key: Optional[str] = None ) -> None: + """Updates an unmanaged Access Grant to make it managed. + + This endpoint can only be used to convert unmanaged access grants to managed ones by setting ``is_managed`` to ``true``. It cannot be used to convert managed access grants back to unmanaged. + + When converting an unmanaged access grant to managed, all associated access methods will also be converted to managed. + + :param access_grant_id: ID of the unmanaged Access Grant to update. + + :param is_managed: Must be set to true to convert the unmanaged access grant to managed. + + :param access_grant_key: Unique key for the access grant. If not provided, the existing key will be preserved. + """ json_payload = {} if access_grant_id is not None: diff --git a/seam/routes/access_methods.py b/seam/routes/access_methods.py index 83a03a7..37e320b 100644 --- a/seam/routes/access_methods.py +++ b/seam/routes/access_methods.py @@ -24,6 +24,15 @@ def assign_card( card_number: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Assigns a pre-registered card credential, identified by ``card_number``, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. + + :param access_method_id: ID of the ``access_method`` to assign the credential to. + + :param card_number: Card number of the credential to assign. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -34,6 +43,14 @@ def delete( access_grant_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 reservation_key: Reservation key of the access grant whose access methods should be deleted. + """ raise NotImplementedError() @abc.abstractmethod @@ -44,10 +61,24 @@ def encode( acs_encoder_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Encodes an existing access method onto a plastic card placed on the specified `encoder `_. + + :param access_method_id: ID of the ``access_method`` to encode onto a card. + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to encode the ``access_method``. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def get(self, *, access_method_id: str) -> AccessMethod: + """Gets an access method. + + :param access_method_id: ID of access method to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -58,6 +89,15 @@ def get_related( exclude: Optional[List[str]] = None, include: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Access Methods. + + :param access_method_ids: IDs of the access methods that you want to get along with their related resources. + + :param exclude: + + :param include: + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -71,6 +111,21 @@ def list( device_id: Optional[str] = None, space_id: Optional[str] = None ) -> List[AccessMethod]: + """Lists all access methods, usually filtered by Access Grant. + + :param access_code_id: ID of the access code for which you want to retrieve all access methods. + + :param access_grant_id: ID of Access Grant to list access methods for. + + :param access_grant_key: Key of Access Grant to list access methods for. + + :param acs_entrance_id: ID of the entrance for which you want to retrieve all access methods. + + :param device_id: ID of the device for which you want to retrieve all access methods. + + :param space_id: ID of the space for which you want to retrieve all access methods. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -81,6 +136,15 @@ def unlock_door( acs_entrance_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Remotely unlocks a specified `entrance `_ using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. + + :param access_method_id: ID of the cloud_key ``access_method`` to use for the unlock operation. + + :param acs_entrance_id: ID of the entrance to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -101,6 +165,15 @@ def assign_card( card_number: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Assigns a pre-registered card credential, identified by ``card_number``, to a card-mode access method. Use this endpoint for access systems that use pre-registered cards, where a physical card must be associated with an access method before it can be used for access. Assigning a card credential also triggers issuance of the access method. + + :param access_method_id: ID of the ``access_method`` to assign the credential to. + + :param card_number: Card number of the credential to assign. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if access_method_id is not None: @@ -129,6 +202,14 @@ def delete( access_grant_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 reservation_key: Reservation key of the access grant whose access methods should be deleted. + """ json_payload = {} if access_method_id is not None: @@ -149,6 +230,15 @@ def encode( acs_encoder_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Encodes an existing access method onto a plastic card placed on the specified `encoder `_. + + :param access_method_id: ID of the ``access_method`` to encode onto a card. + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to encode the ``access_method``. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if access_method_id is not None: @@ -171,6 +261,11 @@ def encode( ) def get(self, *, access_method_id: str) -> AccessMethod: + """Gets an access method. + + :param access_method_id: ID of access method to get. + + :returns: OK""" json_payload = {} if access_method_id is not None: @@ -187,6 +282,15 @@ def get_related( exclude: Optional[List[str]] = None, include: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Access Methods. + + :param access_method_ids: IDs of the access methods that you want to get along with their related resources. + + :param exclude: + + :param include: + + :returns: OK""" json_payload = {} if access_method_ids is not None: @@ -210,6 +314,21 @@ def list( device_id: Optional[str] = None, space_id: Optional[str] = None ) -> List[AccessMethod]: + """Lists all access methods, usually filtered by Access Grant. + + :param access_code_id: ID of the access code for which you want to retrieve all access methods. + + :param access_grant_id: ID of Access Grant to list access methods for. + + :param access_grant_key: Key of Access Grant to list access methods for. + + :param acs_entrance_id: ID of the entrance for which you want to retrieve all access methods. + + :param device_id: ID of the device for which you want to retrieve all access methods. + + :param space_id: ID of the space for which you want to retrieve all access methods. + + :returns: OK""" json_payload = {} if access_code_id is not None: @@ -236,6 +355,15 @@ def unlock_door( acs_entrance_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Remotely unlocks a specified `entrance `_ using the cloud key credential associated with an access method. Returns an action attempt that tracks the progress of the unlock operation. + + :param access_method_id: ID of the cloud_key ``access_method`` to use for the unlock operation. + + :param acs_entrance_id: ID of the entrance to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if access_method_id is not None: diff --git a/seam/routes/access_methods_unmanaged.py b/seam/routes/access_methods_unmanaged.py index 60dbe0d..6921115 100644 --- a/seam/routes/access_methods_unmanaged.py +++ b/seam/routes/access_methods_unmanaged.py @@ -7,6 +7,9 @@ class AbstractAccessMethodsUnmanaged(abc.ABC): @abc.abstractmethod def get(self, *, access_method_id: str) -> None: + """Gets an unmanaged access method (where is_managed = false). + + :param access_method_id: ID of unmanaged access method to get.""" raise NotImplementedError() @abc.abstractmethod @@ -18,6 +21,16 @@ def list( device_id: Optional[str] = None, space_id: Optional[str] = None ) -> None: + """Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. + + :param access_grant_id: ID of Access Grant to list unmanaged access methods for. + + :param acs_entrance_id: ID of the entrance for which you want to retrieve all unmanaged access methods. + + :param device_id: ID of the device for which you want to retrieve all unmanaged access methods. + + :param space_id: ID of the space for which you want to retrieve all unmanaged access methods. + """ raise NotImplementedError() @@ -27,6 +40,9 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def get(self, *, access_method_id: str) -> None: + """Gets an unmanaged access method (where is_managed = false). + + :param access_method_id: ID of unmanaged access method to get.""" json_payload = {} if access_method_id is not None: @@ -44,6 +60,16 @@ def list( device_id: Optional[str] = None, space_id: Optional[str] = None ) -> None: + """Lists all unmanaged access methods (where is_managed = false), usually filtered by Access Grant. + + :param access_grant_id: ID of Access Grant to list unmanaged access methods for. + + :param acs_entrance_id: ID of the entrance for which you want to retrieve all unmanaged access methods. + + :param device_id: ID of the device for which you want to retrieve all unmanaged access methods. + + :param space_id: ID of the space for which you want to retrieve all unmanaged access methods. + """ json_payload = {} if access_grant_id is not None: diff --git a/seam/routes/acs_access_groups.py b/seam/routes/acs_access_groups.py index 35c0cbd..11ce595 100644 --- a/seam/routes/acs_access_groups.py +++ b/seam/routes/acs_access_groups.py @@ -14,14 +14,30 @@ def add_user( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Adds a specified `access system user `_ to a specified `access group `_. + + :param acs_access_group_id: ID of the access group to which you want to add an access system user. + + :param acs_user_id: ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ raise NotImplementedError() @abc.abstractmethod def delete(self, *, acs_access_group_id: str) -> None: + """Deletes a specified `access group `_. + + :param acs_access_group_id: ID of the access group that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, acs_access_group_id: str) -> AcsAccessGroup: + """Returns a specified `access group `_. + + :param acs_access_group_id: ID of the access group that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -33,16 +49,37 @@ def list( search: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AcsAccessGroup]: + """Returns a list of all `access groups `_. + + :param acs_system_id: ID of the access system for which you want to retrieve all access groups. + + :param acs_user_id: ID of the access system user for which you want to retrieve all access groups. + + :param search: String for which to search. Filters returned access groups to include all records that satisfy a partial match using ``name`` or ``acs_access_group_id``. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access groups. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_accessible_entrances( self, *, acs_access_group_id: str ) -> List[AcsEntrance]: + """Returns a list of all accessible entrances for a specified `access group `_. + + :param acs_access_group_id: ID of the access group for which you want to retrieve all accessible entrances. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_users(self, *, acs_access_group_id: str) -> List[AcsUser]: + """Returns a list of all `access system users `_ in an `access group `_. + + :param acs_access_group_id: ID of the access group for which you want to retrieve all access system users. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -53,6 +90,14 @@ def remove_user( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Removes a specified `access system user `_ from a specified `access group `_. + + :param acs_access_group_id: ID of the access group from which you want to remove an access system user. + + :param acs_user_id: ID of the access system user that you want to remove from an access group. + + :param user_identity_id: ID of the user identity associated with the user that you want to remove from an access group. + """ raise NotImplementedError() @@ -68,6 +113,14 @@ def add_user( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Adds a specified `access system user `_ to a specified `access group `_. + + :param acs_access_group_id: ID of the access group to which you want to add an access system user. + + :param acs_user_id: ID of the access system user that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the desired user identity that you want to add to an access group. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ json_payload = {} if acs_access_group_id is not None: @@ -82,6 +135,9 @@ def add_user( return None def delete(self, *, acs_access_group_id: str) -> None: + """Deletes a specified `access group `_. + + :param acs_access_group_id: ID of the access group that you want to delete.""" json_payload = {} if acs_access_group_id is not None: @@ -92,6 +148,11 @@ def delete(self, *, acs_access_group_id: str) -> None: return None def get(self, *, acs_access_group_id: str) -> AcsAccessGroup: + """Returns a specified `access group `_. + + :param acs_access_group_id: ID of the access group that you want to get. + + :returns: OK""" json_payload = {} if acs_access_group_id is not None: @@ -109,6 +170,17 @@ def list( search: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AcsAccessGroup]: + """Returns a list of all `access groups `_. + + :param acs_system_id: ID of the access system for which you want to retrieve all access groups. + + :param acs_user_id: ID of the access system user for which you want to retrieve all access groups. + + :param search: String for which to search. Filters returned access groups to include all records that satisfy a partial match using ``name`` or ``acs_access_group_id``. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access groups. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -127,6 +199,11 @@ def list( def list_accessible_entrances( self, *, acs_access_group_id: str ) -> List[AcsEntrance]: + """Returns a list of all accessible entrances for a specified `access group `_. + + :param acs_access_group_id: ID of the access group for which you want to retrieve all accessible entrances. + + :returns: OK""" json_payload = {} if acs_access_group_id is not None: @@ -139,6 +216,11 @@ def list_accessible_entrances( return [AcsEntrance.from_dict(item) for item in res["acs_entrances"]] def list_users(self, *, acs_access_group_id: str) -> List[AcsUser]: + """Returns a list of all `access system users `_ in an `access group `_. + + :param acs_access_group_id: ID of the access group for which you want to retrieve all access system users. + + :returns: OK""" json_payload = {} if acs_access_group_id is not None: @@ -155,6 +237,14 @@ def remove_user( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Removes a specified `access system user `_ from a specified `access group `_. + + :param acs_access_group_id: ID of the access group from which you want to remove an access system user. + + :param acs_user_id: ID of the access system user that you want to remove from an access group. + + :param user_identity_id: ID of the user identity associated with the user that you want to remove from an access group. + """ json_payload = {} if acs_access_group_id is not None: diff --git a/seam/routes/acs_credentials.py b/seam/routes/acs_credentials.py index 7946fed..c655973 100644 --- a/seam/routes/acs_credentials.py +++ b/seam/routes/acs_credentials.py @@ -14,6 +14,14 @@ def assign( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Assigns a specified `credential `_ to a specified `access system user `_. + + :param acs_credential_id: ID of the credential that you want to assign to an access system user. + + :param acs_user_id: ID of the access system user to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ raise NotImplementedError() @abc.abstractmethod @@ -34,14 +42,51 @@ def create( user_identity_id: Optional[str] = None, visionline_metadata: Optional[Dict[str, Any]] = None ) -> AcsCredential: + """Creates a new `credential `_ for a specified `ACS user `_. For granting access, we recommend `Access Grants `_ instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. + + :param access_method: Access method for the new credential. Supported values: ``code``, ``card``, ``mobile_key``, ``cloud_key``. + + :param acs_system_id: ID of the access system to which the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. + + :param acs_user_id: ID of the access system user to whom the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. + + :param allowed_acs_entrance_ids: Set of IDs of the `entrances `_ for which the new credential grants access. + + :param assa_abloy_vostio_metadata: Vostio-specific metadata for the new credential. + + :param code: Access (PIN) code for the new credential. There may be manufacturer-specific code restrictions. For details, see the applicable `device or system integration guide `_. + + :param credential_manager_acs_system_id: ACS system ID of the credential manager for the new credential. + + :param ends_at: Date and time at which the validity of the new credential ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_multi_phone_sync_credential: Indicates whether the new credential is a `multi-phone sync credential `_. + + :param salto_space_metadata: Salto Space-specific metadata for the new credential. + + :param starts_at: Date and time at which the validity of the new credential starts, in `ISO 8601 `_ format. + + :param user_identity_id: ID of the user identity to whom the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. If the access system contains a user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the credential belongs to the access system user. If the access system does not have a corresponding user, one is created. + + :param visionline_metadata: Visionline-specific metadata for the new credential. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, acs_credential_id: str) -> None: + """Deletes a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, acs_credential_id: str) -> AcsCredential: + """Returns a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -57,10 +102,34 @@ def list( page_cursor: Optional[str] = None, search: Optional[str] = None ) -> List[AcsCredential]: + """Returns a list of all `credentials `_. + + :param acs_user_id: ID of the access system user for which you want to retrieve all credentials. + + :param acs_system_id: ID of the access system for which you want to retrieve all credentials. + + :param user_identity_id: ID of the user identity for which you want to retrieve all credentials. + + :param created_before: Date and time, in `ISO 8601 `_ format, before which events to return were created. + + :param is_multi_phone_sync_credential: Indicates whether you want to retrieve only multi-phone sync credentials or non-multi-phone sync credentials. + + :param limit: Number of credentials to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned credentials to include all records that satisfy a partial match using ``display_name``, ``code``, ``card_number``, ``acs_user_id`` or ``acs_credential_id``. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_accessible_entrances(self, *, acs_credential_id: str) -> List[AcsEntrance]: + """Returns a list of all `entrances `_ to which a `credential `_ grants access. + + :param acs_credential_id: ID of the credential for which you want to retrieve all entrances to which the credential grants access. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -71,6 +140,14 @@ def unassign( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Unassigns a specified `credential `_ from a specified `access system user `_. + + :param acs_credential_id: ID of the credential that you want to unassign from an access system user. + + :param acs_user_id: ID of the access system user from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -81,6 +158,14 @@ def update( code: Optional[str] = None, ends_at: Optional[str] = None ) -> None: + """Updates the code and ends at date and time for a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to update. + + :param code: Replacement access (PIN) code for the credential that you want to update. + + :param ends_at: Replacement date and time at which the validity of the credential ends, in `ISO 8601 `_ format. Must be a time in the future and after the ``starts_at`` value that you set when creating the credential. + """ raise NotImplementedError() @@ -96,6 +181,14 @@ def assign( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Assigns a specified `credential `_ to a specified `access system user `_. + + :param acs_credential_id: ID of the credential that you want to assign to an access system user. + + :param acs_user_id: ID of the access system user to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity to whom you want to assign a credential. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the credential belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ json_payload = {} if acs_credential_id is not None: @@ -126,6 +219,35 @@ def create( user_identity_id: Optional[str] = None, visionline_metadata: Optional[Dict[str, Any]] = None ) -> AcsCredential: + """Creates a new `credential `_ for a specified `ACS user `_. For granting access, we recommend `Access Grants `_ instead: they create and manage the underlying credentials for you, across access systems and standalone smart locks alike. Use this low-level endpoint only when you need direct control over an individual ACS credential. + + :param access_method: Access method for the new credential. Supported values: ``code``, ``card``, ``mobile_key``, ``cloud_key``. + + :param acs_system_id: ID of the access system to which the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. + + :param acs_user_id: ID of the access system user to whom the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. + + :param allowed_acs_entrance_ids: Set of IDs of the `entrances `_ for which the new credential grants access. + + :param assa_abloy_vostio_metadata: Vostio-specific metadata for the new credential. + + :param code: Access (PIN) code for the new credential. There may be manufacturer-specific code restrictions. For details, see the applicable `device or system integration guide `_. + + :param credential_manager_acs_system_id: ACS system ID of the credential manager for the new credential. + + :param ends_at: Date and time at which the validity of the new credential ends, in `ISO 8601 `_ format. Must be a time in the future and after ``starts_at``. + + :param is_multi_phone_sync_credential: Indicates whether the new credential is a `multi-phone sync credential `_. + + :param salto_space_metadata: Salto Space-specific metadata for the new credential. + + :param starts_at: Date and time at which the validity of the new credential starts, in `ISO 8601 `_ format. + + :param user_identity_id: ID of the user identity to whom the new credential belongs. You must provide either ``acs_user_id`` or the combination of ``user_identity_id`` and ``acs_system_id``. If the access system contains a user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the credential belongs to the access system user. If the access system does not have a corresponding user, one is created. + + :param visionline_metadata: Visionline-specific metadata for the new credential. + + :returns: OK""" json_payload = {} if access_method is not None: @@ -164,6 +286,9 @@ def create( return AcsCredential.from_dict(res["acs_credential"]) def delete(self, *, acs_credential_id: str) -> None: + """Deletes a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to delete.""" json_payload = {} if acs_credential_id is not None: @@ -174,6 +299,11 @@ def delete(self, *, acs_credential_id: str) -> None: return None def get(self, *, acs_credential_id: str) -> AcsCredential: + """Returns a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to get. + + :returns: OK""" json_payload = {} if acs_credential_id is not None: @@ -195,6 +325,25 @@ def list( page_cursor: Optional[str] = None, search: Optional[str] = None ) -> List[AcsCredential]: + """Returns a list of all `credentials `_. + + :param acs_user_id: ID of the access system user for which you want to retrieve all credentials. + + :param acs_system_id: ID of the access system for which you want to retrieve all credentials. + + :param user_identity_id: ID of the user identity for which you want to retrieve all credentials. + + :param created_before: Date and time, in `ISO 8601 `_ format, before which events to return were created. + + :param is_multi_phone_sync_credential: Indicates whether you want to retrieve only multi-phone sync credentials or non-multi-phone sync credentials. + + :param limit: Number of credentials to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned credentials to include all records that satisfy a partial match using ``display_name``, ``code``, ``card_number``, ``acs_user_id`` or ``acs_credential_id``. + + :returns: OK""" json_payload = {} if acs_user_id is not None: @@ -221,6 +370,11 @@ def list( return [AcsCredential.from_dict(item) for item in res["acs_credentials"]] def list_accessible_entrances(self, *, acs_credential_id: str) -> List[AcsEntrance]: + """Returns a list of all `entrances `_ to which a `credential `_ grants access. + + :param acs_credential_id: ID of the credential for which you want to retrieve all entrances to which the credential grants access. + + :returns: OK""" json_payload = {} if acs_credential_id is not None: @@ -239,6 +393,14 @@ def unassign( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Unassigns a specified `credential `_ from a specified `access system user `_. + + :param acs_credential_id: ID of the credential that you want to unassign from an access system user. + + :param acs_user_id: ID of the access system user from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity from which you want to unassign a credential. You can only provide one of acs_user_id or user_identity_id. + """ json_payload = {} if acs_credential_id is not None: @@ -259,6 +421,14 @@ def update( code: Optional[str] = None, ends_at: Optional[str] = None ) -> None: + """Updates the code and ends at date and time for a specified `credential `_. + + :param acs_credential_id: ID of the credential that you want to update. + + :param code: Replacement access (PIN) code for the credential that you want to update. + + :param ends_at: Replacement date and time at which the validity of the credential ends, in `ISO 8601 `_ format. Must be a time in the future and after the ``starts_at`` value that you set when creating the credential. + """ json_payload = {} if acs_credential_id is not None: diff --git a/seam/routes/acs_encoders.py b/seam/routes/acs_encoders.py index f14315c..e537a0f 100644 --- a/seam/routes/acs_encoders.py +++ b/seam/routes/acs_encoders.py @@ -22,10 +22,26 @@ def encode_credential( acs_credential_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Encodes an existing `credential `_ onto a plastic card placed on the specified `encoder `_. Either provide an ``acs_credential_id`` or an ``access_method_id`` + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to encode the ``acs_credential``. + + :param access_method_id: ID of the ``access_method`` to encode onto a card. + + :param acs_credential_id: ID of the ``acs_credential`` to encode onto a card. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def get(self, *, acs_encoder_id: str) -> AcsEncoder: + """Returns a specified `encoder `_. + + :param acs_encoder_id: ID of the encoder that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -38,6 +54,19 @@ def list( limit: Optional[float] = None, page_cursor: Optional[str] = None ) -> List[AcsEncoder]: + """Returns a list of all `encoders `_. + + :param acs_system_id: ID of the access system for which you want to retrieve all encoders. + + :param acs_system_ids: IDs of the access systems for which you want to retrieve all encoders. + + :param acs_encoder_ids: IDs of the encoders that you want to retrieve. + + :param limit: Number of encoders to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -48,6 +77,15 @@ def scan_credential( salto_ks_metadata: Optional[Dict[str, Any]] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Scans an encoded `acs_credential `_ from a plastic card placed on the specified `encoder `_. + + :param acs_encoder_id: ID of the encoder to use for the scan. + + :param salto_ks_metadata: Salto KS-specific metadata for the scan action. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -60,6 +98,19 @@ def scan_to_assign_credential( user_identity_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Scans a physical card placed on the specified `encoder `_ and assigns the scanned credential to an ACS user. Provide either an ``acs_user_id`` or a ``user_identity_id``. + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to scan the credential. + + :param acs_user_id: ID of the ``acs_user`` to assign the scanned credential to. + + :param salto_ks_metadata: Salto KS-specific metadata for the scan action. + + :param user_identity_id: ID of the ``user_identity`` to assign the scanned credential to. If the ACS system contains an ACS user linked to this user identity, it is used. Otherwise, one is created. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -81,6 +132,17 @@ def encode_credential( acs_credential_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Encodes an existing `credential `_ onto a plastic card placed on the specified `encoder `_. Either provide an ``acs_credential_id`` or an ``access_method_id`` + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to encode the ``acs_credential``. + + :param access_method_id: ID of the ``access_method`` to encode onto a card. + + :param acs_credential_id: ID of the ``acs_credential`` to encode onto a card. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if acs_encoder_id is not None: @@ -105,6 +167,11 @@ def encode_credential( ) def get(self, *, acs_encoder_id: str) -> AcsEncoder: + """Returns a specified `encoder `_. + + :param acs_encoder_id: ID of the encoder that you want to get. + + :returns: OK""" json_payload = {} if acs_encoder_id is not None: @@ -123,6 +190,19 @@ def list( limit: Optional[float] = None, page_cursor: Optional[str] = None ) -> List[AcsEncoder]: + """Returns a list of all `encoders `_. + + :param acs_system_id: ID of the access system for which you want to retrieve all encoders. + + :param acs_system_ids: IDs of the access systems for which you want to retrieve all encoders. + + :param acs_encoder_ids: IDs of the encoders that you want to retrieve. + + :param limit: Number of encoders to return. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -147,6 +227,15 @@ def scan_credential( salto_ks_metadata: Optional[Dict[str, Any]] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Scans an encoded `acs_credential `_ from a plastic card placed on the specified `encoder `_. + + :param acs_encoder_id: ID of the encoder to use for the scan. + + :param salto_ks_metadata: Salto KS-specific metadata for the scan action. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if acs_encoder_id is not None: @@ -177,6 +266,19 @@ def scan_to_assign_credential( user_identity_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Scans a physical card placed on the specified `encoder `_ and assigns the scanned credential to an ACS user. Provide either an ``acs_user_id`` or a ``user_identity_id``. + + :param acs_encoder_id: ID of the ``acs_encoder`` to use to scan the credential. + + :param acs_user_id: ID of the ``acs_user`` to assign the scanned credential to. + + :param salto_ks_metadata: Salto KS-specific metadata for the scan action. + + :param user_identity_id: ID of the ``user_identity`` to assign the scanned credential to. If the ACS system contains an ACS user linked to this user identity, it is used. Otherwise, one is created. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if acs_encoder_id is not None: diff --git a/seam/routes/acs_encoders_simulate.py b/seam/routes/acs_encoders_simulate.py index ea00fab..e08aaf1 100644 --- a/seam/routes/acs_encoders_simulate.py +++ b/seam/routes/acs_encoders_simulate.py @@ -13,12 +13,25 @@ def next_credential_encode_will_fail( error_code: Optional[str] = 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. + """ raise NotImplementedError() @abc.abstractmethod def next_credential_encode_will_succeed( self, *, acs_encoder_id: str, scenario: Optional[str] = None ) -> None: + """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will succeed. 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 scenario: Scenario to simulate.""" raise NotImplementedError() @abc.abstractmethod @@ -29,6 +42,13 @@ def next_credential_scan_will_fail( error_code: Optional[str] = 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:""" raise NotImplementedError() @abc.abstractmethod @@ -39,6 +59,13 @@ def next_credential_scan_will_succeed( acs_credential_id_on_seam: Optional[str] = None, scenario: Optional[str] = None ) -> None: + """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will succeed. 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 scan the ``acs_credential``. + + :param acs_credential_id_on_seam: ID of the Seam ``acs_credential`` that matches the ``acs_credential`` on the encoder in this simulation. + + :param scenario: Scenario to simulate.""" raise NotImplementedError() @@ -54,6 +81,14 @@ def next_credential_encode_will_fail( error_code: Optional[str] = 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. + """ json_payload = {} if acs_encoder_id is not None: @@ -72,6 +107,11 @@ def next_credential_encode_will_fail( def next_credential_encode_will_succeed( self, *, acs_encoder_id: str, scenario: Optional[str] = None ) -> None: + """Simulates that the next attempt to encode a `credential `_ using the specified `encoder `_ will succeed. 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 scenario: Scenario to simulate.""" json_payload = {} if acs_encoder_id is not None: @@ -93,6 +133,13 @@ def next_credential_scan_will_fail( error_code: Optional[str] = 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:""" json_payload = {} if acs_encoder_id is not None: @@ -115,6 +162,13 @@ def next_credential_scan_will_succeed( acs_credential_id_on_seam: Optional[str] = None, scenario: Optional[str] = None ) -> None: + """Simulates that the next attempt to scan a `credential `_ using the specified `encoder `_ will succeed. 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 scan the ``acs_credential``. + + :param acs_credential_id_on_seam: ID of the Seam ``acs_credential`` that matches the ``acs_credential`` on the encoder in this simulation. + + :param scenario: Scenario to simulate.""" json_payload = {} if acs_encoder_id is not None: diff --git a/seam/routes/acs_entrances.py b/seam/routes/acs_entrances.py index a2de339..97a5bba 100644 --- a/seam/routes/acs_entrances.py +++ b/seam/routes/acs_entrances.py @@ -9,6 +9,11 @@ class AbstractAcsEntrances(abc.ABC): @abc.abstractmethod def get(self, *, acs_entrance_id: str) -> AcsEntrance: + """Returns a specified `access system entrance `_. + + :param acs_entrance_id: ID of the entrance that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -19,6 +24,14 @@ def grant_access( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Grants a specified `access system user `_ access to a specified `access system entrance `_. + + :param acs_entrance_id: ID of the entrance to which you want to grant an access system user access. + + :param acs_user_id: ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ raise NotImplementedError() @abc.abstractmethod @@ -36,12 +49,42 @@ def list( search: Optional[str] = None, space_id: Optional[str] = None ) -> List[AcsEntrance]: + """Returns a list of all `access system entrances `_. + + :param acs_credential_id: ID of the credential for which you want to retrieve all entrances. + + :param acs_entrance_ids: IDs of the entrances for which you want to retrieve all entrances. + + :param acs_system_id: ID of the access system for which you want to retrieve all entrances. + + :param connected_account_id: ID of the connected account for which you want to retrieve all entrances. + + :param customer_key: Customer key for which you want to list entrances. + + :param limit: Maximum number of records to return per page. + + :param location_id: Deprecated: Use ``space_id``. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned entrances to include all records that satisfy a partial match using ``display_name``. + + :param space_id: ID of the space for which you want to list entrances. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_credentials_with_access( self, *, acs_entrance_id: str, include_if: Optional[List[str]] = None ) -> List[AcsCredential]: + """Returns a list of all `credentials `_ with access to a specified `entrance `_. + + :param acs_entrance_id: ID of the entrance for which you want to list all credentials that grant access. + + :param include_if: Conditions that credentials must meet to be included in the returned list. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -52,6 +95,15 @@ def unlock( acs_entrance_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Remotely unlocks a specified `entrance `_ using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. + + :param acs_credential_id: ID of the cloud_key credential to use for the unlock operation. + + :param acs_entrance_id: ID of the entrance to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -61,6 +113,11 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def get(self, *, acs_entrance_id: str) -> AcsEntrance: + """Returns a specified `access system entrance `_. + + :param acs_entrance_id: ID of the entrance that you want to get. + + :returns: OK""" json_payload = {} if acs_entrance_id is not None: @@ -77,6 +134,14 @@ def grant_access( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Grants a specified `access system user `_ access to a specified `access system entrance `_. + + :param acs_entrance_id: ID of the entrance to which you want to grant an access system user access. + + :param acs_user_id: ID of the access system user to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity to whom you want to grant access to an entrance. You can only provide one of acs_user_id or user_identity_id. If the ACS system contains an ACS user with the same ``email_address`` or ``phone_number`` as the user identity that you specify, they are linked, and the access group membership belongs to the ACS user. If the ACS system does not have a corresponding ACS user, one is created. + """ json_payload = {} if acs_entrance_id is not None: @@ -104,6 +169,29 @@ def list( search: Optional[str] = None, space_id: Optional[str] = None ) -> List[AcsEntrance]: + """Returns a list of all `access system entrances `_. + + :param acs_credential_id: ID of the credential for which you want to retrieve all entrances. + + :param acs_entrance_ids: IDs of the entrances for which you want to retrieve all entrances. + + :param acs_system_id: ID of the access system for which you want to retrieve all entrances. + + :param connected_account_id: ID of the connected account for which you want to retrieve all entrances. + + :param customer_key: Customer key for which you want to list entrances. + + :param limit: Maximum number of records to return per page. + + :param location_id: Deprecated: Use ``space_id``. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned entrances to include all records that satisfy a partial match using ``display_name``. + + :param space_id: ID of the space for which you want to list entrances. + + :returns: OK""" json_payload = {} if acs_credential_id is not None: @@ -134,6 +222,13 @@ def list( def list_credentials_with_access( self, *, acs_entrance_id: str, include_if: Optional[List[str]] = None ) -> List[AcsCredential]: + """Returns a list of all `credentials `_ with access to a specified `entrance `_. + + :param acs_entrance_id: ID of the entrance for which you want to list all credentials that grant access. + + :param include_if: Conditions that credentials must meet to be included in the returned list. + + :returns: OK""" json_payload = {} if acs_entrance_id is not None: @@ -154,6 +249,15 @@ def unlock( acs_entrance_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Remotely unlocks a specified `entrance `_ using a cloud_key credential. Returns an action attempt that tracks the progress of the unlock operation. + + :param acs_credential_id: ID of the cloud_key credential to use for the unlock operation. + + :param acs_entrance_id: ID of the entrance to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if acs_credential_id is not None: diff --git a/seam/routes/acs_systems.py b/seam/routes/acs_systems.py index 6e33bdd..b4ca7d3 100644 --- a/seam/routes/acs_systems.py +++ b/seam/routes/acs_systems.py @@ -8,6 +8,11 @@ class AbstractAcsSystems(abc.ABC): @abc.abstractmethod def get(self, *, acs_system_id: str) -> AcsSystem: + """Returns a specified `access system `_. + + :param acs_system_id: ID of the access system that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -18,12 +23,30 @@ def list( customer_key: Optional[str] = None, search: Optional[str] = None ) -> List[AcsSystem]: + """Returns a list of all `access systems `_. + + To filter the list of returned access systems by a specific connected account ID, include the ``connected_account_id`` in the request body. If you omit the ``connected_account_id`` parameter, the response includes all access systems connected to your workspace. + + :param connected_account_id: ID of the connected account by which you want to filter the list of access systems. + + :param customer_key: Customer key for which you want to list access systems. + + :param search: String for which to search. Filters returned access systems to include all records that satisfy a partial match using ``name`` or ``acs_system_id``. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_compatible_credential_manager_acs_systems( self, *, acs_system_id: str ) -> List[AcsSystem]: + """Returns a list of all credential manager systems that are compatible with a specified `access system `_. + + Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding ``acs_system_id`` in the request body. + + :param acs_system_id: ID of the access system for which you want to retrieve all compatible credential manager systems. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -34,6 +57,13 @@ def report_devices( acs_encoders: Optional[List[Dict[str, Any]]] = None, acs_entrances: Optional[List[Dict[str, Any]]] = None ) -> None: + """Reports ACS system device status including encoders and entrances. + + :param acs_system_id: ID of the ACS system to report resources for + + :param acs_encoders: Array of ACS encoders to report + + :param acs_entrances: Array of ACS entrances to report""" raise NotImplementedError() @@ -43,6 +73,11 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def get(self, *, acs_system_id: str) -> AcsSystem: + """Returns a specified `access system `_. + + :param acs_system_id: ID of the access system that you want to get. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -59,6 +94,17 @@ def list( customer_key: Optional[str] = None, search: Optional[str] = None ) -> List[AcsSystem]: + """Returns a list of all `access systems `_. + + To filter the list of returned access systems by a specific connected account ID, include the ``connected_account_id`` in the request body. If you omit the ``connected_account_id`` parameter, the response includes all access systems connected to your workspace. + + :param connected_account_id: ID of the connected account by which you want to filter the list of access systems. + + :param customer_key: Customer key for which you want to list access systems. + + :param search: String for which to search. Filters returned access systems to include all records that satisfy a partial match using ``name`` or ``acs_system_id``. + + :returns: OK""" json_payload = {} if connected_account_id is not None: @@ -75,6 +121,13 @@ def list( def list_compatible_credential_manager_acs_systems( self, *, acs_system_id: str ) -> List[AcsSystem]: + """Returns a list of all credential manager systems that are compatible with a specified `access system `_. + + Specify the access system for which you want to retrieve all compatible credential manager systems by including the corresponding ``acs_system_id`` in the request body. + + :param acs_system_id: ID of the access system for which you want to retrieve all compatible credential manager systems. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -94,6 +147,13 @@ def report_devices( acs_encoders: Optional[List[Dict[str, Any]]] = None, acs_entrances: Optional[List[Dict[str, Any]]] = None ) -> None: + """Reports ACS system device status including encoders and entrances. + + :param acs_system_id: ID of the ACS system to report resources for + + :param acs_encoders: Array of ACS encoders to report + + :param acs_entrances: Array of ACS entrances to report""" json_payload = {} if acs_system_id is not None: diff --git a/seam/routes/acs_users.py b/seam/routes/acs_users.py index 082c08e..7f59c38 100644 --- a/seam/routes/acs_users.py +++ b/seam/routes/acs_users.py @@ -10,6 +10,12 @@ class AbstractAcsUsers(abc.ABC): def add_to_access_group( self, *, acs_access_group_id: str, acs_user_id: str ) -> None: + """Adds a specified `access system user `_ to a specified `access group `_. + + :param acs_access_group_id: ID of the access group to which you want to add an access system user. + + :param acs_user_id: ID of the access system user that you want to add to an access group. + """ raise NotImplementedError() @abc.abstractmethod @@ -25,6 +31,25 @@ def create( phone_number: Optional[str] = None, user_identity_id: Optional[str] = None ) -> AcsUser: + """Creates a new `access system user `_. + + :param acs_system_id: ID of the access system to which you want to add the new access system user. + + :param full_name: Full name of the new access system user. + + :param access_schedule: ``starts_at`` and ``ends_at`` timestamps for the new access system user's access. If you specify an ``access_schedule``, you may include both ``starts_at`` and ``ends_at``. If you omit ``starts_at``, it defaults to the current time. ``ends_at`` is optional and must be a time in the future and after ``starts_at``. + + :param acs_access_group_ids: Array of access group IDs to indicate the access groups to which you want to add the new access system user. + + :param email: Deprecated: use email_address. + + :param email_address: Email address of the `access system user `_. + + :param phone_number: Phone number of the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :param user_identity_id: ID of the user identity with which you want to associate the new access system user. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -35,6 +60,14 @@ def delete( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Deletes a specified `access system user `_ and invalidates the access system user's `credentials `_. + + :param acs_system_id: ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id + + :param user_identity_id: ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -45,6 +78,15 @@ def get( acs_system_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> AcsUser: + """Returns a specified `access system user `_. + + :param acs_user_id: ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id. + + :param acs_system_id: ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -60,6 +102,25 @@ def list( user_identity_id: Optional[str] = None, user_identity_phone_number: Optional[str] = None ) -> List[AcsUser]: + """Returns a list of all `access system users `_. + + :param acs_system_id: ID of the ``acs_system`` for which you want to retrieve all access system users. + + :param created_before: Timestamp by which to limit returned access system users. Returns users created before this timestamp. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access system users to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address``, ``acs_user_id``, ``user_identity_id``, ``user_identity_full_name`` or ``user_identity_phone_number``. + + :param user_identity_email_address: Email address of the user identity for which you want to retrieve all access system users. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access system users. + + :param user_identity_phone_number: Phone number of the user identity for which you want to retrieve all access system users, in `E.164 format `_ (for example, ``+15555550100``). + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -70,6 +131,15 @@ def list_accessible_entrances( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AcsEntrance]: + """Lists the `entrances `_ to which a specified `access system user `_ has access. + + :param acs_system_id: ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -80,6 +150,14 @@ def remove_from_access_group( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Removes a specified `access system user `_ from a specified `access group `_. + + :param acs_access_group_id: ID of the access group from which you want to remove an access system user. + + :param acs_user_id: ID of the access system user that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -90,6 +168,14 @@ def revoke_access_to_all_entrances( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Revokes access to all `entrances `_ for a specified `access system user `_. + + :param acs_system_id: ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -100,6 +186,14 @@ def suspend( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """`Suspends `_ a specified `access system user `_. Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can `unsuspend `_ them. + + :param acs_system_id: ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param acs_user_id: ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param user_identity_id: ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -110,6 +204,14 @@ def unsuspend( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """`Unsuspends `_ a specified suspended `access system user `_. While `suspending an access system user `_ revokes their access temporarily, unsuspending the access system user restores their access. + + :param acs_system_id: ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param user_identity_id: ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + """ raise NotImplementedError() @abc.abstractmethod @@ -126,6 +228,26 @@ def update( phone_number: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Updates the properties of a specified `access system user `_. + + :param access_schedule: ``starts_at`` and ``ends_at`` timestamps for the access system user's access. If you specify an ``access_schedule``, you may include both ``starts_at`` and ``ends_at``. If you omit ``starts_at``, it defaults to the current time. ``ends_at`` is optional and must be a time in the future and after ``starts_at``. + + :param acs_system_id: ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id. + + :param email: Deprecated: use email_address. + + :param email_address: Email address of the `access system user `_. + + :param full_name: Full name of the `access system user `_. + + :param hid_acs_system_id: ID of the HID access control system associated with the user. + + :param phone_number: Phone number of the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :param user_identity_id: ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + """ raise NotImplementedError() @@ -137,6 +259,12 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): def add_to_access_group( self, *, acs_access_group_id: str, acs_user_id: str ) -> None: + """Adds a specified `access system user `_ to a specified `access group `_. + + :param acs_access_group_id: ID of the access group to which you want to add an access system user. + + :param acs_user_id: ID of the access system user that you want to add to an access group. + """ json_payload = {} if acs_access_group_id is not None: @@ -160,6 +288,25 @@ def create( phone_number: Optional[str] = None, user_identity_id: Optional[str] = None ) -> AcsUser: + """Creates a new `access system user `_. + + :param acs_system_id: ID of the access system to which you want to add the new access system user. + + :param full_name: Full name of the new access system user. + + :param access_schedule: ``starts_at`` and ``ends_at`` timestamps for the new access system user's access. If you specify an ``access_schedule``, you may include both ``starts_at`` and ``ends_at``. If you omit ``starts_at``, it defaults to the current time. ``ends_at`` is optional and must be a time in the future and after ``starts_at``. + + :param acs_access_group_ids: Array of access group IDs to indicate the access groups to which you want to add the new access system user. + + :param email: Deprecated: use email_address. + + :param email_address: Email address of the `access system user `_. + + :param phone_number: Phone number of the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :param user_identity_id: ID of the user identity with which you want to associate the new access system user. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -190,6 +337,14 @@ def delete( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Deletes a specified `access system user `_ and invalidates the access system user's `credentials `_. + + :param acs_system_id: ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id + + :param user_identity_id: ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + """ json_payload = {} if acs_system_id is not None: @@ -210,6 +365,15 @@ def get( acs_system_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> AcsUser: + """Returns a specified `access system user `_. + + :param acs_user_id: ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id. + + :param acs_system_id: ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id. + + :returns: OK""" json_payload = {} if acs_user_id is not None: @@ -235,6 +399,25 @@ def list( user_identity_id: Optional[str] = None, user_identity_phone_number: Optional[str] = None ) -> List[AcsUser]: + """Returns a list of all `access system users `_. + + :param acs_system_id: ID of the ``acs_system`` for which you want to retrieve all access system users. + + :param created_before: Timestamp by which to limit returned access system users. Returns users created before this timestamp. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned access system users to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address``, ``acs_user_id``, ``user_identity_id``, ``user_identity_full_name`` or ``user_identity_phone_number``. + + :param user_identity_email_address: Email address of the user identity for which you want to retrieve all access system users. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access system users. + + :param user_identity_phone_number: Phone number of the user identity for which you want to retrieve all access system users, in `E.164 format `_ (for example, ``+15555550100``). + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -265,6 +448,15 @@ def list_accessible_entrances( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> List[AcsEntrance]: + """Lists the `entrances `_ to which a specified `access system user `_ has access. + + :param acs_system_id: ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id. + + :returns: OK""" json_payload = {} if acs_system_id is not None: @@ -287,6 +479,14 @@ def remove_from_access_group( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Removes a specified `access system user `_ from a specified `access group `_. + + :param acs_access_group_id: ID of the access group from which you want to remove an access system user. + + :param acs_user_id: ID of the access system user that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id. + """ json_payload = {} if acs_access_group_id is not None: @@ -307,6 +507,14 @@ def revoke_access_to_all_entrances( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Revokes access to all `entrances `_ for a specified `access system user `_. + + :param acs_system_id: ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + + :param user_identity_id: ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id. + """ json_payload = {} if acs_system_id is not None: @@ -327,6 +535,14 @@ def suspend( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """`Suspends `_ a specified `access system user `_. Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can `unsuspend `_ them. + + :param acs_system_id: ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param acs_user_id: ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param user_identity_id: ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + """ json_payload = {} if acs_system_id is not None: @@ -347,6 +563,14 @@ def unsuspend( acs_user_id: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """`Unsuspends `_ a specified suspended `access system user `_. While `suspending an access system user `_ revokes their access temporarily, unsuspending the access system user restores their access. + + :param acs_system_id: ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + + :param user_identity_id: ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id. + """ json_payload = {} if acs_system_id is not None: @@ -373,6 +597,26 @@ def update( phone_number: Optional[str] = None, user_identity_id: Optional[str] = None ) -> None: + """Updates the properties of a specified `access system user `_. + + :param access_schedule: ``starts_at`` and ``ends_at`` timestamps for the access system user's access. If you specify an ``access_schedule``, you may include both ``starts_at`` and ``ends_at``. If you omit ``starts_at``, it defaults to the current time. ``ends_at`` is optional and must be a time in the future and after ``starts_at``. + + :param acs_system_id: ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id. + + :param acs_user_id: ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id. + + :param email: Deprecated: use email_address. + + :param email_address: Email address of the `access system user `_. + + :param full_name: Full name of the `access system user `_. + + :param hid_acs_system_id: ID of the HID access control system associated with the user. + + :param phone_number: Phone number of the `access system user `_ in E.164 format (for example, ``+15555550100``). + + :param user_identity_id: ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id. + """ json_payload = {} if access_schedule is not None: diff --git a/seam/routes/action_attempts.py b/seam/routes/action_attempts.py index 4b09607..e14dfe8 100644 --- a/seam/routes/action_attempts.py +++ b/seam/routes/action_attempts.py @@ -14,6 +14,13 @@ def get( action_attempt_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Returns a specified `action attempt `_. + + :param action_attempt_id: ID of the action attempt that you want to get. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -25,6 +32,17 @@ def list( limit: Optional[int] = None, page_cursor: Optional[str] = None ) -> List[ActionAttempt]: + """Returns a list of the `action attempts `_ that you specify as an array of ``action_attempt_id``s. + + :param action_attempt_ids: IDs of the action attempts that you want to retrieve. + + :param device_id: ID of the device to filter action attempts by. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :returns: OK""" raise NotImplementedError() @@ -39,6 +57,13 @@ def get( action_attempt_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Returns a specified `action attempt `_. + + :param action_attempt_id: ID of the action attempt that you want to get. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if action_attempt_id is not None: @@ -66,6 +91,17 @@ def list( limit: Optional[int] = None, page_cursor: Optional[str] = None ) -> List[ActionAttempt]: + """Returns a list of the `action attempts `_ that you specify as an array of ``action_attempt_id``s. + + :param action_attempt_ids: IDs of the action attempts that you want to retrieve. + + :param device_id: ID of the device to filter action attempts by. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :returns: OK""" json_payload = {} if action_attempt_ids is not None: diff --git a/seam/routes/client_sessions.py b/seam/routes/client_sessions.py index d3ff209..29f996a 100644 --- a/seam/routes/client_sessions.py +++ b/seam/routes/client_sessions.py @@ -19,10 +19,32 @@ def create( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> ClientSession: + """Creates a new `client session `_. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ for which you want to create a client session. + + :param connected_account_ids: IDs of the `connected accounts `_ for which you want to create a client session. + + :param customer_id: Customer ID that you want to associate with the new client session. + + :param customer_key: Customer key that you want to associate with the new client session. + + :param expires_at: Date and time at which the client session should expire, in `ISO 8601 `_ format. + + :param user_identifier_key: Your user ID for the user for whom you want to create a client session. + + :param user_identity_id: ID of the `user identity `_ for which you want to create a client session. + + :param user_identity_ids: Deprecated: Use ``user_identity_id`` instead. IDs of the `user identities `_ that you want to associate with the client session. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, client_session_id: str) -> None: + """Deletes a `client session `_. + + :param client_session_id: ID of the client session that you want to delete.""" raise NotImplementedError() @abc.abstractmethod @@ -32,6 +54,13 @@ def get( client_session_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> ClientSession: + """Returns a specified `client session `_. + + :param client_session_id: ID of the client session that you want to get. + + :param user_identifier_key: User identifier key associated with the client session that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -45,6 +74,21 @@ def get_or_create( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> ClientSession: + """Returns a `client session `_ with specific characteristics or creates a new client session with these characteristics if it does not yet exist. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param connected_account_ids: IDs of the `connected accounts `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param expires_at: Date and time at which the client session should expire in `ISO 8601 `_ format. If the client session already exists, this will update the expiration before returning it. + + :param user_identifier_key: Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session). + + :param user_identity_id: ID of the `user identity `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param user_identity_ids: Deprecated: Use ``user_identity_id``. IDs of the `user identities `_ that you want to associate with the client session. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -58,6 +102,20 @@ def grant_access( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> None: + """Grants a `client session `_ access to one or more resources, such as `Connect Webviews `_, `user identities `_, and so on. + + :param client_session_id: ID of the client session to which you want to grant access to resources. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ that you want to associate with the client session. + + :param connected_account_ids: IDs of the `connected accounts `_ that you want to associate with the client session. + + :param user_identifier_key: Your user ID for the user that you want to associate with the client session. + + :param user_identity_id: ID of the `user identity `_ that you want to associate with the client session. + + :param user_identity_ids: Deprecated: Use ``user_identity_id``. IDs of the `user identities `_ that you want to associate with the client session. + """ raise NotImplementedError() @abc.abstractmethod @@ -70,10 +128,28 @@ def list( user_identity_id: Optional[str] = None, without_user_identifier_key: Optional[bool] = None ) -> List[ClientSession]: + """Returns a list of all `client sessions `_. + + :param client_session_id: ID of the client session that you want to retrieve. + + :param connect_webview_id: ID of the `Connect Webview `_ for which you want to retrieve client sessions. + + :param user_identifier_key: Your user ID for the user by which you want to filter client sessions. + + :param user_identity_id: ID of the `user identity `_ for which you want to retrieve client sessions. + + :param without_user_identifier_key: Indicates whether to retrieve only client sessions without associated user identifier keys. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def revoke(self, *, client_session_id: str) -> None: + """Revokes a `client session `_. + + Note that `deleting a client session `_ is a separate action. + + :param client_session_id: ID of the client session that you want to revoke.""" raise NotImplementedError() @@ -94,6 +170,25 @@ def create( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> ClientSession: + """Creates a new `client session `_. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ for which you want to create a client session. + + :param connected_account_ids: IDs of the `connected accounts `_ for which you want to create a client session. + + :param customer_id: Customer ID that you want to associate with the new client session. + + :param customer_key: Customer key that you want to associate with the new client session. + + :param expires_at: Date and time at which the client session should expire, in `ISO 8601 `_ format. + + :param user_identifier_key: Your user ID for the user for whom you want to create a client session. + + :param user_identity_id: ID of the `user identity `_ for which you want to create a client session. + + :param user_identity_ids: Deprecated: Use ``user_identity_id`` instead. IDs of the `user identities `_ that you want to associate with the client session. + + :returns: OK""" json_payload = {} if connect_webview_ids is not None: @@ -118,6 +213,9 @@ def create( return ClientSession.from_dict(res["client_session"]) def delete(self, *, client_session_id: str) -> None: + """Deletes a `client session `_. + + :param client_session_id: ID of the client session that you want to delete.""" json_payload = {} if client_session_id is not None: @@ -133,6 +231,13 @@ def get( client_session_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> ClientSession: + """Returns a specified `client session `_. + + :param client_session_id: ID of the client session that you want to get. + + :param user_identifier_key: User identifier key associated with the client session that you want to get. + + :returns: OK""" json_payload = {} if client_session_id is not None: @@ -154,6 +259,21 @@ def get_or_create( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> ClientSession: + """Returns a `client session `_ with specific characteristics or creates a new client session with these characteristics if it does not yet exist. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param connected_account_ids: IDs of the `connected accounts `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param expires_at: Date and time at which the client session should expire in `ISO 8601 `_ format. If the client session already exists, this will update the expiration before returning it. + + :param user_identifier_key: Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session). + + :param user_identity_id: ID of the `user identity `_ that you want to associate with the client session (or that are already associated with the existing client session). + + :param user_identity_ids: Deprecated: Use ``user_identity_id``. IDs of the `user identities `_ that you want to associate with the client session. + + :returns: OK""" json_payload = {} if connect_webview_ids is not None: @@ -183,6 +303,20 @@ def grant_access( user_identity_id: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> None: + """Grants a `client session `_ access to one or more resources, such as `Connect Webviews `_, `user identities `_, and so on. + + :param client_session_id: ID of the client session to which you want to grant access to resources. + + :param connect_webview_ids: IDs of the `Connect Webviews `_ that you want to associate with the client session. + + :param connected_account_ids: IDs of the `connected accounts `_ that you want to associate with the client session. + + :param user_identifier_key: Your user ID for the user that you want to associate with the client session. + + :param user_identity_id: ID of the `user identity `_ that you want to associate with the client session. + + :param user_identity_ids: Deprecated: Use ``user_identity_id``. IDs of the `user identities `_ that you want to associate with the client session. + """ json_payload = {} if client_session_id is not None: @@ -211,6 +345,19 @@ def list( user_identity_id: Optional[str] = None, without_user_identifier_key: Optional[bool] = None ) -> List[ClientSession]: + """Returns a list of all `client sessions `_. + + :param client_session_id: ID of the client session that you want to retrieve. + + :param connect_webview_id: ID of the `Connect Webview `_ for which you want to retrieve client sessions. + + :param user_identifier_key: Your user ID for the user by which you want to filter client sessions. + + :param user_identity_id: ID of the `user identity `_ for which you want to retrieve client sessions. + + :param without_user_identifier_key: Indicates whether to retrieve only client sessions without associated user identifier keys. + + :returns: OK""" json_payload = {} if client_session_id is not None: @@ -229,6 +376,11 @@ def list( return [ClientSession.from_dict(item) for item in res["client_sessions"]] def revoke(self, *, client_session_id: str) -> None: + """Revokes a `client session `_. + + Note that `deleting a client session `_ is a separate action. + + :param client_session_id: ID of the client session that you want to revoke.""" json_payload = {} if client_session_id is not None: diff --git a/seam/routes/connect_webviews.py b/seam/routes/connect_webviews.py index ff0db12..d6b32d6 100644 --- a/seam/routes/connect_webviews.py +++ b/seam/routes/connect_webviews.py @@ -21,14 +21,55 @@ def create( provider_category: Optional[str] = None, wait_for_device_creation: Optional[bool] = None ) -> ConnectWebview: + """Creates a new `Connect Webview `_. + + To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a ``connect_webview``. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. + + You should make a new ``connect_webview`` for each unique login request. Each ``connect_webview`` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. + + See also: `Connect Webview Process `_. + + :param accepted_capabilities: List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. + + :param accepted_providers: Accepted device provider keys as an alternative to ``provider_category``. Use this parameter to specify accepted providers explicitly. See `Customize the Brands to Display in Your Connect Webviews `_. To list all provider keys, use ```/devices/list_device_providers`` `_ with no filters. + + :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_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``. + + :param custom_redirect_url: URL that you want to redirect the user to after the provider login is complete. + + :param customer_key: Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error. + + :param excluded_providers: List of provider keys to exclude from the Connect Webview. These providers will not be shown when the user tries to connect an account. + + :param provider_category: Specifies the category of providers that you want to include. To list all providers within a category, use ```/devices/list_device_providers`` `_ with the desired ``provider_category`` filter. + + :param wait_for_device_creation: Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview. See also: `Customize the Behavior Settings of Your Connect Webviews `_. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, connect_webview_id: str) -> None: + """Deletes a `Connect Webview `_. + + You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. + + :param connect_webview_id: ID of the Connect Webview that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, connect_webview_id: str) -> ConnectWebview: + """Returns a specified `Connect Webview `_. + + Unless you're using a ``custom_redirect_url``, you should poll a newly-created ``connect_webview`` to find out if the user has signed in or to get details about what devices they've connected. + + :param connect_webview_id: ID of the Connect Webview that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -42,6 +83,21 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> 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 customer_key: Customer key for which you want to list connect webviews. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using ``connect_webview_id``, ``accepted_providers``, ``custom_metadata``, or ``customer_key``. + + :param user_identifier_key: Your user ID for the user by which you want to filter Connect Webviews. + + :returns: OK""" raise NotImplementedError() @@ -64,6 +120,35 @@ def create( provider_category: Optional[str] = None, wait_for_device_creation: Optional[bool] = None ) -> ConnectWebview: + """Creates a new `Connect Webview `_. + + To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a ``connect_webview``. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview. + + You should make a new ``connect_webview`` for each unique login request. Each ``connect_webview`` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users. + + See also: `Connect Webview Process `_. + + :param accepted_capabilities: List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers. + + :param accepted_providers: Accepted device provider keys as an alternative to ``provider_category``. Use this parameter to specify accepted providers explicitly. See `Customize the Brands to Display in Your Connect Webviews `_. To list all provider keys, use ```/devices/list_device_providers`` `_ with no filters. + + :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_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``. + + :param custom_redirect_url: URL that you want to redirect the user to after the provider login is complete. + + :param customer_key: Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error. + + :param excluded_providers: List of provider keys to exclude from the Connect Webview. These providers will not be shown when the user tries to connect an account. + + :param provider_category: Specifies the category of providers that you want to include. To list all providers within a category, use ```/devices/list_device_providers`` `_ with the desired ``provider_category`` filter. + + :param wait_for_device_creation: Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview. See also: `Customize the Behavior Settings of Your Connect Webviews `_. + + :returns: OK""" json_payload = {} if accepted_capabilities is not None: @@ -94,6 +179,11 @@ def create( return ConnectWebview.from_dict(res["connect_webview"]) def delete(self, *, connect_webview_id: str) -> None: + """Deletes a `Connect Webview `_. + + You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews. + + :param connect_webview_id: ID of the Connect Webview that you want to delete.""" json_payload = {} if connect_webview_id is not None: @@ -104,6 +194,13 @@ def delete(self, *, connect_webview_id: str) -> None: return None def get(self, *, connect_webview_id: str) -> ConnectWebview: + """Returns a specified `Connect Webview `_. + + Unless you're using a ``custom_redirect_url``, you should poll a newly-created ``connect_webview`` to find out if the user has signed in or to get details about what devices they've connected. + + :param connect_webview_id: ID of the Connect Webview that you want to get. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: @@ -123,6 +220,21 @@ def list( search: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> 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 customer_key: Customer key for which you want to list connect webviews. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using ``connect_webview_id``, ``accepted_providers``, ``custom_metadata``, or ``customer_key``. + + :param user_identifier_key: Your user ID for the user by which you want to filter Connect Webviews. + + :returns: OK""" json_payload = {} if custom_metadata_has is not None: diff --git a/seam/routes/connected_accounts.py b/seam/routes/connected_accounts.py index 902cdfb..bcc979f 100644 --- a/seam/routes/connected_accounts.py +++ b/seam/routes/connected_accounts.py @@ -17,12 +17,27 @@ def simulate(self) -> AbstractConnectedAccountsSimulate: @abc.abstractmethod def delete(self, *, connected_account_id: str) -> None: + """Deletes a specified `connected account `_. + + Deleting a connected account triggers a ``connected_account.deleted`` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. + + For example, if you delete a connected account with a device that has an access code, Seam sends a ``connected_account.deleted`` event, a ``device.deleted`` event, and an ``access_code.deleted`` event, but Seam does not remove the access code from the device. + + :param connected_account_id: ID of the connected account that you want to delete. + """ raise NotImplementedError() @abc.abstractmethod def get( self, *, connected_account_id: Optional[str] = None, email: Optional[str] = None ) -> ConnectedAccount: + """Returns a specified `connected account `_. + + :param connected_account_id: ID of the connected account that you want to get. + + :param email: Email address associated with the connected account that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -37,10 +52,31 @@ def list( space_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> 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 customer_key: Customer key by which you want to filter connected accounts. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using ``connected_account_id``, ``account_type``, ``customer_key``, ``custom_metadata``, ``user_identifier.username``, ``user_identifier.email`` or ``user_identifier.phone``. + + :param space_id: ID of the space by which you want to filter connected accounts. + + :param user_identifier_key: Your user ID for the user by which you want to filter connected accounts. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def sync(self, *, connected_account_id: str) -> None: + """Request a `connected account `_ sync attempt for the specified ``connected_account_id``. + + :param connected_account_id: ID of the connected account that you want to sync. + """ raise NotImplementedError() @abc.abstractmethod @@ -54,6 +90,20 @@ def update( customer_key: Optional[str] = None, display_name: Optional[str] = None ) -> None: + """Updates a `connected account `_. + + :param connected_account_id: ID of the connected account that you want to update. + + :param accepted_capabilities: List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are ``lock``, ``thermostat``, ``noise_sensor``, and ``access_control``. + + :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 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. + + :param display_name: Human-readable name for the connected account, shown in the dashboard. For example, ``Booking from Airbnb House 1``. + """ raise NotImplementedError() @@ -68,6 +118,14 @@ def simulate(self) -> ConnectedAccountsSimulate: return self._simulate def delete(self, *, connected_account_id: str) -> None: + """Deletes a specified `connected account `_. + + Deleting a connected account triggers a ``connected_account.deleted`` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider. + + For example, if you delete a connected account with a device that has an access code, Seam sends a ``connected_account.deleted`` event, a ``device.deleted`` event, and an ``access_code.deleted`` event, but Seam does not remove the access code from the device. + + :param connected_account_id: ID of the connected account that you want to delete. + """ json_payload = {} if connected_account_id is not None: @@ -80,6 +138,13 @@ def delete(self, *, connected_account_id: str) -> None: def get( self, *, connected_account_id: Optional[str] = None, email: Optional[str] = None ) -> ConnectedAccount: + """Returns a specified `connected account `_. + + :param connected_account_id: ID of the connected account that you want to get. + + :param email: Email address associated with the connected account that you want to get. + + :returns: OK""" json_payload = {} if connected_account_id is not None: @@ -102,6 +167,23 @@ def list( space_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> 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 customer_key: Customer key by which you want to filter connected accounts. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using ``connected_account_id``, ``account_type``, ``customer_key``, ``custom_metadata``, ``user_identifier.username``, ``user_identifier.email`` or ``user_identifier.phone``. + + :param space_id: ID of the space by which you want to filter connected accounts. + + :param user_identifier_key: Your user ID for the user by which you want to filter connected accounts. + + :returns: OK""" json_payload = {} if custom_metadata_has is not None: @@ -124,6 +206,10 @@ def list( return [ConnectedAccount.from_dict(item) for item in res["connected_accounts"]] def sync(self, *, connected_account_id: str) -> None: + """Request a `connected account `_ sync attempt for the specified ``connected_account_id``. + + :param connected_account_id: ID of the connected account that you want to sync. + """ json_payload = {} if connected_account_id is not None: @@ -143,6 +229,20 @@ def update( customer_key: Optional[str] = None, display_name: Optional[str] = None ) -> None: + """Updates a `connected account `_. + + :param connected_account_id: ID of the connected account that you want to update. + + :param accepted_capabilities: List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are ``lock``, ``thermostat``, ``noise_sensor``, and ``access_control``. + + :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 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. + + :param display_name: Human-readable name for the connected account, shown in the dashboard. For example, ``Booking from Airbnb House 1``. + """ json_payload = {} if connected_account_id is not None: diff --git a/seam/routes/connected_accounts_simulate.py b/seam/routes/connected_accounts_simulate.py index 9b797da..3766b03 100644 --- a/seam/routes/connected_accounts_simulate.py +++ b/seam/routes/connected_accounts_simulate.py @@ -7,6 +7,10 @@ class AbstractConnectedAccountsSimulate(abc.ABC): @abc.abstractmethod def disconnect(self, *, connected_account_id: str) -> None: + """Simulates a connected account becoming disconnected from Seam. Only applicable for `sandbox workspaces `_. + + :param connected_account_id: ID of the connected account you want to simulate as disconnected. + """ raise NotImplementedError() @@ -16,6 +20,10 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def disconnect(self, *, connected_account_id: str) -> None: + """Simulates a connected account becoming disconnected from Seam. Only applicable for `sandbox workspaces `_. + + :param connected_account_id: ID of the connected account you want to simulate as disconnected. + """ json_payload = {} if connected_account_id is not None: diff --git a/seam/routes/customers.py b/seam/routes/customers.py index 2b9d0c0..bdbf4f5 100644 --- a/seam/routes/customers.py +++ b/seam/routes/customers.py @@ -22,6 +22,31 @@ def create_portal( 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_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. + + :param deep_link: Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource. + + :param exclude_locale_picker: Whether to exclude the option to select a locale within the portal UI. + + :param features: + + :param is_embedded: Whether the portal is embedded in another application. + + :param landing_page: Configuration for the landing page when the portal loads. + + :param locale: The locale to use for the portal. + + :param navigation_mode: Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. + + :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() @abc.abstractmethod @@ -48,6 +73,46 @@ def delete_data( user_identity_keys: Optional[List[str]] = None, user_keys: Optional[List[str]] = None ) -> None: + """Deletes customer data including resources like spaces, properties, rooms, users, etc. + This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). + + :param access_grant_keys: List of access grant keys to delete. + + :param booking_keys: List of booking keys to delete. + + :param building_keys: List of building keys to delete. + + :param common_area_keys: List of common area keys to delete. + + :param customer_keys: List of customer keys to delete all data for. + + :param facility_keys: List of facility keys to delete. + + :param guest_keys: List of guest keys to delete. + + :param listing_keys: List of listing keys to delete. + + :param property_keys: List of property keys to delete. + + :param property_listing_keys: List of property listing keys to delete. + + :param reservation_keys: List of reservation keys to delete. + + :param resident_keys: List of resident keys to delete. + + :param room_keys: List of room keys to delete. + + :param space_keys: List of space keys to delete. + + :param staff_member_keys: List of staff member keys to delete. + + :param tenant_keys: List of tenant keys to delete. + + :param unit_keys: List of unit keys to delete. + + :param user_identity_keys: List of user identity keys to delete. + + :param user_keys: List of user keys to delete.""" raise NotImplementedError() @abc.abstractmethod @@ -75,6 +140,47 @@ def push_data( user_identities: Optional[List[Dict[str, Any]]] = None, users: Optional[List[Dict[str, Any]]] = None ) -> None: + """Pushes customer data including resources like spaces, properties, rooms, users, etc. + + :param customer_key: Your unique identifier for the customer. + + :param access_grants: List of access grants. + + :param bookings: List of bookings. + + :param buildings: List of buildings. + + :param common_areas: List of shared common areas. + + :param facilities: List of gym or fitness facilities. + + :param guests: List of guests. + + :param listings: List of property listings. + + :param properties: List of short-term rental properties. + + :param property_listings: List of property listings. + + :param reservations: List of reservations. + + :param residents: List of residents. + + :param rooms: List of hotel or hospitality rooms. + + :param sites: List of general sites or areas. + + :param spaces: List of general spaces or areas. + + :param staff_members: List of staff members. + + :param tenants: List of tenants. + + :param units: List of multi-family residential units. + + :param user_identities: List of user identities. + + :param users: List of users.""" raise NotImplementedError() @@ -98,6 +204,31 @@ def create_portal( 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_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. + + :param deep_link: Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource. + + :param exclude_locale_picker: Whether to exclude the option to select a locale within the portal UI. + + :param features: + + :param is_embedded: Whether the portal is embedded in another application. + + :param landing_page: Configuration for the landing page when the portal loads. + + :param locale: The locale to use for the portal. + + :param navigation_mode: Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links. + + :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 = {} if customer_resources_filters is not None: @@ -150,6 +281,46 @@ def delete_data( user_identity_keys: Optional[List[str]] = None, user_keys: Optional[List[str]] = None ) -> None: + """Deletes customer data including resources like spaces, properties, rooms, users, etc. + This will delete the partner resources and any related Seam resources (user identities, access grants, spaces). + + :param access_grant_keys: List of access grant keys to delete. + + :param booking_keys: List of booking keys to delete. + + :param building_keys: List of building keys to delete. + + :param common_area_keys: List of common area keys to delete. + + :param customer_keys: List of customer keys to delete all data for. + + :param facility_keys: List of facility keys to delete. + + :param guest_keys: List of guest keys to delete. + + :param listing_keys: List of listing keys to delete. + + :param property_keys: List of property keys to delete. + + :param property_listing_keys: List of property listing keys to delete. + + :param reservation_keys: List of reservation keys to delete. + + :param resident_keys: List of resident keys to delete. + + :param room_keys: List of room keys to delete. + + :param space_keys: List of space keys to delete. + + :param staff_member_keys: List of staff member keys to delete. + + :param tenant_keys: List of tenant keys to delete. + + :param unit_keys: List of unit keys to delete. + + :param user_identity_keys: List of user identity keys to delete. + + :param user_keys: List of user keys to delete.""" json_payload = {} if access_grant_keys is not None: @@ -219,6 +390,47 @@ def push_data( user_identities: Optional[List[Dict[str, Any]]] = None, users: Optional[List[Dict[str, Any]]] = None ) -> None: + """Pushes customer data including resources like spaces, properties, rooms, users, etc. + + :param customer_key: Your unique identifier for the customer. + + :param access_grants: List of access grants. + + :param bookings: List of bookings. + + :param buildings: List of buildings. + + :param common_areas: List of shared common areas. + + :param facilities: List of gym or fitness facilities. + + :param guests: List of guests. + + :param listings: List of property listings. + + :param properties: List of short-term rental properties. + + :param property_listings: List of property listings. + + :param reservations: List of reservations. + + :param residents: List of residents. + + :param rooms: List of hotel or hospitality rooms. + + :param sites: List of general sites or areas. + + :param spaces: List of general spaces or areas. + + :param staff_members: List of staff members. + + :param tenants: List of tenants. + + :param units: List of multi-family residential units. + + :param user_identities: List of user identities. + + :param users: List of users.""" json_payload = {} if customer_key is not None: diff --git a/seam/routes/devices.py b/seam/routes/devices.py index 4d93a11..433a8d4 100644 --- a/seam/routes/devices.py +++ b/seam/routes/devices.py @@ -22,6 +22,15 @@ def unmanaged(self) -> AbstractDevicesUnmanaged: def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> Device: + """Returns a specified `device `_. + + You must specify either ``device_id`` or ``name``. + + :param device_id: ID of the device that you want to get. + + :param name: Name of the device that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -45,16 +54,63 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `devices `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type for which you want to list devices. + + :param device_types: Array of device types for which you want to list devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer for which you want to list devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_device_providers( self, *, provider_category: Optional[str] = None ) -> List[DeviceProvider]: + """Returns a list of all device providers. + + The information that this endpoint returns for each provider includes a set of `capability flags `_, such as ``device_provider.can_remotely_unlock``. If at least one supported device from a provider has a specific capability, the corresponding capability flag is ``true``. + + When you create a `Connect Webview `_, you can customize the providers—that is, the brands—that it displays. In the ``/connect_webviews/create`` request, include the desired set of device provider keys in the ``accepted_providers`` parameter. See also `Customize the Brands to Display in Your Connect Webviews `_. + + :param provider_category: Category for which you want to list providers. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def report_provider_metadata(self, *, devices: List[Dict[str, Any]]) -> None: + """Updates provider-specific metadata for devices. + + :param devices: Array of devices with provider metadata to update""" raise NotImplementedError() @abc.abstractmethod @@ -68,6 +124,21 @@ def update( name: Optional[str] = None, properties: Optional[Dict[str, Any]] = None ) -> None: + """Updates a specified `device `_. + + You can add or change `custom metadata `_ for a device, change the device's name, or `convert a managed device to unmanaged `_. + + :param device_id: ID of the device that you want to 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 is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. + + :param name: Name for the device. + + :param properties:""" raise NotImplementedError() @@ -89,6 +160,15 @@ def unmanaged(self) -> DevicesUnmanaged: def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> Device: + """Returns a specified `device `_. + + You must specify either ``device_id`` or ``name``. + + :param device_id: ID of the device that you want to get. + + :param name: Name of the device that you want to get. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -120,6 +200,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `devices `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type for which you want to list devices. + + :param device_types: Array of device types for which you want to list devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer for which you want to list devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: @@ -162,6 +277,15 @@ def list( def list_device_providers( self, *, provider_category: Optional[str] = None ) -> List[DeviceProvider]: + """Returns a list of all device providers. + + The information that this endpoint returns for each provider includes a set of `capability flags `_, such as ``device_provider.can_remotely_unlock``. If at least one supported device from a provider has a specific capability, the corresponding capability flag is ``true``. + + When you create a `Connect Webview `_, you can customize the providers—that is, the brands—that it displays. In the ``/connect_webviews/create`` request, include the desired set of device provider keys in the ``accepted_providers`` parameter. See also `Customize the Brands to Display in Your Connect Webviews `_. + + :param provider_category: Category for which you want to list providers. + + :returns: OK""" json_payload = {} if provider_category is not None: @@ -172,6 +296,9 @@ def list_device_providers( return [DeviceProvider.from_dict(item) for item in res["device_providers"]] def report_provider_metadata(self, *, devices: List[Dict[str, Any]]) -> None: + """Updates provider-specific metadata for devices. + + :param devices: Array of devices with provider metadata to update""" json_payload = {} if devices is not None: @@ -191,6 +318,21 @@ def update( name: Optional[str] = None, properties: Optional[Dict[str, Any]] = None ) -> None: + """Updates a specified `device `_. + + You can add or change `custom metadata `_ for a device, change the device's name, or `convert a managed device to unmanaged `_. + + :param device_id: ID of the device that you want to 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 is_managed: Indicates whether the device is managed. To unmanage a device, set ``is_managed`` to ``false``. + + :param name: Name for the device. + + :param properties:""" json_payload = {} if device_id is not None: diff --git a/seam/routes/devices_simulate.py b/seam/routes/devices_simulate.py index ca95994..2ebaa23 100644 --- a/seam/routes/devices_simulate.py +++ b/seam/routes/devices_simulate.py @@ -7,26 +7,58 @@ class AbstractDevicesSimulate(abc.ABC): @abc.abstractmethod def connect(self, *, device_id: str) -> None: + """Simulates connecting a device to Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate connecting to Seam. + """ raise NotImplementedError() @abc.abstractmethod def connect_to_hub(self, *, device_id: str) -> None: + """Simulates bringing the Wi‑Fi hub (bridge) back online for a device. + Only applicable for sandbox workspaces and currently + implemented for August and TTLock locks. + This will clear the ``hub_disconnected`` error on the device. + + :param device_id: ID of the device whose hub you want to reconnect.""" raise NotImplementedError() @abc.abstractmethod def disconnect(self, *, device_id: str) -> None: + """Simulates disconnecting a device from Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate disconnecting from Seam. + """ raise NotImplementedError() @abc.abstractmethod def disconnect_from_hub(self, *, device_id: str) -> None: + """Simulates taking the Wi‑Fi hub (bridge) offline for a device. + Only applicable for sandbox workspaces and currently + implemented for August, TTLock, and IglooHome devices. + This will set the ``hub_disconnected`` error on the device, or mark the + IglooHome bridge offline in sandbox. + + :param device_id: ID of the device whose hub you want to disconnect.""" raise NotImplementedError() @abc.abstractmethod def paid_subscription(self, *, device_id: str, is_expired: bool) -> None: + """Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). + Send ``is_expired: true`` to simulate an expired subscription, or ``false`` to simulate an active subscription. + The actual device error is created/cleared by the poller after this state change. + + :param device_id: + + :param is_expired:""" raise NotImplementedError() @abc.abstractmethod def remove(self, *, device_id: str) -> None: + """Simulates removing a device from Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate removing from Seam. + """ raise NotImplementedError() @@ -36,6 +68,10 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def connect(self, *, device_id: str) -> None: + """Simulates connecting a device to Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate connecting to Seam. + """ json_payload = {} if device_id is not None: @@ -46,6 +82,12 @@ def connect(self, *, device_id: str) -> None: return None def connect_to_hub(self, *, device_id: str) -> None: + """Simulates bringing the Wi‑Fi hub (bridge) back online for a device. + Only applicable for sandbox workspaces and currently + implemented for August and TTLock locks. + This will clear the ``hub_disconnected`` error on the device. + + :param device_id: ID of the device whose hub you want to reconnect.""" json_payload = {} if device_id is not None: @@ -56,6 +98,10 @@ def connect_to_hub(self, *, device_id: str) -> None: return None def disconnect(self, *, device_id: str) -> None: + """Simulates disconnecting a device from Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate disconnecting from Seam. + """ json_payload = {} if device_id is not None: @@ -66,6 +112,13 @@ def disconnect(self, *, device_id: str) -> None: return None def disconnect_from_hub(self, *, device_id: str) -> None: + """Simulates taking the Wi‑Fi hub (bridge) offline for a device. + Only applicable for sandbox workspaces and currently + implemented for August, TTLock, and IglooHome devices. + This will set the ``hub_disconnected`` error on the device, or mark the + IglooHome bridge offline in sandbox. + + :param device_id: ID of the device whose hub you want to disconnect.""" json_payload = {} if device_id is not None: @@ -76,6 +129,13 @@ def disconnect_from_hub(self, *, device_id: str) -> None: return None def paid_subscription(self, *, device_id: str, is_expired: bool) -> None: + """Toggle the simulated Nuki Smart Hosting subscription for a device (sandbox only). + Send ``is_expired: true`` to simulate an expired subscription, or ``false`` to simulate an active subscription. + The actual device error is created/cleared by the poller after this state change. + + :param device_id: + + :param is_expired:""" json_payload = {} if device_id is not None: @@ -88,6 +148,10 @@ def paid_subscription(self, *, device_id: str, is_expired: bool) -> None: return None def remove(self, *, device_id: str) -> None: + """Simulates removing a device from Seam. Only applicable for `sandbox devices `_. See also `Testing Your App Against Device Disconnection and Removal `_. + + :param device_id: ID of the device that you want to simulate removing from Seam. + """ json_payload = {} if device_id is not None: diff --git a/seam/routes/devices_unmanaged.py b/seam/routes/devices_unmanaged.py index efee558..9c0e865 100644 --- a/seam/routes/devices_unmanaged.py +++ b/seam/routes/devices_unmanaged.py @@ -10,6 +10,17 @@ class AbstractDevicesUnmanaged(abc.ABC): def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> UnmanagedDevice: + """Returns a specified `unmanaged device `_. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + You must specify either ``device_id`` or ``name``. + + :param device_id: ID of the unmanaged device that you want to get. + + :param name: Name of the unmanaged device that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -33,6 +44,43 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[UnmanagedDevice]: + """Returns a list of all `unmanaged devices `_. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type for which you want to list devices. + + :param device_types: Array of device types for which you want to list devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer for which you want to list devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -43,6 +91,16 @@ def update( custom_metadata: Optional[Dict[str, Any]] = None, is_managed: Optional[bool] = None ) -> None: + """Updates a specified `unmanaged device `_. To convert an unmanaged device to managed, set ``is_managed`` to ``true``. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :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 is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. + """ raise NotImplementedError() @@ -54,6 +112,17 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> UnmanagedDevice: + """Returns a specified `unmanaged device `_. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + You must specify either ``device_id`` or ``name``. + + :param device_id: ID of the unmanaged device that you want to get. + + :param name: Name of the unmanaged device that you want to get. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -85,6 +154,43 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[UnmanagedDevice]: + """Returns a list of all `unmanaged devices `_. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type for which you want to list devices. + + :param device_types: Array of device types for which you want to list devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer for which you want to list devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: @@ -131,6 +237,16 @@ def update( custom_metadata: Optional[Dict[str, Any]] = None, is_managed: Optional[bool] = None ) -> None: + """Updates a specified `unmanaged device `_. To convert an unmanaged device to managed, set ``is_managed`` to ``true``. + + An unmanaged device has a limited set of visible properties and a subset of supported events. You cannot control an unmanaged device. Any `access codes `_ on an unmanaged device are unmanaged. To control an unmanaged device with Seam, `convert it to a managed device `_. + + :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 is_managed: Indicates whether the device is managed. Set this parameter to ``true`` to convert an unmanaged device to managed. + """ json_payload = {} if device_id is not None: diff --git a/seam/routes/events.py b/seam/routes/events.py index cb35257..30ce08e 100644 --- a/seam/routes/events.py +++ b/seam/routes/events.py @@ -14,6 +14,15 @@ def get( device_id: Optional[str] = None, event_type: Optional[str] = None ) -> SeamEvent: + """Returns a specified event. This endpoint returns the same event that would be sent to a `webhook `_, but it enables you to retrieve an event that already took place. + + :param event_id: Unique identifier for the event that you want to get. + + :param device_id: Unique identifier for the device that triggered the event that you want to get. + + :param event_type: Type of the event that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -49,6 +58,65 @@ def list( unstable_offset: Optional[float] = None, user_identity_id: Optional[str] = None ) -> List[SeamEvent]: + """Returns a list of all events. This endpoint returns the same events that would be sent to a `webhook `_, but it enables you to filter or see events that already took place. + + :param access_code_id: ID of the access code for which you want to list events. + + :param access_code_ids: IDs of the access codes for which you want to list events. + + :param access_grant_id: ID of the access grant for which you want to list events. + + :param access_grant_ids: IDs of the access grants for which you want to list events. + + :param access_method_id: ID of the access method for which you want to list events. + + :param access_method_ids: IDs of the access methods for which you want to list events. + + :param acs_access_group_id: ID of the ACS access group for which you want to list events. + + :param acs_credential_id: ID of the ACS credential for which you want to list events. + + :param acs_encoder_id: ID of the ACS encoder for which you want to list events. + + :param acs_entrance_id: ID of the ACS entrance for which you want to list events. + + :param acs_system_id: ID of the access system for which you want to list events. + + :param acs_system_ids: IDs of the access systems for which you want to list events. + + :param acs_user_id: ID of the ACS user for which you want to list events. + + :param between: Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include ``since`` or ``between``. + + :param connect_webview_id: ID of the Connect Webview for which you want to list events. + + :param connected_account_id: ID of the connected account for which you want to list events. + + :param customer_key: Customer key for which you want to list events. + + :param device_id: ID of the device for which you want to list events. + + :param device_ids: IDs of the devices for which you want to list events. + + :param event_ids: IDs of the events that you want to list. + + :param event_type: Type of the events that you want to list. + + :param event_types: Types of the events that you want to list. + + :param limit: Numerical limit on the number of events to return. + + :param since: Timestamp to indicate the beginning generation time for the events that you want to list. You must include ``since`` or ``between``. + + :param space_id: ID of the space for which you want to list events. + + :param space_ids: IDs of the spaces for which you want to list events. + + :param unstable_offset: Offset for the events that you want to list. + + :param user_identity_id: ID of the user identity for which you want to list events. + + :returns: OK""" raise NotImplementedError() @@ -64,6 +132,15 @@ def get( device_id: Optional[str] = None, event_type: Optional[str] = None ) -> SeamEvent: + """Returns a specified event. This endpoint returns the same event that would be sent to a `webhook `_, but it enables you to retrieve an event that already took place. + + :param event_id: Unique identifier for the event that you want to get. + + :param device_id: Unique identifier for the device that triggered the event that you want to get. + + :param event_type: Type of the event that you want to get. + + :returns: OK""" json_payload = {} if event_id is not None: @@ -109,6 +186,65 @@ def list( unstable_offset: Optional[float] = None, user_identity_id: Optional[str] = None ) -> List[SeamEvent]: + """Returns a list of all events. This endpoint returns the same events that would be sent to a `webhook `_, but it enables you to filter or see events that already took place. + + :param access_code_id: ID of the access code for which you want to list events. + + :param access_code_ids: IDs of the access codes for which you want to list events. + + :param access_grant_id: ID of the access grant for which you want to list events. + + :param access_grant_ids: IDs of the access grants for which you want to list events. + + :param access_method_id: ID of the access method for which you want to list events. + + :param access_method_ids: IDs of the access methods for which you want to list events. + + :param acs_access_group_id: ID of the ACS access group for which you want to list events. + + :param acs_credential_id: ID of the ACS credential for which you want to list events. + + :param acs_encoder_id: ID of the ACS encoder for which you want to list events. + + :param acs_entrance_id: ID of the ACS entrance for which you want to list events. + + :param acs_system_id: ID of the access system for which you want to list events. + + :param acs_system_ids: IDs of the access systems for which you want to list events. + + :param acs_user_id: ID of the ACS user for which you want to list events. + + :param between: Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include ``since`` or ``between``. + + :param connect_webview_id: ID of the Connect Webview for which you want to list events. + + :param connected_account_id: ID of the connected account for which you want to list events. + + :param customer_key: Customer key for which you want to list events. + + :param device_id: ID of the device for which you want to list events. + + :param device_ids: IDs of the devices for which you want to list events. + + :param event_ids: IDs of the events that you want to list. + + :param event_type: Type of the events that you want to list. + + :param event_types: Types of the events that you want to list. + + :param limit: Numerical limit on the number of events to return. + + :param since: Timestamp to indicate the beginning generation time for the events that you want to list. You must include ``since`` or ``between``. + + :param space_id: ID of the space for which you want to list events. + + :param space_ids: IDs of the spaces for which you want to list events. + + :param unstable_offset: Offset for the events that you want to list. + + :param user_identity_id: ID of the user identity for which you want to list events. + + :returns: OK""" json_payload = {} if access_code_id is not None: diff --git a/seam/routes/instant_keys.py b/seam/routes/instant_keys.py index e5ecaa8..b1c3bf2 100644 --- a/seam/routes/instant_keys.py +++ b/seam/routes/instant_keys.py @@ -8,6 +8,9 @@ class AbstractInstantKeys(abc.ABC): @abc.abstractmethod def delete(self, *, instant_key_id: str) -> None: + """Deletes a specified `Instant Key `_. + + :param instant_key_id: ID of the Instant Key that you want to delete.""" raise NotImplementedError() @abc.abstractmethod @@ -17,10 +20,22 @@ def get( instant_key_id: Optional[str] = None, instant_key_url: Optional[str] = None ) -> InstantKey: + """Gets an `instant key `_. + + :param instant_key_id: ID of the instant key to get. + + :param instant_key_url: URL of the instant key to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list(self, *, user_identity_id: Optional[str] = None) -> List[InstantKey]: + """Returns a list of all `instant keys `_. + + :param user_identity_id: ID of the user identity by which you want to filter the list of Instant Keys. + + :returns: OK""" raise NotImplementedError() @@ -30,6 +45,9 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def delete(self, *, instant_key_id: str) -> None: + """Deletes a specified `Instant Key `_. + + :param instant_key_id: ID of the Instant Key that you want to delete.""" json_payload = {} if instant_key_id is not None: @@ -45,6 +63,13 @@ def get( instant_key_id: Optional[str] = None, instant_key_url: Optional[str] = None ) -> InstantKey: + """Gets an `instant key `_. + + :param instant_key_id: ID of the instant key to get. + + :param instant_key_url: URL of the instant key to get. + + :returns: OK""" json_payload = {} if instant_key_id is not None: @@ -57,6 +82,11 @@ def get( return InstantKey.from_dict(res["instant_key"]) def list(self, *, user_identity_id: Optional[str] = None) -> List[InstantKey]: + """Returns a list of all `instant keys `_. + + :param user_identity_id: ID of the user identity by which you want to filter the list of Instant Keys. + + :returns: OK""" json_payload = {} if user_identity_id is not None: diff --git a/seam/routes/locks.py b/seam/routes/locks.py index c8ba40c..23a41b0 100644 --- a/seam/routes/locks.py +++ b/seam/routes/locks.py @@ -22,12 +22,33 @@ def configure_auto_lock( auto_lock_delay_seconds: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Configures the auto-lock setting for a specified `lock `_. + + :param auto_lock_enabled: Whether to enable or disable auto-lock. + + :param device_id: ID of the lock for which you want to configure the auto-lock. + + :param auto_lock_delay_seconds: Delay in seconds before the lock automatically locks. Required when enabling auto-lock. Must be between 1 and 60. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> Device: + """Returns a specified `lock `_. + + :param device_id: ID of the lock that you want to get. + + :param name: Name of the lock that you want to get. + + :returns: OK + + .. deprecated:: + Use ``/devices/get`` instead.""" raise NotImplementedError() @abc.abstractmethod @@ -51,6 +72,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `locks `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type of the locks that you want to list. + + :param device_types: Device types of the locks that you want to list. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer of the locks that you want to list. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -60,6 +116,13 @@ def lock_door( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Locks a `lock `_. See also `Locking and Unlocking Smart Locks `_. + + :param device_id: ID of the lock that you want to lock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -69,6 +132,13 @@ def unlock_door( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Unlocks a `lock `_. See also `Locking and Unlocking Smart Locks `_. + + :param device_id: ID of the lock that you want to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -90,6 +160,17 @@ def configure_auto_lock( auto_lock_delay_seconds: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Configures the auto-lock setting for a specified `lock `_. + + :param auto_lock_enabled: Whether to enable or disable auto-lock. + + :param device_id: ID of the lock for which you want to configure the auto-lock. + + :param auto_lock_delay_seconds: Delay in seconds before the lock automatically locks. Required when enabling auto-lock. Must be between 1 and 60. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if auto_lock_enabled is not None: @@ -116,6 +197,16 @@ def configure_auto_lock( def get( self, *, device_id: Optional[str] = None, name: Optional[str] = None ) -> Device: + """Returns a specified `lock `_. + + :param device_id: ID of the lock that you want to get. + + :param name: Name of the lock that you want to get. + + :returns: OK + + .. deprecated:: + Use ``/devices/get`` instead.""" json_payload = {} if device_id is not None: @@ -147,6 +238,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `locks `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type of the locks that you want to list. + + :param device_types: Device types of the locks that you want to list. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer of the locks that you want to list. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: @@ -192,6 +318,13 @@ def lock_door( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Locks a `lock `_. See also `Locking and Unlocking Smart Locks `_. + + :param device_id: ID of the lock that you want to lock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -217,6 +350,13 @@ def unlock_door( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Unlocks a `lock `_. See also `Locking and Unlocking Smart Locks `_. + + :param device_id: ID of the lock that you want to unlock. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: diff --git a/seam/routes/locks_simulate.py b/seam/routes/locks_simulate.py index 6eeb24b..937cb37 100644 --- a/seam/routes/locks_simulate.py +++ b/seam/routes/locks_simulate.py @@ -15,6 +15,15 @@ def keypad_code_entry( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Simulates the entry of a code on a keypad. You can only perform this action for `August `_ devices within `sandbox workspaces `_. + + :param code: Code that you want to simulate entering on a keypad. + + :param device_id: ID of the device for which you want to simulate a keypad code entry. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -24,6 +33,13 @@ def manual_lock_via_keypad( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Simulates a manual lock action using a keypad. You can only perform this action for `August `_ devices within `sandbox workspaces `_. + + :param device_id: ID of the device for which you want to simulate a manual lock action using a keypad. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -39,6 +55,15 @@ def keypad_code_entry( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Simulates the entry of a code on a keypad. You can only perform this action for `August `_ devices within `sandbox workspaces `_. + + :param code: Code that you want to simulate entering on a keypad. + + :param device_id: ID of the device for which you want to simulate a keypad code entry. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if code is not None: @@ -66,6 +91,13 @@ def manual_lock_via_keypad( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Simulates a manual lock action using a keypad. You can only perform this action for `August `_ devices within `sandbox workspaces `_. + + :param device_id: ID of the device for which you want to simulate a manual lock action using a keypad. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: diff --git a/seam/routes/noise_sensors.py b/seam/routes/noise_sensors.py index ef307b9..efd90f4 100644 --- a/seam/routes/noise_sensors.py +++ b/seam/routes/noise_sensors.py @@ -42,6 +42,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `noise sensors `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type of the noise sensors that you want to list. + + :param device_types: Device types of the noise sensors that you want to list. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturers of the noise sensors that you want to list. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" raise NotImplementedError() @@ -82,6 +117,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `noise sensors `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type of the noise sensors that you want to list. + + :param device_types: Device types of the noise sensors that you want to list. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturers of the noise sensors that you want to list. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: diff --git a/seam/routes/noise_sensors_noise_thresholds.py b/seam/routes/noise_sensors_noise_thresholds.py index 034300a..8c5c9f0 100644 --- a/seam/routes/noise_sensors_noise_thresholds.py +++ b/seam/routes/noise_sensors_noise_thresholds.py @@ -17,18 +17,48 @@ def create( noise_threshold_decibels: Optional[float] = None, noise_threshold_nrs: Optional[float] = None ) -> NoiseThreshold: + """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + + :param device_id: ID of the device for which you want to create a noise threshold. + + :param ends_daily_at: Time at which the new noise threshold should become inactive daily. + + :param starts_daily_at: Time at which the new noise threshold should become active daily. + + :param name: Name of the new noise threshold. + + :param noise_threshold_decibels: Noise level in decibels for the new noise threshold. + + :param noise_threshold_nrs: Noise level in Noiseaware Noise Risk Score (NRS) for the new noise threshold. This parameter is only relevant for `Noiseaware sensors `_. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, device_id: str, noise_threshold_id: str) -> None: + """Deletes a `noise threshold `_ from a `noise sensor `_. + + :param device_id: ID of the device that contains the noise threshold that you want to delete. + + :param noise_threshold_id: ID of the noise threshold that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, noise_threshold_id: str) -> NoiseThreshold: + """Returns a specified `noise threshold `_ for a `noise sensor `_. + + :param noise_threshold_id: ID of the noise threshold that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list(self, *, device_id: str) -> List[NoiseThreshold]: + """Returns a list of all `noise thresholds `_ for a `noise sensor `_. + + :param device_id: ID of the device for which you want to list noise thresholds. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -43,6 +73,22 @@ def update( noise_threshold_nrs: Optional[float] = None, starts_daily_at: Optional[str] = None ) -> None: + """Updates a `noise threshold `_ for a `noise sensor `_. + + :param device_id: ID of the device that contains the noise threshold that you want to update. + + :param noise_threshold_id: ID of the noise threshold that you want to update. + + :param ends_daily_at: Time at which the noise threshold should become inactive daily. + + :param name: Name of the noise threshold that you want to update. + + :param noise_threshold_decibels: Noise level in decibels for the noise threshold. + + :param noise_threshold_nrs: Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for `Noiseaware sensors `_. + + :param starts_daily_at: Time at which the noise threshold should become active daily. + """ raise NotImplementedError() @@ -61,6 +107,21 @@ def create( noise_threshold_decibels: Optional[float] = None, noise_threshold_nrs: Optional[float] = None ) -> NoiseThreshold: + """Creates a new `noise threshold `_ for a `noise sensor `_. Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them. + + :param device_id: ID of the device for which you want to create a noise threshold. + + :param ends_daily_at: Time at which the new noise threshold should become inactive daily. + + :param starts_daily_at: Time at which the new noise threshold should become active daily. + + :param name: Name of the new noise threshold. + + :param noise_threshold_decibels: Noise level in decibels for the new noise threshold. + + :param noise_threshold_nrs: Noise level in Noiseaware Noise Risk Score (NRS) for the new noise threshold. This parameter is only relevant for `Noiseaware sensors `_. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -83,6 +144,11 @@ def create( return NoiseThreshold.from_dict(res["noise_threshold"]) def delete(self, *, device_id: str, noise_threshold_id: str) -> None: + """Deletes a `noise threshold `_ from a `noise sensor `_. + + :param device_id: ID of the device that contains the noise threshold that you want to delete. + + :param noise_threshold_id: ID of the noise threshold that you want to delete.""" json_payload = {} if device_id is not None: @@ -95,6 +161,11 @@ def delete(self, *, device_id: str, noise_threshold_id: str) -> None: return None def get(self, *, noise_threshold_id: str) -> NoiseThreshold: + """Returns a specified `noise threshold `_ for a `noise sensor `_. + + :param noise_threshold_id: ID of the noise threshold that you want to get. + + :returns: OK""" json_payload = {} if noise_threshold_id is not None: @@ -105,6 +176,11 @@ def get(self, *, noise_threshold_id: str) -> NoiseThreshold: return NoiseThreshold.from_dict(res["noise_threshold"]) def list(self, *, device_id: str) -> List[NoiseThreshold]: + """Returns a list of all `noise thresholds `_ for a `noise sensor `_. + + :param device_id: ID of the device for which you want to list noise thresholds. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -127,6 +203,22 @@ def update( noise_threshold_nrs: Optional[float] = None, starts_daily_at: Optional[str] = None ) -> None: + """Updates a `noise threshold `_ for a `noise sensor `_. + + :param device_id: ID of the device that contains the noise threshold that you want to update. + + :param noise_threshold_id: ID of the noise threshold that you want to update. + + :param ends_daily_at: Time at which the noise threshold should become inactive daily. + + :param name: Name of the noise threshold that you want to update. + + :param noise_threshold_decibels: Noise level in decibels for the noise threshold. + + :param noise_threshold_nrs: Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for `Noiseaware sensors `_. + + :param starts_daily_at: Time at which the noise threshold should become active daily. + """ json_payload = {} if device_id is not None: diff --git a/seam/routes/noise_sensors_simulate.py b/seam/routes/noise_sensors_simulate.py index 2c1a2cf..1ce320f 100644 --- a/seam/routes/noise_sensors_simulate.py +++ b/seam/routes/noise_sensors_simulate.py @@ -7,6 +7,10 @@ class AbstractNoiseSensorsSimulate(abc.ABC): @abc.abstractmethod def trigger_noise_threshold(self, *, device_id: str) -> None: + """Simulates the triggering of a `noise threshold `_ for a `noise sensor `_ in a `sandbox workspace `_. + + :param device_id: ID of the device for which you want to simulate the triggering of a noise threshold. + """ raise NotImplementedError() @@ -16,6 +20,10 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def trigger_noise_threshold(self, *, device_id: str) -> None: + """Simulates the triggering of a `noise threshold `_ for a `noise sensor `_ in a `sandbox workspace `_. + + :param device_id: ID of the device for which you want to simulate the triggering of a noise threshold. + """ json_payload = {} if device_id is not None: diff --git a/seam/routes/phones.py b/seam/routes/phones.py index 6b1896a..2c19692 100644 --- a/seam/routes/phones.py +++ b/seam/routes/phones.py @@ -14,10 +14,18 @@ def simulate(self) -> AbstractPhonesSimulate: @abc.abstractmethod def deactivate(self, *, device_id: str) -> None: + """Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see `App User Lost Phone Process `_. + + :param device_id: Device ID of the phone that you want to deactivate.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, device_id: str) -> Phone: + """Returns a specified `phone `_. + + :param device_id: Device ID of the phone that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -27,6 +35,13 @@ def list( acs_credential_id: Optional[str] = None, owner_user_identity_id: Optional[str] = None ) -> List[Phone]: + """Returns a list of all `phones `_. To filter the list of returned phones by a specific owner user identity or credential, include the ``owner_user_identity_id`` or ``acs_credential_id``, respectively, in the request body. + + :param acs_credential_id: ID of the `credential `_ by which you want to filter the list of returned phones. + + :param owner_user_identity_id: ID of the user identity that represents the owner by which you want to filter the list of returned phones. + + :returns: OK""" raise NotImplementedError() @@ -41,6 +56,9 @@ def simulate(self) -> PhonesSimulate: return self._simulate def deactivate(self, *, device_id: str) -> None: + """Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see `App User Lost Phone Process `_. + + :param device_id: Device ID of the phone that you want to deactivate.""" json_payload = {} if device_id is not None: @@ -51,6 +69,11 @@ def deactivate(self, *, device_id: str) -> None: return None def get(self, *, device_id: str) -> Phone: + """Returns a specified `phone `_. + + :param device_id: Device ID of the phone that you want to get. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -66,6 +89,13 @@ def list( acs_credential_id: Optional[str] = None, owner_user_identity_id: Optional[str] = None ) -> List[Phone]: + """Returns a list of all `phones `_. To filter the list of returned phones by a specific owner user identity or credential, include the ``owner_user_identity_id`` or ``acs_credential_id``, respectively, in the request body. + + :param acs_credential_id: ID of the `credential `_ by which you want to filter the list of returned phones. + + :param owner_user_identity_id: ID of the user identity that represents the owner by which you want to filter the list of returned phones. + + :returns: OK""" json_payload = {} if acs_credential_id is not None: diff --git a/seam/routes/phones_simulate.py b/seam/routes/phones_simulate.py index e5b3871..3144dba 100644 --- a/seam/routes/phones_simulate.py +++ b/seam/routes/phones_simulate.py @@ -15,6 +15,17 @@ def create_sandbox_phone( custom_sdk_installation_id: Optional[str] = None, phone_metadata: Optional[Dict[str, Any]] = None ) -> Phone: + """Creates a new simulated phone in a `sandbox workspace `_. See also `Creating a Simulated Phone for a User Identity `_. + + :param user_identity_id: ID of the user identity that you want to associate with the simulated phone. + + :param assa_abloy_metadata: ASSA ABLOY metadata that you want to associate with the simulated phone. + + :param custom_sdk_installation_id: ID of the custom SDK installation that you want to use for the simulated phone. + + :param phone_metadata: Metadata that you want to associate with the simulated phone. + + :returns: OK""" raise NotImplementedError() @@ -31,6 +42,17 @@ def create_sandbox_phone( custom_sdk_installation_id: Optional[str] = None, phone_metadata: Optional[Dict[str, Any]] = None ) -> Phone: + """Creates a new simulated phone in a `sandbox workspace `_. See also `Creating a Simulated Phone for a User Identity `_. + + :param user_identity_id: ID of the user identity that you want to associate with the simulated phone. + + :param assa_abloy_metadata: ASSA ABLOY metadata that you want to associate with the simulated phone. + + :param custom_sdk_installation_id: ID of the custom SDK installation that you want to use for the simulated phone. + + :param phone_metadata: Metadata that you want to associate with the simulated phone. + + :returns: OK""" json_payload = {} if user_identity_id is not None: diff --git a/seam/routes/spaces.py b/seam/routes/spaces.py index 238f4ac..4ebb7ed 100644 --- a/seam/routes/spaces.py +++ b/seam/routes/spaces.py @@ -8,16 +8,32 @@ class AbstractSpaces(abc.ABC): @abc.abstractmethod def add_acs_entrances(self, *, acs_entrance_ids: List[str], space_id: str) -> None: + """Adds `entrances `_ to a specific space. + + :param acs_entrance_ids: IDs of the entrances that you want to add to the space. + + :param space_id: ID of the space to which you want to add entrances.""" raise NotImplementedError() @abc.abstractmethod def add_connected_account( self, *, connected_account_id: str, space_id: str ) -> None: + """Adds a `connected account `_ to a specific space. + + :param connected_account_id: ID of the connected account that you want to add to the space. + + :param space_id: ID of the space to which you want to add the connected account. + """ raise NotImplementedError() @abc.abstractmethod def add_devices(self, *, device_ids: List[str], space_id: str) -> None: + """Adds devices to a specific space. + + :param device_ids: IDs of the devices that you want to add to the space. + + :param space_id: ID of the space to which you want to add devices.""" raise NotImplementedError() @abc.abstractmethod @@ -32,16 +48,43 @@ def create( device_ids: Optional[List[str]] = None, space_key: Optional[str] = None ) -> Space: + """Creates a new space. + + :param name: Name of the space that you want to create. + + :param acs_entrance_ids: IDs of the entrances that you want to add to the new space. + + :param connected_account_ids: IDs of connected accounts to associate with the new space. Persisted on seam.location_third_party_account so the UI can show which provider account(s) a space came from. + + :param customer_data: Reservation/stay-related defaults for the space. + + :param customer_key: Customer key for which you want to create the space. + + :param device_ids: IDs of the devices that you want to add to the new space. + + :param space_key: Unique key for the space within the workspace. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, space_id: str) -> None: + """Deletes a space. + + :param space_id: ID of the space that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get( self, *, space_id: Optional[str] = None, space_key: Optional[str] = None ) -> Space: + """Gets a space. + + :param space_id: ID of the space that you want to get. + + :param space_key: Unique key of the space that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -53,6 +96,17 @@ def get_related( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Spaces. + + :param exclude: + + :param include: + + :param space_ids: IDs of the spaces that you want to get along with their related resources. + + :param space_keys: Keys of the spaces that you want to get along with their related resources. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -65,22 +119,51 @@ def list( search: Optional[str] = None, space_key: Optional[str] = None ) -> List[Space]: + """Returns a list of all spaces. + + :param customer_key: Customer key for which you want to list spaces. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned spaces to include all records that satisfy a partial match using ``name``, ``space_key``, or ``customer_key``. + + :param space_key: Filter spaces by space_key. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def remove_acs_entrances( self, *, acs_entrance_ids: List[str], space_id: str ) -> None: + """Removes `entrances `_ from a specific space. + + :param acs_entrance_ids: IDs of the entrances that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove entrances.""" raise NotImplementedError() @abc.abstractmethod def remove_connected_account( self, *, connected_account_id: str, space_id: str ) -> None: + """Removes a `connected account `_ from a specific space. + + :param connected_account_id: ID of the connected account that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove the connected account. + """ raise NotImplementedError() @abc.abstractmethod def remove_devices(self, *, device_ids: List[str], space_id: str) -> None: + """Removes devices from a specific space. + + :param device_ids: IDs of the devices that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove devices.""" raise NotImplementedError() @abc.abstractmethod @@ -94,6 +177,21 @@ def update( space_id: Optional[str] = None, space_key: Optional[str] = None ) -> Space: + """Updates an existing space. + + :param acs_entrance_ids: IDs of the entrances that you want to set for the space. If specified, this will replace all existing entrances. + + :param customer_data: Reservation/stay-related defaults for the space. Only the keys you provide are updated; omit a key to leave it unchanged. Pass null on a key to clear it. + + :param device_ids: IDs of the devices that you want to set for the space. If specified, this will replace all existing devices. + + :param name: Name of the space. + + :param space_id: ID of the space that you want to update. + + :param space_key: Unique key of the space that you want to update. + + :returns: OK""" raise NotImplementedError() @@ -103,6 +201,11 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def add_acs_entrances(self, *, acs_entrance_ids: List[str], space_id: str) -> None: + """Adds `entrances `_ to a specific space. + + :param acs_entrance_ids: IDs of the entrances that you want to add to the space. + + :param space_id: ID of the space to which you want to add entrances.""" json_payload = {} if acs_entrance_ids is not None: @@ -117,6 +220,12 @@ def add_acs_entrances(self, *, acs_entrance_ids: List[str], space_id: str) -> No def add_connected_account( self, *, connected_account_id: str, space_id: str ) -> None: + """Adds a `connected account `_ to a specific space. + + :param connected_account_id: ID of the connected account that you want to add to the space. + + :param space_id: ID of the space to which you want to add the connected account. + """ json_payload = {} if connected_account_id is not None: @@ -129,6 +238,11 @@ def add_connected_account( return None def add_devices(self, *, device_ids: List[str], space_id: str) -> None: + """Adds devices to a specific space. + + :param device_ids: IDs of the devices that you want to add to the space. + + :param space_id: ID of the space to which you want to add devices.""" json_payload = {} if device_ids is not None: @@ -151,6 +265,23 @@ def create( device_ids: Optional[List[str]] = None, space_key: Optional[str] = None ) -> Space: + """Creates a new space. + + :param name: Name of the space that you want to create. + + :param acs_entrance_ids: IDs of the entrances that you want to add to the new space. + + :param connected_account_ids: IDs of connected accounts to associate with the new space. Persisted on seam.location_third_party_account so the UI can show which provider account(s) a space came from. + + :param customer_data: Reservation/stay-related defaults for the space. + + :param customer_key: Customer key for which you want to create the space. + + :param device_ids: IDs of the devices that you want to add to the new space. + + :param space_key: Unique key for the space within the workspace. + + :returns: OK""" json_payload = {} if name is not None: @@ -173,6 +304,9 @@ def create( return Space.from_dict(res["space"]) def delete(self, *, space_id: str) -> None: + """Deletes a space. + + :param space_id: ID of the space that you want to delete.""" json_payload = {} if space_id is not None: @@ -185,6 +319,13 @@ def delete(self, *, space_id: str) -> None: def get( self, *, space_id: Optional[str] = None, space_key: Optional[str] = None ) -> Space: + """Gets a space. + + :param space_id: ID of the space that you want to get. + + :param space_key: Unique key of the space that you want to get. + + :returns: OK""" json_payload = {} if space_id is not None: @@ -204,6 +345,17 @@ def get_related( space_ids: Optional[List[str]] = None, space_keys: Optional[List[str]] = None ) -> Batch: + """Gets all related resources for one or more Spaces. + + :param exclude: + + :param include: + + :param space_ids: IDs of the spaces that you want to get along with their related resources. + + :param space_keys: Keys of the spaces that you want to get along with their related resources. + + :returns: OK""" json_payload = {} if exclude is not None: @@ -228,6 +380,19 @@ def list( search: Optional[str] = None, space_key: Optional[str] = None ) -> List[Space]: + """Returns a list of all spaces. + + :param customer_key: Customer key for which you want to list spaces. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned spaces to include all records that satisfy a partial match using ``name``, ``space_key``, or ``customer_key``. + + :param space_key: Filter spaces by space_key. + + :returns: OK""" json_payload = {} if customer_key is not None: @@ -248,6 +413,11 @@ def list( def remove_acs_entrances( self, *, acs_entrance_ids: List[str], space_id: str ) -> None: + """Removes `entrances `_ from a specific space. + + :param acs_entrance_ids: IDs of the entrances that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove entrances.""" json_payload = {} if acs_entrance_ids is not None: @@ -262,6 +432,12 @@ def remove_acs_entrances( def remove_connected_account( self, *, connected_account_id: str, space_id: str ) -> None: + """Removes a `connected account `_ from a specific space. + + :param connected_account_id: ID of the connected account that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove the connected account. + """ json_payload = {} if connected_account_id is not None: @@ -274,6 +450,11 @@ def remove_connected_account( return None def remove_devices(self, *, device_ids: List[str], space_id: str) -> None: + """Removes devices from a specific space. + + :param device_ids: IDs of the devices that you want to remove from the space. + + :param space_id: ID of the space from which you want to remove devices.""" json_payload = {} if device_ids is not None: @@ -295,6 +476,21 @@ def update( space_id: Optional[str] = None, space_key: Optional[str] = None ) -> Space: + """Updates an existing space. + + :param acs_entrance_ids: IDs of the entrances that you want to set for the space. If specified, this will replace all existing entrances. + + :param customer_data: Reservation/stay-related defaults for the space. Only the keys you provide are updated; omit a key to leave it unchanged. Pass null on a key to clear it. + + :param device_ids: IDs of the devices that you want to set for the space. If specified, this will replace all existing devices. + + :param name: Name of the space. + + :param space_id: ID of the space that you want to update. + + :param space_key: Unique key of the space that you want to update. + + :returns: OK""" json_payload = {} if acs_entrance_ids is not None: diff --git a/seam/routes/thermostats.py b/seam/routes/thermostats.py index d1eb2d1..f074107 100644 --- a/seam/routes/thermostats.py +++ b/seam/routes/thermostats.py @@ -36,6 +36,15 @@ def activate_climate_preset( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Activates a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to activate. + + :param device_id: ID of the thermostat device for which you want to activate a climate preset. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -47,6 +56,17 @@ def cool( cooling_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `cool mode `_. + + :param device_id: ID of the thermostat device that you want to set to cool mode. + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -66,10 +86,42 @@ def create_climate_preset( manual_override_allowed: Optional[bool] = None, name: Optional[str] = None ) -> None: + """Creates a `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Unique key to identify the `climate preset `_. + + :param device_id: ID of the thermostat device for which you want create a climate preset. + + :param climate_preset_mode: The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + + :param cooling_set_point_celsius: Temperature to which the thermostat should cool (in °C). See also `Set Points `_. + + :param cooling_set_point_fahrenheit: Temperature to which the thermostat should cool (in °F). See also `Set Points `_. + + :param ecobee_metadata: Metadata specific to the Ecobee climate, if applicable. + + :param fan_mode_setting: Desired `fan mode setting `_, such as ``on``, ``auto``, or ``circulate``. + + :param heating_set_point_celsius: Temperature to which the thermostat should heat (in °C). See also `Set Points `_. + + :param heating_set_point_fahrenheit: Temperature to which the thermostat should heat (in °F). See also `Set Points `_. + + :param hvac_mode_setting: Desired `HVAC mode `_ setting, such as ``heat``, ``cool``, ``heat_cool``, or ``off``. + + :param manual_override_allowed: Deprecated: Use 'thermostat_schedule.is_override_allowed' Indicates whether a person at the thermostat or using the API can change the thermostat's settings. + + :param name: User-friendly name to identify the `climate preset `_. + """ raise NotImplementedError() @abc.abstractmethod def delete_climate_preset(self, *, climate_preset_key: str, device_id: str) -> None: + """Deletes a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to delete. + + :param device_id: ID of the thermostat device for which you want to delete a climate preset. + """ raise NotImplementedError() @abc.abstractmethod @@ -81,6 +133,17 @@ def heat( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `heat mode `_. + + :param device_id: ID of the thermostat device that you want to set to heat mode. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -94,6 +157,21 @@ def heat_cool( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `heat-cool ("auto") mode `_. + + :param device_id: ID of the thermostat device that you want to set to heat-cool mode. + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -117,6 +195,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `thermostats `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type by which you want to filter thermostat devices. + + :param device_types: Array of device types by which you want to filter thermostat devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer by which you want to filter thermostat devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -126,12 +239,25 @@ def off( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `"off" mode `_. + + :param device_id: ID of the thermostat device that you want to set to off mode. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def set_fallback_climate_preset( self, *, climate_preset_key: str, device_id: str ) -> None: + """Sets a specified `climate preset `_ as the `"fallback" `_ preset for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to set as the fallback climate preset. + + :param device_id: ID of the thermostat device for which you want to set the fallback climate preset. + """ raise NotImplementedError() @abc.abstractmethod @@ -143,6 +269,17 @@ def set_fan_mode( fan_mode_setting: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets the `fan mode setting `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to set the fan mode. + + :param fan_mode: Deprecated: Use ``fan_mode_setting`` instead. Fan mode setting for the thermostat, such as ``auto``, ``on``, or ``circulate``. + + :param fan_mode_setting: `Fan mode setting `_ that you want to set for the thermostat. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -157,6 +294,23 @@ def set_hvac_mode( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets the `HVAC mode `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to set the HVAC mode. + + :param hvac_mode_setting: + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -169,6 +323,18 @@ def set_temperature_threshold( upper_limit_celsius: Optional[float] = None, upper_limit_fahrenheit: Optional[float] = None ) -> None: + """Sets a `temperature threshold `_ for a specified thermostat. Seam emits a ``thermostat.temperature_threshold_exceeded`` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. + + :param device_id: ID of the thermostat device for which you want to set a temperature threshold. + + :param lower_limit_celsius: Lower temperature limit in in °C. Seam alerts you if the reported temperature is lower than this value. You can specify either ``lower_limit`` but not both. + + :param lower_limit_fahrenheit: Lower temperature limit in in °F. Seam alerts you if the reported temperature is lower than this value. You can specify either ``lower_limit`` but not both. + + :param upper_limit_celsius: Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either ``upper_limit`` but not both. + + :param upper_limit_fahrenheit: Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either ``upper_limit`` but not both. + """ raise NotImplementedError() @abc.abstractmethod @@ -188,6 +354,32 @@ def update_climate_preset( manual_override_allowed: Optional[bool] = None, name: Optional[str] = None ) -> None: + """Updates a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Unique key to identify the `climate preset `_. + + :param device_id: ID of the thermostat device for which you want to update a climate preset. + + :param climate_preset_mode: The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + + :param cooling_set_point_celsius: Temperature to which the thermostat should cool (in °C). See also `Set Points `_. + + :param cooling_set_point_fahrenheit: Temperature to which the thermostat should cool (in °F). See also `Set Points `_. + + :param ecobee_metadata: Metadata specific to the Ecobee climate, if applicable. + + :param fan_mode_setting: Desired `fan mode setting `_, such as ``on``, ``auto``, or ``circulate``. + + :param heating_set_point_celsius: Temperature to which the thermostat should heat (in °C). See also `Set Points `_. + + :param heating_set_point_fahrenheit: Temperature to which the thermostat should heat (in °F). See also `Set Points `_. + + :param hvac_mode_setting: Desired `HVAC mode `_ setting, such as ``heat``, ``cool``, ``heat_cool``, or ``off``. + + :param manual_override_allowed: Deprecated: Use 'thermostat_schedule.is_override_allowed' Indicates whether a person at the thermostat can change the thermostat's settings. See `Specifying Manual Override Permissions `_. + + :param name: User-friendly name to identify the `climate preset `_. + """ raise NotImplementedError() @abc.abstractmethod @@ -204,6 +396,27 @@ def update_weekly_program( wednesday_program_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. + + :param device_id: ID of the thermostat device for which you want to update the weekly program. + + :param friday_program_id: ID of the thermostat daily program to run on Fridays. + + :param monday_program_id: ID of the thermostat daily program to run on Mondays. + + :param saturday_program_id: ID of the thermostat daily program to run on Saturdays. + + :param sunday_program_id: ID of the thermostat daily program to run on Sundays. + + :param thursday_program_id: ID of the thermostat daily program to run on Thursdays. + + :param tuesday_program_id: ID of the thermostat daily program to run on Tuesdays. + + :param wednesday_program_id: ID of the thermostat daily program to run on Wednesdays. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -236,6 +449,15 @@ def activate_climate_preset( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Activates a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to activate. + + :param device_id: ID of the thermostat device for which you want to activate a climate preset. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if climate_preset_key is not None: @@ -267,6 +489,17 @@ def cool( cooling_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `cool mode `_. + + :param device_id: ID of the thermostat device that you want to set to cool mode. + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -306,6 +539,32 @@ def create_climate_preset( manual_override_allowed: Optional[bool] = None, name: Optional[str] = None ) -> None: + """Creates a `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Unique key to identify the `climate preset `_. + + :param device_id: ID of the thermostat device for which you want create a climate preset. + + :param climate_preset_mode: The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + + :param cooling_set_point_celsius: Temperature to which the thermostat should cool (in °C). See also `Set Points `_. + + :param cooling_set_point_fahrenheit: Temperature to which the thermostat should cool (in °F). See also `Set Points `_. + + :param ecobee_metadata: Metadata specific to the Ecobee climate, if applicable. + + :param fan_mode_setting: Desired `fan mode setting `_, such as ``on``, ``auto``, or ``circulate``. + + :param heating_set_point_celsius: Temperature to which the thermostat should heat (in °C). See also `Set Points `_. + + :param heating_set_point_fahrenheit: Temperature to which the thermostat should heat (in °F). See also `Set Points `_. + + :param hvac_mode_setting: Desired `HVAC mode `_ setting, such as ``heat``, ``cool``, ``heat_cool``, or ``off``. + + :param manual_override_allowed: Deprecated: Use 'thermostat_schedule.is_override_allowed' Indicates whether a person at the thermostat or using the API can change the thermostat's settings. + + :param name: User-friendly name to identify the `climate preset `_. + """ json_payload = {} if climate_preset_key is not None: @@ -338,6 +597,12 @@ def create_climate_preset( return None def delete_climate_preset(self, *, climate_preset_key: str, device_id: str) -> None: + """Deletes a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to delete. + + :param device_id: ID of the thermostat device for which you want to delete a climate preset. + """ json_payload = {} if climate_preset_key is not None: @@ -357,6 +622,17 @@ def heat( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `heat mode `_. + + :param device_id: ID of the thermostat device that you want to set to heat mode. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -390,6 +666,21 @@ def heat_cool( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `heat-cool ("auto") mode `_. + + :param device_id: ID of the thermostat device that you want to set to heat-cool mode. + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -437,6 +728,41 @@ def list( unstable_location_id: Optional[str] = None, user_identifier_key: Optional[str] = None ) -> List[Device]: + """Returns a list of all `thermostats `_. + + :param connect_webview_id: ID of the Connect Webview for which you want to list devices. + + :param connected_account_id: ID of the connected account for which you want to list devices. + + :param connected_account_ids: Array of IDs of the connected accounts for which you want to list devices. + + :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 customer_key: Customer key for which you want to list devices. + + :param device_ids: Array of device IDs for which you want to list devices. + + :param device_type: Device type by which you want to filter thermostat devices. + + :param device_types: Array of device types by which you want to filter thermostat devices. + + :param limit: Numerical limit on the number of devices to return. + + :param manufacturer: Manufacturer by which you want to filter thermostat devices. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned devices to include all records that satisfy a partial match using ``device_id`` (full or partial UUID prefix, minimum 4 characters), ``connected_account_id``, ``display_name``, ``custom_metadata`` or ``location.location_name``. + + :param space_id: ID of the space for which you want to list devices. + + :param unstable_location_id: Deprecated: Use ``space_id``. + + :param user_identifier_key: Your own internal user ID for the user for which you want to list devices. + + :returns: OK""" json_payload = {} if connect_webview_id is not None: @@ -482,6 +808,13 @@ def off( device_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets a specified `thermostat `_ to `"off" mode `_. + + :param device_id: ID of the thermostat device that you want to set to off mode. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -504,6 +837,12 @@ def off( def set_fallback_climate_preset( self, *, climate_preset_key: str, device_id: str ) -> None: + """Sets a specified `climate preset `_ as the `"fallback" `_ preset for a specified `thermostat `_. + + :param climate_preset_key: Climate preset key of the climate preset that you want to set as the fallback climate preset. + + :param device_id: ID of the thermostat device for which you want to set the fallback climate preset. + """ json_payload = {} if climate_preset_key is not None: @@ -523,6 +862,17 @@ def set_fan_mode( fan_mode_setting: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets the `fan mode setting `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to set the fan mode. + + :param fan_mode: Deprecated: Use ``fan_mode_setting`` instead. Fan mode setting for the thermostat, such as ``auto``, ``on``, or ``circulate``. + + :param fan_mode_setting: `Fan mode setting `_ that you want to set for the thermostat. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -557,6 +907,23 @@ def set_hvac_mode( heating_set_point_fahrenheit: Optional[float] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Sets the `HVAC mode `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to set the HVAC mode. + + :param hvac_mode_setting: + + :param cooling_set_point_celsius: `Cooling set point `_ in °C that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param cooling_set_point_fahrenheit: `Cooling set point `_ in °F that you want to set for the thermostat. You must set one of the ``cooling_set_point`` parameters. + + :param heating_set_point_celsius: `Heating set point `_ in °C that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param heating_set_point_fahrenheit: `Heating set point `_ in °F that you want to set for the thermostat. You must set one of the ``heating_set_point`` parameters. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -595,6 +962,18 @@ def set_temperature_threshold( upper_limit_celsius: Optional[float] = None, upper_limit_fahrenheit: Optional[float] = None ) -> None: + """Sets a `temperature threshold `_ for a specified thermostat. Seam emits a ``thermostat.temperature_threshold_exceeded`` event and adds a warning on a thermostat if it reports a temperature outside the threshold range. + + :param device_id: ID of the thermostat device for which you want to set a temperature threshold. + + :param lower_limit_celsius: Lower temperature limit in in °C. Seam alerts you if the reported temperature is lower than this value. You can specify either ``lower_limit`` but not both. + + :param lower_limit_fahrenheit: Lower temperature limit in in °F. Seam alerts you if the reported temperature is lower than this value. You can specify either ``lower_limit`` but not both. + + :param upper_limit_celsius: Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either ``upper_limit`` but not both. + + :param upper_limit_fahrenheit: Upper temperature limit in in °C. Seam alerts you if the reported temperature is higher than this value. You can specify either ``upper_limit`` but not both. + """ json_payload = {} if device_id is not None: @@ -628,6 +1007,32 @@ def update_climate_preset( manual_override_allowed: Optional[bool] = None, name: Optional[str] = None ) -> None: + """Updates a specified `climate preset `_ for a specified `thermostat `_. + + :param climate_preset_key: Unique key to identify the `climate preset `_. + + :param device_id: ID of the thermostat device for which you want to update a climate preset. + + :param climate_preset_mode: The climate preset mode for the thermostat, based on the available climate preset modes reported by the device. + + :param cooling_set_point_celsius: Temperature to which the thermostat should cool (in °C). See also `Set Points `_. + + :param cooling_set_point_fahrenheit: Temperature to which the thermostat should cool (in °F). See also `Set Points `_. + + :param ecobee_metadata: Metadata specific to the Ecobee climate, if applicable. + + :param fan_mode_setting: Desired `fan mode setting `_, such as ``on``, ``auto``, or ``circulate``. + + :param heating_set_point_celsius: Temperature to which the thermostat should heat (in °C). See also `Set Points `_. + + :param heating_set_point_fahrenheit: Temperature to which the thermostat should heat (in °F). See also `Set Points `_. + + :param hvac_mode_setting: Desired `HVAC mode `_ setting, such as ``heat``, ``cool``, ``heat_cool``, or ``off``. + + :param manual_override_allowed: Deprecated: Use 'thermostat_schedule.is_override_allowed' Indicates whether a person at the thermostat can change the thermostat's settings. See `Specifying Manual Override Permissions `_. + + :param name: User-friendly name to identify the `climate preset `_. + """ json_payload = {} if climate_preset_key is not None: @@ -672,6 +1077,27 @@ def update_weekly_program( wednesday_program_id: Optional[str] = None, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Updates the thermostat weekly program for a thermostat device. To configure a weekly program, specify the ID of the daily program that you want to use for each day of the week. When you update a weekly program, the set of programs that you specify overwrites any previous weekly program for the thermostat. + + :param device_id: ID of the thermostat device for which you want to update the weekly program. + + :param friday_program_id: ID of the thermostat daily program to run on Fridays. + + :param monday_program_id: ID of the thermostat daily program to run on Mondays. + + :param saturday_program_id: ID of the thermostat daily program to run on Saturdays. + + :param sunday_program_id: ID of the thermostat daily program to run on Sundays. + + :param thursday_program_id: ID of the thermostat daily program to run on Thursdays. + + :param tuesday_program_id: ID of the thermostat daily program to run on Tuesdays. + + :param wednesday_program_id: ID of the thermostat daily program to run on Wednesdays. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if device_id is not None: diff --git a/seam/routes/thermostats_daily_programs.py b/seam/routes/thermostats_daily_programs.py index dbe80dd..56e886d 100644 --- a/seam/routes/thermostats_daily_programs.py +++ b/seam/routes/thermostats_daily_programs.py @@ -11,10 +11,23 @@ class AbstractThermostatsDailyPrograms(abc.ABC): def create( self, *, device_id: str, name: str, periods: List[Dict[str, Any]] ) -> ThermostatDailyProgram: + """Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. + + :param device_id: ID of the thermostat device for which you want to create a daily program. + + :param name: Name of the thermostat daily program. + + :param periods: Array of thermostat daily program periods. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, thermostat_daily_program_id: str) -> None: + """Deletes a thermostat daily program. + + :param thermostat_daily_program_id: ID of the thermostat daily program that you want to delete. + """ raise NotImplementedError() @abc.abstractmethod @@ -26,6 +39,17 @@ def update( thermostat_daily_program_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. + + :param name: Name of the thermostat daily program that you want to update. + + :param periods: Array of thermostat daily program periods. The periods that you specify overwrite any existing periods for the daily program. + + :param thermostat_daily_program_id: ID of the thermostat daily program that you want to update. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @@ -37,6 +61,15 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): def create( self, *, device_id: str, name: str, periods: List[Dict[str, Any]] ) -> ThermostatDailyProgram: + """Creates a new thermostat daily program. A daily program consists of a set of periods, where each period includes a start time and the key of a configured climate preset. Once you have defined a daily program, you can assign it to one or more days within a weekly program. + + :param device_id: ID of the thermostat device for which you want to create a daily program. + + :param name: Name of the thermostat daily program. + + :param periods: Array of thermostat daily program periods. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -51,6 +84,10 @@ def create( return ThermostatDailyProgram.from_dict(res["thermostat_daily_program"]) def delete(self, *, thermostat_daily_program_id: str) -> None: + """Deletes a thermostat daily program. + + :param thermostat_daily_program_id: ID of the thermostat daily program that you want to delete. + """ json_payload = {} if thermostat_daily_program_id is not None: @@ -68,6 +105,17 @@ def update( thermostat_daily_program_id: str, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Updates a specified thermostat daily program. The periods that you specify overwrite any existing periods for the daily program. + + :param name: Name of the thermostat daily program that you want to update. + + :param periods: Array of thermostat daily program periods. The periods that you specify overwrite any existing periods for the daily program. + + :param thermostat_daily_program_id: ID of the thermostat daily program that you want to update. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} if name is not None: diff --git a/seam/routes/thermostats_schedules.py b/seam/routes/thermostats_schedules.py index e6fcb8a..24935b3 100644 --- a/seam/routes/thermostats_schedules.py +++ b/seam/routes/thermostats_schedules.py @@ -18,20 +18,53 @@ def create( max_override_period_minutes: Optional[int] = None, name: Optional[str] = None ) -> ThermostatSchedule: + """Creates a new `thermostat schedule `_ for a specified `thermostat `_. + + :param climate_preset_key: Key of the `climate preset `_ to use for the new thermostat schedule. + + :param device_id: ID of the thermostat device for which you want to create a schedule. + + :param ends_at: Date and time at which the new thermostat schedule ends, in `ISO 8601 `_ format. + + :param starts_at: Date and time at which the new thermostat schedule starts, in `ISO 8601 `_ format. + + :param is_override_allowed: Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the new schedule is active. See also `Specifying Manual Override Permissions `_. + + :param max_override_period_minutes: Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also `Specifying Manual Override Permissions `_. + + :param name: Name of the thermostat schedule. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, thermostat_schedule_id: str) -> None: + """Deletes a `thermostat schedule `_ for a specified `thermostat `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to delete. + """ raise NotImplementedError() @abc.abstractmethod def get(self, *, thermostat_schedule_id: str) -> ThermostatSchedule: + """Returns a specified `thermostat schedule `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list( self, *, device_id: str, user_identifier_key: Optional[str] = None ) -> List[ThermostatSchedule]: + """Returns a list of all `thermostat schedules `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to list schedules. + + :param user_identifier_key: User identifier key by which to filter the list of returned thermostat schedules. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -46,6 +79,22 @@ def update( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates a specified `thermostat schedule `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to update. + + :param climate_preset_key: Key of the `climate preset `_ to use for the thermostat schedule. + + :param ends_at: Date and time at which the thermostat schedule ends, in `ISO 8601 `_ format. + + :param is_override_allowed: Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the schedule is active. See also `Specifying Manual Override Permissions `_. + + :param max_override_period_minutes: Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also `Specifying Manual Override Permissions `_. + + :param name: Name of the thermostat schedule. + + :param starts_at: Date and time at which the thermostat schedule starts, in `ISO 8601 `_ format. + """ raise NotImplementedError() @@ -65,6 +114,23 @@ def create( max_override_period_minutes: Optional[int] = None, name: Optional[str] = None ) -> ThermostatSchedule: + """Creates a new `thermostat schedule `_ for a specified `thermostat `_. + + :param climate_preset_key: Key of the `climate preset `_ to use for the new thermostat schedule. + + :param device_id: ID of the thermostat device for which you want to create a schedule. + + :param ends_at: Date and time at which the new thermostat schedule ends, in `ISO 8601 `_ format. + + :param starts_at: Date and time at which the new thermostat schedule starts, in `ISO 8601 `_ format. + + :param is_override_allowed: Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the new schedule is active. See also `Specifying Manual Override Permissions `_. + + :param max_override_period_minutes: Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also `Specifying Manual Override Permissions `_. + + :param name: Name of the thermostat schedule. + + :returns: OK""" json_payload = {} if climate_preset_key is not None: @@ -87,6 +153,10 @@ def create( return ThermostatSchedule.from_dict(res["thermostat_schedule"]) def delete(self, *, thermostat_schedule_id: str) -> None: + """Deletes a `thermostat schedule `_ for a specified `thermostat `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to delete. + """ json_payload = {} if thermostat_schedule_id is not None: @@ -97,6 +167,11 @@ def delete(self, *, thermostat_schedule_id: str) -> None: return None def get(self, *, thermostat_schedule_id: str) -> ThermostatSchedule: + """Returns a specified `thermostat schedule `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to get. + + :returns: OK""" json_payload = {} if thermostat_schedule_id is not None: @@ -109,6 +184,13 @@ def get(self, *, thermostat_schedule_id: str) -> ThermostatSchedule: def list( self, *, device_id: str, user_identifier_key: Optional[str] = None ) -> List[ThermostatSchedule]: + """Returns a list of all `thermostat schedules `_ for a specified `thermostat `_. + + :param device_id: ID of the thermostat device for which you want to list schedules. + + :param user_identifier_key: User identifier key by which to filter the list of returned thermostat schedules. + + :returns: OK""" json_payload = {} if device_id is not None: @@ -133,6 +215,22 @@ def update( name: Optional[str] = None, starts_at: Optional[str] = None ) -> None: + """Updates a specified `thermostat schedule `_. + + :param thermostat_schedule_id: ID of the thermostat schedule that you want to update. + + :param climate_preset_key: Key of the `climate preset `_ to use for the thermostat schedule. + + :param ends_at: Date and time at which the thermostat schedule ends, in `ISO 8601 `_ format. + + :param is_override_allowed: Indicates whether a person at the thermostat or using the API can change the thermostat's settings while the schedule is active. See also `Specifying Manual Override Permissions `_. + + :param max_override_period_minutes: Number of minutes for which a person at the thermostat or using the API can change the thermostat's settings after the activation of the scheduled climate preset. See also `Specifying Manual Override Permissions `_. + + :param name: Name of the thermostat schedule. + + :param starts_at: Date and time at which the thermostat schedule starts, in `ISO 8601 `_ format. + """ json_payload = {} if thermostat_schedule_id is not None: diff --git a/seam/routes/thermostats_simulate.py b/seam/routes/thermostats_simulate.py index b1155f9..94d2a1b 100644 --- a/seam/routes/thermostats_simulate.py +++ b/seam/routes/thermostats_simulate.py @@ -16,6 +16,20 @@ def hvac_mode_adjusted( heating_set_point_celsius: Optional[float] = None, heating_set_point_fahrenheit: Optional[float] = None ) -> None: + """Simulates having adjusted the `HVAC mode `_ for a `thermostat `_. Only applicable for `sandbox devices `_. See also `Testing Your Thermostat App with Simulate Endpoints `_. + + :param device_id: ID of the thermostat device for which you want to simulate having adjusted the HVAC mode. + + :param hvac_mode: HVAC mode that you want to simulate. + + :param cooling_set_point_celsius: Cooling `set point `_ in °C that you want to simulate. You must set ``cooling_set_point_celsius`` or ``cooling_set_point_fahrenheit``. + + :param cooling_set_point_fahrenheit: Cooling `set point `_ in °F that you want to simulate. You must set ``cooling_set_point_fahrenheit`` or ``cooling_set_point_celsius``. + + :param heating_set_point_celsius: Heating `set point `_ in °C that you want to simulate. You must set ``heating_set_point_celsius`` or ``heating_set_point_fahrenheit``. + + :param heating_set_point_fahrenheit: Heating `set point `_ in °F that you want to simulate. You must set ``heating_set_point_fahrenheit`` or ``heating_set_point_celsius``. + """ raise NotImplementedError() @abc.abstractmethod @@ -26,6 +40,14 @@ def temperature_reached( temperature_celsius: Optional[float] = None, temperature_fahrenheit: Optional[float] = None ) -> None: + """Simulates a `thermostat `_ reaching a specified temperature. Only applicable for `sandbox devices `_. See also `Testing Your Thermostat App with Simulate Endpoints `_. + + :param device_id: ID of the thermostat device that you want to simulate reaching a specified temperature. + + :param temperature_celsius: Temperature in °C that you want simulate the thermostat reaching. You must set ``temperature_celsius`` or ``temperature_fahrenheit``. + + :param temperature_fahrenheit: Temperature in °F that you want simulate the thermostat reaching. You must set ``temperature_fahrenheit`` or ``temperature_celsius``. + """ raise NotImplementedError() @@ -44,6 +66,20 @@ def hvac_mode_adjusted( heating_set_point_celsius: Optional[float] = None, heating_set_point_fahrenheit: Optional[float] = None ) -> None: + """Simulates having adjusted the `HVAC mode `_ for a `thermostat `_. Only applicable for `sandbox devices `_. See also `Testing Your Thermostat App with Simulate Endpoints `_. + + :param device_id: ID of the thermostat device for which you want to simulate having adjusted the HVAC mode. + + :param hvac_mode: HVAC mode that you want to simulate. + + :param cooling_set_point_celsius: Cooling `set point `_ in °C that you want to simulate. You must set ``cooling_set_point_celsius`` or ``cooling_set_point_fahrenheit``. + + :param cooling_set_point_fahrenheit: Cooling `set point `_ in °F that you want to simulate. You must set ``cooling_set_point_fahrenheit`` or ``cooling_set_point_celsius``. + + :param heating_set_point_celsius: Heating `set point `_ in °C that you want to simulate. You must set ``heating_set_point_celsius`` or ``heating_set_point_fahrenheit``. + + :param heating_set_point_fahrenheit: Heating `set point `_ in °F that you want to simulate. You must set ``heating_set_point_fahrenheit`` or ``heating_set_point_celsius``. + """ json_payload = {} if device_id is not None: @@ -70,6 +106,14 @@ def temperature_reached( temperature_celsius: Optional[float] = None, temperature_fahrenheit: Optional[float] = None ) -> None: + """Simulates a `thermostat `_ reaching a specified temperature. Only applicable for `sandbox devices `_. See also `Testing Your Thermostat App with Simulate Endpoints `_. + + :param device_id: ID of the thermostat device that you want to simulate reaching a specified temperature. + + :param temperature_celsius: Temperature in °C that you want simulate the thermostat reaching. You must set ``temperature_celsius`` or ``temperature_fahrenheit``. + + :param temperature_fahrenheit: Temperature in °F that you want simulate the thermostat reaching. You must set ``temperature_fahrenheit`` or ``temperature_celsius``. + """ json_payload = {} if device_id is not None: diff --git a/seam/routes/user_identities.py b/seam/routes/user_identities.py index d906c60..819ddd9 100644 --- a/seam/routes/user_identities.py +++ b/seam/routes/user_identities.py @@ -30,6 +30,18 @@ def add_acs_user( user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None ) -> None: + """Adds a specified `access system user `_ to a specified `user identity `_. + + You must specify either ``user_identity_id`` or ``user_identity_key`` to identify the user identity. + + If ``user_identity_key`` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. + + :param acs_user_id: ID of the access system user that you want to add to the user identity. + + :param user_identity_id: ID of the user identity to which you want to add an access system user. + + :param user_identity_key: Key of the user identity to which you want to add an access system user. + """ raise NotImplementedError() @abc.abstractmethod @@ -42,10 +54,26 @@ def create( phone_number: Optional[str] = None, user_identity_key: Optional[str] = None ) -> UserIdentity: + """Creates a new `user identity `_. + + :param acs_system_ids: List of access system IDs to associate with the new user identity through access system users. If there's no user with the same email address or phone number in the specified access systems, a new access system user is created. If there is an existing user with the same email or phone number in the specified access systems, the user is linked to the user identity. + + :param email_address: Unique email address for the new user identity. + + :param full_name: Full name of the user associated with the new user identity. + + :param phone_number: Unique phone number for the new user identity in E.164 format (for example, +15555550100). + + :param user_identity_key: Unique key for the new user identity. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, user_identity_id: str) -> None: + """Deletes a specified `user identity `_. This deletes the user identity and all associated resources, including any `credentials `_, `acs users `_ and `client sessions `_. + + :param user_identity_id: ID of the user identity that you want to delete.""" raise NotImplementedError() @abc.abstractmethod @@ -56,6 +84,15 @@ def generate_instant_key( customization_profile_id: Optional[str] = None, max_use_count: Optional[float] = None ) -> InstantKey: + """Generates a new `instant key `_ for a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to generate an instant key. + + :param customization_profile_id: + + :param max_use_count: Maximum number of times the instant key can be used. Default: 1. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -65,10 +102,23 @@ def get( user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None ) -> UserIdentity: + """Returns a specified `user identity `_. + + :param user_identity_id: ID of the user identity that you want to get. + + :param user_identity_key: + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def grant_access_to_device(self, *, device_id: str, user_identity_id: str) -> None: + """Grants a specified `user identity `_ access to a specified `device `_. + + :param device_id: ID of the managed device to which you want to grant access to the user identity. + + :param user_identity_id: ID of the user identity that you want to grant access to a device. + """ raise NotImplementedError() @abc.abstractmethod @@ -82,30 +132,77 @@ def list( search: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> List[UserIdentity]: + """Returns a list of all `user identities `_. + + :param created_before: Timestamp by which to limit returned user identities. Returns user identities created before this timestamp. + + :param credential_manager_acs_system_id: ``acs_system_id`` of the credential manager by which you want to filter the list of user identities. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned user identities to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address`` or ``user_identity_id``. + + :param user_identity_ids: Array of user identity IDs by which to filter the list of user identities. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_accessible_devices(self, *, user_identity_id: str) -> List[Device]: + """Returns a list of all `devices `_ associated with a specified `user identity `_. This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. + + :param user_identity_id: ID of the user identity for which you want to retrieve all accessible devices. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_accessible_entrances(self, *, user_identity_id: str) -> List[AcsEntrance]: + """Returns a list of all `ACS entrances `_ accessible to a specified `user identity `_. This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. + + :param user_identity_id: ID of the user identity for which you want to retrieve all accessible entrances. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_acs_systems(self, *, user_identity_id: str) -> List[AcsSystem]: + """Returns a list of all `access systems `_ associated with a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access systems. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: + """Returns a list of all `access system users `_ assigned to a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access system users. + + :returns: OK""" 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 `_. + + :param acs_user_id: ID of the access system user that you want to remove from the user identity.. + + :param user_identity_id: ID of the user identity from which you want to remove an access system user. + """ raise NotImplementedError() @abc.abstractmethod def revoke_access_to_device(self, *, device_id: str, user_identity_id: str) -> None: + """Revokes access to a specified `device `_ from a specified `user identity `_. + + :param device_id: ID of the managed device to which you want to revoke access from the user identity. + + :param user_identity_id: ID of the user identity from which you want to revoke access to a device. + """ raise NotImplementedError() @abc.abstractmethod @@ -118,6 +215,17 @@ def update( phone_number: Optional[str] = None, user_identity_key: Optional[str] = None ) -> None: + """Updates a specified `user identity `_. + + :param user_identity_id: ID of the user identity that you want to update. + + :param email_address: Unique email address for the user identity. + + :param full_name: Full name of the user associated with the user identity. + + :param phone_number: Unique phone number for the user identity. + + :param user_identity_key: Unique key for the user identity.""" raise NotImplementedError() @@ -138,6 +246,18 @@ def add_acs_user( user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None ) -> None: + """Adds a specified `access system user `_ to a specified `user identity `_. + + You must specify either ``user_identity_id`` or ``user_identity_key`` to identify the user identity. + + If ``user_identity_key`` is provided, but the user identity doesn't exist, a new user identity will be created automatically using information from the ACS user. + + :param acs_user_id: ID of the access system user that you want to add to the user identity. + + :param user_identity_id: ID of the user identity to which you want to add an access system user. + + :param user_identity_key: Key of the user identity to which you want to add an access system user. + """ json_payload = {} if acs_user_id is not None: @@ -160,6 +280,19 @@ def create( phone_number: Optional[str] = None, user_identity_key: Optional[str] = None ) -> UserIdentity: + """Creates a new `user identity `_. + + :param acs_system_ids: List of access system IDs to associate with the new user identity through access system users. If there's no user with the same email address or phone number in the specified access systems, a new access system user is created. If there is an existing user with the same email or phone number in the specified access systems, the user is linked to the user identity. + + :param email_address: Unique email address for the new user identity. + + :param full_name: Full name of the user associated with the new user identity. + + :param phone_number: Unique phone number for the new user identity in E.164 format (for example, +15555550100). + + :param user_identity_key: Unique key for the new user identity. + + :returns: OK""" json_payload = {} if acs_system_ids is not None: @@ -178,6 +311,9 @@ def create( return UserIdentity.from_dict(res["user_identity"]) def delete(self, *, user_identity_id: str) -> None: + """Deletes a specified `user identity `_. This deletes the user identity and all associated resources, including any `credentials `_, `acs users `_ and `client sessions `_. + + :param user_identity_id: ID of the user identity that you want to delete.""" json_payload = {} if user_identity_id is not None: @@ -194,6 +330,15 @@ def generate_instant_key( customization_profile_id: Optional[str] = None, max_use_count: Optional[float] = None ) -> InstantKey: + """Generates a new `instant key `_ for a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to generate an instant key. + + :param customization_profile_id: + + :param max_use_count: Maximum number of times the instant key can be used. Default: 1. + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -215,6 +360,13 @@ def get( user_identity_id: Optional[str] = None, user_identity_key: Optional[str] = None ) -> UserIdentity: + """Returns a specified `user identity `_. + + :param user_identity_id: ID of the user identity that you want to get. + + :param user_identity_key: + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -227,6 +379,12 @@ def get( return UserIdentity.from_dict(res["user_identity"]) def grant_access_to_device(self, *, device_id: str, user_identity_id: str) -> None: + """Grants a specified `user identity `_ access to a specified `device `_. + + :param device_id: ID of the managed device to which you want to grant access to the user identity. + + :param user_identity_id: ID of the user identity that you want to grant access to a device. + """ json_payload = {} if device_id is not None: @@ -248,6 +406,21 @@ def list( search: Optional[str] = None, user_identity_ids: Optional[List[str]] = None ) -> List[UserIdentity]: + """Returns a list of all `user identities `_. + + :param created_before: Timestamp by which to limit returned user identities. Returns user identities created before this timestamp. + + :param credential_manager_acs_system_id: ``acs_system_id`` of the credential manager by which you want to filter the list of user identities. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned user identities to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address`` or ``user_identity_id``. + + :param user_identity_ids: Array of user identity IDs by which to filter the list of user identities. + + :returns: OK""" json_payload = {} if created_before is not None: @@ -270,6 +443,11 @@ def list( return [UserIdentity.from_dict(item) for item in res["user_identities"]] def list_accessible_devices(self, *, user_identity_id: str) -> List[Device]: + """Returns a list of all `devices `_ associated with a specified `user identity `_. This includes devices derived from the access grants assigned to the user identity and devices directly linked to the user identity. + + :param user_identity_id: ID of the user identity for which you want to retrieve all accessible devices. + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -282,6 +460,11 @@ def list_accessible_devices(self, *, user_identity_id: str) -> List[Device]: return [Device.from_dict(item) for item in res["devices"]] def list_accessible_entrances(self, *, user_identity_id: str) -> List[AcsEntrance]: + """Returns a list of all `ACS entrances `_ accessible to a specified `user identity `_. This includes entrances derived from the access grants assigned to the user identity and entrances accessible through ACS users linked to the user identity. + + :param user_identity_id: ID of the user identity for which you want to retrieve all accessible entrances. + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -294,6 +477,11 @@ def list_accessible_entrances(self, *, user_identity_id: str) -> List[AcsEntranc return [AcsEntrance.from_dict(item) for item in res["acs_entrances"]] def list_acs_systems(self, *, user_identity_id: str) -> List[AcsSystem]: + """Returns a list of all `access systems `_ associated with a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access systems. + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -304,6 +492,11 @@ def list_acs_systems(self, *, user_identity_id: str) -> List[AcsSystem]: return [AcsSystem.from_dict(item) for item in res["acs_systems"]] def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: + """Returns a list of all `access system users `_ assigned to a specified `user identity `_. + + :param user_identity_id: ID of the user identity for which you want to retrieve all access system users. + + :returns: OK""" json_payload = {} if user_identity_id is not None: @@ -314,6 +507,12 @@ def list_acs_users(self, *, user_identity_id: str) -> List[AcsUser]: return [AcsUser.from_dict(item) for item in res["acs_users"]] 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 `_. + + :param acs_user_id: ID of the access system user that you want to remove from the user identity.. + + :param user_identity_id: ID of the user identity from which you want to remove an access system user. + """ json_payload = {} if acs_user_id is not None: @@ -326,6 +525,12 @@ def remove_acs_user(self, *, acs_user_id: str, user_identity_id: str) -> None: return None def revoke_access_to_device(self, *, device_id: str, user_identity_id: str) -> None: + """Revokes access to a specified `device `_ from a specified `user identity `_. + + :param device_id: ID of the managed device to which you want to revoke access from the user identity. + + :param user_identity_id: ID of the user identity from which you want to revoke access to a device. + """ json_payload = {} if device_id is not None: @@ -346,6 +551,17 @@ def update( phone_number: Optional[str] = None, user_identity_key: Optional[str] = None ) -> None: + """Updates a specified `user identity `_. + + :param user_identity_id: ID of the user identity that you want to update. + + :param email_address: Unique email address for the user identity. + + :param full_name: Full name of the user associated with the user identity. + + :param phone_number: Unique phone number for the user identity. + + :param user_identity_key: Unique key for the user identity.""" json_payload = {} if user_identity_id is not None: diff --git a/seam/routes/user_identities_unmanaged.py b/seam/routes/user_identities_unmanaged.py index ab88144..6325702 100644 --- a/seam/routes/user_identities_unmanaged.py +++ b/seam/routes/user_identities_unmanaged.py @@ -7,6 +7,10 @@ class AbstractUserIdentitiesUnmanaged(abc.ABC): @abc.abstractmethod def get(self, *, user_identity_id: str) -> None: + """Returns a specified unmanaged `user identity `_ (where is_managed = false). + + :param user_identity_id: ID of the unmanaged user identity that you want to get. + """ raise NotImplementedError() @abc.abstractmethod @@ -18,6 +22,16 @@ def list( page_cursor: Optional[str] = None, search: Optional[str] = None ) -> None: + """Returns a list of all unmanaged `user identities `_ (where is_managed = false). + + :param created_before: Timestamp by which to limit returned unmanaged user identities. Returns user identities created before this timestamp. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned unmanaged user identities to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address``, ``user_identity_id`` or ``acs_system_id``. + """ raise NotImplementedError() @abc.abstractmethod @@ -28,6 +42,16 @@ def update( user_identity_id: str, user_identity_key: Optional[str] = None ) -> None: + """Updates an unmanaged `user identity `_ to make it managed. + + This endpoint can only be used to convert unmanaged user identities to managed ones by setting ``is_managed`` to ``true``. It cannot be used to convert managed user identities back to unmanaged. + + :param is_managed: Must be set to true to convert the unmanaged user identity to managed. + + :param user_identity_id: ID of the unmanaged user identity that you want to update. + + :param user_identity_key: Unique key for the user identity. If not provided, the existing key will be preserved. + """ raise NotImplementedError() @@ -37,6 +61,10 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def get(self, *, user_identity_id: str) -> None: + """Returns a specified unmanaged `user identity `_ (where is_managed = false). + + :param user_identity_id: ID of the unmanaged user identity that you want to get. + """ json_payload = {} if user_identity_id is not None: @@ -54,6 +82,16 @@ def list( page_cursor: Optional[str] = None, search: Optional[str] = None ) -> None: + """Returns a list of all unmanaged `user identities `_ (where is_managed = false). + + :param created_before: Timestamp by which to limit returned unmanaged user identities. Returns user identities created before this timestamp. + + :param limit: Maximum number of records to return per page. + + :param page_cursor: Identifies the specific page of results to return, obtained from the previous page's ``next_page_cursor``. + + :param search: String for which to search. Filters returned unmanaged user identities to include all records that satisfy a partial match using ``full_name``, ``phone_number``, ``email_address``, ``user_identity_id`` or ``acs_system_id``. + """ json_payload = {} if created_before is not None: @@ -76,6 +114,16 @@ def update( user_identity_id: str, user_identity_key: Optional[str] = None ) -> None: + """Updates an unmanaged `user identity `_ to make it managed. + + This endpoint can only be used to convert unmanaged user identities to managed ones by setting ``is_managed`` to ``true``. It cannot be used to convert managed user identities back to unmanaged. + + :param is_managed: Must be set to true to convert the unmanaged user identity to managed. + + :param user_identity_id: ID of the unmanaged user identity that you want to update. + + :param user_identity_key: Unique key for the user identity. If not provided, the existing key will be preserved. + """ json_payload = {} if is_managed is not None: diff --git a/seam/routes/webhooks.py b/seam/routes/webhooks.py index 4d11eff..05b5d95 100644 --- a/seam/routes/webhooks.py +++ b/seam/routes/webhooks.py @@ -8,24 +8,47 @@ class AbstractWebhooks(abc.ABC): @abc.abstractmethod def create(self, *, url: str, event_types: Optional[List[str]] = None) -> Webhook: + """Creates a new `webhook `_. + + :param url: URL for the new webhook. + + :param event_types: Types of events that you want the new webhook to receive. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def delete(self, *, webhook_id: str) -> None: + """Deletes a specified `webhook `_. + + :param webhook_id: ID of the webhook that you want to delete.""" raise NotImplementedError() @abc.abstractmethod def get(self, *, webhook_id: str) -> Webhook: + """Gets a specified `webhook `_. + + :param webhook_id: ID of the webhook that you want to get. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list( self, ) -> List[Webhook]: + """Returns a list of all `webhooks `_. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def update(self, *, event_types: List[str], webhook_id: str) -> None: + """Updates a specified `webhook `_. + + :param event_types: Types of events that you want the webhook to receive. + + :param webhook_id: ID of the webhook that you want to update.""" raise NotImplementedError() @@ -35,6 +58,13 @@ def __init__(self, client: SeamHttpClient, defaults: Dict[str, Any]): self.defaults = defaults def create(self, *, url: str, event_types: Optional[List[str]] = None) -> Webhook: + """Creates a new `webhook `_. + + :param url: URL for the new webhook. + + :param event_types: Types of events that you want the new webhook to receive. + + :returns: OK""" json_payload = {} if url is not None: @@ -47,6 +77,9 @@ def create(self, *, url: str, event_types: Optional[List[str]] = None) -> Webhoo return Webhook.from_dict(res["webhook"]) def delete(self, *, webhook_id: str) -> None: + """Deletes a specified `webhook `_. + + :param webhook_id: ID of the webhook that you want to delete.""" json_payload = {} if webhook_id is not None: @@ -57,6 +90,11 @@ def delete(self, *, webhook_id: str) -> None: return None def get(self, *, webhook_id: str) -> Webhook: + """Gets a specified `webhook `_. + + :param webhook_id: ID of the webhook that you want to get. + + :returns: OK""" json_payload = {} if webhook_id is not None: @@ -69,6 +107,9 @@ def get(self, *, webhook_id: str) -> Webhook: def list( self, ) -> List[Webhook]: + """Returns a list of all `webhooks `_. + + :returns: OK""" json_payload = {} res = self.client.post("/webhooks/list", json=json_payload) @@ -76,6 +117,11 @@ def list( return [Webhook.from_dict(item) for item in res["webhooks"]] def update(self, *, event_types: List[str], webhook_id: str) -> None: + """Updates a specified `webhook `_. + + :param event_types: Types of events that you want the webhook to receive. + + :param webhook_id: ID of the webhook that you want to update.""" json_payload = {} if event_types is not None: diff --git a/seam/routes/workspaces.py b/seam/routes/workspaces.py index 75ecded..85b0f01 100644 --- a/seam/routes/workspaces.py +++ b/seam/routes/workspaces.py @@ -22,24 +22,58 @@ def create( webview_primary_button_text_color: Optional[str] = None, webview_success_message: Optional[str] = None ) -> Workspace: + """Creates a new `workspace `_. + + :param name: Name of the new workspace. + + :param company_name: Company name for the new workspace. + + :param connect_partner_name: Deprecated: Use ``company_name`` instead. Connect partner name for the new workspace. + + :param connect_webview_customization: `Connect Webview `_ customizations for the new workspace. See also `Customize the Look and Feel of Your Connect Webviews `_. + + :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 webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead. + + :param webview_primary_button_color: Deprecated: Use ``connect_webview_customization.webview_primary_button_color`` instead. + + :param webview_primary_button_text_color: Deprecated: Use ``connect_webview_customization.webview_primary_button_text_color`` instead. + + :param webview_success_message: Deprecated: Use ``connect_webview_customization.webview_success_message`` instead. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def get( self, ) -> Workspace: + """Returns the `workspace `_ associated with the authentication value. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def list( self, ) -> List[Workspace]: + """Returns a list of `workspaces `_ associated with the authentication value. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod def reset_sandbox( self, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Resets the `sandbox workspace `_ associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" raise NotImplementedError() @abc.abstractmethod @@ -53,6 +87,20 @@ def update( name: Optional[str] = None, organization_id: Optional[str] = None ) -> None: + """Updates the `workspace `_ associated with the authentication value. + + :param connect_partner_name: Connect partner name for the workspace. + + :param connect_webview_customization: `Connect Webview `_ customizations for the workspace. See also `Customize the Look and Feel of Your Connect Webviews `_. + + :param is_publishable_key_auth_enabled: Indicates whether publishable key authentication is enabled for this workspace. + + :param is_suspended: Indicates whether the workspace is suspended. + + :param name: Name of the workspace. + + :param organization_id: ID of the organization to assign the workspace to. The authenticated user must be the owner of the workspace and an admin of the target organization. + """ raise NotImplementedError() @@ -75,6 +123,29 @@ def create( webview_primary_button_text_color: Optional[str] = None, webview_success_message: Optional[str] = None ) -> Workspace: + """Creates a new `workspace `_. + + :param name: Name of the new workspace. + + :param company_name: Company name for the new workspace. + + :param connect_partner_name: Deprecated: Use ``company_name`` instead. Connect partner name for the new workspace. + + :param connect_webview_customization: `Connect Webview `_ customizations for the new workspace. See also `Customize the Look and Feel of Your Connect Webviews `_. + + :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 webview_logo_shape: Deprecated: Use ``connect_webview_customization.webview_logo_shape`` instead. + + :param webview_primary_button_color: Deprecated: Use ``connect_webview_customization.webview_primary_button_color`` instead. + + :param webview_primary_button_text_color: Deprecated: Use ``connect_webview_customization.webview_primary_button_text_color`` instead. + + :param webview_success_message: Deprecated: Use ``connect_webview_customization.webview_success_message`` instead. + + :returns: OK""" json_payload = {} if name is not None: @@ -109,6 +180,9 @@ def create( def get( self, ) -> Workspace: + """Returns the `workspace `_ associated with the authentication value. + + :returns: OK""" json_payload = {} res = self.client.post("/workspaces/get", json=json_payload) @@ -118,6 +192,9 @@ def get( def list( self, ) -> List[Workspace]: + """Returns a list of `workspaces `_ associated with the authentication value. + + :returns: OK""" json_payload = {} res = self.client.post("/workspaces/list", json=json_payload) @@ -127,6 +204,11 @@ def list( def reset_sandbox( self, wait_for_action_attempt: Optional[Union[bool, Dict[str, float]]] = None ) -> ActionAttempt: + """Resets the `sandbox workspace `_ associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. + + :param wait_for_action_attempt: Whether, and for how long, to wait for the action attempt to finish. + + :returns: OK""" json_payload = {} res = self.client.post("/workspaces/reset_sandbox", json=json_payload) @@ -153,6 +235,20 @@ def update( name: Optional[str] = None, organization_id: Optional[str] = None ) -> None: + """Updates the `workspace `_ associated with the authentication value. + + :param connect_partner_name: Connect partner name for the workspace. + + :param connect_webview_customization: `Connect Webview `_ customizations for the workspace. See also `Customize the Look and Feel of Your Connect Webviews `_. + + :param is_publishable_key_auth_enabled: Indicates whether publishable key authentication is enabled for this workspace. + + :param is_suspended: Indicates whether the workspace is suspended. + + :param name: Name of the workspace. + + :param organization_id: ID of the organization to assign the workspace to. The authenticated user must be the owner of the workspace and an admin of the target organization. + """ json_payload = {} if connect_partner_name is not None: