seam 2.0.0b5 → 2.0.0.prerelease.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +53 -49
- data/README.md +3 -323
- data/Rakefile +1 -4
- data/lib/seam/client.rb +129 -0
- data/lib/seam/clients/access_codes.rb +95 -0
- data/lib/seam/clients/access_codes_simulate.rb +17 -0
- data/lib/seam/clients/access_codes_unmanaged.rb +57 -0
- data/lib/seam/clients/acs.rb +35 -0
- data/lib/seam/clients/acs_access_groups.rb +57 -0
- data/lib/seam/clients/acs_credential_pools.rb +17 -0
- data/lib/seam/clients/acs_credential_provisioning_automations.rb +17 -0
- data/lib/seam/clients/acs_credentials.rb +77 -0
- data/lib/seam/clients/acs_entrances.rb +47 -0
- data/lib/seam/clients/acs_systems.rb +27 -0
- data/lib/seam/clients/acs_users.rb +117 -0
- data/lib/seam/clients/action_attempts.rb +30 -0
- data/lib/seam/clients/base_client.rb +21 -0
- data/lib/seam/clients/client_sessions.rb +77 -0
- data/lib/seam/clients/connect_webviews.rb +47 -0
- data/lib/seam/clients/connected_accounts.rb +47 -0
- data/lib/seam/clients/devices.rb +65 -0
- data/lib/seam/clients/devices_simulate.rb +17 -0
- data/lib/seam/clients/devices_unmanaged.rb +37 -0
- data/lib/seam/clients/events.rb +27 -0
- data/lib/seam/clients/locks.rb +53 -0
- data/lib/seam/clients/networks.rb +27 -0
- data/lib/seam/clients/noise_sensors.rb +15 -0
- data/lib/seam/clients/noise_sensors_noise_thresholds.rb +57 -0
- data/lib/seam/clients/noise_sensors_simulate.rb +17 -0
- data/lib/seam/clients/phones.rb +31 -0
- data/lib/seam/clients/phones_simulate.rb +17 -0
- data/lib/seam/clients/thermostats.rb +106 -0
- data/lib/seam/clients/thermostats_climate_setting_schedules.rb +57 -0
- data/lib/seam/clients/user_identities.rb +131 -0
- data/lib/seam/clients/user_identities_enrollment_automations.rb +47 -0
- data/lib/seam/clients/webhooks.rb +57 -0
- data/lib/seam/clients/workspaces.rb +50 -0
- data/lib/seam/logger.rb +12 -0
- data/lib/seam/request.rb +51 -84
- data/lib/seam/resources/access_code.rb +12 -0
- data/lib/seam/resources/acs_access_group.rb +9 -0
- data/lib/seam/resources/acs_credential.rb +12 -0
- data/lib/seam/resources/acs_credential_pool.rb +9 -0
- data/lib/seam/resources/acs_credential_provisioning_automation.rb +9 -0
- data/lib/seam/resources/acs_entrance.rb +9 -0
- data/lib/seam/resources/acs_system.rb +9 -0
- data/lib/seam/resources/acs_user.rb +9 -0
- data/lib/seam/resources/action_attempt.rb +46 -0
- data/lib/seam/resources/base_resource.rb +58 -0
- data/lib/seam/resources/client_session.rb +9 -0
- data/lib/seam/resources/climate_setting_schedule.rb +11 -0
- data/lib/seam/resources/connect_webview.rb +9 -0
- data/lib/seam/resources/connected_account.rb +12 -0
- data/lib/seam/resources/device.rb +12 -0
- data/lib/seam/resources/device_provider.rb +7 -0
- data/lib/seam/resources/enrollment_automation.rb +9 -0
- data/lib/seam/resources/event.rb +9 -0
- data/lib/seam/resources/network.rb +9 -0
- data/lib/seam/resources/noise_threshold.rb +7 -0
- data/lib/seam/resources/phone.rb +12 -0
- data/lib/seam/resources/resource_error.rb +9 -0
- data/lib/seam/resources/resource_errors_support.rb +9 -0
- data/lib/seam/resources/resource_warning.rb +9 -0
- data/lib/seam/resources/resource_warnings_support.rb +9 -0
- data/lib/seam/resources/service_health.rb +7 -0
- data/lib/seam/resources/unmanaged_access_code.rb +12 -0
- data/lib/seam/resources/unmanaged_device.rb +12 -0
- data/lib/seam/resources/user_identity.rb +9 -0
- data/lib/seam/resources/webhook.rb +7 -0
- data/lib/seam/resources/workspace.rb +7 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seam.rb +68 -19
- metadata +71 -115
- data/lib/seam/auth.rb +0 -118
- data/lib/seam/base_resource.rb +0 -65
- data/lib/seam/deep_hash_accessor.rb +0 -37
- data/lib/seam/default_endpoint.rb +0 -5
- data/lib/seam/helpers/action_attempt.rb +0 -47
- data/lib/seam/http.rb +0 -52
- data/lib/seam/http_multi_workspace.rb +0 -66
- data/lib/seam/http_single_workspace.rb +0 -46
- data/lib/seam/options.rb +0 -64
- data/lib/seam/parse_options.rb +0 -23
- data/lib/seam/routes/clients/access_codes.rb +0 -74
- data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
- data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
- data/lib/seam/routes/clients/acs.rb +0 -44
- data/lib/seam/routes/clients/acs_access_groups.rb +0 -48
- data/lib/seam/routes/clients/acs_access_groups_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_credential_pools.rb +0 -18
- data/lib/seam/routes/clients/acs_credential_provisioning_automations.rb +0 -18
- data/lib/seam/routes/clients/acs_credentials.rb +0 -60
- data/lib/seam/routes/clients/acs_credentials_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_encoders.rb +0 -36
- data/lib/seam/routes/clients/acs_entrances.rb +0 -36
- data/lib/seam/routes/clients/acs_systems.rb +0 -30
- data/lib/seam/routes/clients/acs_users.rb +0 -78
- data/lib/seam/routes/clients/acs_users_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/action_attempts.rb +0 -28
- data/lib/seam/routes/clients/client_sessions.rb +0 -54
- data/lib/seam/routes/clients/connect_webviews.rb +0 -36
- data/lib/seam/routes/clients/connected_accounts.rb +0 -36
- data/lib/seam/routes/clients/devices.rb +0 -50
- data/lib/seam/routes/clients/devices_simulate.rb +0 -30
- data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/events.rb +0 -24
- data/lib/seam/routes/clients/index.rb +0 -38
- data/lib/seam/routes/clients/locks.rb +0 -42
- data/lib/seam/routes/clients/networks.rb +0 -24
- data/lib/seam/routes/clients/noise_sensors.rb +0 -26
- data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
- data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
- data/lib/seam/routes/clients/phones.rb +0 -28
- data/lib/seam/routes/clients/phones_simulate.rb +0 -18
- data/lib/seam/routes/clients/thermostats.rb +0 -108
- data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
- data/lib/seam/routes/clients/user_identities.rb +0 -88
- data/lib/seam/routes/clients/user_identities_enrollment_automations.rb +0 -36
- data/lib/seam/routes/clients/webhooks.rb +0 -42
- data/lib/seam/routes/clients/workspaces.rb +0 -40
- data/lib/seam/routes/resources/access_code.rb +0 -14
- data/lib/seam/routes/resources/acs_access_group.rb +0 -11
- data/lib/seam/routes/resources/acs_credential.rb +0 -14
- data/lib/seam/routes/resources/acs_credential_pool.rb +0 -11
- data/lib/seam/routes/resources/acs_credential_provisioning_automation.rb +0 -11
- data/lib/seam/routes/resources/acs_entrance.rb +0 -13
- data/lib/seam/routes/resources/acs_system.rb +0 -14
- data/lib/seam/routes/resources/acs_user.rb +0 -14
- data/lib/seam/routes/resources/action_attempt.rb +0 -9
- data/lib/seam/routes/resources/client_session.rb +0 -11
- data/lib/seam/routes/resources/connect_webview.rb +0 -11
- data/lib/seam/routes/resources/connected_account.rb +0 -14
- data/lib/seam/routes/resources/device.rb +0 -14
- data/lib/seam/routes/resources/device_provider.rb +0 -9
- data/lib/seam/routes/resources/enrollment_automation.rb +0 -11
- data/lib/seam/routes/resources/event.rb +0 -11
- data/lib/seam/routes/resources/index.rb +0 -33
- data/lib/seam/routes/resources/network.rb +0 -11
- data/lib/seam/routes/resources/noise_threshold.rb +0 -9
- data/lib/seam/routes/resources/phone.rb +0 -14
- data/lib/seam/routes/resources/resource_error.rb +0 -11
- data/lib/seam/routes/resources/resource_errors_support.rb +0 -11
- data/lib/seam/routes/resources/resource_warning.rb +0 -11
- data/lib/seam/routes/resources/resource_warnings_support.rb +0 -11
- data/lib/seam/routes/resources/service_health.rb +0 -9
- data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
- data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
- data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
- data/lib/seam/routes/resources/user_identity.rb +0 -11
- data/lib/seam/routes/resources/webhook.rb +0 -9
- data/lib/seam/routes/resources/workspace.rb +0 -9
- data/lib/seam/routes/routes.rb +0 -94
- data/lib/seam/token.rb +0 -53
- data/lib/seam/wait_for_action_attempt.rb +0 -32
- data/lib/seam/webhook.rb +0 -23
@@ -1,40 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "seam/helpers/action_attempt"
|
4
|
-
|
5
|
-
module Seam
|
6
|
-
module Clients
|
7
|
-
class Workspaces
|
8
|
-
def initialize(client:, defaults:)
|
9
|
-
@client = client
|
10
|
-
@defaults = defaults
|
11
|
-
end
|
12
|
-
|
13
|
-
def create(name:, company_name: nil, connect_partner_name: nil, is_sandbox: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil)
|
14
|
-
res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, is_sandbox: is_sandbox, webview_logo_shape: webview_logo_shape, webview_primary_button_color: webview_primary_button_color, webview_primary_button_text_color: webview_primary_button_text_color}.compact)
|
15
|
-
|
16
|
-
Seam::Resources::Workspace.load_from_response(res.body["workspace"])
|
17
|
-
end
|
18
|
-
|
19
|
-
def get
|
20
|
-
res = @client.post("/workspaces/get")
|
21
|
-
|
22
|
-
Seam::Resources::Workspace.load_from_response(res.body["workspace"])
|
23
|
-
end
|
24
|
-
|
25
|
-
def list
|
26
|
-
res = @client.post("/workspaces/list")
|
27
|
-
|
28
|
-
Seam::Resources::Workspace.load_from_response(res.body["workspaces"])
|
29
|
-
end
|
30
|
-
|
31
|
-
def reset_sandbox(wait_for_action_attempt: nil)
|
32
|
-
res = @client.post("/workspaces/reset_sandbox")
|
33
|
-
|
34
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
35
|
-
|
36
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AccessCode < BaseResource
|
6
|
-
attr_accessor :access_code_id, :code, :common_code_key, :device_id, :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, :pulled_backup_access_code_id, :status, :type
|
7
|
-
|
8
|
-
date_accessor :created_at, :ends_at, :starts_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsAccessGroup < BaseResource
|
6
|
-
attr_accessor :access_group_type, :access_group_type_display_name, :acs_access_group_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :is_managed, :name, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsCredential < BaseResource
|
6
|
-
attr_accessor :access_method, :acs_credential_id, :acs_credential_pool_id, :acs_system_id, :acs_user_id, :card_number, :code, :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, :parent_acs_credential_id, :starts_at, :visionline_metadata, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at, :issued_at, :latest_desired_state_synced_with_provider_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsCredentialPool < BaseResource
|
6
|
-
attr_accessor :acs_credential_pool_id, :acs_system_id, :display_name, :external_type, :external_type_display_name, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsCredentialProvisioningAutomation < BaseResource
|
6
|
-
attr_accessor :acs_credential_provisioning_automation_id, :credential_manager_acs_system_id, :user_identity_id, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsEntrance < BaseResource
|
6
|
-
attr_accessor :acs_entrance_id, :acs_system_id, :assa_abloy_vostio_metadata, :display_name, :dormakaba_community_metadata, :latch_metadata, :salto_ks_metadata, :visionline_metadata
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsSystem < BaseResource
|
6
|
-
attr_accessor :acs_system_id, :can_add_acs_users_to_acs_access_groups, :can_automate_enrollment, :can_create_acs_access_groups, :can_remove_acs_users_from_acs_access_groups, :connected_account_ids, :default_credential_manager_acs_system_id, :external_type, :external_type_display_name, :image_alt_text, :image_url, :is_credential_manager, :name, :system_type, :system_type_display_name, :visionline_metadata, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class AcsUser < BaseResource
|
6
|
-
attr_accessor :access_schedule, :acs_system_id, :acs_user_id, :display_name, :email, :email_address, :external_type, :external_type_display_name, :full_name, :hid_acs_system_id, :is_latest_desired_state_synced_with_provider, :is_managed, :is_suspended, :phone_number, :user_identity_email_address, :user_identity_full_name, :user_identity_id, :user_identity_phone_number, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at, :latest_desired_state_synced_with_provider_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class ClientSession < BaseResource
|
6
|
-
attr_accessor :client_session_id, :connect_webview_ids, :connected_account_ids, :device_count, :token, :user_identifier_key, :user_identity_ids, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class ConnectWebview < BaseResource
|
6
|
-
attr_accessor :accepted_devices, :accepted_providers, :any_device_allowed, :any_provider_allowed, :automatically_manage_new_devices, :connect_webview_id, :connected_account_id, :custom_metadata, :custom_redirect_failure_url, :custom_redirect_url, :device_selection_mode, :login_successful, :selected_provider, :status, :url, :wait_for_device_creation, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :authorized_at, :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class ConnectedAccount < BaseResource
|
6
|
-
attr_accessor :account_type, :account_type_display_name, :automatically_manage_new_devices, :connected_account_id, :custom_metadata, :user_identifier
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class Device < BaseResource
|
6
|
-
attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class DeviceProvider < BaseResource
|
6
|
-
attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :device_provider_name, :display_name, :image_url, :provider_categories
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class EnrollmentAutomation < BaseResource
|
6
|
-
attr_accessor :credential_manager_acs_system_id, :enrollment_automation_id, :user_identity_id, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class SeamEvent < BaseResource
|
6
|
-
attr_accessor :acs_credential_id, :acs_system_id, :acs_user_id, :action_attempt_id, :client_session_id, :climate_preset_key, :cooling_set_point_celsius, :cooling_set_point_fahrenheit, :device_id, :enrollment_automation_id, :event_description, :event_id, :event_type, :fan_mode_setting, :heating_set_point_celsius, :heating_set_point_fahrenheit, :hvac_mode_setting, :is_fallback_climate_preset, :method, :thermostat_schedule_id, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at, :occurred_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "seam/base_resource"
|
4
|
-
require_relative "resource_error"
|
5
|
-
require_relative "resource_warning"
|
6
|
-
require_relative "resource_errors_support"
|
7
|
-
require_relative "resource_warnings_support"
|
8
|
-
require_relative "access_code"
|
9
|
-
require_relative "acs_access_group"
|
10
|
-
require_relative "acs_credential"
|
11
|
-
require_relative "acs_credential_pool"
|
12
|
-
require_relative "acs_credential_provisioning_automation"
|
13
|
-
require_relative "acs_entrance"
|
14
|
-
require_relative "acs_system"
|
15
|
-
require_relative "acs_user"
|
16
|
-
require_relative "action_attempt"
|
17
|
-
require_relative "client_session"
|
18
|
-
require_relative "connect_webview"
|
19
|
-
require_relative "connected_account"
|
20
|
-
require_relative "device"
|
21
|
-
require_relative "device_provider"
|
22
|
-
require_relative "enrollment_automation"
|
23
|
-
require_relative "event"
|
24
|
-
require_relative "network"
|
25
|
-
require_relative "noise_threshold"
|
26
|
-
require_relative "phone"
|
27
|
-
require_relative "service_health"
|
28
|
-
require_relative "thermostat_schedule"
|
29
|
-
require_relative "unmanaged_access_code"
|
30
|
-
require_relative "unmanaged_device"
|
31
|
-
require_relative "user_identity"
|
32
|
-
require_relative "webhook"
|
33
|
-
require_relative "workspace"
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class Phone < BaseResource
|
6
|
-
attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :custom_metadata, :device_id, :device_type, :display_name, :is_managed, :location, :nickname, :properties, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class ThermostatSchedule < BaseResource
|
6
|
-
attr_accessor :climate_preset_key, :device_id, :max_override_period_minutes, :name, :thermostat_schedule_id
|
7
|
-
|
8
|
-
date_accessor :created_at, :ends_at, :starts_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class UnmanagedAccessCode < BaseResource
|
6
|
-
attr_accessor :access_code_id, :code, :device_id, :is_managed, :name, :status, :type
|
7
|
-
|
8
|
-
date_accessor :created_at, :ends_at, :starts_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class UnmanagedDevice < BaseResource
|
6
|
-
attr_accessor :can_hvac_cool, :can_hvac_heat, :can_hvac_heat_cool, :can_program_offline_access_codes, :can_program_online_access_codes, :can_remotely_lock, :can_remotely_unlock, :can_simulate_connection, :can_simulate_disconnection, :can_simulate_removal, :can_turn_off_hvac, :capabilities_supported, :connected_account_id, :device_id, :device_type, :is_managed, :location, :properties, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
|
10
|
-
include Seam::Resources::ResourceErrorsSupport
|
11
|
-
include Seam::Resources::ResourceWarningsSupport
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Resources
|
5
|
-
class UserIdentity < BaseResource
|
6
|
-
attr_accessor :display_name, :email_address, :full_name, :phone_number, :user_identity_id, :user_identity_key, :workspace_id
|
7
|
-
|
8
|
-
date_accessor :created_at
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
data/lib/seam/routes/routes.rb
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Routes
|
5
|
-
def access_codes
|
6
|
-
@access_codes ||= Seam::Clients::AccessCodes.new(client: @client, defaults: @defaults)
|
7
|
-
end
|
8
|
-
|
9
|
-
def acs
|
10
|
-
@acs ||= Seam::Clients::Acs.new(client: @client, defaults: @defaults)
|
11
|
-
end
|
12
|
-
|
13
|
-
def action_attempts
|
14
|
-
@action_attempts ||= Seam::Clients::ActionAttempts.new(client: @client, defaults: @defaults)
|
15
|
-
end
|
16
|
-
|
17
|
-
def client_sessions
|
18
|
-
@client_sessions ||= Seam::Clients::ClientSessions.new(client: @client, defaults: @defaults)
|
19
|
-
end
|
20
|
-
|
21
|
-
def connect_webviews
|
22
|
-
@connect_webviews ||= Seam::Clients::ConnectWebviews.new(client: @client, defaults: @defaults)
|
23
|
-
end
|
24
|
-
|
25
|
-
def connected_accounts
|
26
|
-
@connected_accounts ||= Seam::Clients::ConnectedAccounts.new(client: @client, defaults: @defaults)
|
27
|
-
end
|
28
|
-
|
29
|
-
def devices
|
30
|
-
@devices ||= Seam::Clients::Devices.new(client: @client, defaults: @defaults)
|
31
|
-
end
|
32
|
-
|
33
|
-
def events
|
34
|
-
@events ||= Seam::Clients::Events.new(client: @client, defaults: @defaults)
|
35
|
-
end
|
36
|
-
|
37
|
-
def locks
|
38
|
-
@locks ||= Seam::Clients::Locks.new(client: @client, defaults: @defaults)
|
39
|
-
end
|
40
|
-
|
41
|
-
def networks
|
42
|
-
@networks ||= Seam::Clients::Networks.new(client: @client, defaults: @defaults)
|
43
|
-
end
|
44
|
-
|
45
|
-
def noise_sensors
|
46
|
-
@noise_sensors ||= Seam::Clients::NoiseSensors.new(client: @client, defaults: @defaults)
|
47
|
-
end
|
48
|
-
|
49
|
-
def phones
|
50
|
-
@phones ||= Seam::Clients::Phones.new(client: @client, defaults: @defaults)
|
51
|
-
end
|
52
|
-
|
53
|
-
def thermostats
|
54
|
-
@thermostats ||= Seam::Clients::Thermostats.new(client: @client, defaults: @defaults)
|
55
|
-
end
|
56
|
-
|
57
|
-
def user_identities
|
58
|
-
@user_identities ||= Seam::Clients::UserIdentities.new(client: @client, defaults: @defaults)
|
59
|
-
end
|
60
|
-
|
61
|
-
def webhooks
|
62
|
-
@webhooks ||= Seam::Clients::Webhooks.new(client: @client, defaults: @defaults)
|
63
|
-
end
|
64
|
-
|
65
|
-
def workspaces
|
66
|
-
@workspaces ||= Seam::Clients::Workspaces.new(client: @client, defaults: @defaults)
|
67
|
-
end
|
68
|
-
|
69
|
-
def health
|
70
|
-
@client.get("/health")
|
71
|
-
end
|
72
|
-
|
73
|
-
# @deprecated Please use {#devices.unmanaged} instead.
|
74
|
-
def unmanaged_devices
|
75
|
-
warn "[DEPRECATION] 'unmanaged_devices' is deprecated. Please use 'devices.unmanaged' instead."
|
76
|
-
|
77
|
-
@unmanaged_devices ||= Seam::Clients::DevicesUnmanaged.new(client: @client, defaults: @defaults)
|
78
|
-
end
|
79
|
-
|
80
|
-
# @deprecated Please use {#access_codes.unmanaged} instead.
|
81
|
-
def unmanaged_access_codes
|
82
|
-
warn "[DEPRECATION] 'unmanaged_access_codes' is deprecated. Please use 'access_codes.unmanaged' instead."
|
83
|
-
|
84
|
-
@unmanaged_access_codes ||= Seam::Clients::AccessCodesUnmanaged.new(client: @client, defaults: @defaults)
|
85
|
-
end
|
86
|
-
|
87
|
-
private
|
88
|
-
|
89
|
-
def initialize_routes(client:, defaults:)
|
90
|
-
@client = client
|
91
|
-
@defaults = defaults
|
92
|
-
end
|
93
|
-
end
|
94
|
-
end
|
data/lib/seam/token.rb
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Http
|
5
|
-
module Auth
|
6
|
-
TOKEN_PREFIX = "seam_"
|
7
|
-
|
8
|
-
ACCESS_TOKEN_PREFIX = "seam_at"
|
9
|
-
|
10
|
-
JWT_PREFIX = "ey"
|
11
|
-
|
12
|
-
CLIENT_SESSION_TOKEN_PREFIX = "seam_cst"
|
13
|
-
|
14
|
-
PUBLISHABLE_KEY_TOKEN_PREFIX = "seam_pk"
|
15
|
-
|
16
|
-
def self.access_token?(token)
|
17
|
-
token.start_with?(ACCESS_TOKEN_PREFIX)
|
18
|
-
end
|
19
|
-
|
20
|
-
def self.jwt?(token)
|
21
|
-
token.start_with?(JWT_PREFIX)
|
22
|
-
end
|
23
|
-
|
24
|
-
def self.seam_token?(token)
|
25
|
-
token.start_with?(TOKEN_PREFIX)
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.api_key?(token)
|
29
|
-
!client_session_token?(token) &&
|
30
|
-
!jwt?(token) &&
|
31
|
-
!access_token?(token) &&
|
32
|
-
!publishable_key?(token) &&
|
33
|
-
seam_token?(token)
|
34
|
-
end
|
35
|
-
|
36
|
-
def self.client_session_token?(token)
|
37
|
-
token.start_with?(CLIENT_SESSION_TOKEN_PREFIX)
|
38
|
-
end
|
39
|
-
|
40
|
-
def self.publishable_key?(token)
|
41
|
-
token.start_with?(PUBLISHABLE_KEY_TOKEN_PREFIX)
|
42
|
-
end
|
43
|
-
|
44
|
-
def self.console_session_token?(token)
|
45
|
-
jwt?(token)
|
46
|
-
end
|
47
|
-
|
48
|
-
def self.personal_access_token?(token)
|
49
|
-
access_token?(token)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
class ActionAttemptError < StandardError
|
5
|
-
attr_reader :action_attempt
|
6
|
-
|
7
|
-
def initialize(message, action_attempt)
|
8
|
-
super(message)
|
9
|
-
@action_attempt = action_attempt
|
10
|
-
end
|
11
|
-
|
12
|
-
def name
|
13
|
-
self.class.name
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
class ActionAttemptFailedError < ActionAttemptError
|
18
|
-
attr_reader :code
|
19
|
-
|
20
|
-
def initialize(action_attempt)
|
21
|
-
super(action_attempt.error.message, action_attempt)
|
22
|
-
@code = action_attempt.error.type
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
class ActionAttemptTimeoutError < ActionAttemptError
|
27
|
-
def initialize(action_attempt, timeout)
|
28
|
-
message = "Timed out waiting for action attempt after #{timeout}s"
|
29
|
-
super(message, action_attempt)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|