diff --git a/lib/seam/routes/clients/access_codes.rb b/lib/seam/routes/clients/access_codes.rb index b88e008..7893ea7 100644 --- a/lib/seam/routes/clients/access_codes.rb +++ b/lib/seam/routes/clients/access_codes.rb @@ -46,14 +46,8 @@ def get(access_code_id: nil, code: nil, device_id: nil) Seam::Resources::AccessCode.load_from_response(res.body["access_code"]) end - def get_timeline(access_code_id:, after: nil, before: nil, event_types: nil, limit: nil) - @client.post("/access_codes/get_timeline", {access_code_id: access_code_id, after: after, before: before, event_types: event_types, limit: limit}.compact) - - nil - end - - def list(access_code_ids: 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, customer_key: customer_key, device_id: device_id, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) + def list(access_code_ids: 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_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 diff --git a/lib/seam/routes/clients/access_grants_unmanaged.rb b/lib/seam/routes/clients/access_grants_unmanaged.rb index 3b9de74..fd2a98d 100644 --- a/lib/seam/routes/clients/access_grants_unmanaged.rb +++ b/lib/seam/routes/clients/access_grants_unmanaged.rb @@ -14,8 +14,8 @@ def get(access_grant_id:) nil end - def list(acs_entrance_id: nil, acs_system_id: nil, reservation_key: nil, user_identity_id: nil) - @client.post("/access_grants/unmanaged/list", {acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, reservation_key: reservation_key, user_identity_id: user_identity_id}.compact) + def list(acs_entrance_id: nil, acs_system_id: nil, limit: nil, page_cursor: nil, reservation_key: nil, user_identity_id: nil) + @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) nil end diff --git a/lib/seam/routes/clients/access_methods.rb b/lib/seam/routes/clients/access_methods.rb index 32437c5..56c3787 100644 --- a/lib/seam/routes/clients/access_methods.rb +++ b/lib/seam/routes/clients/access_methods.rb @@ -14,8 +14,8 @@ def unmanaged @unmanaged ||= Seam::Clients::AccessMethodsUnmanaged.new(client: @client, defaults: @defaults) end - def delete(access_method_id:) - @client.post("/access_methods/delete", {access_method_id: access_method_id}.compact) + 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 @@ -40,8 +40,8 @@ def get_related(access_method_ids:, exclude: nil, include: nil) Seam::Resources::Batch.load_from_response(res.body["batch"]) end - def list(access_grant_id:, acs_entrance_id: nil, device_id: nil, space_id: nil) - res = @client.post("/access_methods/list", {access_grant_id: access_grant_id, acs_entrance_id: acs_entrance_id, device_id: device_id, space_id: space_id}.compact) + def list(access_grant_id: nil, access_grant_key: nil, acs_entrance_id: nil, device_id: nil, space_id: nil) + res = @client.post("/access_methods/list", {access_grant_id: access_grant_id, access_grant_key: access_grant_key, acs_entrance_id: acs_entrance_id, device_id: device_id, space_id: space_id}.compact) Seam::Resources::AccessMethod.load_from_response(res.body["access_methods"]) end diff --git a/lib/seam/routes/clients/acs_entrances.rb b/lib/seam/routes/clients/acs_entrances.rb index ab900e7..011f549 100644 --- a/lib/seam/routes/clients/acs_entrances.rb +++ b/lib/seam/routes/clients/acs_entrances.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require "seam/helpers/action_attempt" + module Seam module Clients class AcsEntrances @@ -31,6 +33,14 @@ def list_credentials_with_access(acs_entrance_id:, include_if: nil) Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"]) end + + 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) + + wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt + + Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) + end end end end diff --git a/lib/seam/routes/clients/customers.rb b/lib/seam/routes/clients/customers.rb index 2768b22..57e1b2f 100644 --- a/lib/seam/routes/clients/customers.rb +++ b/lib/seam/routes/clients/customers.rb @@ -8,12 +8,8 @@ def initialize(client:, defaults:) @defaults = defaults end - def reservations - @reservations ||= Seam::Clients::CustomersReservations.new(client: @client, defaults: @defaults) - end - - 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, 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, customer_data: customer_data}.compact) + def create_portal(customer_resources_filters: nil, customization_profile_id: nil, exclude_locale_picker: nil, features: nil, is_embedded: nil, landing_page: nil, locale: nil, navigation_mode: nil, customer_data: nil) + res = @client.post("/customers/create_portal", {customer_resources_filters: customer_resources_filters, customization_profile_id: customization_profile_id, exclude_locale_picker: exclude_locale_picker, features: features, is_embedded: is_embedded, landing_page: landing_page, locale: locale, navigation_mode: navigation_mode, customer_data: customer_data}.compact) Seam::Resources::MagicLink.load_from_response(res.body["magic_link"]) end diff --git a/lib/seam/routes/clients/customers_reservations.rb b/lib/seam/routes/clients/customers_reservations.rb deleted file mode 100644 index 48df78d..0000000 --- a/lib/seam/routes/clients/customers_reservations.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -module Seam - module Clients - class CustomersReservations - def initialize(client:, defaults:) - @client = client - @defaults = defaults - end - - def create_deep_link(customer_key:, reservation_key:) - @client.post("/customers/reservations/create_deep_link", {customer_key: customer_key, reservation_key: reservation_key}.compact) - - nil - end - end - end -end diff --git a/lib/seam/routes/clients/index.rb b/lib/seam/routes/clients/index.rb index 71c6853..3dc5d84 100644 --- a/lib/seam/routes/clients/index.rb +++ b/lib/seam/routes/clients/index.rb @@ -21,7 +21,6 @@ require_relative "connected_accounts" require_relative "connected_accounts_simulate" require_relative "customers" -require_relative "customers_reservations" require_relative "devices" require_relative "devices_simulate" require_relative "devices_unmanaged" diff --git a/lib/seam/routes/clients/locks.rb b/lib/seam/routes/clients/locks.rb index 6125db6..b2ce2ac 100644 --- a/lib/seam/routes/clients/locks.rb +++ b/lib/seam/routes/clients/locks.rb @@ -14,6 +14,14 @@ def simulate @simulate ||= Seam::Clients::LocksSimulate.new(client: @client, defaults: @defaults) end + 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) + + wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt + + Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) + end + def get(device_id: nil, name: nil) res = @client.post("/locks/get", {device_id: device_id, name: name}.compact) diff --git a/lib/seam/routes/resources/access_method.rb b/lib/seam/routes/resources/access_method.rb index b3451a0..4ae1abc 100644 --- a/lib/seam/routes/resources/access_method.rb +++ b/lib/seam/routes/resources/access_method.rb @@ -3,7 +3,7 @@ module Seam module Resources class AccessMethod < BaseResource - attr_accessor :access_method_id, :client_session_token, :code, :customization_profile_id, :display_name, :instant_key_url, :is_encoding_required, :is_issued, :mode, :pending_mutations, :workspace_id + attr_accessor :access_method_id, :client_session_token, :code, :customization_profile_id, :display_name, :instant_key_url, :is_encoding_required, :is_issued, :is_ready_for_encoding, :mode, :pending_mutations, :workspace_id date_accessor :created_at, :issued_at diff --git a/lib/seam/routes/resources/acs_access_group.rb b/lib/seam/routes/resources/acs_access_group.rb index 01c2a4c..6a29f69 100644 --- a/lib/seam/routes/resources/acs_access_group.rb +++ b/lib/seam/routes/resources/acs_access_group.rb @@ -3,7 +3,7 @@ module Seam module Resources 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, :workspace_id + 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 date_accessor :created_at diff --git a/lib/seam/routes/resources/acs_entrance.rb b/lib/seam/routes/resources/acs_entrance.rb index 1268a4d..ca7a3ef 100644 --- a/lib/seam/routes/resources/acs_entrance.rb +++ b/lib/seam/routes/resources/acs_entrance.rb @@ -3,7 +3,7 @@ module Seam module Resources class AcsEntrance < BaseResource - attr_accessor :acs_entrance_id, :acs_system_id, :assa_abloy_vostio_metadata, :brivo_metadata, :can_belong_to_reservation, :can_unlock_with_card, :can_unlock_with_code, :can_unlock_with_mobile_key, :connected_account_id, :display_name, :dormakaba_ambiance_metadata, :dormakaba_community_metadata, :hotek_metadata, :latch_metadata, :salto_ks_metadata, :salto_space_metadata, :space_ids, :visionline_metadata + attr_accessor :acs_entrance_id, :acs_system_id, :assa_abloy_vostio_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, :latch_metadata, :salto_ks_metadata, :salto_space_metadata, :space_ids, :visionline_metadata date_accessor :created_at diff --git a/lib/seam/routes/resources/device.rb b/lib/seam/routes/resources/device.rb index 48cd5c1..bdfc576 100644 --- a/lib/seam/routes/resources/device.rb +++ b/lib/seam/routes/resources/device.rb @@ -3,7 +3,7 @@ module Seam module Resources class Device < BaseResource - attr_accessor :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 + 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 date_accessor :created_at diff --git a/lib/seam/routes/resources/device_provider.rb b/lib/seam/routes/resources/device_provider.rb index 13a7247..14be324 100644 --- a/lib/seam/routes/resources/device_provider.rb +++ b/lib/seam/routes/resources/device_provider.rb @@ -3,7 +3,7 @@ module Seam module Resources class DeviceProvider < BaseResource - attr_accessor :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 + 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 end end end diff --git a/lib/seam/routes/resources/event.rb b/lib/seam/routes/resources/event.rb index 72e9f63..fd831fb 100644 --- a/lib/seam/routes/resources/event.rb +++ b/lib/seam/routes/resources/event.rb @@ -3,7 +3,7 @@ module Seam module Resources class SeamEvent < BaseResource - attr_accessor :access_code_id, :connected_account_custom_metadata, :connected_account_id, :device_custom_metadata, :device_id, :event_id, :event_type, :workspace_id, :code, :access_code_errors, :access_code_warnings, :connected_account_errors, :connected_account_warnings, :device_errors, :device_warnings, :backup_access_code_id, :access_grant_id, :acs_entrance_id, :access_grant_key, :ends_at, :starts_at, :error_message, :access_grant_ids, :access_grant_keys, :access_method_id, :is_backup_code, :acs_system_id, :acs_system_errors, :acs_system_warnings, :acs_credential_id, :acs_user_id, :acs_encoder_id, :acs_access_group_id, :client_session_id, :connect_webview_id, :customer_key, :connected_account_type, :action_attempt_id, :action_type, :status, :error_code, :battery_level, :battery_status, :minut_metadata, :noise_level_decibels, :noise_level_nrs, :noise_threshold_id, :noise_threshold_name, :noiseaware_metadata, :access_code_is_managed, :method, :user_identity_id, :climate_preset_key, :is_fallback_climate_preset, :thermostat_schedule_id, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :lower_limit_celsius, :lower_limit_fahrenheit, :temperature_celsius, :temperature_fahrenheit, :upper_limit_celsius, :upper_limit_fahrenheit, :desired_temperature_celsius, :desired_temperature_fahrenheit, :device_name, :enrollment_automation_id, :acs_entrance_ids, :device_ids, :space_id, :space_key + attr_accessor :access_code_id, :connected_account_custom_metadata, :connected_account_id, :device_custom_metadata, :device_id, :event_id, :event_type, :workspace_id, :code, :access_code_errors, :access_code_warnings, :connected_account_errors, :connected_account_warnings, :device_errors, :device_warnings, :backup_access_code_id, :access_grant_id, :acs_entrance_id, :access_grant_key, :ends_at, :starts_at, :error_message, :access_grant_ids, :access_grant_keys, :access_method_id, :is_backup_code, :acs_system_id, :acs_system_errors, :acs_system_warnings, :acs_credential_id, :acs_user_id, :acs_encoder_id, :acs_access_group_id, :client_session_id, :connect_webview_id, :customer_key, :connected_account_type, :action_attempt_id, :action_type, :status, :error_code, :battery_level, :battery_status, :minut_metadata, :noise_level_decibels, :noise_level_nrs, :noise_threshold_id, :noise_threshold_name, :noiseaware_metadata, :access_code_is_managed, :method, :user_identity_id, :climate_preset_key, :is_fallback_climate_preset, :thermostat_schedule_id, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :lower_limit_celsius, :lower_limit_fahrenheit, :temperature_celsius, :temperature_fahrenheit, :upper_limit_celsius, :upper_limit_fahrenheit, :desired_temperature_celsius, :desired_temperature_fahrenheit, :device_name, :activation_reason, :image_url, :motion_sub_type, :video_url, :enrollment_automation_id, :acs_entrance_ids, :device_ids, :space_id, :space_key date_accessor :created_at, :occurred_at end diff --git a/lib/seam/routes/resources/unmanaged_acs_access_group.rb b/lib/seam/routes/resources/unmanaged_acs_access_group.rb index 49f5010..680c748 100644 --- a/lib/seam/routes/resources/unmanaged_acs_access_group.rb +++ b/lib/seam/routes/resources/unmanaged_acs_access_group.rb @@ -3,7 +3,7 @@ module Seam module Resources class UnmanagedAcsAccessGroup < 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, :workspace_id + 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 date_accessor :created_at diff --git a/lib/seam/routes/resources/unmanaged_device.rb b/lib/seam/routes/resources/unmanaged_device.rb index f99b6bb..083234f 100644 --- a/lib/seam/routes/resources/unmanaged_device.rb +++ b/lib/seam/routes/resources/unmanaged_device.rb @@ -3,7 +3,7 @@ module Seam module Resources class UnmanagedDevice < BaseResource - attr_accessor :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 + 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 date_accessor :created_at diff --git a/package-lock.json b/package-lock.json index 398070a..6715cb9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,7 +8,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.732.0", + "@seamapi/types": "1.777.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5" @@ -536,9 +536,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.732.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.732.0.tgz", - "integrity": "sha512-6YzI1EvDjpl5YYoRS4pFwkdHAV2nCXgT43g2QQrJBmLaU80d+WnLd5LVPXvNVhscA5VgBKQsn4BDLY127V4IKQ==", + "version": "1.777.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.777.0.tgz", + "integrity": "sha512-zXmpm98Utk2Qq7r/XwehMpILeQ3uz7MpVe5HGOQILVxbOysmrjOBa9DyCXqzgQVZL+FgJgwp0BsIrCNqAk1ZAQ==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index c3871e5..13b474e 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "devDependencies": { "@seamapi/fake-seam-connect": "1.86.0", "@seamapi/nextlove-sdk-generator": "^1.19.10", - "@seamapi/types": "1.732.0", + "@seamapi/types": "1.777.0", "del": "^7.1.0", "markdown-toc": "^1.2.0", "prettier": "^3.2.5"