seam 2.166.0 → 2.167.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +55 -2
- data/lib/seam/action_attempt_resolver.rb +77 -7
- data/lib/seam/auth.rb +2 -1
- data/lib/seam/base_resource.rb +50 -3
- data/lib/seam/deep_hash_accessor.rb +11 -15
- data/lib/seam/errors.rb +6 -0
- data/lib/seam/http.rb +11 -7
- data/lib/seam/http_single_workspace.rb +15 -3
- data/lib/seam/http_without_workspace.rb +17 -7
- data/lib/seam/invalid_response_error.rb +17 -0
- data/lib/seam/options.rb +2 -1
- data/lib/seam/paginator.rb +34 -29
- data/lib/seam/request_parameters.rb +11 -0
- data/lib/seam/resources/access_code.rb +46 -3
- data/lib/seam/resources/access_grant.rb +38 -4
- data/lib/seam/resources/access_method.rb +18 -1
- data/lib/seam/resources/acs_access_group.rb +0 -17
- data/lib/seam/resources/acs_credential.rb +18 -1
- data/lib/seam/resources/acs_entrance.rb +1 -1
- data/lib/seam/resources/acs_system.rb +17 -31
- data/lib/seam/resources/acs_user.rb +0 -3
- data/lib/seam/resources/action_attempt.rb +4 -216
- data/lib/seam/resources/batch.rb +1 -1
- data/lib/seam/resources/client_session.rb +0 -4
- data/lib/seam/resources/connect_webview.rb +1 -0
- data/lib/seam/resources/connected_account.rb +1 -21
- data/lib/seam/resources/device.rb +354 -311
- data/lib/seam/resources/device_provider.rb +11 -13
- data/lib/seam/resources/event.rb +372 -151
- data/lib/seam/resources/instant_key.rb +1 -1
- data/lib/seam/resources/phone.rb +90 -2
- data/lib/seam/resources/space.rb +21 -1
- data/lib/seam/resources/unmanaged_access_code.rb +44 -4
- data/lib/seam/resources/unmanaged_access_grant.rb +38 -4
- data/lib/seam/resources/unmanaged_access_method.rb +18 -1
- data/lib/seam/resources/unmanaged_device.rb +108 -38
- data/lib/seam/resources/workspace.rb +0 -4
- data/lib/seam/routes/access_codes.rb +19 -23
- data/lib/seam/routes/access_codes_simulate.rb +1 -1
- data/lib/seam/routes/access_codes_unmanaged.rb +7 -5
- data/lib/seam/routes/access_grants.rb +24 -24
- data/lib/seam/routes/access_grants_unmanaged.rb +5 -4
- data/lib/seam/routes/access_methods.rb +20 -14
- data/lib/seam/routes/access_methods_unmanaged.rb +2 -2
- data/lib/seam/routes/acs_access_groups.rb +4 -4
- data/lib/seam/routes/acs_credentials.rb +4 -4
- data/lib/seam/routes/acs_encoders.rb +5 -5
- data/lib/seam/routes/acs_entrances.rb +6 -8
- data/lib/seam/routes/acs_systems.rb +3 -3
- data/lib/seam/routes/acs_users.rb +44 -34
- data/lib/seam/routes/action_attempts.rb +2 -2
- data/lib/seam/routes/cameras_live_views.rb +5 -5
- data/lib/seam/routes/client_sessions.rb +20 -21
- data/lib/seam/routes/connect_webviews.rb +3 -3
- data/lib/seam/routes/connected_accounts.rb +7 -5
- data/lib/seam/routes/customers.rb +4 -5
- data/lib/seam/routes/devices.rb +10 -10
- data/lib/seam/routes/devices_unmanaged.rb +7 -5
- data/lib/seam/routes/events.rb +16 -12
- data/lib/seam/routes/instant_keys.rb +7 -5
- data/lib/seam/routes/locks.rb +10 -8
- data/lib/seam/routes/locks_simulate.rb +2 -2
- data/lib/seam/routes/media.rb +1 -1
- data/lib/seam/routes/noise_sensors.rb +1 -1
- data/lib/seam/routes/noise_sensors_noise_thresholds.rb +9 -3
- data/lib/seam/routes/phones.rb +2 -2
- data/lib/seam/routes/phones_simulate.rb +1 -1
- data/lib/seam/routes/spaces.rb +18 -13
- data/lib/seam/routes/thermostats.rb +14 -18
- data/lib/seam/routes/thermostats_daily_programs.rb +2 -2
- data/lib/seam/routes/thermostats_schedules.rb +3 -3
- data/lib/seam/routes/user_identities.rb +24 -18
- data/lib/seam/routes/user_identities_unmanaged.rb +2 -2
- data/lib/seam/routes/webhooks.rb +3 -3
- data/lib/seam/routes/workspaces.rb +6 -16
- data/lib/seam/url_search_params_serializer.rb +2 -1
- data/lib/seam/version.rb +1 -1
- data/lib/seam/wait_for_action_attempt.rb +3 -1
- data/lib/seam/webhook.rb +25 -5
- data/lib/seam.rb +12 -6
- metadata +5 -2
|
@@ -16,13 +16,11 @@ module Seam
|
|
|
16
16
|
# @param expires_at [Time, nil] Date and time at which the client session should expire, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.
|
|
17
17
|
# @param user_identifier_key [String, nil] Your user ID for the user for whom you want to create a client session. When you authenticate with a publishable key, the `user_identifier_key` must be a high-entropy secret that only the user knows, such as a UUIDv4 or a salted hash. Do not use an email address, name, phone number, or other guessable value, because anyone who knows the `user_identifier_key` can retrieve the client session.
|
|
18
18
|
# @param user_identity_id [String, nil] ID of the [user identity](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to create a client session.
|
|
19
|
-
# @param user_identity_ids [Array<String>, nil] IDs of the [user identities](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session.
|
|
20
|
-
# @deprecated user_identity_ids: Use `user_identity_id` instead.
|
|
21
19
|
# @return [Seam::Resources::ClientSession] OK
|
|
22
|
-
def create(connect_webview_ids: nil, connected_account_ids: nil, customer_id: nil, customer_key: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil
|
|
23
|
-
res = @client.put("/client_sessions/create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, customer_id: customer_id, customer_key: customer_key, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id
|
|
20
|
+
def create(connect_webview_ids: nil, connected_account_ids: nil, customer_id: nil, customer_key: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil)
|
|
21
|
+
res = @client.put("/client_sessions/create", {connect_webview_ids: connect_webview_ids, connected_account_ids: connected_account_ids, customer_id: customer_id, customer_key: customer_key, expires_at: expires_at, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id}.compact)
|
|
24
22
|
|
|
25
|
-
Seam::Resources::ClientSession.
|
|
23
|
+
Seam::Resources::ClientSession.from_http_response(res, "client_session", "/client_sessions/create")
|
|
26
24
|
end
|
|
27
25
|
|
|
28
26
|
# Deletes a [client session](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens).
|
|
@@ -41,7 +39,7 @@ module Seam
|
|
|
41
39
|
def get(client_session_id: nil, user_identifier_key: nil)
|
|
42
40
|
res = @client.get("/client_sessions/get", {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact)
|
|
43
41
|
|
|
44
|
-
Seam::Resources::ClientSession.
|
|
42
|
+
Seam::Resources::ClientSession.from_http_response(res, "client_session", "/client_sessions/get")
|
|
45
43
|
end
|
|
46
44
|
|
|
47
45
|
# Returns a [client session](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist.
|
|
@@ -50,13 +48,11 @@ module Seam
|
|
|
50
48
|
# @param expires_at [Time, nil] Date and time at which the client session should expire in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. If the client session already exists, this will update the expiration before returning it.
|
|
51
49
|
# @param user_identifier_key [String, nil] Your user ID for the user that you want to associate with the client session (or that is already associated with the existing client session). When you authenticate with a publishable key, the `user_identifier_key` must be a high-entropy secret that only the user knows, such as a UUIDv4 or a salted hash. Do not use an email address, name, phone number, or other guessable value, because anyone who knows the `user_identifier_key` can retrieve the client session.
|
|
52
50
|
# @param user_identity_id [String, nil] ID of the [user identity](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session (or that are already associated with the existing client session).
|
|
53
|
-
# @param user_identity_ids [Array<String>, nil] IDs of the [user identities](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session.
|
|
54
|
-
# @deprecated user_identity_ids: Use `user_identity_id`.
|
|
55
51
|
# @return [Seam::Resources::ClientSession] OK
|
|
56
|
-
def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil
|
|
57
|
-
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_id: user_identity_id
|
|
52
|
+
def get_or_create(connect_webview_ids: nil, connected_account_ids: nil, expires_at: nil, user_identifier_key: nil, user_identity_id: nil)
|
|
53
|
+
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_id: user_identity_id}.compact)
|
|
58
54
|
|
|
59
|
-
Seam::Resources::ClientSession.
|
|
55
|
+
Seam::Resources::ClientSession.from_http_response(res, "client_session", "/client_sessions/get_or_create")
|
|
60
56
|
end
|
|
61
57
|
|
|
62
58
|
# Grants a [client session](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://www.seam.co/docs/core-concepts/connect-webviews), [user identities](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on.
|
|
@@ -65,15 +61,15 @@ module Seam
|
|
|
65
61
|
# @param connected_account_ids [Array<String>, nil] IDs of the [connected accounts](https://www.seam.co/docs/core-concepts/connected-accounts) that you want to associate with the client session.
|
|
66
62
|
# @param user_identifier_key [String, nil] Your user ID for the user that you want to associate with the client session.
|
|
67
63
|
# @param user_identity_id [String, nil] ID of the [user identity](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session.
|
|
68
|
-
# @param user_identity_ids [Array<String>, nil] IDs of the [user identities](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) that you want to associate with the client session.
|
|
69
|
-
# @deprecated user_identity_ids: Use `user_identity_id`.
|
|
70
64
|
# @return [nil] OK
|
|
71
|
-
def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_id: nil
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
65
|
+
def grant_access(client_session_id: nil, connect_webview_ids: nil, connected_account_ids: nil, user_identifier_key: nil, user_identity_id: nil)
|
|
66
|
+
Seam::RequestParameters.require_at_least_one(
|
|
67
|
+
"/client_sessions/grant_access",
|
|
68
|
+
{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_id: user_identity_id},
|
|
69
|
+
[:client_session_id, :connect_webview_ids, :connected_account_ids, :user_identifier_key, :user_identity_id]
|
|
70
|
+
)
|
|
75
71
|
|
|
76
|
-
@client.patch("/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_id: user_identity_id
|
|
72
|
+
@client.patch("/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_id: user_identity_id}.compact)
|
|
77
73
|
|
|
78
74
|
nil
|
|
79
75
|
end
|
|
@@ -81,14 +77,17 @@ module Seam
|
|
|
81
77
|
# Returns a list of all [client sessions](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens).
|
|
82
78
|
# @param client_session_id [String, nil] ID of the client session that you want to retrieve.
|
|
83
79
|
# @param connect_webview_id [String, Seam::Null, nil] ID of the [Connect Webview](https://www.seam.co/docs/core-concepts/connect-webviews) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a Connect Webview.
|
|
80
|
+
# @param customer_key [String, nil] Customer key for which you want to list client sessions.
|
|
81
|
+
# @param limit [Integer, nil] Maximum number of records to return per page.
|
|
82
|
+
# @param page_cursor [String, Seam::Null, nil] Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
84
83
|
# @param user_identifier_key [String, nil] Your user ID for the user by which you want to filter client sessions.
|
|
85
84
|
# @param user_identity_id [String, Seam::Null, nil] ID of the [user identity](https://www.seam.co/docs/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) for which you want to retrieve client sessions. Specify `null` to retrieve client sessions that are not associated with a user identity.
|
|
86
85
|
# @param without_user_identifier_key [Boolean, nil] Indicates whether to retrieve only client sessions without associated user identifier keys.
|
|
87
86
|
# @return [Seam::Resources::ClientSession] OK
|
|
88
|
-
def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil)
|
|
89
|
-
res = @client.get("/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)
|
|
87
|
+
def list(client_session_id: nil, connect_webview_id: nil, customer_key: nil, limit: nil, page_cursor: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil)
|
|
88
|
+
res = @client.get("/client_sessions/list", {client_session_id: client_session_id, connect_webview_id: connect_webview_id, customer_key: customer_key, limit: limit, page_cursor: page_cursor, user_identifier_key: user_identifier_key, user_identity_id: user_identity_id, without_user_identifier_key: without_user_identifier_key}.compact)
|
|
90
89
|
|
|
91
|
-
Seam::Resources::ClientSession.
|
|
90
|
+
Seam::Resources::ClientSession.list_from_http_response(res, "client_sessions", "/client_sessions/list")
|
|
92
91
|
end
|
|
93
92
|
|
|
94
93
|
# Revokes a [client session](https://www.seam.co/docs/core-concepts/authentication/client-session-tokens).
|
|
@@ -29,7 +29,7 @@ module Seam
|
|
|
29
29
|
def create(accepted_capabilities: nil, accepted_providers: nil, automatically_manage_new_devices: nil, custom_metadata: nil, custom_redirect_failure_url: nil, custom_redirect_url: nil, customer_key: nil, excluded_providers: nil, provider_category: nil, wait_for_device_creation: nil)
|
|
30
30
|
res = @client.post("/connect_webviews/create", {accepted_capabilities: accepted_capabilities, 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, customer_key: customer_key, excluded_providers: excluded_providers, provider_category: provider_category, wait_for_device_creation: wait_for_device_creation}.compact)
|
|
31
31
|
|
|
32
|
-
Seam::Resources::ConnectWebview.
|
|
32
|
+
Seam::Resources::ConnectWebview.from_http_response(res, "connect_webview", "/connect_webviews/create")
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
# Deletes a [Connect Webview](https://www.seam.co/docs/core-concepts/connect-webviews).
|
|
@@ -51,7 +51,7 @@ module Seam
|
|
|
51
51
|
def get(connect_webview_id:)
|
|
52
52
|
res = @client.get("/connect_webviews/get", {connect_webview_id: connect_webview_id}.compact)
|
|
53
53
|
|
|
54
|
-
Seam::Resources::ConnectWebview.
|
|
54
|
+
Seam::Resources::ConnectWebview.from_http_response(res, "connect_webview", "/connect_webviews/get")
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
# Returns a list of all [Connect Webviews](https://www.seam.co/docs/core-concepts/connect-webviews).
|
|
@@ -65,7 +65,7 @@ module Seam
|
|
|
65
65
|
def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil)
|
|
66
66
|
res = @client.get("/connect_webviews/list", {custom_metadata_has: custom_metadata_has, customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact)
|
|
67
67
|
|
|
68
|
-
Seam::Resources::ConnectWebview.
|
|
68
|
+
Seam::Resources::ConnectWebview.list_from_http_response(res, "connect_webviews", "/connect_webviews/list")
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
end
|
|
@@ -30,13 +30,15 @@ module Seam
|
|
|
30
30
|
# @param email [String, nil] Email address associated with the connected account that you want to get.
|
|
31
31
|
# @return [Seam::Resources::ConnectedAccount] OK
|
|
32
32
|
def get(connected_account_id: nil, email: nil)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
Seam::RequestParameters.require_at_least_one(
|
|
34
|
+
"/connected_accounts/get",
|
|
35
|
+
{connected_account_id: connected_account_id, email: email},
|
|
36
|
+
[:connected_account_id, :email]
|
|
37
|
+
)
|
|
36
38
|
|
|
37
39
|
res = @client.get("/connected_accounts/get", {connected_account_id: connected_account_id, email: email}.compact)
|
|
38
40
|
|
|
39
|
-
Seam::Resources::ConnectedAccount.
|
|
41
|
+
Seam::Resources::ConnectedAccount.from_http_response(res, "connected_account", "/connected_accounts/get")
|
|
40
42
|
end
|
|
41
43
|
|
|
42
44
|
# Returns a list of all [connected accounts](https://www.seam.co/docs/core-concepts/connected-accounts).
|
|
@@ -51,7 +53,7 @@ module Seam
|
|
|
51
53
|
def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, space_id: nil, user_identifier_key: nil)
|
|
52
54
|
res = @client.get("/connected_accounts/list", {custom_metadata_has: custom_metadata_has, customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, space_id: space_id, user_identifier_key: user_identifier_key}.compact)
|
|
53
55
|
|
|
54
|
-
Seam::Resources::ConnectedAccount.
|
|
56
|
+
Seam::Resources::ConnectedAccount.list_from_http_response(res, "connected_accounts", "/connected_accounts/list")
|
|
55
57
|
end
|
|
56
58
|
|
|
57
59
|
# Request a [connected account](https://www.seam.co/docs/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`.
|
|
@@ -12,19 +12,18 @@ module Seam
|
|
|
12
12
|
# @param customer_data [Hash, nil]
|
|
13
13
|
# @param customer_resources_filters [Array<Hash>, nil] Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata.
|
|
14
14
|
# @param customization_profile_id [String, nil] The ID of the customization profile to use for the portal.
|
|
15
|
-
# @param deep_link [Hash, nil] Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource.
|
|
16
15
|
# @param exclude_locale_picker [Boolean, nil] Whether to exclude the option to select a locale within the portal UI.
|
|
17
|
-
# @param features [Hash, nil]
|
|
16
|
+
# @param features [Hash, nil] Features to include in the portal. Settings you omit use the portal's customization profile, then the Seam default. Settings you pass take precedence over the customization profile's, so changing the profile doesn't change them.
|
|
18
17
|
# @param is_embedded [Boolean, nil] Whether the portal is embedded in another application.
|
|
19
18
|
# @param landing_page [Hash, nil] Configuration for the landing page when the portal loads.
|
|
20
19
|
# @param locale [String, nil] The locale to use for the portal.
|
|
21
20
|
# @param navigation_mode [String, nil] Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links.
|
|
22
21
|
# @param read_only [Boolean, nil] Whether the portal is read-only. When true, the customer can browse the portal but cannot perform any mutating action; write requests made with the portal's client session are rejected.
|
|
23
22
|
# @return [Seam::Resources::CustomerPortal] OK
|
|
24
|
-
def create_portal(customer_data: nil, customer_resources_filters: nil, customization_profile_id: nil,
|
|
25
|
-
res = @client.post("/customers/create_portal", {customer_data: customer_data, customer_resources_filters: customer_resources_filters, customization_profile_id: customization_profile_id,
|
|
23
|
+
def create_portal(customer_data: nil, customer_resources_filters: nil, customization_profile_id: nil, exclude_locale_picker: nil, features: nil, is_embedded: nil, landing_page: nil, locale: nil, navigation_mode: nil, read_only: nil)
|
|
24
|
+
res = @client.post("/customers/create_portal", {customer_data: customer_data, customer_resources_filters: customer_resources_filters, customization_profile_id: customization_profile_id, exclude_locale_picker: exclude_locale_picker, features: features, is_embedded: is_embedded, landing_page: landing_page, locale: locale, navigation_mode: navigation_mode, read_only: read_only}.compact)
|
|
26
25
|
|
|
27
|
-
Seam::Resources::CustomerPortal.
|
|
26
|
+
Seam::Resources::CustomerPortal.from_http_response(res, "customer_portal", "/customers/create_portal")
|
|
28
27
|
end
|
|
29
28
|
|
|
30
29
|
# Deletes customer data including resources like spaces, properties, rooms, users, etc.
|
data/lib/seam/routes/devices.rb
CHANGED
|
@@ -23,13 +23,15 @@ module Seam
|
|
|
23
23
|
# @param name [String, nil] Name of the device that you want to get.
|
|
24
24
|
# @return [Seam::Resources::Device] OK
|
|
25
25
|
def get(device_id: nil, name: nil)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
Seam::RequestParameters.require_at_least_one(
|
|
27
|
+
"/devices/get",
|
|
28
|
+
{device_id: device_id, name: name},
|
|
29
|
+
[:device_id, :name]
|
|
30
|
+
)
|
|
29
31
|
|
|
30
32
|
res = @client.get("/devices/get", {device_id: device_id, name: name}.compact)
|
|
31
33
|
|
|
32
|
-
Seam::Resources::Device.
|
|
34
|
+
Seam::Resources::Device.from_http_response(res, "device", "/devices/get")
|
|
33
35
|
end
|
|
34
36
|
|
|
35
37
|
# Returns a list of all [devices](https://www.seam.co/docs/core-concepts/devices).
|
|
@@ -47,14 +49,12 @@ module Seam
|
|
|
47
49
|
# @param page_cursor [String, Seam::Null, nil] Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
48
50
|
# @param search [String, nil] String for which to search. Filters returned devices to include all records that satisfy a partial match using `device_id` (full or partial UUID prefix, minimum 4 characters), `connected_account_id`, `display_name`, `custom_metadata` or `location.location_name`.
|
|
49
51
|
# @param space_id [String, nil] ID of the space for which you want to list devices.
|
|
50
|
-
# @param unstable_location_id [String, Seam::Null, nil]
|
|
51
|
-
# @deprecated unstable_location_id: Use `space_id`.
|
|
52
52
|
# @param user_identifier_key [String, nil] Your own internal user ID for the user for which you want to list devices.
|
|
53
53
|
# @return [Seam::Resources::Device] OK
|
|
54
|
-
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil,
|
|
55
|
-
res = @client.get("/devices/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, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id,
|
|
54
|
+
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, custom_metadata_has: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil, space_id: nil, user_identifier_key: nil)
|
|
55
|
+
res = @client.get("/devices/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, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search, space_id: space_id, user_identifier_key: user_identifier_key}.compact)
|
|
56
56
|
|
|
57
|
-
Seam::Resources::Device.
|
|
57
|
+
Seam::Resources::Device.list_from_http_response(res, "devices", "/devices/list")
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
# Returns a list of all device providers.
|
|
@@ -67,7 +67,7 @@ module Seam
|
|
|
67
67
|
def list_device_providers(provider_category: nil)
|
|
68
68
|
res = @client.get("/devices/list_device_providers", {provider_category: provider_category}.compact)
|
|
69
69
|
|
|
70
|
-
Seam::Resources::DeviceProvider.
|
|
70
|
+
Seam::Resources::DeviceProvider.list_from_http_response(res, "device_providers", "/devices/list_device_providers")
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
# Updates provider-specific metadata for devices.
|
|
@@ -17,13 +17,15 @@ module Seam
|
|
|
17
17
|
# @param name [String, nil] Name of the unmanaged device that you want to get.
|
|
18
18
|
# @return [Seam::Resources::UnmanagedDevice] OK
|
|
19
19
|
def get(device_id: nil, name: nil)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
Seam::RequestParameters.require_at_least_one(
|
|
21
|
+
"/devices/unmanaged/get",
|
|
22
|
+
{device_id: device_id, name: name},
|
|
23
|
+
[:device_id, :name]
|
|
24
|
+
)
|
|
23
25
|
|
|
24
26
|
res = @client.get("/devices/unmanaged/get", {device_id: device_id, name: name}.compact)
|
|
25
27
|
|
|
26
|
-
Seam::Resources::UnmanagedDevice.
|
|
28
|
+
Seam::Resources::UnmanagedDevice.from_http_response(res, "device", "/devices/unmanaged/get")
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
# Returns a list of all [unmanaged devices](https://www.seam.co/docs/core-concepts/devices/managed-and-unmanaged-devices).
|
|
@@ -45,7 +47,7 @@ module Seam
|
|
|
45
47
|
def list(connect_webview_id: nil, connected_account_id: nil, connected_account_ids: nil, created_before: nil, customer_key: nil, device_ids: nil, device_type: nil, device_types: nil, limit: nil, manufacturer: nil, page_cursor: nil, search: nil)
|
|
46
48
|
res = @client.get("/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, customer_key: customer_key, device_ids: device_ids, device_type: device_type, device_types: device_types, limit: limit, manufacturer: manufacturer, page_cursor: page_cursor, search: search}.compact)
|
|
47
49
|
|
|
48
|
-
Seam::Resources::UnmanagedDevice.
|
|
50
|
+
Seam::Resources::UnmanagedDevice.list_from_http_response(res, "devices", "/devices/unmanaged/list")
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
# Updates a specified [unmanaged device](https://www.seam.co/docs/core-concepts/devices/managed-and-unmanaged-devices). To convert an unmanaged device to managed, set `is_managed` to `true`.
|
data/lib/seam/routes/events.rb
CHANGED
|
@@ -8,22 +8,24 @@ module Seam
|
|
|
8
8
|
@defaults = defaults
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
# Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to retrieve an event that already took place.
|
|
11
|
+
# Returns a specified event. This endpoint returns the same event that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to retrieve an event that already took place. Events older than 90 days are not returned.
|
|
12
12
|
# @param event_id [String, nil] Unique identifier for the event that you want to get.
|
|
13
13
|
# @param device_id [String, nil] Unique identifier for the device that triggered the event that you want to get.
|
|
14
14
|
# @param event_type [String, nil] Type of the event that you want to get.
|
|
15
15
|
# @return [Seam::Resources::SeamEvent] OK
|
|
16
16
|
def get(event_id: nil, device_id: nil, event_type: nil)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
Seam::RequestParameters.require_at_least_one(
|
|
18
|
+
"/events/get",
|
|
19
|
+
{event_id: event_id, device_id: device_id, event_type: event_type},
|
|
20
|
+
[:event_id, :device_id, :event_type]
|
|
21
|
+
)
|
|
20
22
|
|
|
21
23
|
res = @client.get("/events/get", {event_id: event_id, device_id: device_id, event_type: event_type}.compact)
|
|
22
24
|
|
|
23
|
-
Seam::Resources::SeamEvent.
|
|
25
|
+
Seam::Resources::SeamEvent.from_http_response(res, "event", "/events/get")
|
|
24
26
|
end
|
|
25
27
|
|
|
26
|
-
# Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to filter or see events that already took place.
|
|
28
|
+
# Returns a list of all events. This endpoint returns the same events that would be sent to a [webhook](https://www.seam.co/docs/developer-tools/webhooks), but it enables you to filter or see events that already took place. Only events from the last 90 days are returned.
|
|
27
29
|
# @param access_code_id [String, nil] ID of the access code for which you want to list events.
|
|
28
30
|
# @param access_code_ids [Array<String>, nil] IDs of the access codes for which you want to list events.
|
|
29
31
|
# @param access_grant_id [String, nil] ID of the access grant for which you want to list events.
|
|
@@ -37,7 +39,7 @@ module Seam
|
|
|
37
39
|
# @param acs_system_id [String, nil] ID of the access system for which you want to list events.
|
|
38
40
|
# @param acs_system_ids [Array<String>, nil] IDs of the access systems for which you want to list events.
|
|
39
41
|
# @param acs_user_id [String, nil] ID of the ACS user for which you want to list events.
|
|
40
|
-
# @param between [Array<String>, nil] Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include `since` or `between`.
|
|
42
|
+
# @param between [Array<String>, nil] Lower and upper timestamps to define an exclusive interval containing the events that you want to list. You must include `since` or `between`. Only events from the last 90 days are returned, so a lower timestamp older than 90 days is treated as 90 days ago.
|
|
41
43
|
# @param connect_webview_id [String, nil] ID of the Connect Webview for which you want to list events.
|
|
42
44
|
# @param connected_account_id [String, nil] ID of the connected account for which you want to list events.
|
|
43
45
|
# @param customer_key [String, nil] Customer key for which you want to list events.
|
|
@@ -47,20 +49,22 @@ module Seam
|
|
|
47
49
|
# @param event_type [String, nil] Type of the events that you want to list.
|
|
48
50
|
# @param event_types [Array<String>, nil] Types of the events that you want to list.
|
|
49
51
|
# @param limit [Float, nil] Numerical limit on the number of events to return.
|
|
50
|
-
# @param since [String, nil] Timestamp to indicate the beginning generation time for the events that you want to list. You must include `since` or `between`.
|
|
52
|
+
# @param since [String, nil] Timestamp to indicate the beginning generation time for the events that you want to list. You must include `since` or `between`. Only events from the last 90 days are returned, so a `since` older than 90 days is treated as 90 days ago.
|
|
51
53
|
# @param space_id [String, nil] ID of the space for which you want to list events.
|
|
52
54
|
# @param space_ids [Array<String>, nil] IDs of the spaces for which you want to list events.
|
|
53
55
|
# @param unstable_offset [Float, nil] Offset for the events that you want to list.
|
|
54
56
|
# @param user_identity_id [String, nil] ID of the user identity for which you want to list events.
|
|
55
57
|
# @return [Seam::Resources::SeamEvent] OK
|
|
56
58
|
def list(access_code_id: nil, access_code_ids: nil, access_grant_id: nil, access_grant_ids: nil, access_method_id: nil, access_method_ids: nil, acs_access_group_id: nil, acs_credential_id: nil, acs_encoder_id: nil, acs_entrance_id: nil, acs_system_id: nil, acs_system_ids: nil, acs_user_id: nil, between: nil, connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_id: nil, device_ids: nil, event_ids: nil, event_type: nil, event_types: nil, limit: nil, since: nil, space_id: nil, space_ids: nil, unstable_offset: nil, user_identity_id: nil)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
Seam::RequestParameters.require_at_least_one(
|
|
60
|
+
"/events/list",
|
|
61
|
+
{access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id},
|
|
62
|
+
[:access_code_id, :access_code_ids, :access_grant_id, :access_grant_ids, :access_method_id, :access_method_ids, :acs_access_group_id, :acs_credential_id, :acs_encoder_id, :acs_entrance_id, :acs_system_id, :acs_system_ids, :acs_user_id, :between, :connect_webview_id, :connected_account_id, :customer_key, :device_id, :device_ids, :event_ids, :event_type, :event_types, :since, :space_id, :space_ids, :unstable_offset, :user_identity_id]
|
|
63
|
+
)
|
|
60
64
|
|
|
61
65
|
res = @client.get("/events/list", {access_code_id: access_code_id, access_code_ids: access_code_ids, access_grant_id: access_grant_id, access_grant_ids: access_grant_ids, access_method_id: access_method_id, access_method_ids: access_method_ids, acs_access_group_id: acs_access_group_id, acs_credential_id: acs_credential_id, acs_encoder_id: acs_encoder_id, acs_entrance_id: acs_entrance_id, acs_system_id: acs_system_id, acs_system_ids: acs_system_ids, acs_user_id: acs_user_id, between: between, connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_id: device_id, device_ids: device_ids, event_ids: event_ids, event_type: event_type, event_types: event_types, limit: limit, since: since, space_id: space_id, space_ids: space_ids, unstable_offset: unstable_offset, user_identity_id: user_identity_id}.compact)
|
|
62
66
|
|
|
63
|
-
Seam::Resources::SeamEvent.
|
|
67
|
+
Seam::Resources::SeamEvent.list_from_http_response(res, "events", "/events/list")
|
|
64
68
|
end
|
|
65
69
|
end
|
|
66
70
|
end
|
|
@@ -22,13 +22,15 @@ module Seam
|
|
|
22
22
|
# @param instant_key_url [String, nil] URL of the instant key to get.
|
|
23
23
|
# @return [Seam::Resources::InstantKey] OK
|
|
24
24
|
def get(instant_key_id: nil, instant_key_url: nil)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
Seam::RequestParameters.require_at_least_one(
|
|
26
|
+
"/instant_keys/get",
|
|
27
|
+
{instant_key_id: instant_key_id, instant_key_url: instant_key_url},
|
|
28
|
+
[:instant_key_id, :instant_key_url]
|
|
29
|
+
)
|
|
28
30
|
|
|
29
31
|
res = @client.get("/instant_keys/get", {instant_key_id: instant_key_id, instant_key_url: instant_key_url}.compact)
|
|
30
32
|
|
|
31
|
-
Seam::Resources::InstantKey.
|
|
33
|
+
Seam::Resources::InstantKey.from_http_response(res, "instant_key", "/instant_keys/get")
|
|
32
34
|
end
|
|
33
35
|
|
|
34
36
|
# Returns a list of all [instant keys](https://www.seam.co/docs/use-cases/granting-access/using-instant-keys).
|
|
@@ -37,7 +39,7 @@ module Seam
|
|
|
37
39
|
def list(user_identity_id: nil)
|
|
38
40
|
res = @client.get("/instant_keys/list", {user_identity_id: user_identity_id}.compact)
|
|
39
41
|
|
|
40
|
-
Seam::Resources::InstantKey.
|
|
42
|
+
Seam::Resources::InstantKey.list_from_http_response(res, "instant_keys", "/instant_keys/list")
|
|
41
43
|
end
|
|
42
44
|
end
|
|
43
45
|
end
|
data/lib/seam/routes/locks.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Seam
|
|
|
24
24
|
|
|
25
25
|
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
26
26
|
|
|
27
|
-
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.
|
|
27
|
+
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.from_http_response(res, "action_attempt", "/locks/configure_auto_lock"), @client, wait_for_action_attempt)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# Returns a specified [lock](https://www.seam.co/docs/low-level-apis/smart-locks).
|
|
@@ -33,13 +33,15 @@ module Seam
|
|
|
33
33
|
# @return [Seam::Resources::Device] OK
|
|
34
34
|
# @deprecated Use `/devices/get` instead.
|
|
35
35
|
def get(device_id: nil, name: nil)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
Seam::RequestParameters.require_at_least_one(
|
|
37
|
+
"/locks/get",
|
|
38
|
+
{device_id: device_id, name: name},
|
|
39
|
+
[:device_id, :name]
|
|
40
|
+
)
|
|
39
41
|
|
|
40
42
|
res = @client.get("/locks/get", {device_id: device_id, name: name}.compact)
|
|
41
43
|
|
|
42
|
-
Seam::Resources::Device.
|
|
44
|
+
Seam::Resources::Device.from_http_response(res, "device", "/locks/get")
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
# Returns a list of all [locks](https://www.seam.co/docs/low-level-apis/smart-locks).
|
|
@@ -53,7 +55,7 @@ module Seam
|
|
|
53
55
|
def list(connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_type: nil, device_types: nil, manufacturer: nil)
|
|
54
56
|
res = @client.get("/locks/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_type: device_type, device_types: device_types, manufacturer: manufacturer}.compact)
|
|
55
57
|
|
|
56
|
-
Seam::Resources::Device.
|
|
58
|
+
Seam::Resources::Device.list_from_http_response(res, "devices", "/locks/list")
|
|
57
59
|
end
|
|
58
60
|
|
|
59
61
|
# Locks a [lock](https://www.seam.co/docs/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://www.seam.co/docs/low-level-apis/smart-locks/lock-and-unlock).
|
|
@@ -64,7 +66,7 @@ module Seam
|
|
|
64
66
|
|
|
65
67
|
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
66
68
|
|
|
67
|
-
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.
|
|
69
|
+
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.from_http_response(res, "action_attempt", "/locks/lock_door"), @client, wait_for_action_attempt)
|
|
68
70
|
end
|
|
69
71
|
|
|
70
72
|
# Unlocks a [lock](https://www.seam.co/docs/low-level-apis/smart-locks). See also [Locking and Unlocking Smart Locks](https://www.seam.co/docs/low-level-apis/smart-locks/lock-and-unlock).
|
|
@@ -75,7 +77,7 @@ module Seam
|
|
|
75
77
|
|
|
76
78
|
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
77
79
|
|
|
78
|
-
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.
|
|
80
|
+
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.from_http_response(res, "action_attempt", "/locks/unlock_door"), @client, wait_for_action_attempt)
|
|
79
81
|
end
|
|
80
82
|
end
|
|
81
83
|
end
|
|
@@ -19,7 +19,7 @@ module Seam
|
|
|
19
19
|
|
|
20
20
|
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
21
21
|
|
|
22
|
-
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.
|
|
22
|
+
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.from_http_response(res, "action_attempt", "/locks/simulate/keypad_code_entry"), @client, wait_for_action_attempt)
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
# Simulates a manual lock action using a keypad. You can only perform this action for [August](https://www.seam.co/docs/device-and-system-integration-guides/august-locks) devices within [sandbox workspaces](https://www.seam.co/docs/core-concepts/workspaces#sandbox-workspaces).
|
|
@@ -30,7 +30,7 @@ module Seam
|
|
|
30
30
|
|
|
31
31
|
wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt
|
|
32
32
|
|
|
33
|
-
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.
|
|
33
|
+
Seam::ActionAttemptResolver.resolve(Seam::Resources::ActionAttempt.from_http_response(res, "action_attempt", "/locks/simulate/manual_lock_via_keypad"), @client, wait_for_action_attempt)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
end
|
data/lib/seam/routes/media.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Seam
|
|
|
15
15
|
def get(media_id:, format: nil)
|
|
16
16
|
res = @client.get("/media/get", {media_id: media_id, format: format}.compact)
|
|
17
17
|
|
|
18
|
-
Seam::Resources::Media.
|
|
18
|
+
Seam::Resources::Media.from_http_response(res, "media", "/media/get")
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
end
|
|
@@ -27,7 +27,7 @@ module Seam
|
|
|
27
27
|
def list(connect_webview_id: nil, connected_account_id: nil, customer_key: nil, device_type: nil, device_types: nil, manufacturer: nil)
|
|
28
28
|
res = @client.get("/noise_sensors/list", {connect_webview_id: connect_webview_id, connected_account_id: connected_account_id, customer_key: customer_key, device_type: device_type, device_types: device_types, manufacturer: manufacturer}.compact)
|
|
29
29
|
|
|
30
|
-
Seam::Resources::Device.
|
|
30
|
+
Seam::Resources::Device.list_from_http_response(res, "devices", "/noise_sensors/list")
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -9,6 +9,8 @@ module Seam
|
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
# Creates a new [noise threshold](https://www.seam.co/docs/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://www.seam.co/docs/capability-guides/noise-sensors). Thresholds represent the limits of noise tolerated at a property, which can be customized for each hour of the day. Each device has its own default thresholds, but you can use the Seam API to modify them.
|
|
12
|
+
#
|
|
13
|
+
# For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the request fails with a `noise_threshold_managed_by_noise_profile` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the request fails with a `noise_profile_assignment_unverified` error and nothing is changed; try again.
|
|
12
14
|
# @param device_id [String] ID of the device for which you want to create a noise threshold.
|
|
13
15
|
# @param ends_daily_at [String] Time at which the new noise threshold should become inactive daily.
|
|
14
16
|
# @param starts_daily_at [String] Time at which the new noise threshold should become active daily.
|
|
@@ -19,10 +21,12 @@ module Seam
|
|
|
19
21
|
def create(device_id:, ends_daily_at:, starts_daily_at:, name: nil, noise_threshold_decibels: nil, noise_threshold_nrs: nil)
|
|
20
22
|
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}.compact)
|
|
21
23
|
|
|
22
|
-
Seam::Resources::NoiseThreshold.
|
|
24
|
+
Seam::Resources::NoiseThreshold.from_http_response(res, "noise_threshold", "/noise_sensors/noise_thresholds/create")
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
# Deletes a [noise threshold](https://www.seam.co/docs/capability-guides/noise-sensors/configure-noise-threshold-settings) from a [noise sensor](https://www.seam.co/docs/capability-guides/noise-sensors).
|
|
28
|
+
#
|
|
29
|
+
# For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a `noise_threshold_managed_by_noise_profile` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a `noise_profile_assignment_unverified` error and nothing is changed; try again.
|
|
26
30
|
# @param device_id [String] ID of the device that contains the noise threshold that you want to delete.
|
|
27
31
|
# @param noise_threshold_id [String] ID of the noise threshold that you want to delete.
|
|
28
32
|
# @return [nil] OK
|
|
@@ -38,7 +42,7 @@ module Seam
|
|
|
38
42
|
def get(noise_threshold_id:)
|
|
39
43
|
res = @client.get("/noise_sensors/noise_thresholds/get", {noise_threshold_id: noise_threshold_id}.compact)
|
|
40
44
|
|
|
41
|
-
Seam::Resources::NoiseThreshold.
|
|
45
|
+
Seam::Resources::NoiseThreshold.from_http_response(res, "noise_threshold", "/noise_sensors/noise_thresholds/get")
|
|
42
46
|
end
|
|
43
47
|
|
|
44
48
|
# Returns a list of all [noise thresholds](https://www.seam.co/docs/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://www.seam.co/docs/capability-guides/noise-sensors).
|
|
@@ -47,10 +51,12 @@ module Seam
|
|
|
47
51
|
def list(device_id:)
|
|
48
52
|
res = @client.get("/noise_sensors/noise_thresholds/list", {device_id: device_id}.compact)
|
|
49
53
|
|
|
50
|
-
Seam::Resources::NoiseThreshold.
|
|
54
|
+
Seam::Resources::NoiseThreshold.list_from_http_response(res, "noise_thresholds", "/noise_sensors/noise_thresholds/list")
|
|
51
55
|
end
|
|
52
56
|
|
|
53
57
|
# Updates a [noise threshold](https://www.seam.co/docs/capability-guides/noise-sensors/configure-noise-threshold-settings) for a [noise sensor](https://www.seam.co/docs/capability-guides/noise-sensors).
|
|
58
|
+
#
|
|
59
|
+
# For Minut sensors, Seam does not change thresholds that Minut manages through a noise preset, which can be shared across homes. If the home of the sensor is assigned a noise preset, the action attempt ends with a `noise_threshold_managed_by_noise_profile` error; edit the noise preset in the Minut app instead. If Seam cannot check which noise preset applies to the home of the sensor, the action attempt ends with a `noise_profile_assignment_unverified` error and nothing is changed; try again.
|
|
54
60
|
# @param device_id [String] ID of the device that contains the noise threshold that you want to update.
|
|
55
61
|
# @param noise_threshold_id [String] ID of the noise threshold that you want to update.
|
|
56
62
|
# @param ends_daily_at [String, nil] Time at which the noise threshold should become inactive daily.
|
data/lib/seam/routes/phones.rb
CHANGED
|
@@ -27,7 +27,7 @@ module Seam
|
|
|
27
27
|
def get(device_id:)
|
|
28
28
|
res = @client.get("/phones/get", {device_id: device_id}.compact)
|
|
29
29
|
|
|
30
|
-
Seam::Resources::Phone.
|
|
30
|
+
Seam::Resources::Phone.from_http_response(res, "phone", "/phones/get")
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# Returns a list of all [phones](https://www.seam.co/docs/capability-guides/mobile-access/managing-phones-for-a-user-identity). To filter the list of returned phones by a specific owner user identity or credential, include the `owner_user_identity_id` or `acs_credential_id`, respectively, in the request body.
|
|
@@ -37,7 +37,7 @@ module Seam
|
|
|
37
37
|
def list(acs_credential_id: nil, owner_user_identity_id: nil)
|
|
38
38
|
res = @client.get("/phones/list", {acs_credential_id: acs_credential_id, owner_user_identity_id: owner_user_identity_id}.compact)
|
|
39
39
|
|
|
40
|
-
Seam::Resources::Phone.
|
|
40
|
+
Seam::Resources::Phone.list_from_http_response(res, "phones", "/phones/list")
|
|
41
41
|
end
|
|
42
42
|
end
|
|
43
43
|
end
|
|
@@ -17,7 +17,7 @@ module Seam
|
|
|
17
17
|
def create_sandbox_phone(user_identity_id:, assa_abloy_metadata: nil, custom_sdk_installation_id: nil, phone_metadata: nil)
|
|
18
18
|
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)
|
|
19
19
|
|
|
20
|
-
Seam::Resources::Phone.
|
|
20
|
+
Seam::Resources::Phone.from_http_response(res, "phone", "/phones/simulate/create_sandbox_phone")
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
end
|