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,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class DevicesSimulate
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def connect(device_id:)
|
12
|
-
@client.post("/devices/simulate/connect", {device_id: device_id}.compact)
|
13
|
-
|
14
|
-
nil
|
15
|
-
end
|
16
|
-
|
17
|
-
def disconnect(device_id:)
|
18
|
-
@client.post("/devices/simulate/disconnect", {device_id: device_id}.compact)
|
19
|
-
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
def remove(device_id:)
|
24
|
-
@client.post("/devices/simulate/remove", {device_id: device_id}.compact)
|
25
|
-
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class DevicesUnmanaged
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def get(device_id: nil, name: nil)
|
12
|
-
res = @client.post("/devices/unmanaged/get", {device_id: device_id, name: name}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::UnmanagedDevice.load_from_response(res.body["device"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil)
|
18
|
-
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, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact)
|
19
|
-
|
20
|
-
Seam::Resources::UnmanagedDevice.load_from_response(res.body["devices"])
|
21
|
-
end
|
22
|
-
|
23
|
-
def update(device_id:, is_managed:)
|
24
|
-
@client.post("/devices/unmanaged/update", {device_id: device_id, is_managed: is_managed}.compact)
|
25
|
-
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class Events
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def get(device_id: nil, event_id: nil, event_type: nil)
|
12
|
-
res = @client.post("/events/get", {device_id: device_id, event_id: event_id, event_type: event_type}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::SeamEvent.load_from_response(res.body["event"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def list(access_code_id: nil, access_code_ids: nil, acs_system_id: nil, acs_system_ids: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, device_id: nil, device_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, unstable_offset: nil)
|
18
|
-
res = @client.post("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, device_id: device_id, device_ids: device_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, unstable_offset: unstable_offset}.compact)
|
19
|
-
|
20
|
-
Seam::Resources::SeamEvent.load_from_response(res.body["events"])
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "access_codes"
|
4
|
-
require_relative "access_codes_simulate"
|
5
|
-
require_relative "access_codes_unmanaged"
|
6
|
-
require_relative "acs_access_groups"
|
7
|
-
require_relative "acs"
|
8
|
-
require_relative "acs_access_groups_unmanaged"
|
9
|
-
require_relative "acs_credential_pools"
|
10
|
-
require_relative "acs_credential_provisioning_automations"
|
11
|
-
require_relative "acs_credentials"
|
12
|
-
require_relative "acs_credentials_unmanaged"
|
13
|
-
require_relative "acs_encoders"
|
14
|
-
require_relative "acs_entrances"
|
15
|
-
require_relative "acs_systems"
|
16
|
-
require_relative "acs_users"
|
17
|
-
require_relative "acs_users_unmanaged"
|
18
|
-
require_relative "action_attempts"
|
19
|
-
require_relative "client_sessions"
|
20
|
-
require_relative "connect_webviews"
|
21
|
-
require_relative "connected_accounts"
|
22
|
-
require_relative "devices"
|
23
|
-
require_relative "devices_simulate"
|
24
|
-
require_relative "devices_unmanaged"
|
25
|
-
require_relative "events"
|
26
|
-
require_relative "locks"
|
27
|
-
require_relative "networks"
|
28
|
-
require_relative "noise_sensors"
|
29
|
-
require_relative "noise_sensors_noise_thresholds"
|
30
|
-
require_relative "noise_sensors_simulate"
|
31
|
-
require_relative "phones"
|
32
|
-
require_relative "phones_simulate"
|
33
|
-
require_relative "thermostats"
|
34
|
-
require_relative "thermostats_schedules"
|
35
|
-
require_relative "user_identities"
|
36
|
-
require_relative "user_identities_enrollment_automations"
|
37
|
-
require_relative "webhooks"
|
38
|
-
require_relative "workspaces"
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "seam/helpers/action_attempt"
|
4
|
-
|
5
|
-
module Seam
|
6
|
-
module Clients
|
7
|
-
class Locks
|
8
|
-
def initialize(client:, defaults:)
|
9
|
-
@client = client
|
10
|
-
@defaults = defaults
|
11
|
-
end
|
12
|
-
|
13
|
-
def get(device_id: nil, name: nil)
|
14
|
-
res = @client.post("/locks/get", {device_id: device_id, name: name}.compact)
|
15
|
-
|
16
|
-
Seam::Resources::Device.load_from_response(res.body["device"])
|
17
|
-
end
|
18
|
-
|
19
|
-
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil)
|
20
|
-
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, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact)
|
21
|
-
|
22
|
-
Seam::Resources::Device.load_from_response(res.body["devices"])
|
23
|
-
end
|
24
|
-
|
25
|
-
def lock_door(device_id:, sync: nil, wait_for_action_attempt: nil)
|
26
|
-
res = @client.post("/locks/lock_door", {device_id: device_id, sync: sync}.compact)
|
27
|
-
|
28
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
29
|
-
|
30
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
31
|
-
end
|
32
|
-
|
33
|
-
def unlock_door(device_id:, sync: nil, wait_for_action_attempt: nil)
|
34
|
-
res = @client.post("/locks/unlock_door", {device_id: device_id, sync: sync}.compact)
|
35
|
-
|
36
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
37
|
-
|
38
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class Networks
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def get(network_id:)
|
12
|
-
res = @client.post("/networks/get", {network_id: network_id}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::Network.load_from_response(res.body["network"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def list
|
18
|
-
res = @client.post("/networks/list")
|
19
|
-
|
20
|
-
Seam::Resources::Network.load_from_response(res.body["networks"])
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class NoiseSensors
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def noise_thresholds
|
12
|
-
@noise_thresholds ||= Seam::Clients::NoiseSensorsNoiseThresholds.new(client: @client, defaults: @defaults)
|
13
|
-
end
|
14
|
-
|
15
|
-
def simulate
|
16
|
-
@simulate ||= Seam::Clients::NoiseSensorsSimulate.new(client: @client, defaults: @defaults)
|
17
|
-
end
|
18
|
-
|
19
|
-
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil)
|
20
|
-
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, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact)
|
21
|
-
|
22
|
-
Seam::Resources::Device.load_from_response(res.body["devices"])
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class NoiseSensorsNoiseThresholds
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil, sync: nil)
|
12
|
-
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, sync: sync}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def delete(device_id:, noise_threshold_id:, sync: nil)
|
18
|
-
@client.post("/noise_sensors/noise_thresholds/delete", {device_id: device_id, noise_threshold_id: noise_threshold_id, sync: sync}.compact)
|
19
|
-
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
def get(noise_threshold_id:)
|
24
|
-
res = @client.post("/noise_sensors/noise_thresholds/get", {noise_threshold_id: noise_threshold_id}.compact)
|
25
|
-
|
26
|
-
Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_threshold"])
|
27
|
-
end
|
28
|
-
|
29
|
-
def list(device_id:, is_programmed: nil)
|
30
|
-
res = @client.post("/noise_sensors/noise_thresholds/list", {device_id: device_id, is_programmed: is_programmed}.compact)
|
31
|
-
|
32
|
-
Seam::Resources::NoiseThreshold.load_from_response(res.body["noise_thresholds"])
|
33
|
-
end
|
34
|
-
|
35
|
-
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, sync: nil)
|
36
|
-
@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, sync: sync}.compact)
|
37
|
-
|
38
|
-
nil
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class NoiseSensorsSimulate
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def trigger_noise_threshold(device_id:)
|
12
|
-
@client.post("/noise_sensors/simulate/trigger_noise_threshold", {device_id: device_id}.compact)
|
13
|
-
|
14
|
-
nil
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class Phones
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def simulate
|
12
|
-
@simulate ||= Seam::Clients::PhonesSimulate.new(client: @client, defaults: @defaults)
|
13
|
-
end
|
14
|
-
|
15
|
-
def deactivate(device_id:)
|
16
|
-
@client.post("/phones/deactivate", {device_id: device_id}.compact)
|
17
|
-
|
18
|
-
nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def list(acs_credential_id: nil, owner_user_identity_id: nil)
|
22
|
-
res = @client.post("/phones/list", {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact)
|
23
|
-
|
24
|
-
Seam::Resources::Phone.load_from_response(res.body["phones"])
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class PhonesSimulate
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk_installation_id: nil, phone_metadata: nil)
|
12
|
-
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)
|
13
|
-
|
14
|
-
Seam::Resources::Phone.load_from_response(res.body["phone"])
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
@@ -1,108 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "seam/helpers/action_attempt"
|
4
|
-
|
5
|
-
module Seam
|
6
|
-
module Clients
|
7
|
-
class Thermostats
|
8
|
-
def initialize(client:, defaults:)
|
9
|
-
@client = client
|
10
|
-
@defaults = defaults
|
11
|
-
end
|
12
|
-
|
13
|
-
def schedules
|
14
|
-
@schedules ||= Seam::Clients::ThermostatsSchedules.new(client: @client, defaults: @defaults)
|
15
|
-
end
|
16
|
-
|
17
|
-
def activate_climate_preset(climate_preset_key:, device_id:, wait_for_action_attempt: nil)
|
18
|
-
res = @client.post("/thermostats/activate_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
19
|
-
|
20
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
21
|
-
|
22
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
23
|
-
end
|
24
|
-
|
25
|
-
def cool(device_id:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, sync: nil, wait_for_action_attempt: nil)
|
26
|
-
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, sync: sync}.compact)
|
27
|
-
|
28
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
29
|
-
|
30
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
31
|
-
end
|
32
|
-
|
33
|
-
def create_climate_preset(climate_preset_key:, device_id:, manual_override_allowed:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, name: nil)
|
34
|
-
@client.post("/thermostats/create_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, manual_override_allowed: manual_override_allowed, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, 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, name: name}.compact)
|
35
|
-
|
36
|
-
nil
|
37
|
-
end
|
38
|
-
|
39
|
-
def delete_climate_preset(climate_preset_key:, device_id:)
|
40
|
-
@client.post("/thermostats/delete_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
41
|
-
|
42
|
-
nil
|
43
|
-
end
|
44
|
-
|
45
|
-
def get(device_id: nil, name: nil)
|
46
|
-
res = @client.post("/thermostats/get", {device_id: device_id, name: name}.compact)
|
47
|
-
|
48
|
-
Seam::Resources::Device.load_from_response(res.body["thermostat"])
|
49
|
-
end
|
50
|
-
|
51
|
-
def heat(device_id:, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, sync: nil, wait_for_action_attempt: nil)
|
52
|
-
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, sync: sync}.compact)
|
53
|
-
|
54
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
55
|
-
|
56
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
57
|
-
end
|
58
|
-
|
59
|
-
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, sync: nil, wait_for_action_attempt: nil)
|
60
|
-
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, sync: sync}.compact)
|
61
|
-
|
62
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
63
|
-
|
64
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
65
|
-
end
|
66
|
-
|
67
|
-
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, device_ids: nil, device_types: nil, exclude_if: nil, include_if: nil, limit: nil, manufacturer: nil, user_identifier_key: nil)
|
68
|
-
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, device_ids: device_ids, device_types: device_types, exclude_if: exclude_if, include_if: include_if, limit: limit, manufacturer: manufacturer, user_identifier_key: user_identifier_key}.compact)
|
69
|
-
|
70
|
-
Seam::Resources::Device.load_from_response(res.body["devices"])
|
71
|
-
end
|
72
|
-
|
73
|
-
def off(device_id:, sync: nil, wait_for_action_attempt: nil)
|
74
|
-
res = @client.post("/thermostats/off", {device_id: device_id, sync: sync}.compact)
|
75
|
-
|
76
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
77
|
-
|
78
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
79
|
-
end
|
80
|
-
|
81
|
-
def set_fallback_climate_preset(climate_preset_key:, device_id:)
|
82
|
-
@client.post("/thermostats/set_fallback_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id}.compact)
|
83
|
-
|
84
|
-
nil
|
85
|
-
end
|
86
|
-
|
87
|
-
def set_fan_mode(device_id:, fan_mode: nil, fan_mode_setting: nil, sync: nil, wait_for_action_attempt: nil)
|
88
|
-
res = @client.post("/thermostats/set_fan_mode", {device_id: device_id, fan_mode: fan_mode, fan_mode_setting: fan_mode_setting, sync: sync}.compact)
|
89
|
-
|
90
|
-
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
91
|
-
|
92
|
-
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
93
|
-
end
|
94
|
-
|
95
|
-
def set_temperature_threshold(device_id:, lower_limit_celsius: nil, lower_limit_fahrenheit: nil, upper_limit_celsius: nil, upper_limit_fahrenheit: nil)
|
96
|
-
@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)
|
97
|
-
|
98
|
-
nil
|
99
|
-
end
|
100
|
-
|
101
|
-
def update_climate_preset(climate_preset_key:, device_id:, manual_override_allowed:, cooling_set_point_celsius: nil, cooling_set_point_fahrenheit: nil, fan_mode_setting: nil, heating_set_point_celsius: nil, heating_set_point_fahrenheit: nil, hvac_mode_setting: nil, name: nil)
|
102
|
-
@client.post("/thermostats/update_climate_preset", {climate_preset_key: climate_preset_key, device_id: device_id, manual_override_allowed: manual_override_allowed, cooling_set_point_celsius: cooling_set_point_celsius, cooling_set_point_fahrenheit: cooling_set_point_fahrenheit, 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, name: name}.compact)
|
103
|
-
|
104
|
-
nil
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class ThermostatsSchedules
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def create(climate_preset_key:, device_id:, ends_at:, starts_at:, max_override_period_minutes: nil, name: nil)
|
12
|
-
res = @client.post("/thermostats/schedules/create", {climate_preset_key: climate_preset_key, device_id: device_id, ends_at: ends_at, starts_at: starts_at, max_override_period_minutes: max_override_period_minutes, name: name}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def delete(thermostat_schedule_id:)
|
18
|
-
@client.post("/thermostats/schedules/delete", {thermostat_schedule_id: thermostat_schedule_id}.compact)
|
19
|
-
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
def get(thermostat_schedule_id:)
|
24
|
-
res = @client.post("/thermostats/schedules/get", {thermostat_schedule_id: thermostat_schedule_id}.compact)
|
25
|
-
|
26
|
-
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedule"])
|
27
|
-
end
|
28
|
-
|
29
|
-
def list(device_id:, user_identifier_key: nil)
|
30
|
-
res = @client.post("/thermostats/schedules/list", {device_id: device_id, user_identifier_key: user_identifier_key}.compact)
|
31
|
-
|
32
|
-
Seam::Resources::ThermostatSchedule.load_from_response(res.body["thermostat_schedules"])
|
33
|
-
end
|
34
|
-
|
35
|
-
def update(thermostat_schedule_id:, climate_preset_key: nil, ends_at: nil, max_override_period_minutes: nil, name: nil, starts_at: nil)
|
36
|
-
@client.post("/thermostats/schedules/update", {thermostat_schedule_id: thermostat_schedule_id, climate_preset_key: climate_preset_key, ends_at: ends_at, max_override_period_minutes: max_override_period_minutes, name: name, starts_at: starts_at}.compact)
|
37
|
-
|
38
|
-
nil
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class UserIdentities
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def enrollment_automations
|
12
|
-
@enrollment_automations ||= Seam::Clients::UserIdentitiesEnrollmentAutomations.new(client: @client, defaults: @defaults)
|
13
|
-
end
|
14
|
-
|
15
|
-
def add_acs_user(acs_user_id:, user_identity_id:)
|
16
|
-
@client.post("/user_identities/add_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
17
|
-
|
18
|
-
nil
|
19
|
-
end
|
20
|
-
|
21
|
-
def create(email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
|
22
|
-
res = @client.post("/user_identities/create", {email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_key: user_identity_key}.compact)
|
23
|
-
|
24
|
-
Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])
|
25
|
-
end
|
26
|
-
|
27
|
-
def delete(user_identity_id:)
|
28
|
-
@client.post("/user_identities/delete", {user_identity_id: user_identity_id}.compact)
|
29
|
-
|
30
|
-
nil
|
31
|
-
end
|
32
|
-
|
33
|
-
def get(user_identity_id: nil, user_identity_key: nil)
|
34
|
-
res = @client.post("/user_identities/get", {user_identity_id: user_identity_id, user_identity_key: user_identity_key}.compact)
|
35
|
-
|
36
|
-
Seam::Resources::UserIdentity.load_from_response(res.body["user_identity"])
|
37
|
-
end
|
38
|
-
|
39
|
-
def grant_access_to_device(device_id:, user_identity_id:)
|
40
|
-
@client.post("/user_identities/grant_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact)
|
41
|
-
|
42
|
-
nil
|
43
|
-
end
|
44
|
-
|
45
|
-
def list(credential_manager_acs_system_id: nil)
|
46
|
-
res = @client.post("/user_identities/list", {credential_manager_acs_system_id: credential_manager_acs_system_id}.compact)
|
47
|
-
|
48
|
-
Seam::Resources::UserIdentity.load_from_response(res.body["user_identities"])
|
49
|
-
end
|
50
|
-
|
51
|
-
def list_accessible_devices(user_identity_id:)
|
52
|
-
res = @client.post("/user_identities/list_accessible_devices", {user_identity_id: user_identity_id}.compact)
|
53
|
-
|
54
|
-
Seam::Resources::Device.load_from_response(res.body["devices"])
|
55
|
-
end
|
56
|
-
|
57
|
-
def list_acs_systems(user_identity_id:)
|
58
|
-
res = @client.post("/user_identities/list_acs_systems", {user_identity_id: user_identity_id}.compact)
|
59
|
-
|
60
|
-
Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
|
61
|
-
end
|
62
|
-
|
63
|
-
def list_acs_users(user_identity_id:)
|
64
|
-
res = @client.post("/user_identities/list_acs_users", {user_identity_id: user_identity_id}.compact)
|
65
|
-
|
66
|
-
Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
|
67
|
-
end
|
68
|
-
|
69
|
-
def remove_acs_user(acs_user_id:, user_identity_id:)
|
70
|
-
@client.post("/user_identities/remove_acs_user", {acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
71
|
-
|
72
|
-
nil
|
73
|
-
end
|
74
|
-
|
75
|
-
def revoke_access_to_device(device_id:, user_identity_id:)
|
76
|
-
@client.post("/user_identities/revoke_access_to_device", {device_id: device_id, user_identity_id: user_identity_id}.compact)
|
77
|
-
|
78
|
-
nil
|
79
|
-
end
|
80
|
-
|
81
|
-
def update(user_identity_id:, email_address: nil, full_name: nil, phone_number: nil, user_identity_key: nil)
|
82
|
-
@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)
|
83
|
-
|
84
|
-
nil
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class UserIdentitiesEnrollmentAutomations
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def delete(enrollment_automation_id:)
|
12
|
-
@client.post("/user_identities/enrollment_automations/delete", {enrollment_automation_id: enrollment_automation_id}.compact)
|
13
|
-
|
14
|
-
nil
|
15
|
-
end
|
16
|
-
|
17
|
-
def get(enrollment_automation_id:)
|
18
|
-
res = @client.post("/user_identities/enrollment_automations/get", {enrollment_automation_id: enrollment_automation_id}.compact)
|
19
|
-
|
20
|
-
Seam::Resources::EnrollmentAutomation.load_from_response(res.body["enrollment_automation"])
|
21
|
-
end
|
22
|
-
|
23
|
-
def launch(credential_manager_acs_system_id:, user_identity_id:, acs_credential_pool_id: nil, create_credential_manager_user: nil, credential_manager_acs_user_id: nil)
|
24
|
-
@client.post("/user_identities/enrollment_automations/launch", {credential_manager_acs_system_id: credential_manager_acs_system_id, user_identity_id: user_identity_id, acs_credential_pool_id: acs_credential_pool_id, create_credential_manager_user: create_credential_manager_user, credential_manager_acs_user_id: credential_manager_acs_user_id}.compact)
|
25
|
-
|
26
|
-
nil
|
27
|
-
end
|
28
|
-
|
29
|
-
def list(user_identity_id:)
|
30
|
-
res = @client.post("/user_identities/enrollment_automations/list", {user_identity_id: user_identity_id}.compact)
|
31
|
-
|
32
|
-
Seam::Resources::EnrollmentAutomation.load_from_response(res.body["enrollment_automations"])
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Seam
|
4
|
-
module Clients
|
5
|
-
class Webhooks
|
6
|
-
def initialize(client:, defaults:)
|
7
|
-
@client = client
|
8
|
-
@defaults = defaults
|
9
|
-
end
|
10
|
-
|
11
|
-
def create(url:, event_types: nil)
|
12
|
-
res = @client.post("/webhooks/create", {url: url, event_types: event_types}.compact)
|
13
|
-
|
14
|
-
Seam::Resources::Webhook.load_from_response(res.body["webhook"])
|
15
|
-
end
|
16
|
-
|
17
|
-
def delete(webhook_id:)
|
18
|
-
@client.post("/webhooks/delete", {webhook_id: webhook_id}.compact)
|
19
|
-
|
20
|
-
nil
|
21
|
-
end
|
22
|
-
|
23
|
-
def get(webhook_id:)
|
24
|
-
res = @client.post("/webhooks/get", {webhook_id: webhook_id}.compact)
|
25
|
-
|
26
|
-
Seam::Resources::Webhook.load_from_response(res.body["webhook"])
|
27
|
-
end
|
28
|
-
|
29
|
-
def list
|
30
|
-
res = @client.post("/webhooks/list")
|
31
|
-
|
32
|
-
Seam::Resources::Webhook.load_from_response(res.body["webhooks"])
|
33
|
-
end
|
34
|
-
|
35
|
-
def update(event_types:, webhook_id:)
|
36
|
-
@client.post("/webhooks/update", {event_types: event_types, webhook_id: webhook_id}.compact)
|
37
|
-
|
38
|
-
nil
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|