seamapi 1.12.1 → 1.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/seam/client.rb +4 -0
- data/lib/seam/clients/access_codes.rb +16 -4
- data/lib/seam/clients/unmanaged_access_codes.rb +46 -0
- data/lib/seam/resources/access_code.rb +2 -2
- data/lib/seam/resources/unmanaged_access_code.rb +12 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seamapi.rb +2 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc6a1d9ef339ddac7615f36a9715242e49ba0932db2ad987479872af3ec323de
|
4
|
+
data.tar.gz: 0be328fc75281169a6c7ea76c0f8ac77c1ee03a6ce0713296664d296479ca137
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0094892ca15cf237acfedac076a705cc06898b8489b50a286a77d627d6cb3cf818385c50e848cc74125194195af883ff7c8a2f285753de038adf28f24a1ea68a'
|
7
|
+
data.tar.gz: 157d0dbe7f4df88fa39482f3e8a1379d9c388d5c496597c510de5deebf3c10dc2cd52d87b8f29b025395dcde9dd765fec3f62b6abaec6d9b501261c4f4d2332b
|
data/Gemfile.lock
CHANGED
data/lib/seam/client.rb
CHANGED
@@ -36,6 +36,10 @@ module Seam
|
|
36
36
|
@access_codes ||= Seam::Clients::AccessCodes.new(self)
|
37
37
|
end
|
38
38
|
|
39
|
+
def unmanaged_access_codes
|
40
|
+
@unmanaged_access_codes ||= Seam::Clients::UnmanagedAccessCodes.new(self)
|
41
|
+
end
|
42
|
+
|
39
43
|
def connect_webviews
|
40
44
|
@connect_webviews ||= Seam::Clients::ConnectWebviews.new(self)
|
41
45
|
end
|
@@ -25,13 +25,14 @@ module Seam
|
|
25
25
|
)
|
26
26
|
end
|
27
27
|
|
28
|
-
def create(device_id: nil, name: nil, code: nil, starts_at: nil, ends_at: nil)
|
28
|
+
def create(device_id: nil, name: nil, code: nil, starts_at: nil, ends_at: nil, use_backup_access_code_pool: nil, allow_external_modification: nil)
|
29
29
|
action_attempt = request_seam_object(
|
30
30
|
:post,
|
31
31
|
"/access_codes/create",
|
32
32
|
Seam::ActionAttempt,
|
33
33
|
"action_attempt",
|
34
|
-
body: {device_id: device_id, code: code, starts_at: starts_at, ends_at: ends_at, name: name
|
34
|
+
body: {device_id: device_id, code: code, starts_at: starts_at, ends_at: ends_at, name: name,
|
35
|
+
use_backup_access_code_pool: use_backup_access_code_pool, allow_external_modification: allow_external_modification}.compact
|
35
36
|
)
|
36
37
|
action_attempt.wait_until_finished
|
37
38
|
# TODO: check if failed
|
@@ -50,7 +51,7 @@ module Seam
|
|
50
51
|
action_attempt
|
51
52
|
end
|
52
53
|
|
53
|
-
def update(access_code_id: nil, name: nil, code: nil, starts_at: nil, ends_at: nil, type: nil)
|
54
|
+
def update(access_code_id: nil, name: nil, code: nil, starts_at: nil, ends_at: nil, type: nil, allow_external_modification: nil)
|
54
55
|
action_attempt = request_seam_object(
|
55
56
|
:post,
|
56
57
|
"/access_codes/update",
|
@@ -62,12 +63,23 @@ module Seam
|
|
62
63
|
code: code,
|
63
64
|
starts_at: starts_at,
|
64
65
|
ends_at: ends_at,
|
65
|
-
type: type
|
66
|
+
type: type,
|
67
|
+
allow_external_modification: allow_external_modification
|
66
68
|
}.compact
|
67
69
|
)
|
68
70
|
action_attempt.wait_until_finished
|
69
71
|
action_attempt
|
70
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}
|
81
|
+
)
|
82
|
+
end
|
71
83
|
end
|
72
84
|
end
|
73
85
|
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
module Clients
|
5
|
+
class UnmanagedAccessCodes < BaseClient
|
6
|
+
def get(access_code_id = nil, device_id: nil, code: nil)
|
7
|
+
request_seam_object(
|
8
|
+
:get,
|
9
|
+
"/access_codes/unmanaged/get",
|
10
|
+
Seam::UnmanagedAccessCode,
|
11
|
+
"access_code",
|
12
|
+
params: {
|
13
|
+
device_id: device_id,
|
14
|
+
access_code_id: access_code_id,
|
15
|
+
code: code
|
16
|
+
}.compact
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def list(device_id)
|
21
|
+
request_seam_object(
|
22
|
+
:get,
|
23
|
+
"/access_codes/unmanaged/list",
|
24
|
+
Seam::UnmanagedAccessCode,
|
25
|
+
"access_codes",
|
26
|
+
params: {device_id: device_id}
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
def convert_to_managed(access_code_id, allow_external_modification: nil)
|
31
|
+
action_attempt = request_seam_object(
|
32
|
+
:post,
|
33
|
+
"/access_codes/unmanaged/convert_to_managed",
|
34
|
+
Seam::ActionAttempt,
|
35
|
+
"action_attempt",
|
36
|
+
body: {
|
37
|
+
access_code_id: access_code_id,
|
38
|
+
allow_external_modification: allow_external_modification
|
39
|
+
}.compact
|
40
|
+
)
|
41
|
+
action_attempt.wait_until_finished
|
42
|
+
action_attempt
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
module Seam
|
4
4
|
class AccessCode < BaseResource
|
5
|
-
attr_reader :access_code_id, :name, :type, :code
|
5
|
+
attr_reader :access_code_id, :name, :type, :code, :is_managed, :status, :device_id, :is_scheduled_on_device, :is_waiting_for_code_assignment, :pulled_backup_access_code_id, :is_backup_access_code_available, :is_backup, :appearance, :is_external_modification_allowed
|
6
6
|
|
7
|
-
date_accessor :starts_at, :ends_at
|
7
|
+
date_accessor :starts_at, :ends_at, :created_at
|
8
8
|
|
9
9
|
include Seam::ResourceErrorsSupport
|
10
10
|
include Seam::ResourceWarningsSupport
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Seam
|
4
|
+
class UnmanagedAccessCode < BaseResource
|
5
|
+
attr_accessor :access_code_id, :device_id, :type, :name, :code, :is_managed, :status
|
6
|
+
|
7
|
+
date_accessor :created_at, :starts_at, :ends_at
|
8
|
+
|
9
|
+
include Seam::ResourceErrorsSupport
|
10
|
+
include Seam::ResourceWarningsSupport
|
11
|
+
end
|
12
|
+
end
|
data/lib/seam/version.rb
CHANGED
data/lib/seamapi.rb
CHANGED
@@ -12,6 +12,7 @@ require_relative "seam/clients/workspaces"
|
|
12
12
|
require_relative "seam/clients/connect_webviews"
|
13
13
|
require_relative "seam/clients/connected_accounts"
|
14
14
|
require_relative "seam/clients/access_codes"
|
15
|
+
require_relative "seam/clients/unmanaged_access_codes"
|
15
16
|
require_relative "seam/clients/action_attempts"
|
16
17
|
require_relative "seam/clients/events"
|
17
18
|
require_relative "seam/resources/base_resource"
|
@@ -23,6 +24,7 @@ require_relative "seam/resources/device"
|
|
23
24
|
require_relative "seam/resources/unmanaged_device"
|
24
25
|
require_relative "seam/resources/device_provider"
|
25
26
|
require_relative "seam/resources/access_code"
|
27
|
+
require_relative "seam/resources/unmanaged_access_code"
|
26
28
|
require_relative "seam/resources/action_attempt"
|
27
29
|
require_relative "seam/resources/connect_webview"
|
28
30
|
require_relative "seam/resources/connected_account"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seamapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seam Labs, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- lib/seam/clients/devices.rb
|
171
171
|
- lib/seam/clients/events.rb
|
172
172
|
- lib/seam/clients/locks.rb
|
173
|
+
- lib/seam/clients/unmanaged_access_codes.rb
|
173
174
|
- lib/seam/clients/unmanaged_devices.rb
|
174
175
|
- lib/seam/clients/workspaces.rb
|
175
176
|
- lib/seam/logger.rb
|
@@ -186,6 +187,7 @@ files:
|
|
186
187
|
- lib/seam/resources/resource_errors_support.rb
|
187
188
|
- lib/seam/resources/resource_warning.rb
|
188
189
|
- lib/seam/resources/resource_warnings_support.rb
|
190
|
+
- lib/seam/resources/unmanaged_access_code.rb
|
189
191
|
- lib/seam/resources/unmanaged_device.rb
|
190
192
|
- lib/seam/resources/workspace.rb
|
191
193
|
- lib/seam/version.rb
|