From f89c209aa9fc46e0055b2d61e39ebcb3e67ca9a5 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 28 Jul 2026 11:47:08 -0500 Subject: [PATCH 1/2] Move docstring rendering into Handlebars --- codegen/layouts/partials/client-method.hbs | 10 + codegen/layouts/resource.hbs | 26 ++- codegen/lib/handlebars-helpers.ts | 62 ++++++ codegen/lib/layouts/client.ts | 10 + codegen/lib/layouts/resource.ts | 27 ++- codegen/lib/routes.ts | 59 ++++-- codegen/lib/ruby-client.ts | 7 + lib/seam/resources/access_code.rb | 57 +++++- lib/seam/resources/access_grant.rb | 41 +++- lib/seam/resources/access_method.rb | 36 +++- lib/seam/resources/acs_access_group.rb | 33 +++- lib/seam/resources/acs_credential.rb | 63 +++++- lib/seam/resources/acs_encoder.rb | 26 ++- lib/seam/resources/acs_entrance.rb | 49 ++++- lib/seam/resources/acs_system.rb | 42 +++- lib/seam/resources/acs_user.rb | 51 ++++- lib/seam/resources/action_attempt.rb | 11 +- lib/seam/resources/batch.rb | 127 +++++++++++- lib/seam/resources/client_session.rb | 37 +++- lib/seam/resources/connect_webview.rb | 52 ++++- lib/seam/resources/connected_account.rb | 34 +++- lib/seam/resources/customer_portal.rb | 18 +- lib/seam/resources/device.rb | 71 ++++++- lib/seam/resources/device_provider.rb | 49 ++++- lib/seam/resources/event.rb | 186 +++++++++++++++++- lib/seam/resources/instant_key.rb | 24 ++- lib/seam/resources/noise_threshold.rb | 16 +- lib/seam/resources/pagination.rb | 8 +- lib/seam/resources/phone.rb | 17 +- lib/seam/resources/space.rb | 23 ++- .../resources/thermostat_daily_program.rb | 13 +- lib/seam/resources/thermostat_schedule.rb | 25 ++- lib/seam/resources/unmanaged_access_code.rb | 43 +++- lib/seam/resources/unmanaged_access_grant.rb | 33 +++- lib/seam/resources/unmanaged_access_method.rb | 30 ++- lib/seam/resources/unmanaged_device.rb | 61 +++++- lib/seam/resources/unmanaged_user_identity.rb | 17 +- lib/seam/resources/user_identity.rb | 19 +- lib/seam/resources/webhook.rb | 10 +- lib/seam/resources/workspace.rb | 21 +- lib/seam/routes/access_codes.rb | 145 ++++++++++++++ lib/seam/routes/access_codes_simulate.rb | 5 + lib/seam/routes/access_codes_unmanaged.rb | 34 ++++ lib/seam/routes/access_grants.rb | 56 ++++++ lib/seam/routes/access_grants_unmanaged.rb | 20 ++ lib/seam/routes/access_methods.rb | 35 ++++ lib/seam/routes/access_methods_unmanaged.rb | 9 + lib/seam/routes/acs_access_groups.rb | 28 +++ lib/seam/routes/acs_credentials.rb | 49 +++++ lib/seam/routes/acs_encoders.rb | 25 +++ lib/seam/routes/acs_encoders_simulate.rb | 19 ++ lib/seam/routes/acs_entrances.rb | 29 +++ lib/seam/routes/acs_systems.rb | 20 ++ lib/seam/routes/acs_users.rb | 70 +++++++ lib/seam/routes/action_attempts.rb | 9 + lib/seam/routes/client_sessions.rb | 45 +++++ lib/seam/routes/connect_webviews.rb | 36 ++++ lib/seam/routes/connected_accounts.rb | 31 +++ .../routes/connected_accounts_simulate.rb | 3 + lib/seam/routes/customers.rb | 57 ++++++ lib/seam/routes/devices.rb | 44 +++++ lib/seam/routes/devices_simulate.rb | 28 +++ lib/seam/routes/devices_unmanaged.rb | 35 ++++ lib/seam/routes/events.rb | 35 ++++ lib/seam/routes/instant_keys.rb | 10 + lib/seam/routes/locks.rb | 34 ++++ lib/seam/routes/locks_simulate.rb | 7 + lib/seam/routes/noise_sensors.rb | 18 ++ .../routes/noise_sensors_noise_thresholds.rb | 27 +++ lib/seam/routes/noise_sensors_simulate.rb | 3 + lib/seam/routes/phones.rb | 10 + lib/seam/routes/phones_simulate.rb | 6 + lib/seam/routes/spaces.rb | 61 ++++++ lib/seam/routes/thermostats.rb | 108 ++++++++++ lib/seam/routes/thermostats_daily_programs.rb | 13 ++ lib/seam/routes/thermostats_schedules.rb | 28 +++ lib/seam/routes/thermostats_simulate.rb | 13 ++ lib/seam/routes/user_identities.rb | 67 +++++++ lib/seam/routes/user_identities_unmanaged.rb | 16 ++ lib/seam/routes/webhooks.rb | 16 ++ lib/seam/routes/workspaces.rb | 26 +++ 81 files changed, 2802 insertions(+), 72 deletions(-) diff --git a/codegen/layouts/partials/client-method.hbs b/codegen/layouts/partials/client-method.hbs index 90e0a5da..5204dadc 100644 --- a/codegen/layouts/partials/client-method.hbs +++ b/codegen/layouts/partials/client-method.hbs @@ -1,3 +1,13 @@ +{{#if description}} +{{{rubyDoc description 6}}} +{{/if}} +{{#each parameters}} +{{{rubyParamDoc this 6}}} +{{/each}} +{{{rubyReturnDoc returnResource responseDescription 6}}} +{{#if isDeprecated}} +{{{rubyDeprecatedDoc this 6}}} +{{/if}} def {{name}}{{#if hasSignature}}({{signatureParams}}){{/if}} {{#if usesRes}}res = {{/if}}@client.post("{{path}}"{{#if hasParams}}, {{bodyParams}}.compact{{/if}}) {{#if isResource}} diff --git a/codegen/layouts/resource.hbs b/codegen/layouts/resource.hbs index caf09136..315cd9c5 100644 --- a/codegen/layouts/resource.hbs +++ b/codegen/layouts/resource.hbs @@ -2,12 +2,32 @@ module Seam module Resources +{{#if resource.description}} +{{{rubyDoc resource.description 4}}} +{{/if}} +{{#if resource.isDeprecated}} +{{{rubyDeprecatedDoc resource 4}}} +{{/if}} class {{className}} < BaseResource - attr_accessor {{attrAccessors}} -{{#if hasDateAccessors}} +{{#each accessors}} +{{#if description}} +{{{rubyDoc description 6}}} +{{/if}} +{{#if isDeprecated}} +{{{rubyDeprecatedDoc this 6}}} +{{/if}} + attr_accessor :{{name}} +{{/each}} +{{#each dateAccessors}} - date_accessor {{dateAccessors}} +{{#if description}} +{{{rubyDoc description 6}}} +{{/if}} +{{#if isDeprecated}} +{{{rubyDeprecatedDoc this 6}}} {{/if}} + date_accessor :{{name}} +{{/each}} {{#if hasSupportModules}} {{#if includeErrorsSupport}} diff --git a/codegen/lib/handlebars-helpers.ts b/codegen/lib/handlebars-helpers.ts index dac2bee2..a4aaab84 100644 --- a/codegen/lib/handlebars-helpers.ts +++ b/codegen/lib/handlebars-helpers.ts @@ -1 +1,63 @@ export const identity = (x: unknown): unknown => x + +export interface Documented { + description: string + isDeprecated: boolean + deprecationMessage: string +} + +const comment = (lines: string[], indentation: number): string => { + const prefix = `${' '.repeat(indentation)}#` + return lines + .map((line) => `${prefix}${line === '' ? '' : ` ${line}`}`) + .join('\n') +} + +export const rubyDoc = (description: string, indentation: number): string => + comment(description === '' ? [] : description.split('\n'), indentation) + +export const rubyDeprecatedDoc = ( + documented: Documented, + indentation: number, +): string => + documented.isDeprecated + ? comment( + [`@deprecated ${documented.deprecationMessage}`.trimEnd()], + indentation, + ) + : '' + +export const rubyParamDoc = ( + parameter: Documented & { name: string }, + indentation: number, +): string => { + const [firstLine = '', ...remainingLines] = parameter.description.split('\n') + const deprecation = parameter.isDeprecated + ? `Deprecated: ${parameter.deprecationMessage}` + : '' + const firstLineDescription = [firstLine, deprecation] + .filter((part) => part !== '') + .join(' ') + return comment( + [ + `@param ${parameter.name} ${firstLineDescription}`.trimEnd(), + ...remainingLines, + ], + indentation, + ) +} + +export const rubyReturnDoc = ( + resource: string, + description: string, + indentation: number, +): string => { + const [firstLine = '', ...remainingLines] = description.split('\n') + return comment( + [ + `@return [${resource === '' ? 'nil' : `Seam::Resources::${resource}`}] ${firstLine}`.trimEnd(), + ...remainingLines, + ], + indentation, + ) +} diff --git a/codegen/lib/layouts/client.ts b/codegen/lib/layouts/client.ts index b35846b3..b3672df2 100644 --- a/codegen/lib/layouts/client.ts +++ b/codegen/lib/layouts/client.ts @@ -9,6 +9,11 @@ import { } from '../ruby-client.js' export interface ClientMethodLayoutContext { + description: string + isDeprecated: boolean + deprecationMessage: string + responseDescription: string + parameters: ClientMethod['parameters'] name: string hasSignature: boolean signatureParams: string @@ -55,6 +60,11 @@ const getMethodLayoutContext = ( const isNil = !hasReturnValue return { + description: method.description, + isDeprecated: method.isDeprecated, + deprecationMessage: method.deprecationMessage, + responseDescription: method.responseDescription, + parameters: sortedParameters, name: methodName, hasSignature: signatureParams.length > 0, signatureParams, diff --git a/codegen/lib/layouts/resource.ts b/codegen/lib/layouts/resource.ts index 823bd1b0..5db0b7c5 100644 --- a/codegen/lib/layouts/resource.ts +++ b/codegen/lib/layouts/resource.ts @@ -8,17 +8,28 @@ import { convertCustomResourceName } from '../custom-resource-name-conversions.j export interface ResourceLayoutContext { className: string - attrAccessors: string - hasDateAccessors: boolean - dateAccessors: string + resource: Documented + accessors: Array + dateAccessors: Array hasSupportModules: boolean includeErrorsSupport: boolean includeWarningsSupport: boolean } +interface Documented { + description: string + isDeprecated: boolean + deprecationMessage: string +} + export const setResourceLayoutContext = ( snakeName: string, properties: Property[], + resource: { + description: string + isDeprecated: boolean + deprecationMessage: string + }, ): ResourceLayoutContext => { const attrs = properties .filter((property) => property.format !== 'datetime') @@ -35,9 +46,13 @@ export const setResourceLayoutContext = ( return { className: pascalCase(convertCustomResourceName(snakeName)), - attrAccessors: noErrorWarningAttrs.map((attr) => `:${attr}`).join(', '), - hasDateAccessors: dateAttrs.length > 0, - dateAccessors: dateAttrs.map((attr) => `:${attr}`).join(', '), + resource, + accessors: properties + .filter((property) => noErrorWarningAttrs.includes(property.name)) + .map((property) => property), + dateAccessors: properties + .filter((property) => dateAttrs.includes(property.name)) + .map((property) => property), hasSupportModules: includeErrorsSupport || includeWarningsSupport, includeErrorsSupport, includeWarningsSupport, diff --git a/codegen/lib/routes.ts b/codegen/lib/routes.ts index 8c5b398c..de071c81 100644 --- a/codegen/lib/routes.ts +++ b/codegen/lib/routes.ts @@ -10,6 +10,7 @@ import type { Blueprint, Endpoint, Property, + Resource, Response, } from '@seamapi/blueprint' import { pascalCase } from 'change-case' @@ -54,11 +55,11 @@ export const routes = ( resourceNames.push(name) } - for (const [name, properties] of getResources(blueprint)) { + for (const [name, resource] of getResources(blueprint)) { files[`${resourcesPath}/${name}.rb`] = { contents: Buffer.from('\n'), layout: 'resource.hbs', - ...setResourceLayoutContext(name, properties), + ...setResourceLayoutContext(name, resource.properties, resource), } resourceNames.push(name) } @@ -94,42 +95,59 @@ export const routes = ( } } -const getResources = (blueprint: Blueprint): Array<[string, Property[]]> => { - const resources = new Map() +type ResourceDocumentation = Pick< + Resource, + 'description' | 'isDeprecated' | 'deprecationMessage' +> + +interface ResourceSource extends ResourceDocumentation { + properties: Property[] +} + +const getResources = ( + blueprint: Blueprint, +): Array<[string, ResourceSource]> => { + const resources = new Map() for (const resource of blueprint.resources) { - resources.set(resource.resourceType, resource.properties) + resources.set(resource.resourceType, resource) } // The event resource only has the properties common to all events, but the // SDK exposes a single SeamEvent class, so it needs an accessor for every // property of every event variant. - const eventProperties = resources.get('event') - if (eventProperties != null) { - resources.set( - 'event', - mergeProperties([ - eventProperties, + const eventResource = resources.get('event') + if (eventResource != null) { + resources.set('event', { + ...eventResource, + properties: mergeProperties([ + eventResource.properties, ...blueprint.events.map((event) => event.properties), ]), - ) + }) } // Action attempts are one blueprint entry per action type, but the SDK // exposes a single ActionAttempt class. if (blueprint.actionAttempts.length > 0) { - resources.set( - 'action_attempt', - mergeProperties( + const resource = blueprint.actionAttempts[0] + if (resource == null) throw new Error('Expected an action attempt resource') + resources.set('action_attempt', { + ...resource, + properties: mergeProperties( blueprint.actionAttempts.map( (actionAttempt) => actionAttempt.properties, ), ), - ) + }) } if (blueprint.pagination != null) { - resources.set('pagination', blueprint.pagination.properties) + resources.set('pagination', { + ...blueprint.pagination, + isDeprecated: false, + deprecationMessage: '', + }) } return [...resources.entries()].sort(([a], [b]) => a.localeCompare(b)) @@ -215,9 +233,16 @@ const createClientMethod = (endpoint: Endpoint): ClientMethod => { return { methodName: endpoint.name, + description: endpoint.description, + isDeprecated: endpoint.isDeprecated, + deprecationMessage: endpoint.deprecationMessage, + responseDescription: endpoint.response.description, path: endpoint.path, parameters: endpoint.request.parameters.map((parameter) => ({ name: parameter.name, + description: parameter.description, + isDeprecated: parameter.isDeprecated, + deprecationMessage: parameter.deprecationMessage, required: parameter.isRequired, position: endpoint.name === 'get' && parameter.name === `${returnPath}_id` diff --git a/codegen/lib/ruby-client.ts b/codegen/lib/ruby-client.ts index 64dd4ad9..a3c396af 100644 --- a/codegen/lib/ruby-client.ts +++ b/codegen/lib/ruby-client.ts @@ -4,12 +4,19 @@ export interface ClientMethodParameter { name: string + description: string + isDeprecated: boolean + deprecationMessage: string required?: boolean | undefined position?: number | undefined } export interface ClientMethod { methodName: string + description: string + isDeprecated: boolean + deprecationMessage: string + responseDescription: string path: string parameters: ClientMethodParameter[] returnResource: string | null diff --git a/lib/seam/resources/access_code.rb b/lib/seam/resources/access_code.rb index 34824aeb..efb7e463 100644 --- a/lib/seam/resources/access_code.rb +++ b/lib/seam/resources/access_code.rb @@ -2,10 +2,63 @@ module Seam module Resources + # Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + # + # 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#ongoing-access-codes) and [time-bound](https://docs.seam.co/low-level-apis/smart-locks/access-codes#time-bound-access-codes). 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](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. class AccessCode < BaseResource - attr_accessor :access_code_id, :code, :common_code_key, :device_id, :dormakaba_oracode_metadata, :is_backup, :is_backup_access_code_available, :is_external_modification_allowed, :is_managed, :is_offline_access_code, :is_one_time_use, :is_scheduled_on_device, :is_waiting_for_code_assignment, :name, :pending_mutations, :pulled_backup_access_code_id, :status, :type, :workspace_id + # Unique identifier for the access code. + attr_accessor :access_code_id + # Code used for access. Typically, a numeric or alphanumeric string. + attr_accessor :code + # Unique identifier for a group of access codes that share the same code. + attr_accessor :common_code_key + # Unique identifier for the device associated with the access code. + attr_accessor :device_id + # Metadata for a dormakaba Oracode managed access code. Only present for access codes from dormakaba Oracode devices. + attr_accessor :dormakaba_oracode_metadata + # Indicates whether the access code is a backup code. + attr_accessor :is_backup + # Indicates whether a backup access code is available for use if the primary access code is lost or compromised. + attr_accessor :is_backup_access_code_available + # Indicates whether changes to the access code from external sources are permitted. + attr_accessor :is_external_modification_allowed + # Indicates whether Seam manages the access code. + attr_accessor :is_managed + # 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. + attr_accessor :is_offline_access_code + # Indicates whether the access code can only be used once. If `true`, the code becomes invalid after the first use. + attr_accessor :is_one_time_use + # Indicates whether the code is set on the device according to a preconfigured schedule. + attr_accessor :is_scheduled_on_device + # Indicates whether the access code is waiting for a code assignment. + attr_accessor :is_waiting_for_code_assignment + # 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). + attr_accessor :name + # Collection of pending mutations for the access code. Indicates changes that Seam is in the process of pushing to the device. + attr_accessor :pending_mutations + # Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code. + attr_accessor :pulled_backup_access_code_id + # 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/lifecycle-of-access-codes). + attr_accessor :status + # Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + attr_accessor :type + # Unique identifier for the Seam workspace associated with the access code. + attr_accessor :workspace_id - date_accessor :created_at, :ends_at, :starts_at + # Date and time at which the access code was created. + date_accessor :created_at + + # Date and time after which the time-bound access code becomes inactive. + date_accessor :ends_at + + # Date and time at which the time-bound access code becomes active. + date_accessor :starts_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/access_grant.rb b/lib/seam/resources/access_grant.rb index b0ec4cac..dd388621 100644 --- a/lib/seam/resources/access_grant.rb +++ b/lib/seam/resources/access_grant.rb @@ -2,10 +2,47 @@ module Seam module Resources + # 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. class AccessGrant < BaseResource - attr_accessor :access_grant_id, :access_grant_key, :access_method_ids, :client_session_token, :customization_profile_id, :display_name, :instant_key_url, :location_ids, :name, :pending_mutations, :requested_access_methods, :reservation_key, :space_ids, :user_identity_id, :workspace_id + # ID of the Access Grant. + attr_accessor :access_grant_id + # Unique key for the access grant within the workspace. + attr_accessor :access_grant_key + # IDs of the access methods created for the Access Grant. + attr_accessor :access_method_ids + # Client Session Token. Only returned if the Access Grant has a mobile_key access method. + attr_accessor :client_session_token + # ID of the customization profile associated with the Access Grant. + attr_accessor :customization_profile_id + # Display name of the Access Grant. + attr_accessor :display_name + # Instant Key URL. Only returned if the Access Grant has a single mobile_key access_method. + attr_accessor :instant_key_url + # @deprecated Use `space_ids`. + attr_accessor :location_ids + # Name of the Access Grant. If not provided, the display name will be computed. + attr_accessor :name + # List of pending mutations for the access grant. This shows updates that are in progress. + attr_accessor :pending_mutations + # Access methods that the user requested for the Access Grant. + attr_accessor :requested_access_methods + # Reservation key for the access grant. + attr_accessor :reservation_key + # IDs of the spaces to which the Access Grant gives access. + attr_accessor :space_ids + # ID of user identity to which the Access Grant gives access. + attr_accessor :user_identity_id + # ID of the Seam workspace associated with the Access Grant. + attr_accessor :workspace_id - date_accessor :created_at, :ends_at, :starts_at + # Date and time at which the Access Grant was created. + date_accessor :created_at + + # Date and time at which the Access Grant ends. + date_accessor :ends_at + + # Date and time at which the Access Grant starts. + date_accessor :starts_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/access_method.rb b/lib/seam/resources/access_method.rb index d6b1f07b..0cd4c201 100644 --- a/lib/seam/resources/access_method.rb +++ b/lib/seam/resources/access_method.rb @@ -2,10 +2,42 @@ module Seam module Resources + # 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. class AccessMethod < BaseResource - attr_accessor :access_method_id, :client_session_token, :code, :customization_profile_id, :display_name, :instant_key_url, :is_assignment_required, :is_encoding_required, :is_issued, :is_ready_for_assignment, :is_ready_for_encoding, :mode, :pending_mutations, :workspace_id + # ID of the access method. + attr_accessor :access_method_id + # Token of the client session associated with the access method. + attr_accessor :client_session_token + # The actual PIN code for code access methods. + attr_accessor :code + # ID of the customization profile associated with the access method. + attr_accessor :customization_profile_id + # Display name of the access method. + attr_accessor :display_name + # URL of the Instant Key for mobile key access methods. + attr_accessor :instant_key_url + # 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. + attr_accessor :is_assignment_required + # Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + attr_accessor :is_encoding_required + # Indicates whether the access method has been issued. + attr_accessor :is_issued + # 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. + attr_accessor :is_ready_for_assignment + # 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. + attr_accessor :is_ready_for_encoding + # Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + attr_accessor :mode + # Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. + attr_accessor :pending_mutations + # ID of the Seam workspace associated with the access method. + attr_accessor :workspace_id - date_accessor :created_at, :issued_at + # Date and time at which the access method was created. + date_accessor :created_at + + # Date and time at which the access method was issued. + date_accessor :issued_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/acs_access_group.rb b/lib/seam/resources/acs_access_group.rb index 815e108e..db62c4a8 100644 --- a/lib/seam/resources/acs_access_group.rb +++ b/lib/seam/resources/acs_access_group.rb @@ -2,9 +2,40 @@ module Seam module Resources + # 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](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups), 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](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). class AcsAccessGroup < BaseResource - attr_accessor :access_group_type, :access_group_type_display_name, :access_schedule, :acs_access_group_id, :acs_system_id, :connected_account_id, :display_name, :external_type, :external_type_display_name, :is_managed, :name, :pending_mutations, :workspace_id + # @deprecated Use `external_type`. + attr_accessor :access_group_type + # @deprecated Use `external_type_display_name`. + attr_accessor :access_group_type_display_name + # `starts_at` and `ends_at` timestamps for the access group's access. + attr_accessor :access_schedule + # ID of the access group. + attr_accessor :acs_access_group_id + # ID of the access control system that contains the access group. + attr_accessor :acs_system_id + # ID of the connected account that contains the access group. + attr_accessor :connected_account_id + # Display name for the access group. + attr_accessor :display_name + # Brand-specific terminology for the access group type. + attr_accessor :external_type + # Display name that corresponds to the brand-specific terminology for the access group type. + attr_accessor :external_type_display_name + # Indicates whether Seam manages the access group. + attr_accessor :is_managed + # Name of the access group. + attr_accessor :name + # Collection of pending mutations for the access group. Represents operations that have been requested but not yet completed on the integrated access system. + attr_accessor :pending_mutations + # ID of the workspace that contains the access group. + attr_accessor :workspace_id + # Date and time at which the access group was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/acs_credential.rb b/lib/seam/resources/acs_credential.rb index ada3e44c..011d7fc7 100644 --- a/lib/seam/resources/acs_credential.rb +++ b/lib/seam/resources/acs_credential.rb @@ -2,10 +2,69 @@ module Seam module Resources + # Means by which an [access control system user](https://docs.seam.co/low-level-apis/access-systems/user-management) gains access at an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). The `acs_credential` object represents a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) that provides an ACS user access within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. class AcsCredential < BaseResource - attr_accessor :access_method, :acs_credential_id, :acs_credential_pool_id, :acs_system_id, :acs_user_id, :assa_abloy_vostio_metadata, :card_number, :code, :connected_account_id, :display_name, :ends_at, :external_type, :external_type_display_name, :is_issued, :is_latest_desired_state_synced_with_provider, :is_managed, :is_multi_phone_sync_credential, :is_one_time_use, :parent_acs_credential_id, :starts_at, :user_identity_id, :visionline_metadata, :workspace_id + # Access method for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + attr_accessor :access_method + # ID of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :acs_credential_id + # ID of the credential pool to which the credential belongs. + attr_accessor :acs_credential_pool_id + # ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :acs_system_id + # ID of the [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + attr_accessor :acs_user_id + # Vostio-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :assa_abloy_vostio_metadata + # Number of the card associated with the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :card_number + # Access (PIN) code for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :code + # ID of the [connected account](https://docs.seam.co/core-concepts/connected-accounts) to which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + attr_accessor :connected_account_id + # Display name that corresponds to the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + attr_accessor :display_name + # Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity 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`. + attr_accessor :ends_at + # Brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. Supported values: `pti_card`, `brivo_credential`, `hid_credential`, `visionline_card`. + attr_accessor :external_type + # Display name that corresponds to the brand-specific terminology for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) type. + attr_accessor :external_type_display_name + # Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been encoded onto a card. + attr_accessor :is_issued + # Indicates whether the latest state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) has been synced from Seam to the provider. + attr_accessor :is_latest_desired_state_synced_with_provider + # Indicates whether Seam manages the credential. + attr_accessor :is_managed + # Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) is a [multi-phone sync credential](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + attr_accessor :is_multi_phone_sync_credential + # Indicates whether the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) can only be used once. If `true`, the code becomes invalid after the first use. + attr_accessor :is_one_time_use + # ID of the parent [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :parent_acs_credential_id + # Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) validity starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + attr_accessor :starts_at + # ID of the [user identity](https://docs.seam.co/api/user_identities) to whom the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) belongs. + attr_accessor :user_identity_id + # Visionline-specific metadata for the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :visionline_metadata + # ID of the workspace that contains the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + attr_accessor :workspace_id - date_accessor :created_at, :issued_at, :latest_desired_state_synced_with_provider_at + # Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was created. + date_accessor :created_at + + # Date and time at which the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was encoded onto a card. + date_accessor :issued_at + + # Date and time at which the state of the [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) was most recently synced from Seam to the provider. + date_accessor :latest_desired_state_synced_with_provider_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/acs_encoder.rb b/lib/seam/resources/acs_encoder.rb index 4754cef5..cb6699a3 100644 --- a/lib/seam/resources/acs_encoder.rb +++ b/lib/seam/resources/acs_encoder.rb @@ -2,9 +2,33 @@ module Seam module Resources + # Represents a hardware device that encodes [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) data onto physical cards within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # + # To verify if your access control system requires a card encoder, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). class AcsEncoder < BaseResource - attr_accessor :acs_encoder_id, :acs_system_id, :connected_account_id, :display_name, :workspace_id + # ID of the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + attr_accessor :acs_encoder_id + # ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + attr_accessor :acs_system_id + # ID of the connected account that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + attr_accessor :connected_account_id + # Display name for the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + attr_accessor :display_name + # ID of the workspace that contains the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + attr_accessor :workspace_id + # Date and time at which the [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/acs_entrance.rb b/lib/seam/resources/acs_entrance.rb index 72718b63..00fea3bd 100644 --- a/lib/seam/resources/acs_entrance.rb +++ b/lib/seam/resources/acs_entrance.rb @@ -2,9 +2,56 @@ module Seam module Resources + # Represents an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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. class AcsEntrance < BaseResource - attr_accessor :acs_entrance_id, :acs_system_id, :akiles_metadata, :assa_abloy_vostio_metadata, :avigilon_alta_metadata, :brivo_metadata, :can_belong_to_reservation, :can_unlock_with_card, :can_unlock_with_cloud_key, :can_unlock_with_code, :can_unlock_with_mobile_key, :connected_account_id, :display_name, :dormakaba_ambiance_metadata, :dormakaba_community_metadata, :hotek_metadata, :is_locked, :latch_metadata, :salto_ks_metadata, :salto_space_metadata, :space_ids, :visionline_metadata + # ID of the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :acs_entrance_id + # ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems) that contains the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :acs_system_id + # Akiles-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :akiles_metadata + # ASSA ABLOY Vostio-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :assa_abloy_vostio_metadata + # Avigilon Alta-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :avigilon_alta_metadata + # Brivo-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :brivo_metadata + # Indicates whether the ACS entrance can belong to a reservation via an access_grant.reservation_key. + attr_accessor :can_belong_to_reservation + # Indicates whether the ACS entrance can be unlocked with card credentials. + attr_accessor :can_unlock_with_card + # Indicates whether the ACS entrance can be unlocked with cloud key credentials. + attr_accessor :can_unlock_with_cloud_key + # Indicates whether the ACS entrance can be unlocked with pin codes. + attr_accessor :can_unlock_with_code + # Indicates whether the ACS entrance can be unlocked with mobile key credentials. + attr_accessor :can_unlock_with_mobile_key + # ID of the [connected account](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :connected_account_id + # Display name for the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :display_name + # dormakaba Ambiance-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :dormakaba_ambiance_metadata + # dormakaba Community-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :dormakaba_community_metadata + # Hotek-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :hotek_metadata + # Indicates whether the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) is currently locked. + attr_accessor :is_locked + # Latch-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :latch_metadata + # Salto KS-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :salto_ks_metadata + # Salto Space-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :salto_space_metadata + # IDs of the spaces that the entrance is in. + attr_accessor :space_ids + # Visionline-specific metadata associated with the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :visionline_metadata + # Date and time at which the [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/acs_system.rb b/lib/seam/resources/acs_system.rb index 233714d8..0dd7be6c 100644 --- a/lib/seam/resources/acs_system.rb +++ b/lib/seam/resources/acs_system.rb @@ -2,9 +2,49 @@ module Seam module Resources + # Represents an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # Within an `acs_system`, create [`acs_user`s](https://docs.seam.co/api/acs/users/object) and [`acs_credential`s](https://docs.seam.co/api/acs/credentials/object) 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](https://docs.seam.co/api/acs). class AcsSystem < BaseResource - attr_accessor :acs_access_group_count, :acs_system_id, :acs_user_count, :connected_account_id, :connected_account_ids, :default_credential_manager_acs_system_id, :external_type, :external_type_display_name, :image_alt_text, :image_url, :is_credential_manager, :location, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id + # Number of access groups in the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :acs_access_group_count + # ID of the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :acs_system_id + # Number of users in the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :acs_user_count + # ID of the connected account associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :connected_account_id + # IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [access control system](https://docs.seam.co/low-level-apis/access-systems). + # @deprecated Use `connected_account_id`. + attr_accessor :connected_account_ids + # ID of the default credential manager `acs_system` for this [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :default_credential_manager_acs_system_id + # Brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. + attr_accessor :external_type + # Display name that corresponds to the brand-specific terminology for the [access control system](https://docs.seam.co/low-level-apis/access-systems) type. + attr_accessor :external_type_display_name + # Alternative text for the [access control system](https://docs.seam.co/low-level-apis/access-systems) image. + attr_accessor :image_alt_text + # URL for the image that represents the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :image_url + # Indicates whether the `acs_system` is a credential manager. + attr_accessor :is_credential_manager + # Location information for the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :location + # Name of the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :name + # @deprecated Use `external_type`. + attr_accessor :system_type + # @deprecated Use `external_type_display_name`. + attr_accessor :system_type_display_name + # Visionline-specific metadata for the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :visionline_metadata + # ID of the workspace that contains the [access control system](https://docs.seam.co/low-level-apis/access-systems). + attr_accessor :workspace_id + # Date and time at which the [access control system](https://docs.seam.co/low-level-apis/access-systems) was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/acs_user.rb b/lib/seam/resources/acs_user.rb index e5e4f4de..136a5193 100644 --- a/lib/seam/resources/acs_user.rb +++ b/lib/seam/resources/acs_user.rb @@ -2,9 +2,58 @@ module Seam module Resources + # Represents a [user](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). class AcsUser < BaseResource - attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :connected_account_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_managed, :is_suspended, :pending_mutations, :phone_number, :salto_ks_metadata, :salto_space_metadata, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id + # `starts_at` and `ends_at` timestamps for the [access system user's](https://docs.seam.co/low-level-apis/access-systems/user-management) access. + attr_accessor :access_schedule + # ID of the [access system](https://docs.seam.co/low-level-apis/access-systems) that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :acs_system_id + # ID of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :acs_user_id + # The ID of the connected account that is associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :connected_account_id + # Display name for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :display_name + # @deprecated use email_address. + attr_accessor :email + # Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :email_address + # Brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. + attr_accessor :external_type + # Display name that corresponds to the brand-specific terminology for the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) type. + attr_accessor :external_type_display_name + # Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :full_name + # ID of the HID access control system associated with the user. + attr_accessor :hid_acs_system_id + # Indicates whether Seam manages the access system user. + attr_accessor :is_managed + # Indicates whether the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) is currently [suspended](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users). + attr_accessor :is_suspended + # Pending mutations associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Seam is in the process of pushing these mutations to the integrated access system. + attr_accessor :pending_mutations + # Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + attr_accessor :phone_number + # Salto KS-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :salto_ks_metadata + # Salto Space-specific metadata associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :salto_space_metadata + # Email address of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :user_identity_email_address + # Full name of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :user_identity_full_name + # ID of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :user_identity_id + # Phone number of the user identity associated with the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`). + attr_accessor :user_identity_phone_number + # ID of the workspace that contains the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + attr_accessor :workspace_id + # Date and time at which the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/action_attempt.rb b/lib/seam/resources/action_attempt.rb index 58f32786..c9d00f7f 100644 --- a/lib/seam/resources/action_attempt.rb +++ b/lib/seam/resources/action_attempt.rb @@ -2,8 +2,17 @@ module Seam module Resources + # Locking a door is pending. class ActionAttempt < BaseResource - attr_accessor :action_attempt_id, :action_type, :error, :result, :status + # ID of the action attempt. + attr_accessor :action_attempt_id + # Action attempt to track the status of locking a door. + attr_accessor :action_type + # Error associated with the action. + attr_accessor :error + # Result of the action. + attr_accessor :result + attr_accessor :status end end end diff --git a/lib/seam/resources/batch.rb b/lib/seam/resources/batch.rb index 190e4ccb..19ffabac 100644 --- a/lib/seam/resources/batch.rb +++ b/lib/seam/resources/batch.rb @@ -2,8 +2,133 @@ module Seam module Resources + # A batch of workspace resources. class Batch < BaseResource - attr_accessor :access_codes, :access_grants, :access_methods, :acs_access_groups, :acs_credentials, :acs_encoders, :acs_entrances, :acs_systems, :acs_users, :action_attempts, :client_sessions, :connect_webviews, :connected_accounts, :devices, :events, :instant_keys, :noise_thresholds, :spaces, :thermostat_daily_programs, :thermostat_schedules, :unmanaged_access_codes, :unmanaged_devices, :user_identities, :workspaces + # Represents a smart lock [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + # + # 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#ongoing-access-codes) and [time-bound](https://docs.seam.co/low-level-apis/smart-locks/access-codes#time-bound-access-codes). 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](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. + attr_accessor :access_codes + # 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. + attr_accessor :access_grants + # 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. + attr_accessor :access_methods + # 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](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups), 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](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + attr_accessor :acs_access_groups + # Means by which an [access control system user](https://docs.seam.co/low-level-apis/access-systems/user-management) gains access at an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). The `acs_credential` object represents a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) that provides an ACS user access within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/use-cases/granting-access) are the default and recommended approach. Use the lower-level ACS credential API directly only when you specifically need to manage individual credentials. + attr_accessor :acs_credentials + # Represents a hardware device that encodes [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) data onto physical cards within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # + # To verify if your access control system requires a card encoder, see the corresponding [system integration guide](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + attr_accessor :acs_encoders + # Represents an [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) within an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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. + attr_accessor :acs_entrances + # Represents an [access control system](https://docs.seam.co/low-level-apis/access-systems). + # + # Within an `acs_system`, create [`acs_user`s](https://docs.seam.co/api/acs/users/object) and [`acs_credential`s](https://docs.seam.co/api/acs/credentials/object) 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](https://docs.seam.co/api/acs). + attr_accessor :acs_systems + # Represents a [user](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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](https://docs.seam.co/device-and-system-integration-guides#access-control-systems). + attr_accessor :acs_users + # 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](https://docs.seam.co/core-concepts/action-attempts). + attr_accessor :action_attempts + # Represents a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). 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](https://docs.seam.co/ui-components/overview/getting-started-with-seam-components/get-started-with-react-components-and-client-session-tokens). + attr_accessor :client_sessions + # Represents a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + # + # 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](https://www.w3schools.com/html/html_iframe.asp) 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. + attr_accessor :connect_webviews + # Represents a [connected account](https://docs.seam.co/core-concepts/connected-accounts). 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. + attr_accessor :connected_accounts + # Represents a [device](https://docs.seam.co/core-concepts/devices) that has been connected to Seam. + attr_accessor :devices + # 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](https://console.seam.co). 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. + attr_accessor :events + # 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. + attr_accessor :instant_keys + # Represents a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). 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. + attr_accessor :noise_thresholds + # 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. + attr_accessor :spaces + # 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. + attr_accessor :thermostat_daily_programs + # Represents a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) that activates a configured [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at a specified starting time and deactivates the climate preset at a specified ending time. + attr_accessor :thermostat_schedules + # Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + # + # 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](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) + attr_accessor :unmanaged_access_codes + # Represents an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + attr_accessor :unmanaged_devices + # Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account. + attr_accessor :user_identities + # Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). 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](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) 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](https://docs.seam.co/core-concepts/workspaces#production-workspaces). + attr_accessor :workspaces end end end diff --git a/lib/seam/resources/client_session.rb b/lib/seam/resources/client_session.rb index e9608fc7..e643fa32 100644 --- a/lib/seam/resources/client_session.rb +++ b/lib/seam/resources/client_session.rb @@ -2,10 +2,43 @@ module Seam module Resources + # Represents a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). 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](https://docs.seam.co/ui-components/overview/getting-started-with-seam-components/get-started-with-react-components-and-client-session-tokens). class ClientSession < BaseResource - attr_accessor :client_session_id, :connect_webview_ids, :connected_account_ids, :customer_key, :device_count, :token, :user_identifier_key, :user_identity_id, :user_identity_ids, :workspace_id + # ID of the client session. + attr_accessor :client_session_id + # IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :connect_webview_ids + # IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :connected_account_ids + # Customer key associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :customer_key + # Number of devices associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :device_count + # Client session token associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :token + # Your user ID for the user associated with the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + attr_accessor :user_identifier_key + # ID of the [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. + attr_accessor :user_identity_id + # IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with the client session. + # @deprecated Use `user_identity_id` instead. + attr_accessor :user_identity_ids + # ID of the workspace associated with the client session. + attr_accessor :workspace_id - date_accessor :created_at, :expires_at + # Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) was created. + date_accessor :created_at + + # Date and time at which the [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) expires. + date_accessor :expires_at end end end diff --git a/lib/seam/resources/connect_webview.rb b/lib/seam/resources/connect_webview.rb index f872b88d..03a5a763 100644 --- a/lib/seam/resources/connect_webview.rb +++ b/lib/seam/resources/connect_webview.rb @@ -2,10 +2,58 @@ module Seam module Resources + # Represents a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + # + # 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](https://www.w3schools.com/html/html_iframe.asp) 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. class ConnectWebview < BaseResource - attr_accessor :accepted_capabilities, :accepted_providers, :any_provider_allowed, :automatically_manage_new_devices, :connect_webview_id, :connected_account_id, :custom_metadata, :custom_redirect_failure_url, :custom_redirect_url, :customer_key, :device_selection_mode, :login_successful, :selected_provider, :status, :url, :wait_for_device_creation, :workspace_id + # 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`. + attr_accessor :accepted_capabilities + # List of accepted [provider keys](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). + attr_accessor :accepted_providers + # Indicates whether any provider is allowed. + attr_accessor :any_provider_allowed + # Indicates whether Seam should [import all new devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for use and management by the Seam API. + attr_accessor :automatically_manage_new_devices + # ID of the Connect Webview. + attr_accessor :connect_webview_id + # ID of the connected account associated with the Connect Webview. + attr_accessor :connected_account_id + # Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + attr_accessor :custom_metadata + # URL to which the Connect Webview should redirect when an unexpected error occurs. + attr_accessor :custom_redirect_failure_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. + attr_accessor :custom_redirect_url + # The customer key associated with this webview, if any. + attr_accessor :customer_key + # Device selection mode of the Connect Webview. Supported values: `none`, `single`, `multiple`. + attr_accessor :device_selection_mode + # Indicates whether the user logged in successfully using the Connect Webview. + attr_accessor :login_successful + # Selected provider of the Connect Webview, one of the [provider keys](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). + attr_accessor :selected_provider + # Status of the Connect Webview. `authorized` indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview. + attr_accessor :status + # URL for the Connect Webview. You use the URL to display the Connect Webview flow to your user. + attr_accessor :url + # Indicates whether Seam should [finish syncing all devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#wait_for_device_creation) in a newly-connected account before completing the associated Connect Webview. + attr_accessor :wait_for_device_creation + # ID of the workspace that contains the Connect Webview. + attr_accessor :workspace_id - date_accessor :authorized_at, :created_at + # Date and time at which the user authorized (through the Connect Webview) the management of their devices. + date_accessor :authorized_at + + # Date and time at which the Connect Webview was created. + date_accessor :created_at end end end diff --git a/lib/seam/resources/connected_account.rb b/lib/seam/resources/connected_account.rb index b5fa3036..a344e8de 100644 --- a/lib/seam/resources/connected_account.rb +++ b/lib/seam/resources/connected_account.rb @@ -2,9 +2,41 @@ module Seam module Resources + # Represents a [connected account](https://docs.seam.co/core-concepts/connected-accounts). 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. class ConnectedAccount < BaseResource - attr_accessor :accepted_capabilities, :account_type, :account_type_display_name, :automatically_manage_new_devices, :connected_account_id, :custom_metadata, :customer_key, :default_checkin_time, :default_checkout_time, :display_name, :ical_feed_origin, :ical_url, :image_url, :time_zone, :user_identifier + # List of capabilities that were accepted during the account connection process. + attr_accessor :accepted_capabilities + # Type of connected account. + attr_accessor :account_type + # Display name for the connected account type. + attr_accessor :account_type_display_name + # Indicates whether Seam should [import all new devices](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#automatically_manage_new_devices) for the connected account to make these devices available for management by the Seam API. + attr_accessor :automatically_manage_new_devices + # ID of the connected account. + attr_accessor :connected_account_id + # Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + attr_accessor :custom_metadata + # Your unique key for the customer associated with this connected account. + attr_accessor :customer_key + # 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. + attr_accessor :default_checkin_time + # Default reservation check-out time for this connected account, as `HH:mm` (24-hour). Sourced from the connector configuration. + attr_accessor :default_checkout_time + # Display name for the connected account. + attr_accessor :display_name + # 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. + attr_accessor :ical_feed_origin + # For iCal connected accounts, the feed URL for the connection. Sourced from the connector configuration. + attr_accessor :ical_url + # Logo URL for the connected account provider. + attr_accessor :image_url + # IANA time zone (e.g. America/Los_Angeles) for this connected account. Sourced from the connector configuration. + attr_accessor :time_zone + # User identifier associated with the connected account. + # @deprecated Use `display_name` instead. + attr_accessor :user_identifier + # Date and time at which the connected account was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/customer_portal.rb b/lib/seam/resources/customer_portal.rb index 72a65c58..35a5811c 100644 --- a/lib/seam/resources/customer_portal.rb +++ b/lib/seam/resources/customer_portal.rb @@ -2,10 +2,24 @@ module Seam module Resources + # 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. class CustomerPortal < BaseResource - attr_accessor :customer_key, :url, :workspace_id + # Customer key for the customer portal. + attr_accessor :customer_key + # URL for the customer portal. + attr_accessor :url + # ID of the workspace associated with the customer portal. + attr_accessor :workspace_id - date_accessor :created_at, :expires_at + # Date and time at which the customer portal link was created. + date_accessor :created_at + + # Date and time at which the customer portal link expires. + date_accessor :expires_at end end end diff --git a/lib/seam/resources/device.rb b/lib/seam/resources/device.rb index bdfc576f..4c4f5ff1 100644 --- a/lib/seam/resources/device.rb +++ b/lib/seam/resources/device.rb @@ -2,9 +2,78 @@ module Seam module Resources + # Represents a [device](https://docs.seam.co/core-concepts/devices) that has been connected to Seam. class Device < BaseResource - attr_accessor :can_configure_auto_lock, :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_program_thermostat_programs_as_different_each_day, :can_program_thermostat_programs_as_same_each_day, :can_program_thermostat_programs_as_weekday_weekend, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_hub_connection, :can_simulate_hub_disconnection, :can_simulate_paid_subscription, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_manufacturer, :device_provider, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :space_ids, :workspace_id + # Indicates whether the lock supports configuring automatic locking. + attr_accessor :can_configure_auto_lock + # Indicates whether the thermostat supports cooling. + attr_accessor :can_hvac_cool + # Indicates whether the thermostat supports heating. + attr_accessor :can_hvac_heat + # Indicates whether the thermostat supports simultaneous heating and cooling. + attr_accessor :can_hvac_heat_cool + # Indicates whether the device supports programming offline access codes. + attr_accessor :can_program_offline_access_codes + # Indicates whether the device supports programming online access codes. + attr_accessor :can_program_online_access_codes + # Indicates whether the thermostat supports different climate programs for each day of the week. + attr_accessor :can_program_thermostat_programs_as_different_each_day + # Indicates whether the thermostat supports a single climate program applied to every day. + attr_accessor :can_program_thermostat_programs_as_same_each_day + # Indicates whether the thermostat supports weekday/weekend climate programs. + attr_accessor :can_program_thermostat_programs_as_weekday_weekend + # Indicates whether the device supports remote locking. + attr_accessor :can_remotely_lock + # Indicates whether the device supports remote unlocking. + attr_accessor :can_remotely_unlock + # Indicates whether the thermostat supports running climate programs. + attr_accessor :can_run_thermostat_programs + # Indicates whether the device supports simulating connection in a sandbox. + attr_accessor :can_simulate_connection + # Indicates whether the device supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_disconnection + # Indicates whether the hub supports simulating connection in a sandbox. + attr_accessor :can_simulate_hub_connection + # Indicates whether the hub supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_hub_disconnection + # Indicates whether the device supports simulating a paid subscription in a sandbox. + attr_accessor :can_simulate_paid_subscription + # Indicates whether the device supports simulating removal in a sandbox. + attr_accessor :can_simulate_removal + # Indicates whether the thermostat can be turned off. + attr_accessor :can_turn_off_hvac + # Indicates whether the lock supports unlocking with an access code. + attr_accessor :can_unlock_with_code + # 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](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + attr_accessor :capabilities_supported + # Unique identifier for the account associated with the device. + attr_accessor :connected_account_id + # Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + attr_accessor :custom_metadata + # ID of the device. + attr_accessor :device_id + # Manufacturer of the device. Represents the hardware brand, which may differ from the provider. + attr_accessor :device_manufacturer + # Provider of the device. Represents the third-party service through which the device is controlled. + attr_accessor :device_provider + # Type of the device. + attr_accessor :device_type + # 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. + attr_accessor :display_name + # Indicates whether Seam manages the device. See also [Managed and Unmanaged Devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + attr_accessor :is_managed + # Location information for the device. + attr_accessor :location + # Optional nickname to describe the device, settable through Seam. + attr_accessor :nickname + # Properties of the device. + attr_accessor :properties + # IDs of the spaces the device is in. + attr_accessor :space_ids + # Unique identifier for the Seam workspace associated with the device. + attr_accessor :workspace_id + # Date and time at which the device object was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/device_provider.rb b/lib/seam/resources/device_provider.rb index 14be3247..2f7dc749 100644 --- a/lib/seam/resources/device_provider.rb +++ b/lib/seam/resources/device_provider.rb @@ -3,7 +3,54 @@ module Seam module Resources class DeviceProvider < BaseResource - attr_accessor :can_configure_auto_lock, :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_program_thermostat_programs_as_different_each_day, :can_program_thermostat_programs_as_same_each_day, :can_program_thermostat_programs_as_weekday_weekend, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_hub_connection, :can_simulate_hub_disconnection, :can_simulate_paid_subscription, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :device_provider_name, :display_name, :image_url, :provider_categories + # Indicates whether the lock supports configuring automatic locking. + attr_accessor :can_configure_auto_lock + # Indicates whether the thermostat supports cooling. + attr_accessor :can_hvac_cool + # Indicates whether the thermostat supports heating. + attr_accessor :can_hvac_heat + # Indicates whether the thermostat supports simultaneous heating and cooling. + attr_accessor :can_hvac_heat_cool + # Indicates whether the device supports programming offline access codes. + attr_accessor :can_program_offline_access_codes + # Indicates whether the device supports programming online access codes. + attr_accessor :can_program_online_access_codes + # Indicates whether the thermostat supports different climate programs for each day of the week. + attr_accessor :can_program_thermostat_programs_as_different_each_day + # Indicates whether the thermostat supports a single climate program applied to every day. + attr_accessor :can_program_thermostat_programs_as_same_each_day + # Indicates whether the thermostat supports weekday/weekend climate programs. + attr_accessor :can_program_thermostat_programs_as_weekday_weekend + # Indicates whether the device supports remote locking. + attr_accessor :can_remotely_lock + # Indicates whether the device supports remote unlocking. + attr_accessor :can_remotely_unlock + # Indicates whether the thermostat supports running climate programs. + attr_accessor :can_run_thermostat_programs + # Indicates whether the device supports simulating connection in a sandbox. + attr_accessor :can_simulate_connection + # Indicates whether the device supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_disconnection + # Indicates whether the hub supports simulating connection in a sandbox. + attr_accessor :can_simulate_hub_connection + # Indicates whether the hub supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_hub_disconnection + # Indicates whether the device supports simulating a paid subscription in a sandbox. + attr_accessor :can_simulate_paid_subscription + # Indicates whether the device supports simulating removal in a sandbox. + attr_accessor :can_simulate_removal + # Indicates whether the thermostat can be turned off. + attr_accessor :can_turn_off_hvac + # Indicates whether the lock supports unlocking with an access code. + attr_accessor :can_unlock_with_code + # Name of the device provider. + attr_accessor :device_provider_name + # Display name for the device provider. + attr_accessor :display_name + # Image URL for the device provider. + attr_accessor :image_url + # List of provider categories to which the device provider belongs, such as `stable`, `consumer_smartlocks`, `thermostats`, and so on. + attr_accessor :provider_categories end end end diff --git a/lib/seam/resources/event.rb b/lib/seam/resources/event.rb index d449fdfd..84fee367 100644 --- a/lib/seam/resources/event.rb +++ b/lib/seam/resources/event.rb @@ -3,9 +3,191 @@ module Seam module Resources class SeamEvent < BaseResource - attr_accessor :access_code_errors, :access_code_id, :access_code_is_managed, :access_code_warnings, :access_grant_id, :access_grant_ids, :access_grant_key, :access_grant_keys, :access_method_id, :acs_access_group_id, :acs_credential_id, :acs_encoder_id, :acs_entrance_id, :acs_entrance_ids, :acs_system_errors, :acs_system_id, :acs_system_warnings, :acs_user_id, :action_attempt_id, :action_type, :activation_reason, :backup_access_code_id, :battery_level, :battery_status, :change_reason, :changed_properties, :client_session_id, :climate_preset_key, :code, :connect_webview_id, :connected_account_custom_metadata, :connected_account_errors, :connected_account_id, :connected_account_type, :connected_account_warnings, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :customer_key, :description, :desired_temperature_celsius, :desired_temperature_fahrenheit, :device_custom_metadata, :device_errors, :device_id, :device_ids, :device_name, :device_warnings, :ends_at, :error_code, :error_message, :event_description, :event_id, :event_type, :fan_mode_setting, :from, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :image_url, :is_backup_code, :is_fallback_climate_preset, :is_via_bluetooth, :is_via_nfc, :lower_limit_celsius, :lower_limit_fahrenheit, :method, :minut_metadata, :missing_device_ids, :motion_sub_type, :noise_level_decibels, :noise_level_nrs, :noise_threshold_id, :noise_threshold_name, :noiseaware_metadata, :reason, :requested_mutations, :space_id, :space_key, :starts_at, :status, :temperature_celsius, :temperature_fahrenheit, :thermostat_schedule_id, :to, :upper_limit_celsius, :upper_limit_fahrenheit, :user_identity_id, :video_url, :workspace_id + # Errors associated with the access code. + attr_accessor :access_code_errors + # ID of the affected access code. + attr_accessor :access_code_id + # Whether the access code is managed by Seam (true) or unmanaged (false). Only present when access_code_id is set. + attr_accessor :access_code_is_managed + # Warnings associated with the access code. + attr_accessor :access_code_warnings + # ID of the affected Access Grant. + attr_accessor :access_grant_id + # IDs of the access grants associated with this access method. + attr_accessor :access_grant_ids + # Key of the affected Access Grant (if present). + attr_accessor :access_grant_key + # Keys of the access grants associated with this access method (if present). + attr_accessor :access_grant_keys + # ID of the affected access method. + attr_accessor :access_method_id + # ID of the affected access group. + attr_accessor :acs_access_group_id + # ID of the affected credential. + attr_accessor :acs_credential_id + # ID of the affected encoder. + attr_accessor :acs_encoder_id + # ID of the affected [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + attr_accessor :acs_entrance_id + # IDs of all ACS entrances currently attached to the space. + attr_accessor :acs_entrance_ids + # Errors associated with the access control system. + attr_accessor :acs_system_errors + # ID of the access system. + attr_accessor :acs_system_id + # Warnings associated with the access control system. + attr_accessor :acs_system_warnings + # ID of the affected access system user. + attr_accessor :acs_user_id + # ID of the affected action attempt. + attr_accessor :action_attempt_id + # Type of the action. + attr_accessor :action_type + # The reason the camera was activated. + attr_accessor :activation_reason + # ID of the backup access code that was pulled from the pool. + attr_accessor :backup_access_code_id + # Number in the range 0 to 1.0 indicating the amount of battery in the affected device, as reported by the device. + attr_accessor :battery_level + # Battery status of the affected device, calculated from the numeric `battery_level` value. + attr_accessor :battery_status + # Human-readable reason for the change (e.g. `ongoing code auto-renewed`). + attr_accessor :change_reason + # List of properties that changed on the access code. + attr_accessor :changed_properties + # ID of the affected client session. + attr_accessor :client_session_id + # Key of the climate preset that was activated. + attr_accessor :climate_preset_key + # Code for the affected access code. + attr_accessor :code + # ID of the Connect Webview associated with the event. + attr_accessor :connect_webview_id + # Custom metadata of the connected account, present when connected_account_id is provided. + attr_accessor :connected_account_custom_metadata + # Errors associated with the connected account. + attr_accessor :connected_account_errors + # ID of the connected account associated with the affected access code. + attr_accessor :connected_account_id + # undocumented: Unreleased. + attr_accessor :connected_account_type + # Warnings associated with the connected account. + attr_accessor :connected_account_warnings + # Temperature to which the thermostat should cool (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + attr_accessor :cooling_set_point_celsius + # Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + attr_accessor :cooling_set_point_fahrenheit + # The customer key associated with this connected account, if any. + attr_accessor :customer_key + # Human-readable description of the change and its source. + attr_accessor :description + # Desired temperature, in °C, defined by the affected thermostat's cooling or heating set point. + attr_accessor :desired_temperature_celsius + # Desired temperature, in °F, defined by the affected thermostat's cooling or heating set point. + attr_accessor :desired_temperature_fahrenheit + # Custom metadata of the device, present when device_id is provided. + attr_accessor :device_custom_metadata + # Errors associated with the device. + attr_accessor :device_errors + # ID of the device associated with the affected access code. + attr_accessor :device_id + # IDs of all devices currently attached to the space. + attr_accessor :device_ids + # 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. + attr_accessor :device_name + # Warnings associated with the device. + attr_accessor :device_warnings + # The new end time for the access grant. + attr_accessor :ends_at + # Error code associated with the disconnection event, if any. + attr_accessor :error_code + # Description of why the access methods could not be created. + attr_accessor :error_message + # 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. + attr_accessor :event_description + # ID of the event. + attr_accessor :event_id + attr_accessor :event_type + # Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + attr_accessor :fan_mode_setting + # Previous access code name configuration. + attr_accessor :from + # Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + attr_accessor :heating_set_point_celsius + # Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + attr_accessor :heating_set_point_fahrenheit + # Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + attr_accessor :hvac_mode_setting + # URL to a thumbnail image captured at the time of activation. + attr_accessor :image_url + # Indicates whether the code is a backup code (only present when mode is 'code' and a backup code was used). + attr_accessor :is_backup_code + # Indicates whether the climate preset that was activated is the fallback climate preset for the thermostat. + attr_accessor :is_fallback_climate_preset + # 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. + attr_accessor :is_via_bluetooth + # 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. + attr_accessor :is_via_nfc + # Lower temperature limit, in °C, defined by the set threshold. + attr_accessor :lower_limit_celsius + # Lower temperature limit, in °F, defined by the set threshold. + attr_accessor :lower_limit_fahrenheit + # 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. + attr_accessor :method + # Metadata from Minut. + attr_accessor :minut_metadata + # 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. + attr_accessor :missing_device_ids + # Sub-type of motion detected, if available. + attr_accessor :motion_sub_type + # Detected noise level in decibels. + attr_accessor :noise_level_decibels + # Detected noise level in Noiseaware Noise Risk Score (NRS). + attr_accessor :noise_level_nrs + # ID of the noise threshold that was triggered. + attr_accessor :noise_threshold_id + # Name of the noise threshold that was triggered. + attr_accessor :noise_threshold_name + # Metadata from Noiseaware. + attr_accessor :noiseaware_metadata + # Why access was denied, when the provider reports a determinable cause. Omitted when unknown. + attr_accessor :reason + # Array of mutations requested on the access code, each containing the mutation type and from/to values. + attr_accessor :requested_mutations + # ID of the affected space. + attr_accessor :space_id + # Unique key for the space within the workspace. + attr_accessor :space_key + # The new start time for the access grant. + attr_accessor :starts_at + # Status of the action. + attr_accessor :status + # Temperature, in °C, reported by the affected thermostat. + attr_accessor :temperature_celsius + # Temperature, in °F, reported by the affected thermostat. + attr_accessor :temperature_fahrenheit + # ID of the thermostat schedule that prompted the affected climate preset to be activated. + attr_accessor :thermostat_schedule_id + # New access code name configuration. + attr_accessor :to + # Upper temperature limit, in °C, defined by the set threshold. + attr_accessor :upper_limit_celsius + # Upper temperature limit, in °F, defined by the set threshold. + attr_accessor :upper_limit_fahrenheit + # undocumented: Unreleased. + # --- + # ID of the user identity associated with the lock event. + attr_accessor :user_identity_id + # URL to a short video clip captured at the time of activation. + attr_accessor :video_url + # ID of the workspace associated with the event. + attr_accessor :workspace_id - date_accessor :created_at, :occurred_at + # Date and time at which the event was created. + date_accessor :created_at + + # Date and time at which the event occurred. + date_accessor :occurred_at end end end diff --git a/lib/seam/resources/instant_key.rb b/lib/seam/resources/instant_key.rb index 9cfed5dc..ecee8091 100644 --- a/lib/seam/resources/instant_key.rb +++ b/lib/seam/resources/instant_key.rb @@ -2,10 +2,30 @@ module Seam module Resources + # 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. class InstantKey < BaseResource - attr_accessor :client_session_id, :customization, :customization_profile_id, :instant_key_id, :instant_key_url, :user_identity_id, :workspace_id + # ID of the client session associated with the Instant Key. + attr_accessor :client_session_id + # Customization applied to the Instant Key UI. + attr_accessor :customization + # ID of the customization profile associated with the Instant Key. + attr_accessor :customization_profile_id + # ID of the Instant Key. + attr_accessor :instant_key_id + # 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. + attr_accessor :instant_key_url + # ID of the user identity associated with the Instant Key. + attr_accessor :user_identity_id + # ID of the workspace that contains the Instant Key. + attr_accessor :workspace_id - date_accessor :created_at, :expires_at + # Date and time at which the Instant Key was created. + date_accessor :created_at + + # Date and time at which the Instant Key expires. + date_accessor :expires_at end end end diff --git a/lib/seam/resources/noise_threshold.rb b/lib/seam/resources/noise_threshold.rb index 16f7737f..c95947b1 100644 --- a/lib/seam/resources/noise_threshold.rb +++ b/lib/seam/resources/noise_threshold.rb @@ -2,8 +2,22 @@ module Seam module Resources + # Represents a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). 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. class NoiseThreshold < BaseResource - attr_accessor :device_id, :ends_daily_at, :name, :noise_threshold_decibels, :noise_threshold_id, :noise_threshold_nrs, :starts_daily_at + # Unique identifier for the device that contains the noise threshold. + attr_accessor :device_id + # Time at which the noise threshold should become inactive daily. + attr_accessor :ends_daily_at + # Name of the noise threshold. + attr_accessor :name + # Noise level in decibels for the noise threshold. + attr_accessor :noise_threshold_decibels + # Unique identifier for the noise threshold. + attr_accessor :noise_threshold_id + # Noise level in Noiseaware Noise Risk Score (NRS) for the noise threshold. This parameter is only relevant for [Noiseaware sensors](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + attr_accessor :noise_threshold_nrs + # Time at which the noise threshold should become active daily. + attr_accessor :starts_daily_at end end end diff --git a/lib/seam/resources/pagination.rb b/lib/seam/resources/pagination.rb index 891f5511..659583d5 100644 --- a/lib/seam/resources/pagination.rb +++ b/lib/seam/resources/pagination.rb @@ -2,8 +2,14 @@ module Seam module Resources + # Information about the current page of results. class Pagination < BaseResource - attr_accessor :has_next_page, :next_page_cursor, :next_page_url + # Indicates whether there is another page of results after this one. + attr_accessor :has_next_page + # Opaque value that can be used to select the next page of results via the `page_cursor` parameter. + attr_accessor :next_page_cursor + # URL to get the next page of results. + attr_accessor :next_page_url end end end diff --git a/lib/seam/resources/phone.rb b/lib/seam/resources/phone.rb index 8821fc92..2320592e 100644 --- a/lib/seam/resources/phone.rb +++ b/lib/seam/resources/phone.rb @@ -2,9 +2,24 @@ module Seam module Resources + # Represents an app user's mobile phone. class Phone < BaseResource - attr_accessor :custom_metadata, :device_id, :device_type, :display_name, :nickname, :properties, :workspace_id + # Optional [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for the phone. + attr_accessor :custom_metadata + # ID of the phone. + attr_accessor :device_id + # Type of the phone device, such as `ios_phone` or `android_phone`. + attr_accessor :device_type + # 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. + attr_accessor :display_name + # Optional nickname to describe the phone, settable through Seam. + attr_accessor :nickname + # Properties of the phone. + attr_accessor :properties + # ID of the workspace that contains the phone. + attr_accessor :workspace_id + # Date and time at which the phone was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/space.rb b/lib/seam/resources/space.rb index 2fac3d55..4057177b 100644 --- a/lib/seam/resources/space.rb +++ b/lib/seam/resources/space.rb @@ -2,9 +2,30 @@ module Seam module Resources + # 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. class Space < BaseResource - attr_accessor :acs_entrance_count, :customer_data, :customer_key, :device_count, :display_name, :geolocation, :name, :space_id, :space_key, :workspace_id + # Number of entrances in the space. + attr_accessor :acs_entrance_count + # 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). + attr_accessor :customer_data + # Customer key associated with the space. + attr_accessor :customer_key + # Number of devices in the space. + attr_accessor :device_count + # Display name for the space. + attr_accessor :display_name + # Geographic coordinates (latitude and longitude) of the space. + attr_accessor :geolocation + # Name of the space. + attr_accessor :name + # ID of the space. + attr_accessor :space_id + # Unique key for the space within the workspace. + attr_accessor :space_key + # ID of the workspace associated with the space. + attr_accessor :workspace_id + # Date and time at which the space was created. date_accessor :created_at end end diff --git a/lib/seam/resources/thermostat_daily_program.rb b/lib/seam/resources/thermostat_daily_program.rb index cfac2f76..bcf86120 100644 --- a/lib/seam/resources/thermostat_daily_program.rb +++ b/lib/seam/resources/thermostat_daily_program.rb @@ -2,9 +2,20 @@ module Seam module Resources + # 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. class ThermostatDailyProgram < BaseResource - attr_accessor :device_id, :name, :periods, :thermostat_daily_program_id, :workspace_id + # ID of the thermostat device on which the thermostat daily program is configured. + attr_accessor :device_id + # User-friendly name to identify the thermostat daily program. + attr_accessor :name + # Array of thermostat daily program periods. + attr_accessor :periods + # ID of the thermostat daily program. + attr_accessor :thermostat_daily_program_id + # ID of the workspace that contains the thermostat daily program. + attr_accessor :workspace_id + # Date and time at which the thermostat daily program was created. date_accessor :created_at end end diff --git a/lib/seam/resources/thermostat_schedule.rb b/lib/seam/resources/thermostat_schedule.rb index 5b1e7974..4c85889f 100644 --- a/lib/seam/resources/thermostat_schedule.rb +++ b/lib/seam/resources/thermostat_schedule.rb @@ -2,10 +2,31 @@ module Seam module Resources + # Represents a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) that activates a configured [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at a specified starting time and deactivates the climate preset at a specified ending time. class ThermostatSchedule < BaseResource - attr_accessor :climate_preset_key, :device_id, :is_override_allowed, :max_override_period_minutes, :name, :thermostat_schedule_id, :workspace_id + # Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + attr_accessor :climate_preset_key + # ID of the desired [thermostat](https://docs.seam.co/capability-guides/thermostats) device. + attr_accessor :device_id + # Indicates whether a person at the thermostat can change the thermostat's settings after the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts. + attr_accessor :is_override_allowed + # Number of minutes for which a person at the thermostat can change the thermostat's settings after the activation of the scheduled [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). See also [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + attr_accessor :max_override_period_minutes + # User-friendly name to identify the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + attr_accessor :name + # ID of the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + attr_accessor :thermostat_schedule_id + # ID of the workspace that contains the thermostat schedule. + attr_accessor :workspace_id - date_accessor :created_at, :ends_at, :starts_at + # Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) was created. + date_accessor :created_at + + # Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + date_accessor :ends_at + + # Date and time at which the [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. + date_accessor :starts_at include Seam::Resources::ResourceErrorsSupport end diff --git a/lib/seam/resources/unmanaged_access_code.rb b/lib/seam/resources/unmanaged_access_code.rb index 6b409030..335afb1c 100644 --- a/lib/seam/resources/unmanaged_access_code.rb +++ b/lib/seam/resources/unmanaged_access_code.rb @@ -2,10 +2,49 @@ module Seam module Resources + # Represents an [unmanaged smart lock access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + # + # 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](https://docs.seam.co/device-and-system-integration-guides/kwikset-locks) class UnmanagedAccessCode < BaseResource - attr_accessor :access_code_id, :cannot_be_managed, :cannot_delete_unmanaged_access_code, :code, :device_id, :dormakaba_oracode_metadata, :is_managed, :name, :status, :type, :workspace_id + # Unique identifier for the access code. + attr_accessor :access_code_id + # 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. + attr_accessor :cannot_be_managed + # 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. + attr_accessor :cannot_delete_unmanaged_access_code + # Code used for access. Typically, a numeric or alphanumeric string. + attr_accessor :code + # Unique identifier for the device associated with the access code. + attr_accessor :device_id + # Metadata for a dormakaba Oracode unmanaged access code. Only present for unmanaged access codes from dormakaba Oracode devices. + attr_accessor :dormakaba_oracode_metadata + # Indicates that Seam does not manage the access code. + attr_accessor :is_managed + # 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). + attr_accessor :name + # 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. + attr_accessor :status + # Type of the access code. `ongoing` access codes are active continuously until deactivated manually. `time_bound` access codes have a specific duration. + attr_accessor :type + # Unique identifier for the Seam workspace associated with the access code. + attr_accessor :workspace_id - date_accessor :created_at, :ends_at, :starts_at + # Date and time at which the access code was created. + date_accessor :created_at + + # Date and time after which the time-bound access code becomes inactive. + date_accessor :ends_at + + # Date and time at which the time-bound access code becomes active. + date_accessor :starts_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/unmanaged_access_grant.rb b/lib/seam/resources/unmanaged_access_grant.rb index 657595d0..e604bd79 100644 --- a/lib/seam/resources/unmanaged_access_grant.rb +++ b/lib/seam/resources/unmanaged_access_grant.rb @@ -2,10 +2,39 @@ module Seam module Resources + # Represents an unmanaged Access Grant. Unmanaged Access Grants do not have client sessions, instant keys, customization profiles, or keys. class UnmanagedAccessGrant < BaseResource - attr_accessor :access_grant_id, :access_method_ids, :display_name, :location_ids, :name, :pending_mutations, :requested_access_methods, :reservation_key, :space_ids, :user_identity_id, :workspace_id + # ID of the Access Grant. + attr_accessor :access_grant_id + # IDs of the access methods created for the Access Grant. + attr_accessor :access_method_ids + # Display name of the Access Grant. + attr_accessor :display_name + # @deprecated Use `space_ids`. + attr_accessor :location_ids + # Name of the Access Grant. If not provided, the display name will be computed. + attr_accessor :name + # List of pending mutations for the access grant. This shows updates that are in progress. + attr_accessor :pending_mutations + # Access methods that the user requested for the Access Grant. + attr_accessor :requested_access_methods + # Reservation key for the access grant. + attr_accessor :reservation_key + # IDs of the spaces to which the Access Grant gives access. + attr_accessor :space_ids + # ID of user identity to which the Access Grant gives access. + attr_accessor :user_identity_id + # ID of the Seam workspace associated with the Access Grant. + attr_accessor :workspace_id - date_accessor :created_at, :ends_at, :starts_at + # Date and time at which the Access Grant was created. + date_accessor :created_at + + # Date and time at which the Access Grant ends. + date_accessor :ends_at + + # Date and time at which the Access Grant starts. + date_accessor :starts_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/unmanaged_access_method.rb b/lib/seam/resources/unmanaged_access_method.rb index df75e570..406c255f 100644 --- a/lib/seam/resources/unmanaged_access_method.rb +++ b/lib/seam/resources/unmanaged_access_method.rb @@ -2,10 +2,36 @@ module Seam module Resources + # Represents an unmanaged access method. Unmanaged access methods do not have client sessions, instant keys, customization profiles, or keys. class UnmanagedAccessMethod < BaseResource - attr_accessor :access_method_id, :code, :display_name, :is_assignment_required, :is_encoding_required, :is_issued, :is_ready_for_assignment, :is_ready_for_encoding, :mode, :pending_mutations, :workspace_id + # ID of the access method. + attr_accessor :access_method_id + # The actual PIN code for code access methods. + attr_accessor :code + # Display name of the access method. + attr_accessor :display_name + # 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. + attr_accessor :is_assignment_required + # Indicates whether encoding with an card encoder is required to issue or reissue the plastic card associated with the access method. + attr_accessor :is_encoding_required + # Indicates whether the access method has been issued. + attr_accessor :is_issued + # 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. + attr_accessor :is_ready_for_assignment + # 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. + attr_accessor :is_ready_for_encoding + # Access method mode. Supported values: `code`, `card`, `mobile_key`, `cloud_key`. + attr_accessor :mode + # Pending mutations for the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). Indicates operations that are in progress. + attr_accessor :pending_mutations + # ID of the Seam workspace associated with the access method. + attr_accessor :workspace_id - date_accessor :created_at, :issued_at + # Date and time at which the access method was created. + date_accessor :created_at + + # Date and time at which the access method was issued. + date_accessor :issued_at include Seam::Resources::ResourceErrorsSupport include Seam::Resources::ResourceWarningsSupport diff --git a/lib/seam/resources/unmanaged_device.rb b/lib/seam/resources/unmanaged_device.rb index 083234f6..1a7024aa 100644 --- a/lib/seam/resources/unmanaged_device.rb +++ b/lib/seam/resources/unmanaged_device.rb @@ -2,9 +2,68 @@ module Seam module Resources + # Represents an [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). class UnmanagedDevice < BaseResource - attr_accessor :can_configure_auto_lock, :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_program_thermostat_programs_as_different_each_day, :can_program_thermostat_programs_as_same_each_day, :can_program_thermostat_programs_as_weekday_weekend, :can_remotely_lock, :can_remotely_unlock, :can_run_thermostat_programs, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_hub_connection, :can_simulate_hub_disconnection, :can_simulate_paid_subscription, :can_simulate_removal, :can_turn_off_hvac, :can_unlock_with_code, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id + # Indicates whether the lock supports configuring automatic locking. + attr_accessor :can_configure_auto_lock + # Indicates whether the thermostat supports cooling. + attr_accessor :can_hvac_cool + # Indicates whether the thermostat supports heating. + attr_accessor :can_hvac_heat + # Indicates whether the thermostat supports simultaneous heating and cooling. + attr_accessor :can_hvac_heat_cool + # Indicates whether the device supports programming offline access codes. + attr_accessor :can_program_offline_access_codes + # Indicates whether the device supports programming online access codes. + attr_accessor :can_program_online_access_codes + # Indicates whether the thermostat supports different climate programs for each day of the week. + attr_accessor :can_program_thermostat_programs_as_different_each_day + # Indicates whether the thermostat supports a single climate program applied to every day. + attr_accessor :can_program_thermostat_programs_as_same_each_day + # Indicates whether the thermostat supports weekday/weekend climate programs. + attr_accessor :can_program_thermostat_programs_as_weekday_weekend + # Indicates whether the device supports remote locking. + attr_accessor :can_remotely_lock + # Indicates whether the device supports remote unlocking. + attr_accessor :can_remotely_unlock + # Indicates whether the thermostat supports running climate programs. + attr_accessor :can_run_thermostat_programs + # Indicates whether the device supports simulating connection in a sandbox. + attr_accessor :can_simulate_connection + # Indicates whether the device supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_disconnection + # Indicates whether the hub supports simulating connection in a sandbox. + attr_accessor :can_simulate_hub_connection + # Indicates whether the hub supports simulating disconnection in a sandbox. + attr_accessor :can_simulate_hub_disconnection + # Indicates whether the device supports simulating a paid subscription in a sandbox. + attr_accessor :can_simulate_paid_subscription + # Indicates whether the device supports simulating removal in a sandbox. + attr_accessor :can_simulate_removal + # Indicates whether the thermostat can be turned off. + attr_accessor :can_turn_off_hvac + # Indicates whether the lock supports unlocking with an access code. + attr_accessor :can_unlock_with_code + # 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](https://docs.seam.co/capability-guides/device-and-system-capabilities#capability-flags). + attr_accessor :capabilities_supported + # Unique identifier for the account associated with the device. + attr_accessor :connected_account_id + # Set of key:value pairs. Adding custom metadata to a resource, such as a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview), [connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account), or [device](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device), enables you to store custom information, like customer details or internal IDs from your application. + attr_accessor :custom_metadata + # ID of the device. + attr_accessor :device_id + # Type of the device. + attr_accessor :device_type + # Indicates that Seam does not manage the device. + attr_accessor :is_managed + # Location information for the device. + attr_accessor :location + # properties of the device. + attr_accessor :properties + # Unique identifier for the Seam workspace associated with the device. + attr_accessor :workspace_id + # Date and time at which the device object was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/unmanaged_user_identity.rb b/lib/seam/resources/unmanaged_user_identity.rb index d3edcae5..5ac1188e 100644 --- a/lib/seam/resources/unmanaged_user_identity.rb +++ b/lib/seam/resources/unmanaged_user_identity.rb @@ -2,9 +2,24 @@ module Seam module Resources + # Represents an unmanaged user identity. Unmanaged user identities do not have keys. class UnmanagedUserIdentity < BaseResource - attr_accessor :acs_user_ids, :display_name, :email_address, :full_name, :phone_number, :user_identity_id, :workspace_id + # Array of access system user IDs associated with the user identity. + attr_accessor :acs_user_ids + # Display name for the user identity. + attr_accessor :display_name + # Unique email address for the user identity. + attr_accessor :email_address + # Full name of the user associated with the user identity. + attr_accessor :full_name + # Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). + attr_accessor :phone_number + # ID of the user identity. + attr_accessor :user_identity_id + # ID of the workspace that contains the user identity. + attr_accessor :workspace_id + # Date and time at which the user identity was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/user_identity.rb b/lib/seam/resources/user_identity.rb index e0cf6e93..ad118b36 100644 --- a/lib/seam/resources/user_identity.rb +++ b/lib/seam/resources/user_identity.rb @@ -2,9 +2,26 @@ module Seam module Resources + # Represents a [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) associated with an application user account. class UserIdentity < BaseResource - attr_accessor :acs_user_ids, :display_name, :email_address, :full_name, :phone_number, :user_identity_id, :user_identity_key, :workspace_id + # Array of access system user IDs associated with the user identity. + attr_accessor :acs_user_ids + # Display name for the user identity. + attr_accessor :display_name + # Unique email address for the user identity. + attr_accessor :email_address + # Full name of the user associated with the user identity. + attr_accessor :full_name + # Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). + attr_accessor :phone_number + # ID of the user identity. + attr_accessor :user_identity_id + # Unique key for the user identity. + attr_accessor :user_identity_key + # ID of the workspace that contains the user identity. + attr_accessor :workspace_id + # Date and time at which the user identity was created. date_accessor :created_at include Seam::Resources::ResourceErrorsSupport diff --git a/lib/seam/resources/webhook.rb b/lib/seam/resources/webhook.rb index 3e26abbf..2811c498 100644 --- a/lib/seam/resources/webhook.rb +++ b/lib/seam/resources/webhook.rb @@ -2,8 +2,16 @@ module Seam module Resources + # Represents a [webhook](https://docs.seam.co/developer-tools/webhooks) 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. class Webhook < BaseResource - attr_accessor :event_types, :secret, :url, :webhook_id + # Types of events that the [webhook](https://docs.seam.co/developer-tools/webhooks) should receive. + attr_accessor :event_types + # Secret associated with the [webhook](https://docs.seam.co/developer-tools/webhooks). + attr_accessor :secret + # URL for the [webhook](https://docs.seam.co/developer-tools/webhooks). + attr_accessor :url + # ID of the webhook. + attr_accessor :webhook_id end end end diff --git a/lib/seam/resources/workspace.rb b/lib/seam/resources/workspace.rb index 6406e8d1..6540afec 100644 --- a/lib/seam/resources/workspace.rb +++ b/lib/seam/resources/workspace.rb @@ -2,8 +2,27 @@ module Seam module Resources + # Represents a Seam [workspace](https://docs.seam.co/core-concepts/workspaces). 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](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) 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](https://docs.seam.co/core-concepts/workspaces#production-workspaces). class Workspace < BaseResource - attr_accessor :company_name, :connect_partner_name, :connect_webview_customization, :is_publishable_key_auth_enabled, :is_sandbox, :is_suspended, :name, :organization_id, :publishable_key, :workspace_id + # Company name associated with the [workspace](https://docs.seam.co/core-concepts/workspaces). + attr_accessor :company_name + # @deprecated Use `company_name` instead. + attr_accessor :connect_partner_name + attr_accessor :connect_webview_customization + # Indicates whether publishable key authentication is enabled for this workspace. + attr_accessor :is_publishable_key_auth_enabled + # Indicates whether the workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + attr_accessor :is_sandbox + # Indicates whether the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) is suspended. Seam suspends sandbox workspaces that have not been accessed in 14 days. + attr_accessor :is_suspended + # Name of the [workspace](https://docs.seam.co/core-concepts/workspaces). + attr_accessor :name + # ID of the organization to which the workspace belongs, or `null` if the workspace is not assigned to an organization. + attr_accessor :organization_id + # Publishable key for the [workspace](https://docs.seam.co/core-concepts/workspaces). This key is used to identify the workspace in client-side applications. + attr_accessor :publishable_key + # ID of the workspace. + attr_accessor :workspace_id end end end diff --git a/lib/seam/routes/access_codes.rb b/lib/seam/routes/access_codes.rb index 69dc72f0..66d28cc2 100644 --- a/lib/seam/routes/access_codes.rb +++ b/lib/seam/routes/access_codes.rb @@ -16,60 +16,205 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessCodesUnmanaged.new(client: @client, defaults: @defaults) end + # 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. + # @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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/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](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + # @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. Default: `false`. + # @param is_offline_access_code Indicates whether the access code is an [offline access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). + # @param is_one_time_use 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. + # @param max_time_rounding 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`. + # @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](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`. + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @param use_backup_access_code_pool 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). + # @param use_offline_access_code Deprecated: Use `is_offline_access_code` instead. + # @return [Seam::Resources::AccessCode] OK def create(device_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, common_code_key: nil, ends_at: nil, is_external_modification_allowed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil) res = @client.post("/access_codes/create", {device_id: device_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, common_code_key: common_code_key, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_code"]) end + # 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. + # @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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + # @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](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`. + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @param use_backup_access_code_pool 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). + # @return [Seam::Resources::AccessCode] OK def create_multiple(device_ids:, allow_external_modification: nil, attempt_for_offline_device: nil, behavior_when_code_cannot_be_shared: nil, code: nil, ends_at: nil, is_external_modification_allowed: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, use_backup_access_code_pool: nil) res = @client.post("/access_codes/create_multiple", {device_ids: device_ids, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, behavior_when_code_cannot_be_shared: behavior_when_code_cannot_be_shared, code: code, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_codes"]) end + # Deletes an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + # @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. + # @return [nil] OK def delete(access_code_id:, device_id: nil) @client.post("/access_codes/delete", {access_code_id: access_code_id, device_id: device_id}.compact) nil end + # Generates a code for an [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes), given a device ID. + # @param device_id ID of the device for which you want to generate a code. + # @return [Seam::Resources::AccessCode] OK def generate_code(device_id:) res = @client.post("/access_codes/generate_code", {device_id: device_id}.compact) Seam::Resources::AccessCode.load_from_response(res.body["generated_code"]) end + # 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`. + # @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`. + # @return [Seam::Resources::AccessCode] OK def get(access_code_id: nil, code: nil, device_id: nil) res = @client.post("/access_codes/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_code"]) end + # 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`. + # @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. + # @return [Seam::Resources::AccessCode] OK def list(access_code_ids: nil, access_grant_id: nil, access_grant_key: nil, access_method_id: nil, customer_key: nil, device_id: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) res = @client.post("/access_codes/list", {access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_key: access_grant_key, access_method_id: access_method_id, customer_key: customer_key, device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_codes"]) end + # 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. + # @param access_code_id ID of the access code for which you want to pull a backup access code. + # @return [Seam::Resources::AccessCode] OK def pull_backup_access_code(access_code_id:) res = @client.post("/access_codes/pull_backup_access_code", {access_code_id: access_code_id}.compact) Seam::Resources::AccessCode.load_from_response(res.body["access_code"]) end + # 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`. + # @return [nil] OK def report_device_constraints(device_id:, max_code_length: nil, min_code_length: nil, supported_code_lengths: nil) @client.post("/access_codes/report_device_constraints", {device_id: device_id, max_code_length: max_code_length, min_code_length: min_code_length, supported_code_lengths: supported_code_lengths}.compact) nil end + # 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). + # @param access_code_id ID of the access code that you want to update. + # @param allow_external_modification Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after `starts_at`. + # @param is_external_modification_allowed Indicates whether [external modification](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/offline-access-codes). + # @param is_one_time_use 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. + # @param max_time_rounding 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`. + # @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](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`. + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](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). + # @param use_backup_access_code_pool 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). + # @param use_offline_access_code Deprecated: Use `is_offline_access_code` instead. + # @return [nil] OK def update(access_code_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, device_id: nil, ends_at: nil, is_external_modification_allowed: nil, is_managed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, type: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil) @client.post("/access_codes/update", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, device_id: device_id, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_managed: is_managed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, type: type, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact) nil end + # 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). + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @return [nil] OK def update_multiple(common_code_key:, ends_at: nil, name: nil, starts_at: nil) @client.post("/access_codes/update_multiple", {common_code_key: common_code_key, ends_at: ends_at, name: name, starts_at: starts_at}.compact) diff --git a/lib/seam/routes/access_codes_simulate.rb b/lib/seam/routes/access_codes_simulate.rb index 3654f33c..43d73432 100644 --- a/lib/seam/routes/access_codes_simulate.rb +++ b/lib/seam/routes/access_codes_simulate.rb @@ -8,6 +8,11 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates the creation of an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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. + # @return [Seam::Resources::UnmanagedAccessCode] OK def create_unmanaged_access_code(code:, device_id:, name:) res = @client.post("/access_codes/simulate/create_unmanaged_access_code", {code: code, device_id: device_id, name: name}.compact) diff --git a/lib/seam/routes/access_codes_unmanaged.rb b/lib/seam/routes/access_codes_unmanaged.rb index ee1fd78a..6a664844 100644 --- a/lib/seam/routes/access_codes_unmanaged.rb +++ b/lib/seam/routes/access_codes_unmanaged.rb @@ -8,30 +8,64 @@ def initialize(client:, defaults:) @defaults = defaults end + # Converts an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) to an [access code managed through Seam](https://docs.seam.co/low-level-apis/smart-locks/access-codes). + # + # 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the access code is allowed. + # @return [nil] OK def convert_to_managed(access_code_id:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil) @client.post("/access_codes/unmanaged/convert_to_managed", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed}.compact) nil end + # Deletes an [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + # @param access_code_id ID of the unmanaged access code that you want to delete. + # @return [nil] OK def delete(access_code_id:) @client.post("/access_codes/unmanaged/delete", {access_code_id: access_code_id}.compact) nil end + # Returns a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + # + # 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`. + # @return [Seam::Resources::UnmanagedAccessCode] OK def get(access_code_id: nil, code: nil, device_id: nil) res = @client.post("/access_codes/unmanaged/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact) Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_code"]) end + # Returns a list of all [unmanaged access codes](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-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. + # @return [Seam::Resources::UnmanagedAccessCode] OK def list(device_id:, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) res = @client.post("/access_codes/unmanaged/list", {device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_codes"]) end + # Updates a specified [unmanaged access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes). + # @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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#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](https://docs.seam.co/low-level-apis/smart-locks/access-codes#external-modification) of the code is allowed. + # @return [nil] OK def update(access_code_id:, is_managed:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil) @client.post("/access_codes/unmanaged/update", {access_code_id: access_code_id, is_managed: is_managed, allow_external_modification: allow_external_modification, force: force, is_external_modification_allowed: is_external_modification_allowed}.compact) diff --git a/lib/seam/routes/access_grants.rb b/lib/seam/routes/access_grants.rb index 3df9ed6f..d43a349a 100644 --- a/lib/seam/routes/access_grants.rb +++ b/lib/seam/routes/access_grants.rb @@ -12,42 +12,98 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessGrantsUnmanaged.new(client: @client, defaults: @defaults) end + # Creates a new [Access Grant](https://docs.seam.co/use-cases/granting-access/access-grants). 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](https://docs.seam.co/api/acs/systems/list) 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](https://docs.seam.co/api/devices/list) to which access is being granted. + # @param ends_at Date and time at which the validity of the new grant 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`. + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @return [Seam::Resources::AccessGrant] OK def create(requested_access_methods:, user_identity_id: nil, user_identity: nil, access_grant_key: nil, acs_entrance_ids: nil, customization_profile_id: nil, device_ids: nil, ends_at: nil, location: nil, location_ids: nil, name: nil, reservation_key: nil, space_ids: nil, space_keys: nil, starts_at: nil) res = @client.post("/access_grants/create", {requested_access_methods: requested_access_methods, user_identity_id: user_identity_id, user_identity: user_identity, access_grant_key: access_grant_key, acs_entrance_ids: acs_entrance_ids, customization_profile_id: customization_profile_id, device_ids: device_ids, ends_at: ends_at, location: location, location_ids: location_ids, name: name, reservation_key: reservation_key, space_ids: space_ids, space_keys: space_keys, starts_at: starts_at}.compact) Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"]) end + # Delete an Access Grant. + # @param access_grant_id ID of Access Grant to delete. + # @return [nil] OK def delete(access_grant_id:) @client.post("/access_grants/delete", {access_grant_id: access_grant_id}.compact) nil end + # 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. + # @return [Seam::Resources::AccessGrant] OK def get(access_grant_id: nil, access_grant_key: nil) res = @client.post("/access_grants/get", {access_grant_id: access_grant_id, access_grant_key: access_grant_key}.compact) Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"]) end + # 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 + # @return [Seam::Resources::Batch] OK def get_related(access_grant_ids: nil, access_grant_keys: nil, exclude: nil, include: nil) res = @client.post("/access_grants/get_related", {access_grant_ids: access_grant_ids, access_grant_keys: access_grant_keys, exclude: exclude, include: include}.compact) Seam::Resources::Batch.load_from_response(res.body["batch"]) end + # 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. + # @return [Seam::Resources::AccessGrant] OK def list(access_code_id: nil, access_grant_ids: nil, access_grant_key: nil, acs_entrance_id: nil, acs_system_id: nil, customer_key: nil, device_id: nil, limit: nil, location_id: nil, page_cursor: nil, reservation_key: nil, space_id: nil, user_identity_id: nil) res = @client.post("/access_grants/list", {access_code_id: access_code_id, access_grant_ids: access_grant_ids, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, customer_key: customer_key, device_id: device_id, limit: limit, location_id: location_id, page_cursor: page_cursor, reservation_key: reservation_key, space_id: space_id, user_identity_id: user_identity_id}.compact) Seam::Resources::AccessGrant.load_from_response(res.body["access_grants"]) end + # 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. + # @return [Seam::Resources::AccessGrant] OK def request_access_methods(access_grant_id:, requested_access_methods:) res = @client.post("/access_grants/request_access_methods", {access_grant_id: access_grant_id, requested_access_methods: requested_access_methods}.compact) Seam::Resources::AccessGrant.load_from_response(res.body["access_grant"]) end + # 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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @return [nil] OK def update(access_grant_id: nil, access_grant_key: nil, ends_at: nil, name: nil, starts_at: nil) @client.post("/access_grants/update", {access_grant_id: access_grant_id, access_grant_key: access_grant_key, ends_at: ends_at, name: name, starts_at: starts_at}.compact) diff --git a/lib/seam/routes/access_grants_unmanaged.rb b/lib/seam/routes/access_grants_unmanaged.rb index 3be06360..33a06b53 100644 --- a/lib/seam/routes/access_grants_unmanaged.rb +++ b/lib/seam/routes/access_grants_unmanaged.rb @@ -8,18 +8,38 @@ def initialize(client:, defaults:) @defaults = defaults end + # Get an unmanaged Access Grant (where is_managed = false). + # @param access_grant_id ID of unmanaged Access Grant to get. + # @return [Seam::Resources::UnmanagedAccessGrant] OK def get(access_grant_id:) res = @client.post("/access_grants/unmanaged/get", {access_grant_id: access_grant_id}.compact) Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grant"]) end + # 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. + # @return [Seam::Resources::UnmanagedAccessGrant] OK def list(acs_entrance_id: nil, acs_system_id: nil, limit: nil, page_cursor: nil, reservation_key: nil, user_identity_id: nil) res = @client.post("/access_grants/unmanaged/list", {acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, limit: limit, page_cursor: page_cursor, reservation_key: reservation_key, user_identity_id: user_identity_id}.compact) Seam::Resources::UnmanagedAccessGrant.load_from_response(res.body["access_grants"]) end + # 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. + # @return [nil] OK def update(access_grant_id:, is_managed:, access_grant_key: nil) @client.post("/access_grants/unmanaged/update", {access_grant_id: access_grant_id, is_managed: is_managed, access_grant_key: access_grant_key}.compact) diff --git a/lib/seam/routes/access_methods.rb b/lib/seam/routes/access_methods.rb index 9057bb75..554b05f5 100644 --- a/lib/seam/routes/access_methods.rb +++ b/lib/seam/routes/access_methods.rb @@ -14,6 +14,10 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults) end + # 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. + # @return [Seam::Resources::ActionAttempt] OK def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil) res = @client.post("/access_methods/assign_card", {access_method_id: access_method_id, card_number: card_number}.compact) @@ -22,12 +26,21 @@ def assign_card(access_method_id:, card_number:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # 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. + # @return [nil] OK def delete(access_method_id: nil, access_grant_id: nil, reservation_key: nil) @client.post("/access_methods/delete", {access_method_id: access_method_id, access_grant_id: access_grant_id, reservation_key: reservation_key}.compact) nil end + # Encodes an existing access method onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # @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`. + # @return [Seam::Resources::ActionAttempt] OK def encode(access_method_id:, acs_encoder_id:, wait_for_action_attempt: nil) res = @client.post("/access_methods/encode", {access_method_id: access_method_id, acs_encoder_id: acs_encoder_id}.compact) @@ -36,24 +49,46 @@ def encode(access_method_id:, acs_encoder_id:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Gets an access method. + # @param access_method_id ID of access method to get. + # @return [Seam::Resources::AccessMethod] OK def get(access_method_id:) res = @client.post("/access_methods/get", {access_method_id: access_method_id}.compact) Seam::Resources::AccessMethod.load_from_response(res.body["access_method"]) end + # 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 + # @return [Seam::Resources::Batch] OK def get_related(access_method_ids:, exclude: nil, include: nil) res = @client.post("/access_methods/get_related", {access_method_ids: access_method_ids, exclude: exclude, include: include}.compact) Seam::Resources::Batch.load_from_response(res.body["batch"]) end + # Lists all access methods, usually filtered by Access Grant. + # @param access_code_id ID of the access code by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + # @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 that grant access to it. + # @param device_id ID of the device by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + # @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 space_id ID of the space by which to filter the returned access methods. Must be combined with `access_grant_id`, `access_grant_key`, or `acs_entrance_id`. + # @return [Seam::Resources::AccessMethod] OK def list(access_code_id: nil, access_grant_id: nil, access_grant_key: nil, acs_entrance_id: nil, device_id: nil, limit: nil, page_cursor: nil, space_id: nil) res = @client.post("/access_methods/list", {access_code_id: access_code_id, access_grant_id: access_grant_id, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, device_id: device_id, limit: limit, page_cursor: page_cursor, space_id: space_id}.compact) Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"]) end + # Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) 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. + # @return [Seam::Resources::ActionAttempt] OK def unlock_door(access_method_id:, acs_entrance_id:, wait_for_action_attempt: nil) res = @client.post("/access_methods/unlock_door", {access_method_id: access_method_id, acs_entrance_id: acs_entrance_id}.compact) diff --git a/lib/seam/routes/access_methods_unmanaged.rb b/lib/seam/routes/access_methods_unmanaged.rb index 39072db7..7ed74ab4 100644 --- a/lib/seam/routes/access_methods_unmanaged.rb +++ b/lib/seam/routes/access_methods_unmanaged.rb @@ -8,12 +8,21 @@ def initialize(client:, defaults:) @defaults = defaults end + # Gets an unmanaged access method (where is_managed = false). + # @param access_method_id ID of unmanaged access method to get. + # @return [Seam::Resources::UnmanagedAccessMethod] OK def get(access_method_id:) res = @client.post("/access_methods/unmanaged/get", {access_method_id: access_method_id}.compact) Seam::Resources::UnmanagedAccessMethod.load_from_response(res.body["access_method"]) end + # 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. + # @return [Seam::Resources::UnmanagedAccessMethod] OK def list(access_grant_id:, acs_entrance_id: nil, device_id: nil, space_id: nil) res = @client.post("/access_methods/unmanaged/list", {access_grant_id: access_grant_id, acs_entrance_id: acs_entrance_id, device_id: device_id, space_id: space_id}.compact) diff --git a/lib/seam/routes/acs_access_groups.rb b/lib/seam/routes/acs_access_groups.rb index 3afa41c2..e4c175e2 100644 --- a/lib/seam/routes/acs_access_groups.rb +++ b/lib/seam/routes/acs_access_groups.rb @@ -8,42 +8,70 @@ def initialize(client:, defaults:) @defaults = defaults end + # Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @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. + # @return [nil] OK def add_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/access_groups/add_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Deletes a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @param acs_access_group_id ID of the access group that you want to delete. + # @return [nil] OK def delete(acs_access_group_id:) @client.post("/acs/access_groups/delete", {acs_access_group_id: acs_access_group_id}.compact) nil end + # Returns a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @param acs_access_group_id ID of the access group that you want to get. + # @return [Seam::Resources::AcsAccessGroup] OK def get(acs_access_group_id:) res = @client.post("/acs/access_groups/get", {acs_access_group_id: acs_access_group_id}.compact) Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_group"]) end + # Returns a list of all [access groups](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-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. + # @return [Seam::Resources::AcsAccessGroup] OK def list(acs_system_id: nil, acs_user_id: nil, search: nil, user_identity_id: nil) res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, search: search, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_groups"]) end + # Returns a list of all accessible entrances for a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @param acs_access_group_id ID of the access group for which you want to retrieve all accessible entrances. + # @return [Seam::Resources::AcsEntrance] OK def list_accessible_entrances(acs_access_group_id:) res = @client.post("/acs/access_groups/list_accessible_entrances", {acs_access_group_id: acs_access_group_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end + # Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) in an [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @param acs_access_group_id ID of the access group for which you want to retrieve all access system users. + # @return [Seam::Resources::AcsUser] OK def list_users(acs_access_group_id:) res = @client.post("/acs/access_groups/list_users", {acs_access_group_id: acs_access_group_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_users"]) end + # Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @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. + # @return [nil] OK def remove_user(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/access_groups/remove_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) diff --git a/lib/seam/routes/acs_credentials.rb b/lib/seam/routes/acs_credentials.rb index 3603531c..fea1a5a4 100644 --- a/lib/seam/routes/acs_credentials.rb +++ b/lib/seam/routes/acs_credentials.rb @@ -8,48 +8,97 @@ def initialize(client:, defaults:) @defaults = defaults end + # Assigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) to a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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. + # @return [nil] OK def assign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Creates a new [credential](https://docs.seam.co/low-level-apis/managing-credentials) for a specified [ACS user](https://docs.seam.co/low-level-apis/access-systems/user-management). For granting access, we recommend [Access Grants](https://docs.seam.co/use-cases/granting-access) 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](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) 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](https://docs.seam.co/device-and-system-integration-guides). + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/mobile-access/issuing-mobile-credentials-from-an-access-control-system#what-are-multi-phone-sync-credentials). + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) 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. + # @return [Seam::Resources::AcsCredential] OK def create(access_method:, acs_system_id: nil, acs_user_id: nil, allowed_acs_entrance_ids: nil, assa_abloy_vostio_metadata: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, salto_space_metadata: nil, starts_at: nil, user_identity_id: nil, visionline_metadata: nil) res = @client.post("/acs/credentials/create", {access_method: access_method, acs_system_id: acs_system_id, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, assa_abloy_vostio_metadata: assa_abloy_vostio_metadata, code: code, credential_manager_acs_system_id: credential_manager_acs_system_id, ends_at: ends_at, is_multi_phone_sync_credential: is_multi_phone_sync_credential, salto_space_metadata: salto_space_metadata, starts_at: starts_at, user_identity_id: user_identity_id, visionline_metadata: visionline_metadata}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"]) end + # Deletes a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + # @param acs_credential_id ID of the credential that you want to delete. + # @return [nil] OK def delete(acs_credential_id:) @client.post("/acs/credentials/delete", {acs_credential_id: acs_credential_id}.compact) nil end + # Returns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + # @param acs_credential_id ID of the credential that you want to get. + # @return [Seam::Resources::AcsCredential] OK def get(acs_credential_id:) res = @client.post("/acs/credentials/get", {acs_credential_id: acs_credential_id}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"]) end + # Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-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](https://www.iso.org/iso-8601-date-and-time-format.html) 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`. + # @return [Seam::Resources::AcsCredential] OK def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, created_before: nil, is_multi_phone_sync_credential: nil, limit: nil, page_cursor: nil, search: nil) res = @client.post("/acs/credentials/list", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id, created_before: created_before, is_multi_phone_sync_credential: is_multi_phone_sync_credential, limit: limit, page_cursor: page_cursor, search: search}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"]) end + # Returns a list of all [entrances](https://docs.seam.co/api/acs/entrances) to which a [credential](https://docs.seam.co/api/acs/credentials) grants access. + # @param acs_credential_id ID of the credential for which you want to retrieve all entrances to which the credential grants access. + # @return [Seam::Resources::AcsEntrance] OK def list_accessible_entrances(acs_credential_id:) res = @client.post("/acs/credentials/list_accessible_entrances", {acs_credential_id: acs_credential_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end + # Unassigns a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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. + # @return [nil] OK def unassign(acs_credential_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Updates the code and ends at date and time for a specified [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials). + # @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](https://www.iso.org/iso-8601-date-and-time-format.html) format. Must be a time in the future and after the `starts_at` value that you set when creating the credential. + # @return [nil] OK def update(acs_credential_id:, code: nil, ends_at: nil) @client.post("/acs/credentials/update", {acs_credential_id: acs_credential_id, code: code, ends_at: ends_at}.compact) diff --git a/lib/seam/routes/acs_encoders.rb b/lib/seam/routes/acs_encoders.rb index 35051c4d..7c75f7f4 100644 --- a/lib/seam/routes/acs_encoders.rb +++ b/lib/seam/routes/acs_encoders.rb @@ -14,6 +14,11 @@ def simulate @simulate ||= Seam::Clients::AcsEncodersSimulate.new(client: @client, defaults: @defaults) end + # Encodes an existing [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) onto a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). 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. + # @return [Seam::Resources::ActionAttempt] OK def encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/encode_credential", {acs_encoder_id: acs_encoder_id, access_method_id: access_method_id, acs_credential_id: acs_credential_id}.compact) @@ -22,18 +27,32 @@ def encode_credential(acs_encoder_id:, access_method_id: nil, acs_credential_id: Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Returns a specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # @param acs_encoder_id ID of the encoder that you want to get. + # @return [Seam::Resources::AcsEncoder] OK def get(acs_encoder_id:) res = @client.post("/acs/encoders/get", {acs_encoder_id: acs_encoder_id}.compact) Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoder"]) end + # Returns a list of all [encoders](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # @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`. + # @return [Seam::Resources::AcsEncoder] OK def list(acs_system_id: nil, acs_system_ids: nil, acs_encoder_ids: nil, limit: nil, page_cursor: nil) res = @client.post("/acs/encoders/list", {acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_encoder_ids: acs_encoder_ids, limit: limit, page_cursor: page_cursor}.compact) Seam::Resources::AcsEncoder.load_from_response(res.body["acs_encoders"]) end + # Scans an encoded [acs_credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) from a plastic card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners). + # @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. + # @return [Seam::Resources::ActionAttempt] OK def scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/scan_credential", {acs_encoder_id: acs_encoder_id, salto_ks_metadata: salto_ks_metadata}.compact) @@ -42,6 +61,12 @@ def scan_credential(acs_encoder_id:, salto_ks_metadata: nil, wait_for_action_att Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Scans a physical card placed on the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) 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. + # @return [Seam::Resources::ActionAttempt] OK def scan_to_assign_credential(acs_encoder_id:, acs_user_id: nil, salto_ks_metadata: nil, user_identity_id: nil, wait_for_action_attempt: nil) res = @client.post("/acs/encoders/scan_to_assign_credential", {acs_encoder_id: acs_encoder_id, acs_user_id: acs_user_id, salto_ks_metadata: salto_ks_metadata, user_identity_id: user_identity_id}.compact) diff --git a/lib/seam/routes/acs_encoders_simulate.rb b/lib/seam/routes/acs_encoders_simulate.rb index 8494742e..c307f699 100644 --- a/lib/seam/routes/acs_encoders_simulate.rb +++ b/lib/seam/routes/acs_encoders_simulate.rb @@ -8,24 +8,43 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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. + # @return [nil] OK def next_credential_encode_will_fail(acs_encoder_id:, error_code: nil, acs_credential_id: nil) @client.post("/acs/encoders/simulate/next_credential_encode_will_fail", {acs_encoder_id: acs_encoder_id, error_code: error_code, acs_credential_id: acs_credential_id}.compact) nil end + # Simulates that the next attempt to encode a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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. + # @return [nil] OK def next_credential_encode_will_succeed(acs_encoder_id:, scenario: nil) @client.post("/acs/encoders/simulate/next_credential_encode_will_succeed", {acs_encoder_id: acs_encoder_id, scenario: scenario}.compact) nil end + # Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will fail. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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 + # @return [nil] OK def next_credential_scan_will_fail(acs_encoder_id:, error_code: nil, acs_credential_id_on_seam: nil) @client.post("/acs/encoders/simulate/next_credential_scan_will_fail", {acs_encoder_id: acs_encoder_id, error_code: error_code, acs_credential_id_on_seam: acs_credential_id_on_seam}.compact) nil end + # Simulates that the next attempt to scan a [credential](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) using the specified [encoder](https://docs.seam.co/low-level-apis/access-systems/working-with-card-encoders-and-scanners) will succeed. You can only perform this action within a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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. + # @return [nil] OK def next_credential_scan_will_succeed(acs_encoder_id:, acs_credential_id_on_seam: nil, scenario: nil) @client.post("/acs/encoders/simulate/next_credential_scan_will_succeed", {acs_encoder_id: acs_encoder_id, acs_credential_id_on_seam: acs_credential_id_on_seam, scenario: scenario}.compact) diff --git a/lib/seam/routes/acs_entrances.rb b/lib/seam/routes/acs_entrances.rb index 6c54da11..484a8287 100644 --- a/lib/seam/routes/acs_entrances.rb +++ b/lib/seam/routes/acs_entrances.rb @@ -10,30 +10,59 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + # @param acs_entrance_id ID of the entrance that you want to get. + # @return [Seam::Resources::AcsEntrance] OK def get(acs_entrance_id:) res = @client.post("/acs/entrances/get", {acs_entrance_id: acs_entrance_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrance"]) end + # Grants a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) access to a specified [access system entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + # @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. + # @return [nil] OK def grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/entrances/grant_access", {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Returns a list of all [access system entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + # @param access_method_id ID of the access method for which you want to retrieve all entrances to which it grants access. + # @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. + # @return [Seam::Resources::AcsEntrance] OK def list(access_method_id: nil, acs_credential_id: nil, acs_entrance_ids: nil, acs_system_id: nil, connected_account_id: nil, customer_key: nil, limit: nil, location_id: nil, page_cursor: nil, search: nil, space_id: nil) res = @client.post("/acs/entrances/list", {access_method_id: access_method_id, acs_credential_id: acs_credential_id, acs_entrance_ids: acs_entrance_ids, acs_system_id: acs_system_id, connected_account_id: connected_account_id, customer_key: customer_key, limit: limit, location_id: location_id, page_cursor: page_cursor, search: search, space_id: space_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end + # Returns a list of all [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) with access to a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details). + # @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. + # @return [Seam::Resources::AcsCredential] OK def list_credentials_with_access(acs_entrance_id:, include_if: nil) res = @client.post("/acs/entrances/list_credentials_with_access", {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"]) end + # Remotely unlocks a specified [entrance](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) 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. + # @return [Seam::Resources::ActionAttempt] OK def unlock(acs_credential_id:, acs_entrance_id:, wait_for_action_attempt: nil) res = @client.post("/acs/entrances/unlock", {acs_credential_id: acs_credential_id, acs_entrance_id: acs_entrance_id}.compact) diff --git a/lib/seam/routes/acs_systems.rb b/lib/seam/routes/acs_systems.rb index a24b955b..ab990470 100644 --- a/lib/seam/routes/acs_systems.rb +++ b/lib/seam/routes/acs_systems.rb @@ -8,24 +8,44 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified [access system](https://docs.seam.co/low-level-apis/access-systems). + # @param acs_system_id ID of the access system that you want to get. + # @return [Seam::Resources::AcsSystem] OK def get(acs_system_id:) res = @client.post("/acs/systems/get", {acs_system_id: acs_system_id}.compact) Seam::Resources::AcsSystem.load_from_response(res.body["acs_system"]) end + # Returns a list of all [access systems](https://docs.seam.co/low-level-apis/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`. + # @return [Seam::Resources::AcsSystem] OK def list(connected_account_id: nil, customer_key: nil, search: nil) res = @client.post("/acs/systems/list", {connected_account_id: connected_account_id, customer_key: customer_key, search: search}.compact) Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"]) end + # Returns a list of all credential manager systems that are compatible with a specified [access system](https://docs.seam.co/low-level-apis/access-systems). + # + # 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. + # @return [Seam::Resources::AcsSystem] OK def list_compatible_credential_manager_acs_systems(acs_system_id:) res = @client.post("/acs/systems/list_compatible_credential_manager_acs_systems", {acs_system_id: acs_system_id}.compact) Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"]) end + # 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 + # @return [nil] OK def report_devices(acs_system_id:, acs_encoders: nil, acs_entrances: nil) @client.post("/acs/systems/report_devices", {acs_system_id: acs_system_id, acs_encoders: acs_encoders, acs_entrances: acs_entrances}.compact) diff --git a/lib/seam/routes/acs_users.rb b/lib/seam/routes/acs_users.rb index a946f4a9..4901df30 100644 --- a/lib/seam/routes/acs_users.rb +++ b/lib/seam/routes/acs_users.rb @@ -8,66 +8,136 @@ def initialize(client:, defaults:) @defaults = defaults end + # Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @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. + # @return [nil] OK def add_to_access_group(acs_access_group_id:, acs_user_id:) @client.post("/acs/users/add_to_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact) nil end + # Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @param phone_number Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) 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. + # @return [Seam::Resources::AcsUser] OK def create(acs_system_id:, full_name:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, phone_number: nil, user_identity_id: nil) res = @client.post("/acs/users/create", {acs_system_id: acs_system_id, full_name: full_name, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, phone_number: phone_number, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_user"]) end + # Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-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. + # @return [nil] OK def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/users/delete", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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. + # @return [Seam::Resources::AcsUser] OK def get(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil) res = @client.post("/acs/users/get", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_user"]) end + # Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`). + # @return [Seam::Resources::AcsUser] OK def list(acs_system_id: nil, created_before: nil, limit: nil, page_cursor: nil, search: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil) res = @client.post("/acs/users/list", {acs_system_id: acs_system_id, created_before: created_before, limit: limit, page_cursor: page_cursor, search: search, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_users"]) end + # Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) 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. + # @return [Seam::Resources::AcsEntrance] OK def list_accessible_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) res = @client.post("/acs/users/list_accessible_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end + # Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups). + # @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. + # @return [nil] OK def remove_from_access_group(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/users/remove_from_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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. + # @return [nil] OK def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/users/revoke_access_to_all_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/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. + # @return [nil] OK def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/users/suspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) 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. + # @return [nil] OK def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) @client.post("/acs/users/unsuspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @param full_name Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). + # @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](https://docs.seam.co/low-level-apis/access-systems/user-management) 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. + # @return [nil] OK def update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil) @client.post("/acs/users/update", {access_schedule: access_schedule, acs_system_id: acs_system_id, acs_user_id: acs_user_id, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number, user_identity_id: user_identity_id}.compact) diff --git a/lib/seam/routes/action_attempts.rb b/lib/seam/routes/action_attempts.rb index 7a3119b3..737e9f8b 100644 --- a/lib/seam/routes/action_attempts.rb +++ b/lib/seam/routes/action_attempts.rb @@ -10,6 +10,9 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts). + # @param action_attempt_id ID of the action attempt that you want to get. + # @return [Seam::Resources::ActionAttempt] OK def get(action_attempt_id:, wait_for_action_attempt: nil) res = @client.post("/action_attempts/get", {action_attempt_id: action_attempt_id}.compact) @@ -18,6 +21,12 @@ def get(action_attempt_id:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Returns a list of the [action attempts](https://docs.seam.co/core-concepts/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`. + # @return [Seam::Resources::ActionAttempt] OK def list(action_attempt_ids: nil, device_id: nil, limit: nil, page_cursor: nil) res = @client.post("/action_attempts/list", {action_attempt_ids: action_attempt_ids, device_id: device_id, limit: limit, page_cursor: page_cursor}.compact) diff --git a/lib/seam/routes/client_sessions.rb b/lib/seam/routes/client_sessions.rb index 454e15f4..4eaed0ea 100644 --- a/lib/seam/routes/client_sessions.rb +++ b/lib/seam/routes/client_sessions.rb @@ -8,42 +8,87 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + # @param connect_webview_ids IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) for which you want to create a client session. + # @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/core-concepts/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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to create a client session. + # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id` instead. + # @return [Seam::Resources::ClientSession] OK def create(connect_webview_ids: nil, connected_account_ids: nil, customer_id: nil, customer_key: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) res = @client.post("/client_sessions/create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, customer_id: customer_id, customer_key: customer_key, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) Seam::Resources::ClientSession.load_from_response(res.body["client_session"]) end + # Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + # @param client_session_id ID of the client session that you want to delete. + # @return [nil] OK def delete(client_session_id:) @client.post("/client_sessions/delete", {client_session_id: client_session_id}.compact) nil end + # Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + # @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. + # @return [Seam::Resources::ClientSession] OK def get(client_session_id: nil, user_identifier_key: nil) res = @client.post("/client_sessions/get", {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::ClientSession.load_from_response(res.body["client_session"]) end + # Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) 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](https://docs.seam.co/core-concepts/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](https://docs.seam.co/api/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](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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 IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id`. + # @return [Seam::Resources::ClientSession] OK def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) res = @client.post("/client_sessions/get_or_create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) Seam::Resources::ClientSession.load_from_response(res.body["client_session"]) end + # Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), 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](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session. + # @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/core-concepts/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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id`. + # @return [nil] OK def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) @client.post("/client_sessions/grant_access", {client_session_id: client_session_id, connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) nil end + # Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + # @param client_session_id ID of the client session that you want to retrieve. + # @param connect_webview_id ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) 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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [Seam::Resources::ClientSession] OK def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil) res = @client.post("/client_sessions/list", {client_session_id: client_session_id, connect_webview_id: connect_webview_id, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, without_user_identifier_key: without_user_identifier_key}.compact) Seam::Resources::ClientSession.load_from_response(res.body["client_sessions"]) end + # Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens). + # + # Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action. + # @param client_session_id ID of the client session that you want to revoke. + # @return [nil] OK def revoke(client_session_id:) @client.post("/client_sessions/revoke", {client_session_id: client_session_id}.compact) diff --git a/lib/seam/routes/connect_webviews.rb b/lib/seam/routes/connect_webviews.rb index d45813e0..f56b27ff 100644 --- a/lib/seam/routes/connect_webviews.rb +++ b/lib/seam/routes/connect_webviews.rb @@ -8,24 +8,60 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + # + # 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](https://docs.seam.co/core-concepts/connect-webviews/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](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters. + # @param automatically_manage_new_devices Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#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](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-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](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-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`](https://docs.seam.co/api/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](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews). + # @return [Seam::Resources::ConnectWebview] OK def create(accepted_capabilities: nil, accepted_providers: nil, automatically_manage_new_devices: nil, custom_metadata: nil, custom_redirect_failure_url: nil, custom_redirect_url: nil, customer_key: nil, excluded_providers: nil, provider_category: nil, wait_for_device_creation: nil) res = @client.post("/connect_webviews/create", {accepted_capabilities: accepted_capabilities, accepted_providers: accepted_providers, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata, custom_redirect_failure_url: custom_redirect_failure_url, custom_redirect_url: custom_redirect_url, customer_key: customer_key, excluded_providers: excluded_providers, provider_category: provider_category, wait_for_device_creation: wait_for_device_creation}.compact) Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"]) end + # Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + # + # 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. + # @return [nil] OK def delete(connect_webview_id:) @client.post("/connect_webviews/delete", {connect_webview_id: connect_webview_id}.compact) nil end + # Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews). + # + # 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. + # @return [Seam::Resources::ConnectWebview] OK def get(connect_webview_id:) res = @client.post("/connect_webviews/get", {connect_webview_id: connect_webview_id}.compact) Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"]) end + # Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews). + # @param custom_metadata_has Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). 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. + # @return [Seam::Resources::ConnectWebview] OK def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) res = @client.post("/connect_webviews/list", {custom_metadata_has: custom_metadata_has, customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) diff --git a/lib/seam/routes/connected_accounts.rb b/lib/seam/routes/connected_accounts.rb index 2806fec2..16a2a452 100644 --- a/lib/seam/routes/connected_accounts.rb +++ b/lib/seam/routes/connected_accounts.rb @@ -12,30 +12,61 @@ def simulate @simulate ||= Seam::Clients::ConnectedAccountsSimulate.new(client: @client, defaults: @defaults) end + # Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). + # + # 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. + # @return [nil] OK def delete(connected_account_id:) @client.post("/connected_accounts/delete", {connected_account_id: connected_account_id}.compact) nil end + # Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts). + # @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. + # @return [Seam::Resources::ConnectedAccount] OK def get(connected_account_id: nil, email: nil) res = @client.post("/connected_accounts/get", {connected_account_id: connected_account_id, email: email}.compact) Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"]) end + # Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/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. + # @return [Seam::Resources::ConnectedAccount] OK def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, space_id: nil, user_identifier_key: nil) res = @client.post("/connected_accounts/list", {custom_metadata_has: custom_metadata_has, customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, space_id: space_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_accounts"]) end + # Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`. + # @param connected_account_id ID of the connected account that you want to sync. + # @return [nil] OK def sync(connected_account_id:) @client.post("/connected_accounts/sync", {connected_account_id: connected_account_id}.compact) nil end + # Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts). + # @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](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-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](https://docs.seam.co/core-concepts/connected-accounts/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](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata). + # @param customer_key The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer. + # @param display_name Human-readable name for the connected account, shown in the dashboard. For example, `Booking from Airbnb House 1`. + # @return [nil] OK def update(connected_account_id:, accepted_capabilities: nil, automatically_manage_new_devices: nil, custom_metadata: nil, customer_key: nil, display_name: nil) @client.post("/connected_accounts/update", {connected_account_id: connected_account_id, accepted_capabilities: accepted_capabilities, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata, customer_key: customer_key, display_name: display_name}.compact) diff --git a/lib/seam/routes/connected_accounts_simulate.rb b/lib/seam/routes/connected_accounts_simulate.rb index 1906e7d8..5d8ccd80 100644 --- a/lib/seam/routes/connected_accounts_simulate.rb +++ b/lib/seam/routes/connected_accounts_simulate.rb @@ -8,6 +8,9 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @param connected_account_id ID of the connected account you want to simulate as disconnected. + # @return [nil] OK def disconnect(connected_account_id:) @client.post("/connected_accounts/simulate/disconnect", {connected_account_id: connected_account_id}.compact) diff --git a/lib/seam/routes/customers.rb b/lib/seam/routes/customers.rb index d44662ea..7b84662c 100644 --- a/lib/seam/routes/customers.rb +++ b/lib/seam/routes/customers.rb @@ -8,18 +8,75 @@ def initialize(client:, defaults:) @defaults = defaults end + # 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 + # @return [Seam::Resources::CustomerPortal] OK def create_portal(customer_resources_filters: nil, customization_profile_id: nil, deep_link: nil, exclude_locale_picker: nil, features: nil, is_embedded: nil, landing_page: nil, locale: nil, navigation_mode: nil, read_only: nil, customer_data: nil) res = @client.post("/customers/create_portal", {customer_resources_filters: customer_resources_filters, customization_profile_id: customization_profile_id, deep_link: deep_link, exclude_locale_picker: exclude_locale_picker, features: features, is_embedded: is_embedded, landing_page: landing_page, locale: locale, navigation_mode: navigation_mode, read_only: read_only, customer_data: customer_data}.compact) Seam::Resources::CustomerPortal.load_from_response(res.body["customer_portal"]) end + # 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. + # @return [nil] OK def delete_data(access_grant_keys: nil, booking_keys: nil, building_keys: nil, common_area_keys: nil, customer_keys: nil, facility_keys: nil, guest_keys: nil, listing_keys: nil, property_keys: nil, property_listing_keys: nil, reservation_keys: nil, resident_keys: nil, room_keys: nil, space_keys: nil, staff_member_keys: nil, tenant_keys: nil, unit_keys: nil, user_identity_keys: nil, user_keys: nil) @client.post("/customers/delete_data", {access_grant_keys: access_grant_keys, booking_keys: booking_keys, building_keys: building_keys, common_area_keys: common_area_keys, customer_keys: customer_keys, facility_keys: facility_keys, guest_keys: guest_keys, listing_keys: listing_keys, property_keys: property_keys, property_listing_keys: property_listing_keys, reservation_keys: reservation_keys, resident_keys: resident_keys, room_keys: room_keys, space_keys: space_keys, staff_member_keys: staff_member_keys, tenant_keys: tenant_keys, unit_keys: unit_keys, user_identity_keys: user_identity_keys, user_keys: user_keys}.compact) nil end + # 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. + # @return [nil] OK def push_data(customer_key:, access_grants: nil, bookings: nil, buildings: nil, common_areas: nil, facilities: nil, guests: nil, listings: nil, properties: nil, property_listings: nil, reservations: nil, residents: nil, rooms: nil, sites: nil, spaces: nil, staff_members: nil, tenants: nil, units: nil, user_identities: nil, users: nil) @client.post("/customers/push_data", {customer_key: customer_key, access_grants: access_grants, bookings: bookings, buildings: buildings, common_areas: common_areas, facilities: facilities, guests: guests, listings: listings, properties: properties, property_listings: property_listings, reservations: reservations, residents: residents, rooms: rooms, sites: sites, spaces: spaces, staff_members: staff_members, tenants: tenants, units: units, user_identities: user_identities, users: users}.compact) diff --git a/lib/seam/routes/devices.rb b/lib/seam/routes/devices.rb index 647ca230..770f0301 100644 --- a/lib/seam/routes/devices.rb +++ b/lib/seam/routes/devices.rb @@ -16,30 +16,74 @@ def unmanaged @unmanaged ||= Seam::Clients::DevicesUnmanaged.new(client: @client, defaults: @defaults) end + # Returns a specified [device](https://docs.seam.co/core-concepts/devices). + # + # 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. + # @return [Seam::Resources::Device] OK def get(device_id: nil, name: nil) res = @client.post("/devices/get", {device_id: device_id, name: name}.compact) Seam::Resources::Device.load_from_response(res.body["device"]) end + # Returns a list of all [devices](https://docs.seam.co/core-concepts/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](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) 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. + # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) res = @client.post("/devices/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::Device.load_from_response(res.body["devices"]) end + # Returns a list of all device providers. + # + # The information that this endpoint returns for each provider includes a set of [capability flags](https://docs.seam.co/capability-guides/device-and-system-capabilities#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](https://docs.seam.co/core-concepts/connect-webviews), 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](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). + # @param provider_category Category for which you want to list providers. + # @return [Seam::Resources::DeviceProvider] OK def list_device_providers(provider_category: nil) res = @client.post("/devices/list_device_providers", {provider_category: provider_category}.compact) Seam::Resources::DeviceProvider.load_from_response(res.body["device_providers"]) end + # Updates provider-specific metadata for devices. + # @param devices Array of devices with provider metadata to update + # @return [nil] OK def report_provider_metadata(devices:) @client.post("/devices/report_provider_metadata", {devices: devices}.compact) nil end + # Updates a specified [device](https://docs.seam.co/core-concepts/devices). + # + # You can add or change [custom metadata](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) for a device, change the device's name, or [convert a managed device to unmanaged](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). + # @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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/backup-access-codes) 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](https://docs.seam.co/core-concepts/devices/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](https://docs.seam.co/core-concepts/devices/filtering-devices-by-custom-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 + # @return [nil] OK def update(device_id:, backup_access_code_pool_enabled: nil, custom_metadata: nil, is_managed: nil, name: nil, properties: nil) @client.post("/devices/update", {device_id: device_id, backup_access_code_pool_enabled: backup_access_code_pool_enabled, custom_metadata: custom_metadata, is_managed: is_managed, name: name, properties: properties}.compact) diff --git a/lib/seam/routes/devices_simulate.rb b/lib/seam/routes/devices_simulate.rb index 53c5940e..92e575ae 100644 --- a/lib/seam/routes/devices_simulate.rb +++ b/lib/seam/routes/devices_simulate.rb @@ -8,36 +8,64 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates connecting a device to Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + # @param device_id ID of the device that you want to simulate connecting to Seam. + # @return [nil] OK def connect(device_id:) @client.post("/devices/simulate/connect", {device_id: device_id}.compact) nil end + # 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. + # @return [nil] OK def connect_to_hub(device_id:) @client.post("/devices/simulate/connect_to_hub", {device_id: device_id}.compact) nil end + # Simulates disconnecting a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + # @param device_id ID of the device that you want to simulate disconnecting from Seam. + # @return [nil] OK def disconnect(device_id:) @client.post("/devices/simulate/disconnect", {device_id: device_id}.compact) nil end + # 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. + # @return [nil] OK def disconnect_from_hub(device_id:) @client.post("/devices/simulate/disconnect_from_hub", {device_id: device_id}.compact) nil end + # 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 + # @return [nil] OK def paid_subscription(device_id:, is_expired:) @client.post("/devices/simulate/paid_subscription", {device_id: device_id, is_expired: is_expired}.compact) nil end + # Simulates removing a device from Seam. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your App Against Device Disconnection and Removal](https://docs.seam.co/core-concepts/devices/testing-your-app-against-device-disconnection-and-removal). + # @param device_id ID of the device that you want to simulate removing from Seam. + # @return [nil] OK def remove(device_id:) @client.post("/devices/simulate/remove", {device_id: device_id}.compact) diff --git a/lib/seam/routes/devices_unmanaged.rb b/lib/seam/routes/devices_unmanaged.rb index a6cbca79..64abaed9 100644 --- a/lib/seam/routes/devices_unmanaged.rb +++ b/lib/seam/routes/devices_unmanaged.rb @@ -8,18 +8,53 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + # + # 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. + # @return [Seam::Resources::UnmanagedDevice] OK def get(device_id: nil, name: nil) res = @client.post("/devices/unmanaged/get", {device_id: device_id, name: name}.compact) Seam::Resources::UnmanagedDevice.load_from_response(res.body["device"]) end + # Returns a list of all [unmanaged devices](https://docs.seam.co/core-concepts/devices/managed-and-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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + # @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](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) 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. + # @return [Seam::Resources::UnmanagedDevice] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) res = @client.post("/devices/unmanaged/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::UnmanagedDevice.load_from_response(res.body["devices"]) end + # Updates a specified [unmanaged device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). 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](https://docs.seam.co/low-level-apis/smart-locks/access-codes/migrating-existing-access-codes) on an unmanaged device are unmanaged. To control an unmanaged device with Seam, [convert it to a managed device](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices#convert-an-unmanaged-device-to-managed). + # @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. + # @return [nil] OK def update(device_id:, custom_metadata: nil, is_managed: nil) @client.post("/devices/unmanaged/update", {device_id: device_id, custom_metadata: custom_metadata, is_managed: is_managed}.compact) diff --git a/lib/seam/routes/events.rb b/lib/seam/routes/events.rb index d634150e..1b066341 100644 --- a/lib/seam/routes/events.rb +++ b/lib/seam/routes/events.rb @@ -8,12 +8,47 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), 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. + # @return [Seam::Resources::SeamEvent] OK def get(event_id: nil, device_id: nil, event_type: nil) res = @client.post("/events/get", {event_id: event_id, device_id: device_id, event_type: event_type}.compact) Seam::Resources::SeamEvent.load_from_response(res.body["event"]) end + # Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://docs.seam.co/developer-tools/webhooks), 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. + # @return [Seam::Resources::SeamEvent] OK def list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil) res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id}.compact) diff --git a/lib/seam/routes/instant_keys.rb b/lib/seam/routes/instant_keys.rb index 575586e1..ce77ba72 100644 --- a/lib/seam/routes/instant_keys.rb +++ b/lib/seam/routes/instant_keys.rb @@ -8,18 +8,28 @@ def initialize(client:, defaults:) @defaults = defaults end + # Deletes a specified [Instant Key](https://docs.seam.co/capability-guides/instant-keys). + # @param instant_key_id ID of the Instant Key that you want to delete. + # @return [nil] OK def delete(instant_key_id:) @client.post("/instant_keys/delete", {instant_key_id: instant_key_id}.compact) nil end + # Gets an [instant key](https://docs.seam.co/capability-guides/instant-keys). + # @param instant_key_id ID of the instant key to get. + # @param instant_key_url URL of the instant key to get. + # @return [Seam::Resources::InstantKey] OK def get(instant_key_id: nil, instant_key_url: nil) res = @client.post("/instant_keys/get", {instant_key_id: instant_key_id, instant_key_url: instant_key_url}.compact) Seam::Resources::InstantKey.load_from_response(res.body["instant_key"]) end + # Returns a list of all [instant keys](https://docs.seam.co/capability-guides/instant-keys). + # @param user_identity_id ID of the user identity by which you want to filter the list of Instant Keys. + # @return [Seam::Resources::InstantKey] OK def list(user_identity_id: nil) res = @client.post("/instant_keys/list", {user_identity_id: user_identity_id}.compact) diff --git a/lib/seam/routes/locks.rb b/lib/seam/routes/locks.rb index b2ce2ace..feeec343 100644 --- a/lib/seam/routes/locks.rb +++ b/lib/seam/routes/locks.rb @@ -14,6 +14,11 @@ def simulate @simulate ||= Seam::Clients::LocksSimulate.new(client: @client, defaults: @defaults) end + # Configures the auto-lock setting for a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). + # @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. + # @return [Seam::Resources::ActionAttempt] OK def configure_auto_lock(auto_lock_enabled:, device_id:, auto_lock_delay_seconds: nil, wait_for_action_attempt: nil) res = @client.post("/locks/configure_auto_lock", {auto_lock_enabled: auto_lock_enabled, device_id: device_id, auto_lock_delay_seconds: auto_lock_delay_seconds}.compact) @@ -22,18 +27,44 @@ def configure_auto_lock(auto_lock_enabled:, device_id:, auto_lock_delay_seconds: Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Returns a specified [lock](https://docs.seam.co/low-level-apis/smart-locks). + # @param device_id ID of the lock that you want to get. + # @param name Name of the lock that you want to get. + # @return [Seam::Resources::Device] OK + # @deprecated Use `/devices/get` instead. def get(device_id: nil, name: nil) res = @client.post("/locks/get", {device_id: device_id, name: name}.compact) Seam::Resources::Device.load_from_response(res.body["device"]) end + # Returns a list of all [locks](https://docs.seam.co/low-level-apis/smart-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](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) 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. + # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) res = @client.post("/locks/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::Device.load_from_response(res.body["devices"]) end + # Locks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). + # @param device_id ID of the lock that you want to lock. + # @return [Seam::Resources::ActionAttempt] OK def lock_door(device_id:, wait_for_action_attempt: nil) res = @client.post("/locks/lock_door", {device_id: device_id}.compact) @@ -42,6 +73,9 @@ def lock_door(device_id:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Unlocks a [lock](https://docs.seam.co/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://docs.seam.co/low-level-apis/smart-locks/lock-and-unlock). + # @param device_id ID of the lock that you want to unlock. + # @return [Seam::Resources::ActionAttempt] OK def unlock_door(device_id:, wait_for_action_attempt: nil) res = @client.post("/locks/unlock_door", {device_id: device_id}.compact) diff --git a/lib/seam/routes/locks_simulate.rb b/lib/seam/routes/locks_simulate.rb index 8dced1f9..d3ac82d9 100644 --- a/lib/seam/routes/locks_simulate.rb +++ b/lib/seam/routes/locks_simulate.rb @@ -10,6 +10,10 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates the entry of a code on a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#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. + # @return [Seam::Resources::ActionAttempt] OK def keypad_code_entry(code:, device_id:, wait_for_action_attempt: nil) res = @client.post("/locks/simulate/keypad_code_entry", {code: code, device_id: device_id}.compact) @@ -18,6 +22,9 @@ def keypad_code_entry(code:, device_id:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Simulates a manual lock action using a keypad. You can only perform this action for [August](https://docs.seam.co/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @param device_id ID of the device for which you want to simulate a manual lock action using a keypad. + # @return [Seam::Resources::ActionAttempt] OK def manual_lock_via_keypad(device_id:, wait_for_action_attempt: nil) res = @client.post("/locks/simulate/manual_lock_via_keypad", {device_id: device_id}.compact) diff --git a/lib/seam/routes/noise_sensors.rb b/lib/seam/routes/noise_sensors.rb index 57796797..672f2d72 100644 --- a/lib/seam/routes/noise_sensors.rb +++ b/lib/seam/routes/noise_sensors.rb @@ -16,6 +16,24 @@ def simulate @simulate ||= Seam::Clients::NoiseSensorsSimulate.new(client: @client, defaults: @defaults) end + # Returns a list of all [noise sensors](https://docs.seam.co/capability-guides/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](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) 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. + # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) res = @client.post("/noise_sensors/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact) diff --git a/lib/seam/routes/noise_sensors_noise_thresholds.rb b/lib/seam/routes/noise_sensors_noise_thresholds.rb index 4e6df9fa..6d2e4fff 100644 --- a/lib/seam/routes/noise_sensors_noise_thresholds.rb +++ b/lib/seam/routes/noise_sensors_noise_thresholds.rb @@ -8,30 +8,57 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). 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](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + # @return [Seam::Resources::NoiseThreshold] OK def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil) res = @client.post("/noise_sensors/noise_thresholds/create", {device_id: device_id, ends_daily_at: ends_daily_at, starts_daily_at: starts_daily_at, name: name, noise_threshold_decibels: noise_threshold_decibels, noise_threshold_nrs: noise_threshold_nrs}.compact) Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"]) end + # Deletes a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + # @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. + # @return [nil] OK def delete(device_id:, noise_threshold_id:) @client.post("/noise_sensors/noise_thresholds/delete", {device_id: device_id, noise_threshold_id: noise_threshold_id}.compact) nil end + # Returns a specified [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + # @param noise_threshold_id ID of the noise threshold that you want to get. + # @return [Seam::Resources::NoiseThreshold] OK def get(noise_threshold_id:) res = @client.post("/noise_sensors/noise_thresholds/get", {noise_threshold_id: noise_threshold_id}.compact) Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"]) end + # Returns a list of all [noise thresholds](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + # @param device_id ID of the device for which you want to list noise thresholds. + # @return [Seam::Resources::NoiseThreshold] OK def list(device_id:) res = @client.post("/noise_sensors/noise_thresholds/list", {device_id: device_id}.compact) Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_thresholds"]) end + # Updates a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors). + # @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](https://docs.seam.co/device-and-system-integration-guides/noiseaware-sensors). + # @param starts_daily_at Time at which the noise threshold should become active daily. + # @return [nil] OK def update(device_id:, noise_threshold_id:, ends_daily_at: nil, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil, starts_daily_at: nil) @client.post("/noise_sensors/noise_thresholds/update", {device_id: device_id, noise_threshold_id: noise_threshold_id, ends_daily_at: ends_daily_at, name: name, noise_threshold_decibels: noise_threshold_decibels, noise_threshold_nrs: noise_threshold_nrs, starts_daily_at: starts_daily_at}.compact) diff --git a/lib/seam/routes/noise_sensors_simulate.rb b/lib/seam/routes/noise_sensors_simulate.rb index 6a461fd4..1d7b074f 100644 --- a/lib/seam/routes/noise_sensors_simulate.rb +++ b/lib/seam/routes/noise_sensors_simulate.rb @@ -8,6 +8,9 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates the triggering of a [noise threshold](https://docs.seam.co/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://docs.seam.co/capability-guides/noise-sensors) in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @param device_id ID of the device for which you want to simulate the triggering of a noise threshold. + # @return [nil] OK def trigger_noise_threshold(device_id:) @client.post("/noise_sensors/simulate/trigger_noise_threshold", {device_id: device_id}.compact) diff --git a/lib/seam/routes/phones.rb b/lib/seam/routes/phones.rb index e05c3c53..31088842 100644 --- a/lib/seam/routes/phones.rb +++ b/lib/seam/routes/phones.rb @@ -12,18 +12,28 @@ def simulate @simulate ||= Seam::Clients::PhonesSimulate.new(client: @client, defaults: @defaults) end + # Deactivates a phone, which is useful, for example, if a user has lost their phone. For more information, see [App User Lost Phone Process](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity#app-user-lost-phone-process). + # @param device_id Device ID of the phone that you want to deactivate. + # @return [nil] OK def deactivate(device_id:) @client.post("/phones/deactivate", {device_id: device_id}.compact) nil end + # Returns a specified [phone](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). + # @param device_id Device ID of the phone that you want to get. + # @return [Seam::Resources::Phone] OK def get(device_id:) res = @client.post("/phones/get", {device_id: device_id}.compact) Seam::Resources::Phone.load_from_response(res.body["phone"]) end + # Returns a list of all [phones](https://docs.seam.co/capability-guides/mobile-access/managing-phones-for-a-user-identity). 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](https://docs.seam.co/low-level-apis/access-systems/managing-credentials) 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. + # @return [Seam::Resources::Phone] OK def list(acs_credential_id: nil, owner_user_identity_id: nil) res = @client.post("/phones/list", {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact) diff --git a/lib/seam/routes/phones_simulate.rb b/lib/seam/routes/phones_simulate.rb index 53d346c8..519789ce 100644 --- a/lib/seam/routes/phones_simulate.rb +++ b/lib/seam/routes/phones_simulate.rb @@ -8,6 +8,12 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new simulated phone in a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Creating a Simulated Phone for a User Identity](https://docs.seam.co/capability-guides/mobile-access/developing-in-a-sandbox-workspace#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. + # @return [Seam::Resources::Phone] OK def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk_installation_id: nil, phone_metadata: nil) res = @client.post("/phones/simulate/create_sandbox_phone", {user_identity_id: user_identity_id, assa_abloy_metadata: assa_abloy_metadata, custom_sdk_installation_id: custom_sdk_installation_id, phone_metadata: phone_metadata}.compact) diff --git a/lib/seam/routes/spaces.rb b/lib/seam/routes/spaces.rb index 58c1f09d..3db024bb 100644 --- a/lib/seam/routes/spaces.rb +++ b/lib/seam/routes/spaces.rb @@ -8,72 +8,133 @@ def initialize(client:, defaults:) @defaults = defaults end + # Adds [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) 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. + # @return [nil] OK def add_acs_entrances(acs_entrance_ids:, space_id:) @client.post("/spaces/add_acs_entrances", {acs_entrance_ids: acs_entrance_ids, space_id: space_id}.compact) nil end + # Adds a [connected account](https://docs.seam.co/core-concepts/connected-accounts) 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. + # @return [nil] OK def add_connected_account(connected_account_id:, space_id:) @client.post("/spaces/add_connected_account", {connected_account_id: connected_account_id, space_id: space_id}.compact) nil end + # 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. + # @return [nil] OK def add_devices(device_ids:, space_id:) @client.post("/spaces/add_devices", {device_ids: device_ids, space_id: space_id}.compact) nil end + # 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. + # @return [Seam::Resources::Space] OK def create(name:, acs_entrance_ids: nil, connected_account_ids: nil, customer_data: nil, customer_key: nil, device_ids: nil, space_key: nil) res = @client.post("/spaces/create", {name: name, acs_entrance_ids: acs_entrance_ids, connected_account_ids: connected_account_ids, customer_data: customer_data, customer_key: customer_key, device_ids: device_ids, space_key: space_key}.compact) Seam::Resources::Space.load_from_response(res.body["space"]) end + # Deletes a space. + # @param space_id ID of the space that you want to delete. + # @return [nil] OK def delete(space_id:) @client.post("/spaces/delete", {space_id: space_id}.compact) nil end + # 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. + # @return [Seam::Resources::Space] OK def get(space_id: nil, space_key: nil) res = @client.post("/spaces/get", {space_id: space_id, space_key: space_key}.compact) Seam::Resources::Space.load_from_response(res.body["space"]) end + # 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. + # @return [Seam::Resources::Batch] OK def get_related(exclude: nil, include: nil, space_ids: nil, space_keys: nil) res = @client.post("/spaces/get_related", {exclude: exclude, include: include, space_ids: space_ids, space_keys: space_keys}.compact) Seam::Resources::Batch.load_from_response(res.body["batch"]) end + # 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. + # @return [Seam::Resources::Space] OK def list(customer_key: nil, limit: nil, page_cursor: nil, search: nil, space_key: nil) res = @client.post("/spaces/list", {customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, space_key: space_key}.compact) Seam::Resources::Space.load_from_response(res.body["spaces"]) end + # Removes [entrances](https://docs.seam.co/low-level-apis/access-systems/retrieving-entrance-details) 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. + # @return [nil] OK def remove_acs_entrances(acs_entrance_ids:, space_id:) @client.post("/spaces/remove_acs_entrances", {acs_entrance_ids: acs_entrance_ids, space_id: space_id}.compact) nil end + # Removes a [connected account](https://docs.seam.co/core-concepts/connected-accounts) 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. + # @return [nil] OK def remove_connected_account(connected_account_id:, space_id:) @client.post("/spaces/remove_connected_account", {connected_account_id: connected_account_id, space_id: space_id}.compact) nil end + # 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. + # @return [nil] OK def remove_devices(device_ids:, space_id:) @client.post("/spaces/remove_devices", {device_ids: device_ids, space_id: space_id}.compact) nil end + # 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. + # @return [Seam::Resources::Space] OK def update(acs_entrance_ids: nil, customer_data: nil, device_ids: nil, name: nil, space_id: nil, space_key: nil) res = @client.post("/spaces/update", {acs_entrance_ids: acs_entrance_ids, customer_data: customer_data, device_ids: device_ids, name: name, space_id: space_id, space_key: space_key}.compact) diff --git a/lib/seam/routes/thermostats.rb b/lib/seam/routes/thermostats.rb index b9e153d8..e91d1a18 100644 --- a/lib/seam/routes/thermostats.rb +++ b/lib/seam/routes/thermostats.rb @@ -22,6 +22,10 @@ def simulate @simulate ||= Seam::Clients::ThermostatsSimulate.new(client: @client, defaults: @defaults) end + # Activates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @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. + # @return [Seam::Resources::ActionAttempt] OK def activate_climate_preset(climate_preset_key:, device_id:, wait_for_action_attempt: nil) res = @client.post("/thermostats/activate_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact) @@ -30,6 +34,11 @@ def activate_climate_preset(climate_preset_key:, device_id:, wait_for_action_att Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [cool mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + # @param device_id ID of the thermostat device that you want to set to cool mode. + # @param cooling_set_point_celsius [Cooling set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `cooling_set_point` parameters. + # @return [Seam::Resources::ActionAttempt] OK def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/cool", {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit}.compact) @@ -38,18 +47,41 @@ def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenhei Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Creates a [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @param climate_preset_key Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + # @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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param cooling_set_point_fahrenheit Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param ecobee_metadata Metadata specific to the Ecobee climate, if applicable. + # @param fan_mode_setting Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + # @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + # @param manual_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings. Deprecated: Use 'thermostat_schedule.is_override_allowed' + # @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + # @return [nil] OK def create_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil) @client.post("/thermostats/create_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, climate_preset_mode: climate_preset_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, ecobee_metadata: ecobee_metadata, fan_mode_setting: fan_mode_setting, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name}.compact) nil end + # Deletes a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @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. + # @return [nil] OK def delete_climate_preset(climate_preset_key:, device_id:) @client.post("/thermostats/delete_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact) nil end + # Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + # @param device_id ID of the thermostat device that you want to set to heat mode. + # @param heating_set_point_celsius [Heating set point](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + # @return [Seam::Resources::ActionAttempt] OK def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/heat", {device_id: device_id, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact) @@ -58,6 +90,13 @@ def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenhei Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to [heat-cool ("auto") mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + # @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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + # @return [Seam::Resources::ActionAttempt] OK def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/heat_cool", {device_id: device_id, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact) @@ -66,12 +105,33 @@ def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahr Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Returns a list of all [thermostats](https://docs.seam.co/capability-guides/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](https://docs.seam.co/core-concepts/devices/adding-custom-metadata-to-a-device) 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. + # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) res = @client.post("/thermostats/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, connected_account_ids: connected_account_ids, created_before: created_before, custom_metadata_has: custom_metadata_has, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, unstable_location_id: unstable_location_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::Device.load_from_response(res.body["devices"]) end + # Sets a specified [thermostat](https://docs.seam.co/capability-guides/thermostats) to ["off" mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings). + # @param device_id ID of the thermostat device that you want to set to off mode. + # @return [Seam::Resources::ActionAttempt] OK def off(device_id:, wait_for_action_attempt: nil) res = @client.post("/thermostats/off", {device_id: device_id}.compact) @@ -80,12 +140,21 @@ def off(device_id:, wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Sets a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) as the ["fallback"](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets/setting-the-fallback-climate-preset) preset for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @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. + # @return [nil] OK def set_fallback_climate_preset(climate_preset_key:, device_id:) @client.post("/thermostats/set_fallback_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact) nil end + # Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @param device_id ID of the thermostat device for which you want to set the fan mode. + # @param fan_mode Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. Deprecated: Use `fan_mode_setting` instead. + # @param fan_mode_setting [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. + # @return [Seam::Resources::ActionAttempt] OK def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/set_fan_mode", {device_id: device_id, fan_mode: fan_mode, fan_mode_setting: fan_mode_setting}.compact) @@ -94,6 +163,14 @@ def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, wait_for_acti Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Sets the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to set for the thermostat. You must set one of the `heating_set_point` parameters. + # @return [Seam::Resources::ActionAttempt] OK def set_hvac_mode(device_id:, hvac_mode_setting:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/set_hvac_mode", {device_id: device_id, hvac_mode_setting: hvac_mode_setting, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact) @@ -102,18 +179,49 @@ def set_hvac_mode(device_id:, hvac_mode_setting:, cooling_set_point_celsius: nil Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Sets a [temperature threshold](https://docs.seam.co/capability-guides/thermostats/setting-and-monitoring-temperature-thresholds) 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. + # @return [nil] OK def set_temperature_threshold(device_id:, lower_limit_celsius: nil, lower_limit_fahrenheit: nil, upper_limit_celsius: nil, upper_limit_fahrenheit: nil) @client.post("/thermostats/set_temperature_threshold", {device_id: device_id, lower_limit_celsius: lower_limit_celsius, lower_limit_fahrenheit: lower_limit_fahrenheit, upper_limit_celsius: upper_limit_celsius, upper_limit_fahrenheit: upper_limit_fahrenheit}.compact) nil end + # Updates a specified [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @param climate_preset_key Unique key to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + # @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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param cooling_set_point_fahrenheit Temperature to which the thermostat should cool (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param ecobee_metadata Metadata specific to the Ecobee climate, if applicable. + # @param fan_mode_setting Desired [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings), such as `on`, `auto`, or `circulate`. + # @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). + # @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. + # @param manual_override_allowed Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). Deprecated: Use 'thermostat_schedule.is_override_allowed' + # @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). + # @return [nil] OK def update_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil) @client.post("/thermostats/update_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, climate_preset_mode: climate_preset_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, ecobee_metadata: ecobee_metadata, fan_mode_setting: fan_mode_setting, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit, hvac_mode_setting: hvac_mode_setting, manual_override_allowed: manual_override_allowed, name: name}.compact) nil end + # 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. + # @return [Seam::Resources::ActionAttempt] OK def update_weekly_program(device_id:, friday_program_id: nil, monday_program_id: nil, saturday_program_id: nil, sunday_program_id: nil, thursday_program_id: nil, tuesday_program_id: nil, wednesday_program_id: nil, wait_for_action_attempt: nil) res = @client.post("/thermostats/update_weekly_program", {device_id: device_id, friday_program_id: friday_program_id, monday_program_id: monday_program_id, saturday_program_id: saturday_program_id, sunday_program_id: sunday_program_id, thursday_program_id: thursday_program_id, tuesday_program_id: tuesday_program_id, wednesday_program_id: wednesday_program_id}.compact) diff --git a/lib/seam/routes/thermostats_daily_programs.rb b/lib/seam/routes/thermostats_daily_programs.rb index 30b4e7c1..b2ea5143 100644 --- a/lib/seam/routes/thermostats_daily_programs.rb +++ b/lib/seam/routes/thermostats_daily_programs.rb @@ -10,18 +10,31 @@ def initialize(client:, defaults:) @defaults = defaults end + # 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. + # @return [Seam::Resources::ThermostatDailyProgram] OK def create(device_id:, name:, periods:) res = @client.post("/thermostats/daily_programs/create", {device_id: device_id, name: name, periods: periods}.compact) Seam::Resources::ThermostatDailyProgram.load_from_response(res.body["thermostat_daily_program"]) end + # Deletes a thermostat daily program. + # @param thermostat_daily_program_id ID of the thermostat daily program that you want to delete. + # @return [nil] OK def delete(thermostat_daily_program_id:) @client.post("/thermostats/daily_programs/delete", {thermostat_daily_program_id: thermostat_daily_program_id}.compact) nil end + # 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. + # @return [Seam::Resources::ActionAttempt] OK def update(name:, periods:, thermostat_daily_program_id:, wait_for_action_attempt: nil) res = @client.post("/thermostats/daily_programs/update", {name: name, periods: periods, thermostat_daily_program_id: thermostat_daily_program_id}.compact) diff --git a/lib/seam/routes/thermostats_schedules.rb b/lib/seam/routes/thermostats_schedules.rb index 99812a01..d3b4964d 100644 --- a/lib/seam/routes/thermostats_schedules.rb +++ b/lib/seam/routes/thermostats_schedules.rb @@ -8,30 +8,58 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @param climate_preset_key Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) 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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @param starts_at Date and time at which the new thermostat schedule starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#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](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + # @param name Name of the thermostat schedule. + # @return [Seam::Resources::ThermostatSchedule] OK def create(climate_preset_key:, device_id:, ends_at:, starts_at:, is_override_allowed: nil, max_override_period_minutes: nil, name: nil) res = @client.post("/thermostats/schedules/create", {climate_preset_key: climate_preset_key, device_id: device_id, ends_at: ends_at, starts_at: starts_at, is_override_allowed: is_override_allowed, max_override_period_minutes: max_override_period_minutes, name: name}.compact) Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"]) end + # Deletes a [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @param thermostat_schedule_id ID of the thermostat schedule that you want to delete. + # @return [nil] OK def delete(thermostat_schedule_id:) @client.post("/thermostats/schedules/delete", {thermostat_schedule_id: thermostat_schedule_id}.compact) nil end + # Returns a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + # @param thermostat_schedule_id ID of the thermostat schedule that you want to get. + # @return [Seam::Resources::ThermostatSchedule] OK def get(thermostat_schedule_id:) res = @client.post("/thermostats/schedules/get", {thermostat_schedule_id: thermostat_schedule_id}.compact) Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"]) end + # Returns a list of all [thermostat schedules](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). + # @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. + # @return [Seam::Resources::ThermostatSchedule] OK def list(device_id:, user_identifier_key: nil) res = @client.post("/thermostats/schedules/list", {device_id: device_id, user_identifier_key: user_identifier_key}.compact) Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedules"]) end + # Updates a specified [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules). + # @param thermostat_schedule_id ID of the thermostat schedule that you want to update. + # @param climate_preset_key Key of the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets) to use for the thermostat schedule. + # @param ends_at Date and time at which the thermostat schedule ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#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](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#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](https://www.iso.org/iso-8601-date-and-time-format.html) format. + # @return [nil] OK def update(thermostat_schedule_id:, climate_preset_key: nil, ends_at: nil, is_override_allowed: nil, max_override_period_minutes: nil, name: nil, starts_at: nil) @client.post("/thermostats/schedules/update", {thermostat_schedule_id: thermostat_schedule_id, climate_preset_key: climate_preset_key, ends_at: ends_at, is_override_allowed: is_override_allowed, max_override_period_minutes: max_override_period_minutes, name: name, starts_at: starts_at}.compact) diff --git a/lib/seam/routes/thermostats_simulate.rb b/lib/seam/routes/thermostats_simulate.rb index 17b8405c..5b9298dd 100644 --- a/lib/seam/routes/thermostats_simulate.rb +++ b/lib/seam/routes/thermostats_simulate.rb @@ -8,12 +8,25 @@ def initialize(client:, defaults:) @defaults = defaults end + # Simulates having adjusted the [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) for a [thermostat](https://docs.seam.co/capability-guides/thermostats). Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) 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](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points) in °F that you want to simulate. You must set `heating_set_point_fahrenheit` or `heating_set_point_celsius`. + # @return [nil] OK def hvac_mode_adjusted(device_id:, hvac_mode:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil) @client.post("/thermostats/simulate/hvac_mode_adjusted", {device_id: device_id, hvac_mode: hvac_mode, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, heating_set_point_celsius: heating_set_point_celsius, heating_set_point_fahrenheit: heating_set_point_fahrenheit}.compact) nil end + # Simulates a [thermostat](https://docs.seam.co/capability-guides/thermostats) reaching a specified temperature. Only applicable for [sandbox devices](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). See also [Testing Your Thermostat App with Simulate Endpoints](https://docs.seam.co/capability-guides/thermostats/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`. + # @return [nil] OK def temperature_reached(device_id:, temperature_celsius: nil, temperature_fahrenheit: nil) @client.post("/thermostats/simulate/temperature_reached", {device_id: device_id, temperature_celsius: temperature_celsius, temperature_fahrenheit: temperature_fahrenheit}.compact) diff --git a/lib/seam/routes/user_identities.rb b/lib/seam/routes/user_identities.rb index f6df556d..fe3c3f05 100644 --- a/lib/seam/routes/user_identities.rb +++ b/lib/seam/routes/user_identities.rb @@ -12,84 +12,151 @@ def unmanaged @unmanaged ||= Seam::Clients::UserIdentitiesUnmanaged.new(client: @client, defaults: @defaults) end + # Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [nil] OK def add_acs_user(acs_user_id:, user_identity_id: nil, user_identity_key: nil) @client.post("/user_identities/add_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) nil end + # Creates a new [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [Seam::Resources::UserIdentity] OK def create(acs_system_ids: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) res = @client.post("/user_identities/create", {acs_system_ids: acs_system_ids, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"]) end + # Deletes a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). This deletes the user identity and all associated resources, including any [credentials](https://docs.seam.co/api/acs/credentials), [acs users](https://docs.seam.co/api/acs/users) and [client sessions](https://docs.seam.co/api/client_sessions). + # @param user_identity_id ID of the user identity that you want to delete. + # @return [nil] OK def delete(user_identity_id:) @client.post("/user_identities/delete", {user_identity_id: user_identity_id}.compact) nil end + # Generates a new [instant key](https://docs.seam.co/capability-guides/instant-keys) for a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [Seam::Resources::InstantKey] OK def generate_instant_key(user_identity_id:, customization_profile_id: nil, max_use_count: nil) res = @client.post("/user_identities/generate_instant_key", {user_identity_id: user_identity_id, customization_profile_id: customization_profile_id, max_use_count: max_use_count}.compact) Seam::Resources::InstantKey.load_from_response(res.body["instant_key"]) end + # Returns a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + # @param user_identity_id ID of the user identity that you want to get. + # @param user_identity_key + # @return [Seam::Resources::UserIdentity] OK def get(user_identity_id: nil, user_identity_key: nil) res = @client.post("/user_identities/get", {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"]) end + # Grants a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) access to a specified [device](https://docs.seam.co/core-concepts/devices/). + # @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. + # @return [nil] OK def grant_access_to_device(device_id:, user_identity_id:) @client.post("/user_identities/grant_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact) nil end + # Returns a list of all [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + # @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. + # @return [Seam::Resources::UserIdentity] OK def list(created_before: nil, credential_manager_acs_system_id: nil, limit: nil, page_cursor: nil, search: nil, user_identity_ids: nil) res = @client.post("/user_identities/list", {created_before: created_before, credential_manager_acs_system_id: credential_manager_acs_system_id, limit: limit, page_cursor: page_cursor, search: search, user_identity_ids: user_identity_ids}.compact) Seam::Resources::UserIdentity.load_from_response(res.body["user_identities"]) end + # Returns a list of all [devices](https://docs.seam.co/core-concepts/devices) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [Seam::Resources::Device] OK def list_accessible_devices(user_identity_id:) res = @client.post("/user_identities/list_accessible_devices", {user_identity_id: user_identity_id}.compact) Seam::Resources::Device.load_from_response(res.body["devices"]) end + # Returns a list of all [ACS entrances](https://docs.seam.co/api/acs/entrances) accessible to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [Seam::Resources::AcsEntrance] OK def list_accessible_entrances(user_identity_id:) res = @client.post("/user_identities/list_accessible_entrances", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"]) end + # Returns a list of all [access systems](https://docs.seam.co/low-level-apis/access-systems) associated with a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + # @param user_identity_id ID of the user identity for which you want to retrieve all access systems. + # @return [Seam::Resources::AcsSystem] OK def list_acs_systems(user_identity_id:) res = @client.post("/user_identities/list_acs_systems", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"]) end + # Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management) assigned to a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity). + # @param user_identity_id ID of the user identity for which you want to retrieve all access system users. + # @return [Seam::Resources::AcsUser] OK def list_acs_users(user_identity_id:) res = @client.post("/user_identities/list_acs_users", {user_identity_id: user_identity_id}.compact) Seam::Resources::AcsUser.load_from_response(res.body["acs_users"]) end + # Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [nil] OK def remove_acs_user(acs_user_id:, user_identity_id:) @client.post("/user_identities/remove_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact) nil end + # Revokes access to a specified [device](https://docs.seam.co/core-concepts/devices/) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [nil] OK def revoke_access_to_device(device_id:, user_identity_id:) @client.post("/user_identities/revoke_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact) nil end + # Updates a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [nil] OK def update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil) @client.post("/user_identities/update", {user_identity_id: user_identity_id, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact) diff --git a/lib/seam/routes/user_identities_unmanaged.rb b/lib/seam/routes/user_identities_unmanaged.rb index bed63954..ea38e23a 100644 --- a/lib/seam/routes/user_identities_unmanaged.rb +++ b/lib/seam/routes/user_identities_unmanaged.rb @@ -8,18 +8,34 @@ def initialize(client:, defaults:) @defaults = defaults end + # Returns a specified unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (where is_managed = false). + # @param user_identity_id ID of the unmanaged user identity that you want to get. + # @return [Seam::Resources::UnmanagedUserIdentity] OK def get(user_identity_id:) res = @client.post("/user_identities/unmanaged/get", {user_identity_id: user_identity_id}.compact) Seam::Resources::UnmanagedUserIdentity.load_from_response(res.body["user_identity"]) end + # Returns a list of all unmanaged [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) (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`. + # @return [Seam::Resources::UnmanagedUserIdentity] OK def list(created_before: nil, limit: nil, page_cursor: nil, search: nil) res = @client.post("/user_identities/unmanaged/list", {created_before: created_before, limit: limit, page_cursor: page_cursor, search: search}.compact) Seam::Resources::UnmanagedUserIdentity.load_from_response(res.body["user_identities"]) end + # Updates an unmanaged [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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. + # @return [nil] OK def update(is_managed:, user_identity_id:, user_identity_key: nil) @client.post("/user_identities/unmanaged/update", {is_managed: is_managed, user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact) diff --git a/lib/seam/routes/webhooks.rb b/lib/seam/routes/webhooks.rb index 7269fd76..c42e6461 100644 --- a/lib/seam/routes/webhooks.rb +++ b/lib/seam/routes/webhooks.rb @@ -8,30 +8,46 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [webhook](https://docs.seam.co/developer-tools/webhooks). + # @param url URL for the new webhook. + # @param event_types Types of events that you want the new webhook to receive. + # @return [Seam::Resources::Webhook] OK def create(url:, event_types: nil) res = @client.post("/webhooks/create", {url: url, event_types: event_types}.compact) Seam::Resources::Webhook.load_from_response(res.body["webhook"]) end + # Deletes a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + # @param webhook_id ID of the webhook that you want to delete. + # @return [nil] OK def delete(webhook_id:) @client.post("/webhooks/delete", {webhook_id: webhook_id}.compact) nil end + # Gets a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + # @param webhook_id ID of the webhook that you want to get. + # @return [Seam::Resources::Webhook] OK def get(webhook_id:) res = @client.post("/webhooks/get", {webhook_id: webhook_id}.compact) Seam::Resources::Webhook.load_from_response(res.body["webhook"]) end + # Returns a list of all [webhooks](https://docs.seam.co/developer-tools/webhooks). + # @return [Seam::Resources::Webhook] OK def list res = @client.post("/webhooks/list") Seam::Resources::Webhook.load_from_response(res.body["webhooks"]) end + # Updates a specified [webhook](https://docs.seam.co/developer-tools/webhooks). + # @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. + # @return [nil] OK def update(event_types:, webhook_id:) @client.post("/webhooks/update", {event_types: event_types, webhook_id: webhook_id}.compact) diff --git a/lib/seam/routes/workspaces.rb b/lib/seam/routes/workspaces.rb index d81f6e9f..08909b26 100644 --- a/lib/seam/routes/workspaces.rb +++ b/lib/seam/routes/workspaces.rb @@ -10,24 +10,42 @@ def initialize(client:, defaults:) @defaults = defaults end + # Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). + # @param name Name of the new workspace. + # @param company_name Company name for the new workspace. + # @param connect_partner_name Connect partner name for the new workspace. Deprecated: Use `company_name` instead. + # @param connect_webview_customization [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). + # @param is_sandbox Indicates whether the new workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). + # @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. + # @return [Seam::Resources::Workspace] OK def create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, organization_id: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil) res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_sandbox: is_sandbox, organization_id: organization_id, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color, webview_primary_button_text_color: webview_primary_button_text_color, webview_success_message: webview_success_message}.compact) Seam::Resources::Workspace.load_from_response(res.body["workspace"]) end + # Returns the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + # @return [Seam::Resources::Workspace] OK def get res = @client.post("/workspaces/get") Seam::Resources::Workspace.load_from_response(res.body["workspace"]) end + # Returns a list of [workspaces](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + # @return [Seam::Resources::Workspace] OK def list res = @client.post("/workspaces/list") Seam::Resources::Workspace.load_from_response(res.body["workspaces"]) end + # Resets the [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces) associated with the authentication value. Note that this endpoint is only available for sandbox workspaces. + # @return [Seam::Resources::ActionAttempt] OK def reset_sandbox(wait_for_action_attempt: nil) res = @client.post("/workspaces/reset_sandbox") @@ -36,6 +54,14 @@ def reset_sandbox(wait_for_action_attempt: nil) Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end + # Updates the [workspace](https://docs.seam.co/core-concepts/workspaces) associated with the authentication value. + # @param connect_partner_name Connect partner name for the workspace. + # @param connect_webview_customization [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#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. + # @return [nil] OK def update(connect_partner_name: nil, connect_webview_customization: nil, is_publishable_key_auth_enabled: nil, is_suspended: nil, name: nil, organization_id: nil) @client.post("/workspaces/update", {connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_publishable_key_auth_enabled: is_publishable_key_auth_enabled, is_suspended: is_suspended, name: name, organization_id: organization_id}.compact) From 0705153ad7f5f0c0a6bb3d521acbf8f89c41a1b7 Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 28 Jul 2026 15:27:58 -0500 Subject: [PATCH 2/2] Emit deprecated tags for legacy parameters --- codegen/lib/handlebars-helpers.ts | 12 ++++++------ lib/seam/routes/access_codes.rb | 6 ++++-- lib/seam/routes/access_grants.rb | 9 ++++++--- lib/seam/routes/acs_entrances.rb | 3 ++- lib/seam/routes/acs_users.rb | 6 ++++-- lib/seam/routes/client_sessions.rb | 9 ++++++--- lib/seam/routes/devices.rb | 3 ++- lib/seam/routes/devices_unmanaged.rb | 3 ++- lib/seam/routes/locks.rb | 3 ++- lib/seam/routes/noise_sensors.rb | 3 ++- lib/seam/routes/thermostats.rb | 12 ++++++++---- lib/seam/routes/workspaces.rb | 15 ++++++++++----- 12 files changed, 54 insertions(+), 30 deletions(-) diff --git a/codegen/lib/handlebars-helpers.ts b/codegen/lib/handlebars-helpers.ts index a4aaab84..dedce68d 100644 --- a/codegen/lib/handlebars-helpers.ts +++ b/codegen/lib/handlebars-helpers.ts @@ -33,15 +33,15 @@ export const rubyParamDoc = ( ): string => { const [firstLine = '', ...remainingLines] = parameter.description.split('\n') const deprecation = parameter.isDeprecated - ? `Deprecated: ${parameter.deprecationMessage}` - : '' - const firstLineDescription = [firstLine, deprecation] - .filter((part) => part !== '') - .join(' ') + ? [ + `@deprecated ${parameter.name}: ${parameter.deprecationMessage}`.trimEnd(), + ] + : [] return comment( [ - `@param ${parameter.name} ${firstLineDescription}`.trimEnd(), + `@param ${parameter.name} ${firstLine}`.trimEnd(), ...remainingLines, + ...deprecation, ], indentation, ) diff --git a/lib/seam/routes/access_codes.rb b/lib/seam/routes/access_codes.rb index 66d28cc2..79b3ac1a 100644 --- a/lib/seam/routes/access_codes.rb +++ b/lib/seam/routes/access_codes.rb @@ -38,7 +38,8 @@ def unmanaged # @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](https://www.iso.org/iso-8601-date-and-time-format.html) format. # @param use_backup_access_code_pool 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). - # @param use_offline_access_code Deprecated: Use `is_offline_access_code` instead. + # @param use_offline_access_code + # @deprecated use_offline_access_code: Use `is_offline_access_code` instead. # @return [Seam::Resources::AccessCode] OK def create(device_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, common_code_key: nil, ends_at: nil, is_external_modification_allowed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil) res = @client.post("/access_codes/create", {device_id: device_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, common_code_key: common_code_key, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact) @@ -191,7 +192,8 @@ def report_device_constraints(device_id:, max_code_length: nil, min_code_length: # @param starts_at 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. # @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](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). # @param use_backup_access_code_pool 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). - # @param use_offline_access_code Deprecated: Use `is_offline_access_code` instead. + # @param use_offline_access_code + # @deprecated use_offline_access_code: Use `is_offline_access_code` instead. # @return [nil] OK def update(access_code_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, device_id: nil, ends_at: nil, is_external_modification_allowed: nil, is_managed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, type: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil) @client.post("/access_codes/update", {access_code_id: access_code_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, device_id: device_id, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_managed: is_managed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, type: type, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact) diff --git a/lib/seam/routes/access_grants.rb b/lib/seam/routes/access_grants.rb index d43a349a..75e7b02e 100644 --- a/lib/seam/routes/access_grants.rb +++ b/lib/seam/routes/access_grants.rb @@ -21,8 +21,10 @@ def unmanaged # @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](https://docs.seam.co/api/devices/list) to which access is being granted. # @param ends_at Date and time at which the validity of the new grant 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`. - # @param location Deprecated: Create a space first, then reference it using `space_ids`. - # @param location_ids Deprecated: Use `space_ids`. + # @param location + # @deprecated location: Create a space first, then reference it using `space_ids`. + # @param location_ids + # @deprecated location_ids: 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. @@ -75,7 +77,8 @@ def get_related(access_grant_ids: nil, access_grant_keys: nil, exclude: nil, inc # @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 location_id + # @deprecated location_id: 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. diff --git a/lib/seam/routes/acs_entrances.rb b/lib/seam/routes/acs_entrances.rb index 484a8287..c61e2aa0 100644 --- a/lib/seam/routes/acs_entrances.rb +++ b/lib/seam/routes/acs_entrances.rb @@ -38,7 +38,8 @@ def grant_access(acs_entrance_id:, acs_user_id: nil, user_identity_id: nil) # @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 location_id + # @deprecated location_id: 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. diff --git a/lib/seam/routes/acs_users.rb b/lib/seam/routes/acs_users.rb index 4901df30..f6823258 100644 --- a/lib/seam/routes/acs_users.rb +++ b/lib/seam/routes/acs_users.rb @@ -23,7 +23,8 @@ def add_to_access_group(acs_access_group_id:, acs_user_id:) # @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 + # @deprecated email: use email_address. # @param email_address Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). # @param phone_number Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) 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. @@ -131,7 +132,8 @@ def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil) # @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 + # @deprecated email: use email_address. # @param email_address Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). # @param full_name Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). # @param hid_acs_system_id ID of the HID access control system associated with the user. diff --git a/lib/seam/routes/client_sessions.rb b/lib/seam/routes/client_sessions.rb index 4eaed0ea..8d6505ea 100644 --- a/lib/seam/routes/client_sessions.rb +++ b/lib/seam/routes/client_sessions.rb @@ -16,7 +16,8 @@ def initialize(client:, defaults:) # @param expires_at Date and time at which the client session should expire, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to create a client session. - # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id` instead. + # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + # @deprecated user_identity_ids: Use `user_identity_id` instead. # @return [Seam::Resources::ClientSession] OK def create(connect_webview_ids: nil, connected_account_ids: nil, customer_id: nil, customer_key: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) res = @client.post("/client_sessions/create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, customer_id: customer_id, customer_key: customer_key, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) @@ -49,7 +50,8 @@ def get(client_session_id: nil, user_identifier_key: nil) # @param expires_at Date and time at which the client session should expire in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) 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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-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 IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id`. + # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + # @deprecated user_identity_ids: Use `user_identity_id`. # @return [Seam::Resources::ClientSession] OK def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) res = @client.post("/client_sessions/get_or_create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) @@ -63,7 +65,8 @@ def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_ # @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/core-concepts/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](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. - # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. Deprecated: Use `user_identity_id`. + # @param user_identity_ids IDs of the [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session. + # @deprecated user_identity_ids: Use `user_identity_id`. # @return [nil] OK def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_id: nil, user_identity_ids: nil) @client.post("/client_sessions/grant_access", {client_session_id: client_session_id, connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, user_identity_ids: user_identity_ids}.compact) diff --git a/lib/seam/routes/devices.rb b/lib/seam/routes/devices.rb index 770f0301..e2ca8420 100644 --- a/lib/seam/routes/devices.rb +++ b/lib/seam/routes/devices.rb @@ -43,7 +43,8 @@ def get(device_id: nil, name: nil) # @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 unstable_location_id + # @deprecated unstable_location_id: Use `space_id`. # @param user_identifier_key Your own internal user ID for the user for which you want to list devices. # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) diff --git a/lib/seam/routes/devices_unmanaged.rb b/lib/seam/routes/devices_unmanaged.rb index 64abaed9..17f95ea4 100644 --- a/lib/seam/routes/devices_unmanaged.rb +++ b/lib/seam/routes/devices_unmanaged.rb @@ -39,7 +39,8 @@ def get(device_id: nil, name: nil) # @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 unstable_location_id + # @deprecated unstable_location_id: Use `space_id`. # @param user_identifier_key Your own internal user ID for the user for which you want to list devices. # @return [Seam::Resources::UnmanagedDevice] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) diff --git a/lib/seam/routes/locks.rb b/lib/seam/routes/locks.rb index feeec343..99974a97 100644 --- a/lib/seam/routes/locks.rb +++ b/lib/seam/routes/locks.rb @@ -53,7 +53,8 @@ def get(device_id: nil, name: nil) # @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 unstable_location_id + # @deprecated unstable_location_id: Use `space_id`. # @param user_identifier_key Your own internal user ID for the user for which you want to list devices. # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) diff --git a/lib/seam/routes/noise_sensors.rb b/lib/seam/routes/noise_sensors.rb index 672f2d72..24cfe397 100644 --- a/lib/seam/routes/noise_sensors.rb +++ b/lib/seam/routes/noise_sensors.rb @@ -31,7 +31,8 @@ def simulate # @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 unstable_location_id + # @deprecated unstable_location_id: Use `space_id`. # @param user_identifier_key Your own internal user ID for the user for which you want to list devices. # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) diff --git a/lib/seam/routes/thermostats.rb b/lib/seam/routes/thermostats.rb index e91d1a18..bb28b94e 100644 --- a/lib/seam/routes/thermostats.rb +++ b/lib/seam/routes/thermostats.rb @@ -58,7 +58,8 @@ def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenhei # @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). # @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). # @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - # @param manual_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings. Deprecated: Use 'thermostat_schedule.is_override_allowed' + # @param manual_override_allowed Indicates whether a person at the thermostat or using the API can change the thermostat's settings. + # @deprecated manual_override_allowed: Use 'thermostat_schedule.is_override_allowed' # @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). # @return [nil] OK def create_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil) @@ -120,7 +121,8 @@ def heat_cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahr # @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 unstable_location_id + # @deprecated unstable_location_id: Use `space_id`. # @param user_identifier_key Your own internal user ID for the user for which you want to list devices. # @return [Seam::Resources::Device] OK def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, unstable_location_id: nil, user_identifier_key: nil) @@ -152,7 +154,8 @@ def set_fallback_climate_preset(climate_preset_key:, device_id:) # Sets the [fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats). # @param device_id ID of the thermostat device for which you want to set the fan mode. - # @param fan_mode Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. Deprecated: Use `fan_mode_setting` instead. + # @param fan_mode Fan mode setting for the thermostat, such as `auto`, `on`, or `circulate`. + # @deprecated fan_mode: Use `fan_mode_setting` instead. # @param fan_mode_setting [Fan mode setting](https://docs.seam.co/capability-guides/thermostats/configure-current-climate-settings#fan-mode-settings) that you want to set for the thermostat. # @return [Seam::Resources::ActionAttempt] OK def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, wait_for_action_attempt: nil) @@ -203,7 +206,8 @@ def set_temperature_threshold(device_id:, lower_limit_celsius: nil, lower_limit_ # @param heating_set_point_celsius Temperature to which the thermostat should heat (in °C). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). # @param heating_set_point_fahrenheit Temperature to which the thermostat should heat (in °F). See also [Set Points](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/set-points). # @param hvac_mode_setting Desired [HVAC mode](https://docs.seam.co/capability-guides/thermostats/understanding-thermostat-concepts/hvac-mode) setting, such as `heat`, `cool`, `heat_cool`, or `off`. - # @param manual_override_allowed Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). Deprecated: Use 'thermostat_schedule.is_override_allowed' + # @param manual_override_allowed Indicates whether a person at the thermostat can change the thermostat's settings. See [Specifying Manual Override Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions). + # @deprecated manual_override_allowed: Use 'thermostat_schedule.is_override_allowed' # @param name User-friendly name to identify the [climate preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets). # @return [nil] OK def update_climate_preset(climate_preset_key:, device_id:, climate_preset_mode: nil, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, ecobee_metadata: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, manual_override_allowed: nil, name: nil) diff --git a/lib/seam/routes/workspaces.rb b/lib/seam/routes/workspaces.rb index 08909b26..e8baabfe 100644 --- a/lib/seam/routes/workspaces.rb +++ b/lib/seam/routes/workspaces.rb @@ -13,14 +13,19 @@ def initialize(client:, defaults:) # Creates a new [workspace](https://docs.seam.co/core-concepts/workspaces). # @param name Name of the new workspace. # @param company_name Company name for the new workspace. - # @param connect_partner_name Connect partner name for the new workspace. Deprecated: Use `company_name` instead. + # @param connect_partner_name Connect partner name for the new workspace. + # @deprecated connect_partner_name: Use `company_name` instead. # @param connect_webview_customization [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) customizations for the new workspace. See also [Customize the Look and Feel of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-look-and-feel-of-your-connect-webviews). # @param is_sandbox Indicates whether the new workspace is a [sandbox workspace](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces). # @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. + # @param webview_logo_shape + # @deprecated webview_logo_shape: Use `connect_webview_customization.webview_logo_shape` instead. + # @param webview_primary_button_color + # @deprecated webview_primary_button_color: Use `connect_webview_customization.webview_primary_button_color` instead. + # @param webview_primary_button_text_color + # @deprecated webview_primary_button_text_color: Use `connect_webview_customization.webview_primary_button_text_color` instead. + # @param webview_success_message + # @deprecated webview_success_message: Use `connect_webview_customization.webview_success_message` instead. # @return [Seam::Resources::Workspace] OK def create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, organization_id: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil) res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_sandbox: is_sandbox, organization_id: organization_id, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color, webview_primary_button_text_color: webview_primary_button_text_color, webview_success_message: webview_success_message}.compact)