seam 2.0.0a2 → 2.0.0b0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +54 -51
- data/README.md +323 -3
- data/Rakefile +4 -1
- data/lib/seam/auth.rb +118 -0
- data/lib/seam/base_resource.rb +63 -0
- data/lib/seam/deep_hash_accessor.rb +37 -0
- data/lib/seam/default_endpoint.rb +5 -0
- data/lib/seam/helpers/action_attempt.rb +45 -0
- data/lib/seam/http.rb +52 -0
- data/lib/seam/http_multi_workspace.rb +62 -0
- data/lib/seam/http_single_workspace.rb +42 -0
- data/lib/seam/options.rb +64 -0
- data/lib/seam/parse_options.rb +23 -0
- data/lib/seam/request.rb +82 -51
- data/lib/seam/routes/clients/access_codes.rb +74 -0
- data/lib/seam/routes/clients/access_codes_simulate.rb +18 -0
- data/lib/seam/routes/clients/access_codes_unmanaged.rb +42 -0
- data/lib/seam/routes/clients/acs.rb +44 -0
- data/lib/seam/routes/clients/acs_access_groups.rb +48 -0
- data/lib/seam/routes/clients/acs_access_groups_unmanaged.rb +24 -0
- data/lib/seam/routes/clients/acs_credential_pools.rb +18 -0
- data/lib/seam/routes/clients/acs_credential_provisioning_automations.rb +18 -0
- data/lib/seam/routes/clients/acs_credentials.rb +60 -0
- data/lib/seam/routes/clients/acs_credentials_unmanaged.rb +24 -0
- data/lib/seam/routes/clients/acs_encoders.rb +36 -0
- data/lib/seam/routes/clients/acs_entrances.rb +36 -0
- data/lib/seam/routes/clients/acs_systems.rb +30 -0
- data/lib/seam/routes/clients/acs_users.rb +78 -0
- data/lib/seam/routes/clients/acs_users_unmanaged.rb +24 -0
- data/lib/seam/routes/clients/action_attempts.rb +28 -0
- data/lib/seam/routes/clients/client_sessions.rb +54 -0
- data/lib/seam/routes/clients/connect_webviews.rb +36 -0
- data/lib/seam/routes/clients/connected_accounts.rb +36 -0
- data/lib/seam/routes/clients/devices.rb +50 -0
- data/lib/seam/routes/clients/devices_simulate.rb +30 -0
- data/lib/seam/routes/clients/devices_unmanaged.rb +30 -0
- data/lib/seam/routes/clients/events.rb +24 -0
- data/lib/seam/routes/clients/index.rb +38 -0
- data/lib/seam/routes/clients/locks.rb +42 -0
- data/lib/seam/routes/clients/networks.rb +24 -0
- data/lib/seam/routes/clients/noise_sensors.rb +26 -0
- data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +42 -0
- data/lib/seam/routes/clients/noise_sensors_simulate.rb +18 -0
- data/lib/seam/routes/clients/phones.rb +28 -0
- data/lib/seam/routes/clients/phones_simulate.rb +18 -0
- data/lib/seam/routes/clients/thermostats.rb +108 -0
- data/lib/seam/routes/clients/thermostats_schedules.rb +42 -0
- data/lib/seam/routes/clients/user_identities.rb +88 -0
- data/lib/seam/routes/clients/user_identities_enrollment_automations.rb +36 -0
- data/lib/seam/routes/clients/webhooks.rb +42 -0
- data/lib/seam/routes/clients/workspaces.rb +40 -0
- data/lib/seam/routes/resources/access_code.rb +14 -0
- data/lib/seam/routes/resources/acs_access_group.rb +11 -0
- data/lib/seam/routes/resources/acs_credential.rb +14 -0
- data/lib/seam/routes/resources/acs_credential_pool.rb +11 -0
- data/lib/seam/routes/resources/acs_credential_provisioning_automation.rb +11 -0
- data/lib/seam/routes/resources/acs_entrance.rb +13 -0
- data/lib/seam/routes/resources/acs_system.rb +14 -0
- data/lib/seam/routes/resources/acs_user.rb +14 -0
- data/lib/seam/routes/resources/action_attempt.rb +9 -0
- data/lib/seam/routes/resources/client_session.rb +11 -0
- data/lib/seam/routes/resources/connect_webview.rb +11 -0
- data/lib/seam/routes/resources/connected_account.rb +14 -0
- data/lib/seam/routes/resources/device.rb +14 -0
- data/lib/seam/routes/resources/device_provider.rb +9 -0
- data/lib/seam/routes/resources/enrollment_automation.rb +11 -0
- data/lib/seam/routes/resources/event.rb +11 -0
- data/lib/seam/routes/resources/index.rb +33 -0
- data/lib/seam/routes/resources/network.rb +11 -0
- data/lib/seam/routes/resources/noise_threshold.rb +9 -0
- data/lib/seam/routes/resources/phone.rb +14 -0
- data/lib/seam/routes/resources/resource_error.rb +11 -0
- data/lib/seam/routes/resources/resource_errors_support.rb +11 -0
- data/lib/seam/routes/resources/resource_warning.rb +11 -0
- data/lib/seam/routes/resources/resource_warnings_support.rb +11 -0
- data/lib/seam/routes/resources/service_health.rb +9 -0
- data/lib/seam/routes/resources/thermostat_schedule.rb +13 -0
- data/lib/seam/routes/resources/unmanaged_access_code.rb +14 -0
- data/lib/seam/routes/resources/unmanaged_device.rb +14 -0
- data/lib/seam/routes/resources/user_identity.rb +11 -0
- data/lib/seam/routes/resources/webhook.rb +9 -0
- data/lib/seam/routes/resources/workspace.rb +9 -0
- data/lib/seam/routes/routes.rb +94 -0
- data/lib/seam/token.rb +53 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seam/wait_for_action_attempt.rb +32 -0
- data/lib/seam/webhook.rb +22 -0
- data/lib/seam.rb +19 -68
- metadata +115 -70
- data/lib/seam/client.rb +0 -129
- data/lib/seam/clients/access_codes.rb +0 -95
- data/lib/seam/clients/access_codes_simulate.rb +0 -17
- data/lib/seam/clients/access_codes_unmanaged.rb +0 -57
- data/lib/seam/clients/acs.rb +0 -35
- data/lib/seam/clients/acs_access_groups.rb +0 -57
- data/lib/seam/clients/acs_credential_pools.rb +0 -17
- data/lib/seam/clients/acs_credential_provisioning_automations.rb +0 -17
- data/lib/seam/clients/acs_credentials.rb +0 -77
- data/lib/seam/clients/acs_entrances.rb +0 -47
- data/lib/seam/clients/acs_systems.rb +0 -27
- data/lib/seam/clients/acs_users.rb +0 -117
- data/lib/seam/clients/action_attempts.rb +0 -30
- data/lib/seam/clients/base_client.rb +0 -21
- data/lib/seam/clients/client_sessions.rb +0 -77
- data/lib/seam/clients/connect_webviews.rb +0 -47
- data/lib/seam/clients/connected_accounts.rb +0 -47
- data/lib/seam/clients/devices.rb +0 -65
- data/lib/seam/clients/devices_simulate.rb +0 -17
- data/lib/seam/clients/devices_unmanaged.rb +0 -37
- data/lib/seam/clients/events.rb +0 -27
- data/lib/seam/clients/locks.rb +0 -53
- data/lib/seam/clients/networks.rb +0 -27
- data/lib/seam/clients/noise_sensors.rb +0 -15
- data/lib/seam/clients/noise_sensors_noise_thresholds.rb +0 -57
- data/lib/seam/clients/noise_sensors_simulate.rb +0 -17
- data/lib/seam/clients/phones.rb +0 -31
- data/lib/seam/clients/phones_simulate.rb +0 -17
- data/lib/seam/clients/thermostats.rb +0 -106
- data/lib/seam/clients/thermostats_climate_setting_schedules.rb +0 -57
- data/lib/seam/clients/user_identities.rb +0 -131
- data/lib/seam/clients/user_identities_enrollment_automations.rb +0 -47
- data/lib/seam/clients/webhooks.rb +0 -57
- data/lib/seam/clients/workspaces.rb +0 -50
- data/lib/seam/resources/access_code.rb +0 -12
- data/lib/seam/resources/acs_access_group.rb +0 -9
- data/lib/seam/resources/acs_credential.rb +0 -12
- data/lib/seam/resources/acs_credential_pool.rb +0 -9
- data/lib/seam/resources/acs_credential_provisioning_automation.rb +0 -9
- data/lib/seam/resources/acs_entrance.rb +0 -9
- data/lib/seam/resources/acs_system.rb +0 -9
- data/lib/seam/resources/acs_user.rb +0 -9
- data/lib/seam/resources/action_attempt.rb +0 -46
- data/lib/seam/resources/base_resource.rb +0 -58
- data/lib/seam/resources/client_session.rb +0 -9
- data/lib/seam/resources/climate_setting_schedule.rb +0 -11
- data/lib/seam/resources/connect_webview.rb +0 -9
- data/lib/seam/resources/connected_account.rb +0 -12
- data/lib/seam/resources/device.rb +0 -12
- data/lib/seam/resources/device_provider.rb +0 -7
- data/lib/seam/resources/enrollment_automation.rb +0 -9
- data/lib/seam/resources/event.rb +0 -9
- data/lib/seam/resources/network.rb +0 -9
- data/lib/seam/resources/noise_threshold.rb +0 -7
- data/lib/seam/resources/phone.rb +0 -12
- data/lib/seam/resources/resource_error.rb +0 -9
- data/lib/seam/resources/resource_errors_support.rb +0 -9
- data/lib/seam/resources/resource_warning.rb +0 -9
- data/lib/seam/resources/resource_warnings_support.rb +0 -9
- data/lib/seam/resources/service_health.rb +0 -7
- data/lib/seam/resources/unmanaged_access_code.rb +0 -12
- data/lib/seam/resources/unmanaged_device.rb +0 -12
- data/lib/seam/resources/user_identity.rb +0 -9
- data/lib/seam/resources/webhook.rb +0 -7
- data/lib/seam/resources/workspace.rb +0 -7
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AccessCodesUnmanaged
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def convert_to_managed(access_code_id:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil, sync: nil)
|
12
|
+
@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, sync: sync}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def delete(access_code_id:, sync: nil)
|
18
|
+
@client.post("/access_codes/unmanaged/delete", {access_code_id: access_code_id, sync: sync}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def get(access_code_id: nil, code: nil, device_id: nil)
|
24
|
+
res = @client.post("/access_codes/unmanaged/get", {access_code_id: access_code_id, code: code, device_id: device_id}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_code"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def list(device_id:, user_identifier_key: nil)
|
30
|
+
res = @client.post("/access_codes/unmanaged/list", {device_id: device_id, user_identifier_key: user_identifier_key}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::UnmanagedAccessCode.load_from_response(res.body["access_codes"])
|
33
|
+
end
|
34
|
+
|
35
|
+
def update(access_code_id:, is_managed:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil)
|
36
|
+
@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)
|
37
|
+
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class Acs
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def access_groups
|
12
|
+
@access_groups ||= Seam::Clients::AcsAccessGroups.new(client: @client, defaults: @defaults)
|
13
|
+
end
|
14
|
+
|
15
|
+
def credential_pools
|
16
|
+
@credential_pools ||= Seam::Clients::AcsCredentialPools.new(client: @client, defaults: @defaults)
|
17
|
+
end
|
18
|
+
|
19
|
+
def credential_provisioning_automations
|
20
|
+
@credential_provisioning_automations ||= Seam::Clients::AcsCredentialProvisioningAutomations.new(client: @client, defaults: @defaults)
|
21
|
+
end
|
22
|
+
|
23
|
+
def credentials
|
24
|
+
@credentials ||= Seam::Clients::AcsCredentials.new(client: @client, defaults: @defaults)
|
25
|
+
end
|
26
|
+
|
27
|
+
def encoders
|
28
|
+
@encoders ||= Seam::Clients::AcsEncoders.new(client: @client, defaults: @defaults)
|
29
|
+
end
|
30
|
+
|
31
|
+
def entrances
|
32
|
+
@entrances ||= Seam::Clients::AcsEntrances.new(client: @client, defaults: @defaults)
|
33
|
+
end
|
34
|
+
|
35
|
+
def systems
|
36
|
+
@systems ||= Seam::Clients::AcsSystems.new(client: @client, defaults: @defaults)
|
37
|
+
end
|
38
|
+
|
39
|
+
def users
|
40
|
+
@users ||= Seam::Clients::AcsUsers.new(client: @client, defaults: @defaults)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsAccessGroups
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_user(acs_access_group_id:, acs_user_id:)
|
12
|
+
@client.post("/acs/access_groups/add_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(acs_access_group_id:)
|
18
|
+
res = @client.post("/acs/access_groups/get", {acs_access_group_id: acs_access_group_id}.compact)
|
19
|
+
|
20
|
+
Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_group"])
|
21
|
+
end
|
22
|
+
|
23
|
+
def list(acs_system_id: nil, acs_user_id: nil)
|
24
|
+
res = @client.post("/acs/access_groups/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::AcsAccessGroup.load_from_response(res.body["acs_access_groups"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def list_accessible_entrances(acs_access_group_id:)
|
30
|
+
res = @client.post("/acs/access_groups/list_accessible_entrances", {acs_access_group_id: acs_access_group_id}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
|
33
|
+
end
|
34
|
+
|
35
|
+
def list_users(acs_access_group_id:)
|
36
|
+
res = @client.post("/acs/access_groups/list_users", {acs_access_group_id: acs_access_group_id}.compact)
|
37
|
+
|
38
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
|
39
|
+
end
|
40
|
+
|
41
|
+
def remove_user(acs_access_group_id:, acs_user_id:)
|
42
|
+
@client.post("/acs/access_groups/remove_user", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
|
43
|
+
|
44
|
+
nil
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsAccessGroupsUnmanaged
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(acs_access_group_id:)
|
12
|
+
@client.post("/acs/access_groups/unmanaged/get", {acs_access_group_id: acs_access_group_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def list(acs_system_id: nil, acs_user_id: nil)
|
18
|
+
@client.post("/acs/access_groups/unmanaged/list", {acs_system_id: acs_system_id, acs_user_id: acs_user_id}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentialPools
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def list(acs_system_id:)
|
12
|
+
res = @client.post("/acs/credential_pools/list", {acs_system_id: acs_system_id}.compact)
|
13
|
+
|
14
|
+
Seam::Resources::AcsCredentialPool.load_from_response(res.body["acs_credential_pools"])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentialProvisioningAutomations
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
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)
|
12
|
+
res = @client.post("/acs/credential_provisioning_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)
|
13
|
+
|
14
|
+
Seam::Resources::AcsCredentialProvisioningAutomation.load_from_response(res.body["acs_credential_provisioning_automation"])
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentials
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def assign(acs_credential_id:, acs_user_id:)
|
12
|
+
@client.post("/acs/credentials/assign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def create(access_method:, acs_user_id:, allowed_acs_entrance_ids: nil, code: nil, credential_manager_acs_system_id: nil, ends_at: nil, is_multi_phone_sync_credential: nil, starts_at: nil, visionline_metadata: nil)
|
18
|
+
res = @client.post("/acs/credentials/create", {access_method: access_method, acs_user_id: acs_user_id, allowed_acs_entrance_ids: allowed_acs_entrance_ids, 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, starts_at: starts_at, visionline_metadata: visionline_metadata}.compact)
|
19
|
+
|
20
|
+
Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"])
|
21
|
+
end
|
22
|
+
|
23
|
+
def delete(acs_credential_id:)
|
24
|
+
@client.post("/acs/credentials/delete", {acs_credential_id: acs_credential_id}.compact)
|
25
|
+
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def get(acs_credential_id:)
|
30
|
+
res = @client.post("/acs/credentials/get", {acs_credential_id: acs_credential_id}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::AcsCredential.load_from_response(res.body["acs_credential"])
|
33
|
+
end
|
34
|
+
|
35
|
+
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)
|
36
|
+
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}.compact)
|
37
|
+
|
38
|
+
Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"])
|
39
|
+
end
|
40
|
+
|
41
|
+
def list_accessible_entrances(acs_credential_id:)
|
42
|
+
res = @client.post("/acs/credentials/list_accessible_entrances", {acs_credential_id: acs_credential_id}.compact)
|
43
|
+
|
44
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
|
45
|
+
end
|
46
|
+
|
47
|
+
def unassign(acs_credential_id:, acs_user_id:)
|
48
|
+
@client.post("/acs/credentials/unassign", {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact)
|
49
|
+
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def update(acs_credential_id:, code: nil, ends_at: nil)
|
54
|
+
@client.post("/acs/credentials/update", {acs_credential_id: acs_credential_id, code: code, ends_at: ends_at}.compact)
|
55
|
+
|
56
|
+
nil
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentialsUnmanaged
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(acs_credential_id:)
|
12
|
+
@client.post("/acs/credentials/unmanaged/get", {acs_credential_id: acs_credential_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil)
|
18
|
+
@client.post("/acs/credentials/unmanaged/list", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "seam/helpers/action_attempt"
|
4
|
+
|
5
|
+
module Seam
|
6
|
+
module Clients
|
7
|
+
class AcsEncoders
|
8
|
+
def initialize(client:, defaults:)
|
9
|
+
@client = client
|
10
|
+
@defaults = defaults
|
11
|
+
end
|
12
|
+
|
13
|
+
def encode_card(acs_credential_id:, device_id:, wait_for_action_attempt: nil)
|
14
|
+
res = @client.post("/acs/encoders/encode_card", {acs_credential_id: acs_credential_id, device_id: device_id}.compact)
|
15
|
+
|
16
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
17
|
+
|
18
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
19
|
+
end
|
20
|
+
|
21
|
+
def list(acs_system_ids: nil, device_ids: nil, limit: nil)
|
22
|
+
res = @client.post("/acs/encoders/list", {acs_system_ids: acs_system_ids, device_ids: device_ids, limit: limit}.compact)
|
23
|
+
|
24
|
+
Seam::Resources::Device.load_from_response(res.body["devices"])
|
25
|
+
end
|
26
|
+
|
27
|
+
def scan_card(acs_system_id:, device_id:, wait_for_action_attempt: nil)
|
28
|
+
res = @client.post("/acs/encoders/scan_card", {acs_system_id: acs_system_id, device_id: device_id}.compact)
|
29
|
+
|
30
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
31
|
+
|
32
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsEntrances
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(acs_entrance_id:)
|
12
|
+
res = @client.post("/acs/entrances/get", {acs_entrance_id: acs_entrance_id}.compact)
|
13
|
+
|
14
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrance"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def grant_access(acs_entrance_id:, acs_user_id:)
|
18
|
+
@client.post("/acs/entrances/grant_access", {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def list(acs_credential_id: nil, acs_system_id: nil)
|
24
|
+
res = @client.post("/acs/entrances/list", {acs_credential_id: acs_credential_id, acs_system_id: acs_system_id}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def list_credentials_with_access(acs_entrance_id:, include_if: nil)
|
30
|
+
res = @client.post("/acs/entrances/list_credentials_with_access", {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::AcsCredential.load_from_response(res.body["acs_credentials"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsSystems
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(acs_system_id:)
|
12
|
+
res = @client.post("/acs/systems/get", {acs_system_id: acs_system_id}.compact)
|
13
|
+
|
14
|
+
Seam::Resources::AcsSystem.load_from_response(res.body["acs_system"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def list(connected_account_id: nil)
|
18
|
+
res = @client.post("/acs/systems/list", {connected_account_id: connected_account_id}.compact)
|
19
|
+
|
20
|
+
Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
|
21
|
+
end
|
22
|
+
|
23
|
+
def list_compatible_credential_manager_acs_systems(acs_system_id:)
|
24
|
+
res = @client.post("/acs/systems/list_compatible_credential_manager_acs_systems", {acs_system_id: acs_system_id}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::AcsSystem.load_from_response(res.body["acs_systems"])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsUsers
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_to_access_group(acs_access_group_id:, acs_user_id:)
|
12
|
+
@client.post("/acs/users/add_to_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def create(acs_system_id:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, full_name: nil, phone_number: nil, user_identity_id: nil)
|
18
|
+
res = @client.post("/acs/users/create", {acs_system_id: acs_system_id, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, full_name: full_name, phone_number: phone_number, user_identity_id: user_identity_id}.compact)
|
19
|
+
|
20
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
|
21
|
+
end
|
22
|
+
|
23
|
+
def delete(acs_user_id:)
|
24
|
+
@client.post("/acs/users/delete", {acs_user_id: acs_user_id}.compact)
|
25
|
+
|
26
|
+
nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def get(acs_user_id:)
|
30
|
+
res = @client.post("/acs/users/get", {acs_user_id: acs_user_id}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
|
33
|
+
end
|
34
|
+
|
35
|
+
def list(acs_system_id: nil, created_before: nil, limit: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil)
|
36
|
+
res = @client.post("/acs/users/list", {acs_system_id: acs_system_id, created_before: created_before, limit: limit, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact)
|
37
|
+
|
38
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
|
39
|
+
end
|
40
|
+
|
41
|
+
def list_accessible_entrances(acs_user_id:)
|
42
|
+
res = @client.post("/acs/users/list_accessible_entrances", {acs_user_id: acs_user_id}.compact)
|
43
|
+
|
44
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
|
45
|
+
end
|
46
|
+
|
47
|
+
def remove_from_access_group(acs_access_group_id:, acs_user_id:)
|
48
|
+
@client.post("/acs/users/remove_from_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
|
49
|
+
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
|
53
|
+
def revoke_access_to_all_entrances(acs_user_id:)
|
54
|
+
@client.post("/acs/users/revoke_access_to_all_entrances", {acs_user_id: acs_user_id}.compact)
|
55
|
+
|
56
|
+
nil
|
57
|
+
end
|
58
|
+
|
59
|
+
def suspend(acs_user_id:)
|
60
|
+
@client.post("/acs/users/suspend", {acs_user_id: acs_user_id}.compact)
|
61
|
+
|
62
|
+
nil
|
63
|
+
end
|
64
|
+
|
65
|
+
def unsuspend(acs_user_id:)
|
66
|
+
@client.post("/acs/users/unsuspend", {acs_user_id: acs_user_id}.compact)
|
67
|
+
|
68
|
+
nil
|
69
|
+
end
|
70
|
+
|
71
|
+
def update(acs_user_id:, access_schedule: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil)
|
72
|
+
@client.post("/acs/users/update", {acs_user_id: acs_user_id, access_schedule: access_schedule, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number}.compact)
|
73
|
+
|
74
|
+
nil
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsUsersUnmanaged
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def get(acs_user_id:)
|
12
|
+
@client.post("/acs/users/unmanaged/get", {acs_user_id: acs_user_id}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def list(acs_system_id: nil, limit: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil)
|
18
|
+
@client.post("/acs/users/unmanaged/list", {acs_system_id: acs_system_id, limit: limit, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "seam/helpers/action_attempt"
|
4
|
+
|
5
|
+
module Seam
|
6
|
+
module Clients
|
7
|
+
class ActionAttempts
|
8
|
+
def initialize(client:, defaults:)
|
9
|
+
@client = client
|
10
|
+
@defaults = defaults
|
11
|
+
end
|
12
|
+
|
13
|
+
def get(action_attempt_id:, wait_for_action_attempt: nil)
|
14
|
+
res = @client.post("/action_attempts/get", {action_attempt_id: action_attempt_id}.compact)
|
15
|
+
|
16
|
+
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
17
|
+
|
18
|
+
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
19
|
+
end
|
20
|
+
|
21
|
+
def list(action_attempt_ids:)
|
22
|
+
res = @client.post("/action_attempts/list", {action_attempt_ids: action_attempt_ids}.compact)
|
23
|
+
|
24
|
+
Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempts"])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class ClientSessions
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_ids: nil)
|
12
|
+
res = @client.post("/client_sessions/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_ids: user_identity_ids}.compact)
|
13
|
+
|
14
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def delete(client_session_id:)
|
18
|
+
@client.post("/client_sessions/delete", {client_session_id: client_session_id}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def get(client_session_id: nil, user_identifier_key: nil)
|
24
|
+
res = @client.post("/client_sessions/get", {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_ids: nil)
|
30
|
+
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_ids: user_identity_ids}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
33
|
+
end
|
34
|
+
|
35
|
+
def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_ids: nil)
|
36
|
+
@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_ids: user_identity_ids}.compact)
|
37
|
+
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
41
|
+
def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil)
|
42
|
+
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)
|
43
|
+
|
44
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_sessions"])
|
45
|
+
end
|
46
|
+
|
47
|
+
def revoke(client_session_id:)
|
48
|
+
@client.post("/client_sessions/revoke", {client_session_id: client_session_id}.compact)
|
49
|
+
|
50
|
+
nil
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class ConnectWebviews
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def create(accepted_providers: nil, automatically_manage_new_devices: nil, custom_metadata: nil, custom_redirect_failure_url: nil, custom_redirect_url: nil, device_selection_mode: nil, provider_category: nil, wait_for_device_creation: nil)
|
12
|
+
res = @client.post("/connect_webviews/create", {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, device_selection_mode: device_selection_mode, provider_category: provider_category, wait_for_device_creation: wait_for_device_creation}.compact)
|
13
|
+
|
14
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"])
|
15
|
+
end
|
16
|
+
|
17
|
+
def delete(connect_webview_id:)
|
18
|
+
@client.post("/connect_webviews/delete", {connect_webview_id: connect_webview_id}.compact)
|
19
|
+
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
|
23
|
+
def get(connect_webview_id:)
|
24
|
+
res = @client.post("/connect_webviews/get", {connect_webview_id: connect_webview_id}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def list(custom_metadata_has: nil, limit: nil, user_identifier_key: nil)
|
30
|
+
res = @client.post("/connect_webviews/list", {custom_metadata_has: custom_metadata_has, limit: limit, user_identifier_key: user_identifier_key}.compact)
|
31
|
+
|
32
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webviews"])
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class ConnectedAccounts
|
6
|
+
def initialize(client:, defaults:)
|
7
|
+
@client = client
|
8
|
+
@defaults = defaults
|
9
|
+
end
|
10
|
+
|
11
|
+
def delete(connected_account_id:, sync: nil)
|
12
|
+
@client.post("/connected_accounts/delete", {connected_account_id: connected_account_id, sync: sync}.compact)
|
13
|
+
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
|
17
|
+
def get(connected_account_id: nil, email: nil)
|
18
|
+
res = @client.post("/connected_accounts/get", {connected_account_id: connected_account_id, email: email}.compact)
|
19
|
+
|
20
|
+
Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"])
|
21
|
+
end
|
22
|
+
|
23
|
+
def list(custom_metadata_has: nil, user_identifier_key: nil)
|
24
|
+
res = @client.post("/connected_accounts/list", {custom_metadata_has: custom_metadata_has, user_identifier_key: user_identifier_key}.compact)
|
25
|
+
|
26
|
+
Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_accounts"])
|
27
|
+
end
|
28
|
+
|
29
|
+
def update(connected_account_id:, automatically_manage_new_devices: nil, custom_metadata: nil)
|
30
|
+
@client.post("/connected_accounts/update", {connected_account_id: connected_account_id, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata}.compact)
|
31
|
+
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|