seam 2.0.0a1 → 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 +34 -2
- data/README.md +4 -1
- data/Rakefile +1 -1
- 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/lts_version.rb +5 -0
- data/lib/seam/request.rb +73 -0
- 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 -2
- metadata +98 -3
- data/lib/seam/todo.rb +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 633608dcbbd2c43fd668b46a8a6aa3ee7d23663a81ed92b84885d50dcedae3b4
|
4
|
+
data.tar.gz: 1f6c28b4b491077046e4b6d87cf26375871ba3a8a55df2c2c26c47ba52bea88f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b231444fe73cc6baae32e5ef0af4d9490892bc881f0a56ddc3d6dce6011a18ae80d0805e537a5db1d65bbaf8bd73b498ead3e7391400dd3ce94e70400779b5f5
|
7
|
+
data.tar.gz: 38504e2b53afb62af4ba3808dbf0c2345284c45833a07a6dea1774ae2a6a64edb45c1b66ae9ff87eafb12ff2402e148ad89230d78b9b423be046fee4cad796b8
|
data/Gemfile.lock
CHANGED
@@ -1,19 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
seam (2.0.
|
4
|
+
seam (2.0.0.prerelease.1)
|
5
|
+
http (~> 5.2)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: https://rubygems.org/
|
8
9
|
specs:
|
10
|
+
addressable (2.8.6)
|
11
|
+
public_suffix (>= 2.0.2, < 6.0)
|
9
12
|
ansi (1.5.0)
|
10
13
|
ast (2.4.2)
|
14
|
+
base64 (0.2.0)
|
15
|
+
bigdecimal (3.1.7)
|
16
|
+
crack (1.0.0)
|
17
|
+
bigdecimal
|
18
|
+
rexml
|
11
19
|
diff-lcs (1.5.1)
|
12
20
|
docile (1.4.0)
|
21
|
+
domain_name (0.6.20240107)
|
22
|
+
ffi (1.16.3)
|
23
|
+
ffi-compiler (1.3.2)
|
24
|
+
ffi (>= 1.15.5)
|
25
|
+
rake
|
13
26
|
gem-release (2.2.2)
|
27
|
+
hashdiff (1.1.0)
|
28
|
+
http (5.2.0)
|
29
|
+
addressable (~> 2.8)
|
30
|
+
base64 (~> 0.1)
|
31
|
+
http-cookie (~> 1.0)
|
32
|
+
http-form_data (~> 2.2)
|
33
|
+
llhttp-ffi (~> 0.5.0)
|
34
|
+
http-cookie (1.0.5)
|
35
|
+
domain_name (~> 0.5)
|
36
|
+
http-form_data (2.3.0)
|
14
37
|
json (2.7.2)
|
15
38
|
language_server-protocol (3.17.0.3)
|
16
39
|
lint_roller (1.1.0)
|
40
|
+
llhttp-ffi (0.5.0)
|
41
|
+
ffi-compiler (~> 1.0)
|
42
|
+
rake (~> 13.0)
|
17
43
|
multi_json (1.15.0)
|
18
44
|
parallel (1.24.0)
|
19
45
|
parse_gemspec (1.0.0)
|
@@ -24,6 +50,7 @@ GEM
|
|
24
50
|
parser (3.3.0.5)
|
25
51
|
ast (~> 2.4.1)
|
26
52
|
racc
|
53
|
+
public_suffix (5.0.5)
|
27
54
|
racc (1.7.3)
|
28
55
|
rainbow (3.1.1)
|
29
56
|
rake (13.2.1)
|
@@ -85,6 +112,10 @@ GEM
|
|
85
112
|
unicode-display_width (>= 1.1.1, < 3)
|
86
113
|
thor (1.3.1)
|
87
114
|
unicode-display_width (2.5.0)
|
115
|
+
webmock (3.0.1)
|
116
|
+
addressable (>= 2.3.6)
|
117
|
+
crack (>= 0.3.2)
|
118
|
+
hashdiff
|
88
119
|
|
89
120
|
PLATFORMS
|
90
121
|
ruby
|
@@ -100,6 +131,7 @@ DEPENDENCIES
|
|
100
131
|
simplecov (~> 0.21)
|
101
132
|
simplecov-console (~> 0.9)
|
102
133
|
standard (~> 1.3)
|
134
|
+
webmock (~> 3.0.0)
|
103
135
|
|
104
136
|
BUNDLED WITH
|
105
|
-
2.
|
137
|
+
2.4.19
|
data/README.md
CHANGED
@@ -64,13 +64,14 @@ $ git clone git@github.com:seamapi/ruby-next.git
|
|
64
64
|
|
65
65
|
### Requirements
|
66
66
|
|
67
|
-
You will need [Ruby] with [Bundler].
|
67
|
+
You will need [Ruby] with [Bundler] and [Node.js] with [npm].
|
68
68
|
|
69
69
|
Be sure that all commands run under the correct Ruby version, e.g.,
|
70
70
|
if using [rbenv], install the correct version with
|
71
71
|
|
72
72
|
```
|
73
73
|
$ rbenv install
|
74
|
+
$ npm install
|
74
75
|
```
|
75
76
|
|
76
77
|
Install the development dependencies with
|
@@ -80,6 +81,8 @@ $ bundle install
|
|
80
81
|
```
|
81
82
|
|
82
83
|
[bundler]: https://bundler.io/
|
84
|
+
[Node.js]: https://nodejs.org/
|
85
|
+
[npm]: https://www.npmjs.com/
|
83
86
|
[ruby]: https://www.ruby-lang.org/
|
84
87
|
[rbenv]: https://github.com/rbenv/rbenv
|
85
88
|
|
data/Rakefile
CHANGED
data/lib/seam/client.rb
ADDED
@@ -0,0 +1,129 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
class Client
|
5
|
+
attr_accessor :api_key, :base_uri, :debug, :wait_for_action_attempt
|
6
|
+
|
7
|
+
def self.lts_version
|
8
|
+
Seam::LTS_VERSION
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize(api_key: nil, base_uri: nil, wait_for_action_attempt: false, debug: false)
|
12
|
+
@api_key = api_key || ENV["SEAM_API_KEY"]
|
13
|
+
@base_uri = base_uri || ENV["SEAM_API_URL"] || ENV["SEAM_ENDPOINT"] || "https://connect.getseam.com"
|
14
|
+
@debug = debug
|
15
|
+
@wait_for_action_attempt = wait_for_action_attempt
|
16
|
+
|
17
|
+
raise ArgumentError, "SEAM_API_KEY not found in environment, and api_key not provided" if @api_key.to_s.empty?
|
18
|
+
|
19
|
+
if ENV["SEAM_API_URL"]
|
20
|
+
warn "Using the SEAM_API_URL environment variable is deprecated. " \
|
21
|
+
"Support will be removed in a later major version. Use SEAM_ENDPOINT instead."
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def lts_version
|
26
|
+
Seam::LTS_VERSION
|
27
|
+
end
|
28
|
+
|
29
|
+
def access_codes
|
30
|
+
@access_codes ||= Seam::Clients::AccessCodes.new(self)
|
31
|
+
end
|
32
|
+
|
33
|
+
def acs
|
34
|
+
@acs ||= Seam::Clients::Acs.new(self)
|
35
|
+
end
|
36
|
+
|
37
|
+
def action_attempts
|
38
|
+
@action_attempts ||= Seam::Clients::ActionAttempts.new(self)
|
39
|
+
end
|
40
|
+
|
41
|
+
def client_sessions
|
42
|
+
@client_sessions ||= Seam::Clients::ClientSessions.new(self)
|
43
|
+
end
|
44
|
+
|
45
|
+
def connect_webviews
|
46
|
+
@connect_webviews ||= Seam::Clients::ConnectWebviews.new(self)
|
47
|
+
end
|
48
|
+
|
49
|
+
def connected_accounts
|
50
|
+
@connected_accounts ||= Seam::Clients::ConnectedAccounts.new(self)
|
51
|
+
end
|
52
|
+
|
53
|
+
def devices
|
54
|
+
@devices ||= Seam::Clients::Devices.new(self)
|
55
|
+
end
|
56
|
+
|
57
|
+
def events
|
58
|
+
@events ||= Seam::Clients::Events.new(self)
|
59
|
+
end
|
60
|
+
|
61
|
+
def locks
|
62
|
+
@locks ||= Seam::Clients::Locks.new(self)
|
63
|
+
end
|
64
|
+
|
65
|
+
def networks
|
66
|
+
@networks ||= Seam::Clients::Networks.new(self)
|
67
|
+
end
|
68
|
+
|
69
|
+
def noise_sensors
|
70
|
+
@noise_sensors ||= Seam::Clients::NoiseSensors.new(self)
|
71
|
+
end
|
72
|
+
|
73
|
+
def phones
|
74
|
+
@phones ||= Seam::Clients::Phones.new(self)
|
75
|
+
end
|
76
|
+
|
77
|
+
def thermostats
|
78
|
+
@thermostats ||= Seam::Clients::Thermostats.new(self)
|
79
|
+
end
|
80
|
+
|
81
|
+
def user_identities
|
82
|
+
@user_identities ||= Seam::Clients::UserIdentities.new(self)
|
83
|
+
end
|
84
|
+
|
85
|
+
def webhooks
|
86
|
+
@webhooks ||= Seam::Clients::Webhooks.new(self)
|
87
|
+
end
|
88
|
+
|
89
|
+
def workspaces
|
90
|
+
@workspaces ||= Seam::Clients::Workspaces.new(self)
|
91
|
+
end
|
92
|
+
|
93
|
+
def health
|
94
|
+
request_seam(:get, "/health")
|
95
|
+
end
|
96
|
+
|
97
|
+
# @deprecated Please use {#devices.unmanaged} instead.
|
98
|
+
def unmanaged_devices
|
99
|
+
warn "[DEPRECATION] 'unmanaged_devices' is deprecated. Please use 'devices.unmanaged' instead."
|
100
|
+
|
101
|
+
@unmanaged_devices ||= Seam::Clients::DevicesUnmanaged.new(self)
|
102
|
+
end
|
103
|
+
|
104
|
+
# @deprecated Please use {#access_codes.unmanaged} instead.
|
105
|
+
def unmanaged_access_codes
|
106
|
+
warn "[DEPRECATION] 'unmanaged_access_codes' is deprecated. Please use 'access_codes.unmanaged' instead."
|
107
|
+
|
108
|
+
@unmanaged_access_codes ||= Seam::Clients::AccessCodesUnmanaged.new(self)
|
109
|
+
end
|
110
|
+
|
111
|
+
def request_seam_object(method, path, klass, inner_object, config = {})
|
112
|
+
response = request_seam(method, path, config)
|
113
|
+
|
114
|
+
data = response[inner_object]
|
115
|
+
|
116
|
+
klass.load_from_response(data, self)
|
117
|
+
end
|
118
|
+
|
119
|
+
def request_seam(method, path, config = {})
|
120
|
+
Seam::Request.new(
|
121
|
+
api_key: api_key,
|
122
|
+
base_uri: base_uri,
|
123
|
+
debug: debug
|
124
|
+
).perform(
|
125
|
+
method, path, config
|
126
|
+
)
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
@@ -0,0 +1,95 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AccessCodes < BaseClient
|
6
|
+
def simulate
|
7
|
+
@simulate ||= Seam::Clients::AccessCodesSimulate.new(self)
|
8
|
+
end
|
9
|
+
|
10
|
+
def unmanaged
|
11
|
+
@unmanaged ||= Seam::Clients::AccessCodesUnmanaged.new(self)
|
12
|
+
end
|
13
|
+
|
14
|
+
def create(device_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, common_code_key: nil, ends_at: nil, is_external_modification_allowed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, starts_at: nil, sync: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil)
|
15
|
+
request_seam_object(
|
16
|
+
:post,
|
17
|
+
"/access_codes/create",
|
18
|
+
Seam::AccessCode,
|
19
|
+
"access_code",
|
20
|
+
body: {device_id: device_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, common_code_key: common_code_key, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, starts_at: starts_at, sync: sync, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def create_multiple(device_ids:, allow_external_modification: nil, attempt_for_offline_device: nil, behavior_when_code_cannot_be_shared: nil, code: nil, ends_at: nil, is_external_modification_allowed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, preferred_code_length: nil, starts_at: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil)
|
25
|
+
request_seam_object(
|
26
|
+
:post,
|
27
|
+
"/access_codes/create_multiple",
|
28
|
+
Seam::AccessCode,
|
29
|
+
"access_codes",
|
30
|
+
body: {device_ids: device_ids, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, behavior_when_code_cannot_be_shared: behavior_when_code_cannot_be_shared, code: code, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, preferred_code_length: preferred_code_length, starts_at: starts_at, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact
|
31
|
+
)
|
32
|
+
end
|
33
|
+
|
34
|
+
def delete(access_code_id:, device_id: nil, sync: nil)
|
35
|
+
request_seam(
|
36
|
+
:post,
|
37
|
+
"/access_codes/delete",
|
38
|
+
body: {access_code_id: access_code_id, device_id: device_id, sync: sync}.compact
|
39
|
+
)
|
40
|
+
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
|
44
|
+
def generate_code(device_id:)
|
45
|
+
request_seam_object(
|
46
|
+
:post,
|
47
|
+
"/access_codes/generate_code",
|
48
|
+
Seam::AccessCode,
|
49
|
+
"generated_code",
|
50
|
+
body: {device_id: device_id}.compact
|
51
|
+
)
|
52
|
+
end
|
53
|
+
|
54
|
+
def get(access_code_id: nil, code: nil, device_id: nil)
|
55
|
+
request_seam_object(
|
56
|
+
:post,
|
57
|
+
"/access_codes/get",
|
58
|
+
Seam::AccessCode,
|
59
|
+
"access_code",
|
60
|
+
body: {access_code_id: access_code_id, code: code, device_id: device_id}.compact
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
def list(access_code_ids: nil, device_id: nil, user_identifier_key: nil)
|
65
|
+
request_seam_object(
|
66
|
+
:post,
|
67
|
+
"/access_codes/list",
|
68
|
+
Seam::AccessCode,
|
69
|
+
"access_codes",
|
70
|
+
body: {access_code_ids: access_code_ids, device_id: device_id, user_identifier_key: user_identifier_key}.compact
|
71
|
+
)
|
72
|
+
end
|
73
|
+
|
74
|
+
def pull_backup_access_code(access_code_id:)
|
75
|
+
request_seam_object(
|
76
|
+
:post,
|
77
|
+
"/access_codes/pull_backup_access_code",
|
78
|
+
Seam::AccessCode,
|
79
|
+
"backup_access_code",
|
80
|
+
body: {access_code_id: access_code_id}.compact
|
81
|
+
)
|
82
|
+
end
|
83
|
+
|
84
|
+
def update(access_code_id:, allow_external_modification: nil, attempt_for_offline_device: nil, code: nil, device_id: nil, ends_at: nil, is_external_modification_allowed: nil, is_managed: nil, is_offline_access_code: nil, is_one_time_use: nil, max_time_rounding: nil, name: nil, prefer_native_scheduling: nil, starts_at: nil, sync: nil, type: nil, use_backup_access_code_pool: nil, use_offline_access_code: nil)
|
85
|
+
request_seam(
|
86
|
+
:post,
|
87
|
+
"/access_codes/update",
|
88
|
+
body: {access_code_id: access_code_id, allow_external_modification: allow_external_modification, attempt_for_offline_device: attempt_for_offline_device, code: code, device_id: device_id, ends_at: ends_at, is_external_modification_allowed: is_external_modification_allowed, is_managed: is_managed, is_offline_access_code: is_offline_access_code, is_one_time_use: is_one_time_use, max_time_rounding: max_time_rounding, name: name, prefer_native_scheduling: prefer_native_scheduling, starts_at: starts_at, sync: sync, type: type, use_backup_access_code_pool: use_backup_access_code_pool, use_offline_access_code: use_offline_access_code}.compact
|
89
|
+
)
|
90
|
+
|
91
|
+
nil
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AccessCodesSimulate < BaseClient
|
6
|
+
def create_unmanaged_access_code(code:, device_id:, name:)
|
7
|
+
request_seam_object(
|
8
|
+
:post,
|
9
|
+
"/access_codes/simulate/create_unmanaged_access_code",
|
10
|
+
Seam::UnmanagedAccessCode,
|
11
|
+
"access_code",
|
12
|
+
body: {code: code, device_id: device_id, name: name}.compact
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AccessCodesUnmanaged < BaseClient
|
6
|
+
def convert_to_managed(access_code_id:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil, sync: nil)
|
7
|
+
request_seam(
|
8
|
+
:post,
|
9
|
+
"/access_codes/unmanaged/convert_to_managed",
|
10
|
+
body: {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
|
11
|
+
)
|
12
|
+
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def delete(access_code_id:, sync: nil)
|
17
|
+
request_seam(
|
18
|
+
:post,
|
19
|
+
"/access_codes/unmanaged/delete",
|
20
|
+
body: {access_code_id: access_code_id, sync: sync}.compact
|
21
|
+
)
|
22
|
+
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def get(access_code_id: nil, code: nil, device_id: nil)
|
27
|
+
request_seam_object(
|
28
|
+
:post,
|
29
|
+
"/access_codes/unmanaged/get",
|
30
|
+
Seam::UnmanagedAccessCode,
|
31
|
+
"access_code",
|
32
|
+
body: {access_code_id: access_code_id, code: code, device_id: device_id}.compact
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def list(device_id:, user_identifier_key: nil)
|
37
|
+
request_seam_object(
|
38
|
+
:post,
|
39
|
+
"/access_codes/unmanaged/list",
|
40
|
+
Seam::UnmanagedAccessCode,
|
41
|
+
"access_codes",
|
42
|
+
body: {device_id: device_id, user_identifier_key: user_identifier_key}.compact
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def update(access_code_id:, is_managed:, allow_external_modification: nil, force: nil, is_external_modification_allowed: nil)
|
47
|
+
request_seam(
|
48
|
+
:post,
|
49
|
+
"/access_codes/unmanaged/update",
|
50
|
+
body: {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
|
51
|
+
)
|
52
|
+
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class Acs < BaseClient
|
6
|
+
def access_groups
|
7
|
+
@access_groups ||= Seam::Clients::AcsAccessGroups.new(self)
|
8
|
+
end
|
9
|
+
|
10
|
+
def credential_pools
|
11
|
+
@credential_pools ||= Seam::Clients::AcsCredentialPools.new(self)
|
12
|
+
end
|
13
|
+
|
14
|
+
def credential_provisioning_automations
|
15
|
+
@credential_provisioning_automations ||= Seam::Clients::AcsCredentialProvisioningAutomations.new(self)
|
16
|
+
end
|
17
|
+
|
18
|
+
def credentials
|
19
|
+
@credentials ||= Seam::Clients::AcsCredentials.new(self)
|
20
|
+
end
|
21
|
+
|
22
|
+
def entrances
|
23
|
+
@entrances ||= Seam::Clients::AcsEntrances.new(self)
|
24
|
+
end
|
25
|
+
|
26
|
+
def systems
|
27
|
+
@systems ||= Seam::Clients::AcsSystems.new(self)
|
28
|
+
end
|
29
|
+
|
30
|
+
def users
|
31
|
+
@users ||= Seam::Clients::AcsUsers.new(self)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsAccessGroups < BaseClient
|
6
|
+
def add_user(acs_access_group_id:, acs_user_id:)
|
7
|
+
request_seam(
|
8
|
+
:post,
|
9
|
+
"/acs/access_groups/add_user",
|
10
|
+
body: {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact
|
11
|
+
)
|
12
|
+
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def get(acs_access_group_id:)
|
17
|
+
request_seam_object(
|
18
|
+
:post,
|
19
|
+
"/acs/access_groups/get",
|
20
|
+
Seam::AcsAccessGroup,
|
21
|
+
"acs_access_group",
|
22
|
+
body: {acs_access_group_id: acs_access_group_id}.compact
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def list(acs_system_id: nil, acs_user_id: nil)
|
27
|
+
request_seam_object(
|
28
|
+
:post,
|
29
|
+
"/acs/access_groups/list",
|
30
|
+
Seam::AcsAccessGroup,
|
31
|
+
"acs_access_groups",
|
32
|
+
body: {acs_system_id: acs_system_id, acs_user_id: acs_user_id}.compact
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def list_users(acs_access_group_id:)
|
37
|
+
request_seam_object(
|
38
|
+
:post,
|
39
|
+
"/acs/access_groups/list_users",
|
40
|
+
Seam::AcsUser,
|
41
|
+
"acs_users",
|
42
|
+
body: {acs_access_group_id: acs_access_group_id}.compact
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def remove_user(acs_access_group_id:, acs_user_id:)
|
47
|
+
request_seam(
|
48
|
+
:post,
|
49
|
+
"/acs/access_groups/remove_user",
|
50
|
+
body: {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact
|
51
|
+
)
|
52
|
+
|
53
|
+
nil
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentialPools < BaseClient
|
6
|
+
def list(acs_system_id:)
|
7
|
+
request_seam_object(
|
8
|
+
:post,
|
9
|
+
"/acs/credential_pools/list",
|
10
|
+
Seam::AcsCredentialPool,
|
11
|
+
"acs_credential_pools",
|
12
|
+
body: {acs_system_id: acs_system_id}.compact
|
13
|
+
)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentialProvisioningAutomations < BaseClient
|
6
|
+
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)
|
7
|
+
request_seam_object(
|
8
|
+
:post,
|
9
|
+
"/acs/credential_provisioning_automations/launch",
|
10
|
+
Seam::AcsCredentialProvisioningAutomation,
|
11
|
+
"acs_credential_provisioning_automation",
|
12
|
+
body: {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
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsCredentials < BaseClient
|
6
|
+
def assign(acs_credential_id:, acs_user_id:)
|
7
|
+
request_seam(
|
8
|
+
:post,
|
9
|
+
"/acs/credentials/assign",
|
10
|
+
body: {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact
|
11
|
+
)
|
12
|
+
|
13
|
+
nil
|
14
|
+
end
|
15
|
+
|
16
|
+
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)
|
17
|
+
request_seam_object(
|
18
|
+
:post,
|
19
|
+
"/acs/credentials/create",
|
20
|
+
Seam::AcsCredential,
|
21
|
+
"acs_credential",
|
22
|
+
body: {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
|
23
|
+
)
|
24
|
+
end
|
25
|
+
|
26
|
+
def delete(acs_credential_id:)
|
27
|
+
request_seam(
|
28
|
+
:post,
|
29
|
+
"/acs/credentials/delete",
|
30
|
+
body: {acs_credential_id: acs_credential_id}.compact
|
31
|
+
)
|
32
|
+
|
33
|
+
nil
|
34
|
+
end
|
35
|
+
|
36
|
+
def get(acs_credential_id:)
|
37
|
+
request_seam_object(
|
38
|
+
:post,
|
39
|
+
"/acs/credentials/get",
|
40
|
+
Seam::AcsCredential,
|
41
|
+
"acs_credential",
|
42
|
+
body: {acs_credential_id: acs_credential_id}.compact
|
43
|
+
)
|
44
|
+
end
|
45
|
+
|
46
|
+
def list(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil, is_multi_phone_sync_credential: nil)
|
47
|
+
request_seam_object(
|
48
|
+
:post,
|
49
|
+
"/acs/credentials/list",
|
50
|
+
Seam::AcsCredential,
|
51
|
+
"acs_credentials",
|
52
|
+
body: {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id, is_multi_phone_sync_credential: is_multi_phone_sync_credential}.compact
|
53
|
+
)
|
54
|
+
end
|
55
|
+
|
56
|
+
def unassign(acs_credential_id:, acs_user_id:)
|
57
|
+
request_seam(
|
58
|
+
:post,
|
59
|
+
"/acs/credentials/unassign",
|
60
|
+
body: {acs_credential_id: acs_credential_id, acs_user_id: acs_user_id}.compact
|
61
|
+
)
|
62
|
+
|
63
|
+
nil
|
64
|
+
end
|
65
|
+
|
66
|
+
def update(acs_credential_id:, code:)
|
67
|
+
request_seam(
|
68
|
+
:post,
|
69
|
+
"/acs/credentials/update",
|
70
|
+
body: {acs_credential_id: acs_credential_id, code: code}.compact
|
71
|
+
)
|
72
|
+
|
73
|
+
nil
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class AcsEntrances < BaseClient
|
6
|
+
def get(acs_entrance_id:)
|
7
|
+
request_seam_object(
|
8
|
+
:post,
|
9
|
+
"/acs/entrances/get",
|
10
|
+
Seam::AcsEntrance,
|
11
|
+
"acs_entrance",
|
12
|
+
body: {acs_entrance_id: acs_entrance_id}.compact
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
def grant_access(acs_entrance_id:, acs_user_id:)
|
17
|
+
request_seam(
|
18
|
+
:post,
|
19
|
+
"/acs/entrances/grant_access",
|
20
|
+
body: {acs_entrance_id: acs_entrance_id, acs_user_id: acs_user_id}.compact
|
21
|
+
)
|
22
|
+
|
23
|
+
nil
|
24
|
+
end
|
25
|
+
|
26
|
+
def list(acs_credential_id: nil, acs_system_id: nil)
|
27
|
+
request_seam_object(
|
28
|
+
:post,
|
29
|
+
"/acs/entrances/list",
|
30
|
+
Seam::AcsEntrance,
|
31
|
+
"acs_entrances",
|
32
|
+
body: {acs_credential_id: acs_credential_id, acs_system_id: acs_system_id}.compact
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def list_credentials_with_access(acs_entrance_id:, include_if: nil)
|
37
|
+
request_seam_object(
|
38
|
+
:post,
|
39
|
+
"/acs/entrances/list_credentials_with_access",
|
40
|
+
Seam::AcsCredential,
|
41
|
+
"acs_credentials",
|
42
|
+
body: {acs_entrance_id: acs_entrance_id, include_if: include_if}.compact
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|