/* * Automatically generated by codegen/smith.ts. * Do not edit this file or add other files to this directory. */ import { seamApiLtsVersion } from 'lib/lts-version.js' import { getAuthHeadersForClientSessionToken, warnOnInsecureuserIdentifierKey, } from 'lib/seam/connect/auth.js' import { type Client, createClient } from 'lib/seam/connect/client.js' import { isSeamHttpOptionsWithApiKey, isSeamHttpOptionsWithClient, isSeamHttpOptionsWithClientSessionToken, isSeamHttpOptionsWithConsoleSessionToken, isSeamHttpOptionsWithPersonalAccessToken, type SeamHttpFromPublishableKeyOptions, SeamHttpInvalidOptionsError, type SeamHttpOptions, type SeamHttpOptionsWithApiKey, type SeamHttpOptionsWithClient, type SeamHttpOptionsWithClientSessionToken, type SeamHttpOptionsWithConsoleSessionToken, type SeamHttpOptionsWithPersonalAccessToken, type SeamHttpRequestOptions, } from 'lib/seam/connect/options.js' import { limitToSeamHttpRequestOptions, parseOptions, } from 'lib/seam/connect/parse-options.js' import type { AccessCode } from 'lib/seam/connect/resources/access-code.js' import { SeamHttpClientSessions } from 'lib/seam/connect/routes/client-sessions/index.js' import { SeamHttpRequest } from 'lib/seam/connect/seam-http-request.js' import { SeamPaginator } from 'lib/seam/connect/seam-paginator.js' import { SeamHttpAccessCodesSimulate } from './simulate/index.js' import { SeamHttpAccessCodesUnmanaged } from './unmanaged/index.js' export class SeamHttpAccessCodes { client: Client readonly defaults: Required readonly ltsVersion = seamApiLtsVersion static ltsVersion = seamApiLtsVersion constructor(apiKeyOrOptions: string | SeamHttpOptions = {}) { const options = parseOptions(apiKeyOrOptions) this.client = 'client' in options ? options.client : createClient(options) this.defaults = limitToSeamHttpRequestOptions(options) } static fromClient( client: SeamHttpOptionsWithClient['client'], options: Omit = {}, ): SeamHttpAccessCodes { const constructorOptions = { ...options, client } if (!isSeamHttpOptionsWithClient(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing client') } return new SeamHttpAccessCodes(constructorOptions) } static fromApiKey( apiKey: SeamHttpOptionsWithApiKey['apiKey'], options: Omit = {}, ): SeamHttpAccessCodes { const constructorOptions = { ...options, apiKey } if (!isSeamHttpOptionsWithApiKey(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing apiKey') } return new SeamHttpAccessCodes(constructorOptions) } static fromClientSessionToken( clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], options: Omit< SeamHttpOptionsWithClientSessionToken, 'clientSessionToken' > = {}, ): SeamHttpAccessCodes { const constructorOptions = { ...options, clientSessionToken } if (!isSeamHttpOptionsWithClientSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError('Missing clientSessionToken') } return new SeamHttpAccessCodes(constructorOptions) } static async fromPublishableKey( publishableKey: string, userIdentifierKey: string, options: SeamHttpFromPublishableKeyOptions = {}, ): Promise { warnOnInsecureuserIdentifierKey(userIdentifierKey) const clientOptions = parseOptions({ ...options, publishableKey }) if (isSeamHttpOptionsWithClient(clientOptions)) { throw new SeamHttpInvalidOptionsError( 'The client option cannot be used with SeamHttpAccessCodes.fromPublishableKey', ) } const client = createClient(clientOptions) const clientSessions = SeamHttpClientSessions.fromClient(client) const { token } = await clientSessions.getOrCreate({ user_identifier_key: userIdentifierKey, }) return SeamHttpAccessCodes.fromClientSessionToken(token, options) } static fromConsoleSessionToken( consoleSessionToken: SeamHttpOptionsWithConsoleSessionToken['consoleSessionToken'], workspaceId: SeamHttpOptionsWithConsoleSessionToken['workspaceId'], options: Omit< SeamHttpOptionsWithConsoleSessionToken, 'consoleSessionToken' | 'workspaceId' > = {}, ): SeamHttpAccessCodes { const constructorOptions = { ...options, consoleSessionToken, workspaceId } if (!isSeamHttpOptionsWithConsoleSessionToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing consoleSessionToken or workspaceId', ) } return new SeamHttpAccessCodes(constructorOptions) } static fromPersonalAccessToken( personalAccessToken: SeamHttpOptionsWithPersonalAccessToken['personalAccessToken'], workspaceId: SeamHttpOptionsWithPersonalAccessToken['workspaceId'], options: Omit< SeamHttpOptionsWithPersonalAccessToken, 'personalAccessToken' | 'workspaceId' > = {}, ): SeamHttpAccessCodes { const constructorOptions = { ...options, personalAccessToken, workspaceId } if (!isSeamHttpOptionsWithPersonalAccessToken(constructorOptions)) { throw new SeamHttpInvalidOptionsError( 'Missing personalAccessToken or workspaceId', ) } return new SeamHttpAccessCodes(constructorOptions) } createPaginator( request: SeamHttpRequest, ): SeamPaginator { return new SeamPaginator(this, request) } async updateClientSessionToken( clientSessionToken: SeamHttpOptionsWithClientSessionToken['clientSessionToken'], ): Promise { const { headers } = this.client.defaults const authHeaders = getAuthHeadersForClientSessionToken({ clientSessionToken, }) for (const key of Object.keys(authHeaders)) { if (headers[key] == null) { throw new Error( 'Cannot update a clientSessionToken on a client created without a clientSessionToken', ) } } this.client.defaults.headers = { ...headers, ...authHeaders } const clientSessions = SeamHttpClientSessions.fromClient(this.client) await clientSessions.get() } get simulate(): SeamHttpAccessCodesSimulate { return SeamHttpAccessCodesSimulate.fromClient(this.client, this.defaults) } get unmanaged(): SeamHttpAccessCodesUnmanaged { return SeamHttpAccessCodesUnmanaged.fromClient(this.client, this.defaults) } /** * Creates a new [access code](https://docs.seam.co/low-level-apis/access-codes). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) 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. */ create( parameters: AccessCodesCreateParameters, options: AccessCodesCreateOptions = {}, ): AccessCodesCreateRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/create', method: 'POST', body: parameters, responseKey: 'access_code', options, }) } /** * Creates new [access codes](https://docs.seam.co/low-level-apis/smart-locks/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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). * * For granting a person access to a space, [Access Grants](https://docs.seam.co/use-cases/granting-access) 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. */ createMultiple( parameters: AccessCodesCreateMultipleParameters, options: AccessCodesCreateMultipleOptions = {}, ): AccessCodesCreateMultipleRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/create_multiple', method: 'PUT', body: parameters, responseKey: 'access_codes', options, }) } /** * Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). */ delete( parameters: AccessCodesDeleteParameters, options: AccessCodesDeleteOptions = {}, ): AccessCodesDeleteRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/delete', method: 'POST', body: parameters, responseKey: undefined, options, }) } /** * Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. */ generateCode( parameters: AccessCodesGenerateCodeParameters, options: AccessCodesGenerateCodeOptions = {}, ): AccessCodesGenerateCodeRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/generate_code', method: 'POST', body: parameters, responseKey: 'generated_code', options, }) } /** * Returns a specified [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). * * You must specify either `access_code_id` or both `device_id` and `code`. */ get( parameters?: AccessCodesGetParameters, options: AccessCodesGetOptions = {}, ): AccessCodesGetRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/get', method: 'POST', body: parameters, responseKey: 'access_code', options, }) } /** * Returns a list of all [access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes). * * Specify `device_id`, `access_code_ids`, `access_method_id`, `access_grant_id`, or `access_grant_key`. */ list( parameters?: AccessCodesListParameters, options: AccessCodesListOptions = {}, ): AccessCodesListRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/list', method: 'POST', body: parameters, responseKey: 'access_codes', options, }) } /** * Retrieves a backup access code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). See also [Managing Backup Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/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. */ pullBackupAccessCode( parameters: AccessCodesPullBackupAccessCodeParameters, options: AccessCodesPullBackupAccessCodeOptions = {}, ): AccessCodesPullBackupAccessCodeRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/pull_backup_access_code', method: 'POST', body: parameters, responseKey: 'access_code', options, }) } /** * 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`. */ reportDeviceConstraints( parameters: AccessCodesReportDeviceConstraintsParameters, options: AccessCodesReportDeviceConstraintsOptions = {}, ): AccessCodesReportDeviceConstraintsRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/report_device_constraints', method: 'POST', body: parameters, responseKey: undefined, options, }) } /** * Updates a specified active or upcoming [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). * * See also [Modifying Access Codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes). */ update( parameters: AccessCodesUpdateParameters, options: AccessCodesUpdateOptions = {}, ): AccessCodesUpdateRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/update', method: 'PUT', body: parameters, responseKey: undefined, options, }) } /** * Updates [access codes](https://docs.seam.co/low-level-apis/smart-locks/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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes#update-linked-access-codes). */ updateMultiple( parameters: AccessCodesUpdateMultipleParameters, options: AccessCodesUpdateMultipleOptions = {}, ): AccessCodesUpdateMultipleRequest { return new SeamHttpRequest(this, { pathname: '/access_codes/update_multiple', method: 'PATCH', body: parameters, responseKey: undefined, options, }) } } export type AccessCodesCreateParameters = { /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ allow_external_modification?: boolean | undefined attempt_for_offline_device?: boolean | undefined /** * Code to be used for access. */ code?: string | undefined /** * 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/creating-and-updating-multiple-linked-access-codes). */ common_code_key?: string | undefined /** * ID of the device for which you want to create the new access code. */ device_id: string /** * Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. */ ends_at?: string | undefined /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ is_external_modification_allowed?: boolean | undefined /** * Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). */ is_offline_access_code?: boolean | undefined /** * Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code. */ is_one_time_use?: boolean | undefined /** * Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. */ max_time_rounding?: '1hour' | '1day' | '1h' | '1d' | undefined /** * 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). */ name?: string | undefined /** * Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. */ prefer_native_scheduling?: boolean | undefined /** * 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. */ preferred_code_length?: number | undefined /** * Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */ starts_at?: string | undefined /** * Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). */ use_backup_access_code_pool?: boolean | undefined /** * @deprecated Use `is_offline_access_code` instead. */ use_offline_access_code?: boolean | undefined } /** * @deprecated Use AccessCodesCreateRequest instead. */ export type AccessCodesCreateResponse = { access_code: AccessCode } export type AccessCodesCreateRequest = SeamHttpRequest< AccessCodesCreateResponse, 'access_code' > export interface AccessCodesCreateOptions {} export type AccessCodesCreateMultipleParameters = { /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ allow_external_modification?: boolean | undefined attempt_for_offline_device?: boolean | undefined /** * 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. */ behavior_when_code_cannot_be_shared?: 'throw' | 'create_random_code' | undefined /** * Code to be used for access. */ code?: string | undefined /** * IDs of the devices for which you want to create the new access codes. */ device_ids: Array /** * Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. */ ends_at?: string | undefined /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ is_external_modification_allowed?: boolean | undefined /** * 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). */ name?: string | undefined /** * Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. */ prefer_native_scheduling?: boolean | undefined /** * Preferred code length. If the affected devices do not support the preferred code length, Seam reverts to using the shortest supported code length. */ preferred_code_length?: number | undefined /** * Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */ starts_at?: string | undefined /** * Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). */ use_backup_access_code_pool?: boolean | undefined } /** * @deprecated Use AccessCodesCreateMultipleRequest instead. */ export type AccessCodesCreateMultipleResponse = { access_codes: Array } export type AccessCodesCreateMultipleRequest = SeamHttpRequest< AccessCodesCreateMultipleResponse, 'access_codes' > export interface AccessCodesCreateMultipleOptions {} export type AccessCodesDeleteParameters = { /** * ID of the access code that you want to delete. */ access_code_id: string /** * ID of the device for which you want to delete the access code. */ device_id?: string | undefined } /** * @deprecated Use AccessCodesDeleteRequest instead. */ export type AccessCodesDeleteResponse = void export type AccessCodesDeleteRequest = SeamHttpRequest export interface AccessCodesDeleteOptions {} export type AccessCodesGenerateCodeParameters = { /** * ID of the device for which you want to generate a code. */ device_id: string } /** * @deprecated Use AccessCodesGenerateCodeRequest instead. */ export type AccessCodesGenerateCodeResponse = { generated_code: AccessCode } export type AccessCodesGenerateCodeRequest = SeamHttpRequest< AccessCodesGenerateCodeResponse, 'generated_code' > export interface AccessCodesGenerateCodeOptions {} export type AccessCodesGetParameters = { /** * ID of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. */ access_code_id?: string | undefined /** * Code of the access code that you want to get. You must specify either `access_code_id` or both `device_id` and `code`. */ code?: string | undefined /** * 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`. */ device_id?: string | undefined } /** * @deprecated Use AccessCodesGetRequest instead. */ export type AccessCodesGetResponse = { access_code: AccessCode } export type AccessCodesGetRequest = SeamHttpRequest< AccessCodesGetResponse, 'access_code' > export interface AccessCodesGetOptions {} export type AccessCodesListParameters = { /** * 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`. */ access_code_ids?: Array | undefined /** * 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`. */ access_grant_id?: string | undefined /** * 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`. */ access_grant_key?: string | undefined /** * 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`. */ access_method_id?: string | undefined /** * Customer key for which you want to list access codes. */ customer_key?: string | undefined /** * 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`. */ device_id?: string | undefined /** * Numerical limit on the number of access codes to return. */ limit?: number | undefined /** * Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`. */ page_cursor?: string | undefined /** * 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`. */ search?: string | undefined /** * Your user ID for the user by which to filter access codes. */ user_identifier_key?: string | undefined } /** * @deprecated Use AccessCodesListRequest instead. */ export type AccessCodesListResponse = { access_codes: Array } export type AccessCodesListRequest = SeamHttpRequest< AccessCodesListResponse, 'access_codes' > export interface AccessCodesListOptions {} export type AccessCodesPullBackupAccessCodeParameters = { /** * ID of the access code for which you want to pull a backup access code. */ access_code_id: string } /** * @deprecated Use AccessCodesPullBackupAccessCodeRequest instead. */ export type AccessCodesPullBackupAccessCodeResponse = { access_code: AccessCode } export type AccessCodesPullBackupAccessCodeRequest = SeamHttpRequest< AccessCodesPullBackupAccessCodeResponse, 'access_code' > export interface AccessCodesPullBackupAccessCodeOptions {} export type AccessCodesReportDeviceConstraintsParameters = { /** * ID of the device for which you want to report constraints. */ device_id: string /** * 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`. */ max_code_length?: number | undefined /** * 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`. */ min_code_length?: number | undefined /** * 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`. */ supported_code_lengths?: Array | undefined } /** * @deprecated Use AccessCodesReportDeviceConstraintsRequest instead. */ export type AccessCodesReportDeviceConstraintsResponse = void export type AccessCodesReportDeviceConstraintsRequest = SeamHttpRequest< void, undefined > export interface AccessCodesReportDeviceConstraintsOptions {} export type AccessCodesUpdateParameters = { /** * ID of the access code that you want to update. */ access_code_id: string /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ allow_external_modification?: boolean | undefined attempt_for_offline_device?: boolean | undefined /** * Code to be used for access. */ code?: string | undefined /** * ID of the device containing the access code that you want to update. */ device_id?: string | undefined /** * Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. */ ends_at?: string | undefined /** * Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. */ is_external_modification_allowed?: boolean | undefined /** * 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`. */ is_managed?: boolean | undefined /** * Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). */ is_offline_access_code?: boolean | undefined /** * Indicates whether the [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) is a single-use access code. */ is_one_time_use?: boolean | undefined /** * Maximum rounding adjustment. To create a daily-bound [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes) for devices that support this feature, set this parameter to `1d`. */ max_time_rounding?: '1hour' | '1day' | '1h' | '1d' | undefined /** * 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). */ name?: string | undefined /** * Indicates whether [native scheduling](https://docs.seam.co/low-level-apis/smart-locks/access-codes#native-scheduling) should be used for time-bound codes when supported by the provider. Default: `true`. */ prefer_native_scheduling?: boolean | undefined /** * 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. */ preferred_code_length?: number | undefined /** * Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */ starts_at?: string | undefined /** * 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/modifying-access-codes#special-case-2-changing-a-time-bound-access-code-to-permanent-access). */ type?: 'ongoing' | 'time_bound' | undefined /** * Indicates whether to use a [backup access code pool](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) provided by Seam. If `true`, you can use [`/access_codes/pull_backup_access_code`](https://docs.seam.co/api/access_codes/pull_backup_access_code). */ use_backup_access_code_pool?: boolean | undefined /** * @deprecated Use `is_offline_access_code` instead. */ use_offline_access_code?: boolean | undefined } /** * @deprecated Use AccessCodesUpdateRequest instead. */ export type AccessCodesUpdateResponse = void export type AccessCodesUpdateRequest = SeamHttpRequest export interface AccessCodesUpdateOptions {} export type AccessCodesUpdateMultipleParameters = { /** * Key that links the group of access codes, assigned on creation by `/access_codes/create_multiple`. */ common_code_key: string /** * Date and time at which the validity of the new access code ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. */ ends_at?: string | undefined /** * 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). */ name?: string | undefined /** * Date and time at which the validity of the new access code starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */ starts_at?: string | undefined } /** * @deprecated Use AccessCodesUpdateMultipleRequest instead. */ export type AccessCodesUpdateMultipleResponse = void export type AccessCodesUpdateMultipleRequest = SeamHttpRequest export interface AccessCodesUpdateMultipleOptions {}