seam 2.131.0 → 2.133.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 +1 -1
- data/lib/seam/http_multi_workspace.rb +2 -2
- data/lib/seam/http_single_workspace.rb +2 -2
- data/lib/seam/resources/access_code.rb +67 -0
- data/lib/seam/resources/access_grant.rb +51 -0
- data/lib/seam/resources/access_method.rb +46 -0
- data/lib/seam/resources/acs_access_group.rb +45 -0
- data/lib/seam/resources/acs_credential.rb +73 -0
- data/lib/seam/resources/acs_encoder.rb +37 -0
- data/lib/seam/resources/acs_entrance.rb +61 -0
- data/lib/seam/resources/acs_system.rb +54 -0
- data/lib/seam/resources/acs_user.rb +63 -0
- data/lib/seam/resources/action_attempt.rb +18 -0
- data/lib/seam/resources/batch.rb +134 -0
- data/lib/seam/resources/client_session.rb +44 -0
- data/lib/seam/resources/connect_webview.rb +59 -0
- data/lib/seam/resources/connected_account.rb +46 -0
- data/lib/seam/resources/customer_portal.rb +25 -0
- data/lib/seam/resources/device.rb +83 -0
- data/lib/seam/resources/device_provider.rb +56 -0
- data/lib/seam/resources/event.rb +193 -0
- data/lib/seam/{routes/resources → resources}/index.rb +3 -0
- data/lib/seam/resources/instant_key.rb +31 -0
- data/lib/seam/resources/noise_threshold.rb +23 -0
- data/lib/seam/resources/pagination.rb +15 -0
- data/lib/seam/resources/phone.rb +29 -0
- data/lib/seam/resources/space.rb +32 -0
- data/lib/seam/resources/thermostat_daily_program.rb +22 -0
- data/lib/seam/resources/thermostat_schedule.rb +34 -0
- data/lib/seam/resources/unmanaged_access_code.rb +53 -0
- data/lib/seam/resources/unmanaged_access_grant.rb +43 -0
- data/lib/seam/resources/unmanaged_access_method.rb +40 -0
- data/lib/seam/resources/unmanaged_device.rb +73 -0
- data/lib/seam/resources/unmanaged_user_identity.rb +29 -0
- data/lib/seam/resources/user_identity.rb +31 -0
- data/lib/seam/resources/webhook.rb +17 -0
- data/lib/seam/resources/workspace.rb +28 -0
- data/lib/seam/routes/access_codes.rb +227 -0
- data/lib/seam/routes/access_codes_simulate.rb +23 -0
- data/lib/seam/routes/access_codes_unmanaged.rb +76 -0
- data/lib/seam/routes/access_grants.rb +117 -0
- data/lib/seam/routes/access_grants_unmanaged.rb +50 -0
- data/lib/seam/routes/access_methods.rb +101 -0
- data/lib/seam/routes/access_methods_unmanaged.rb +33 -0
- data/lib/seam/routes/acs_access_groups.rb +82 -0
- data/lib/seam/routes/acs_credentials.rb +109 -0
- data/lib/seam/routes/{clients/acs_encoders.rb → acs_encoders.rb} +25 -0
- data/lib/seam/routes/acs_encoders_simulate.rb +55 -0
- data/lib/seam/routes/acs_entrances.rb +76 -0
- data/lib/seam/routes/acs_systems.rb +56 -0
- data/lib/seam/routes/acs_users.rb +150 -0
- data/lib/seam/routes/{clients/action_attempts.rb → action_attempts.rb} +9 -0
- data/lib/seam/routes/client_sessions.rb +102 -0
- data/lib/seam/routes/connect_webviews.rb +72 -0
- data/lib/seam/routes/connected_accounts.rb +77 -0
- data/lib/seam/routes/{clients/connected_accounts_simulate.rb → connected_accounts_simulate.rb} +3 -0
- data/lib/seam/routes/customers.rb +87 -0
- data/lib/seam/routes/devices.rb +95 -0
- data/lib/seam/routes/devices_simulate.rb +76 -0
- data/lib/seam/routes/devices_unmanaged.rb +66 -0
- data/lib/seam/routes/events.rb +59 -0
- data/lib/seam/routes/{clients/instant_keys.rb → instant_keys.rb} +10 -0
- data/lib/seam/routes/locks.rb +89 -0
- data/lib/seam/routes/{clients/locks_simulate.rb → locks_simulate.rb} +7 -0
- data/lib/seam/routes/noise_sensors.rb +45 -0
- data/lib/seam/routes/noise_sensors_noise_thresholds.rb +69 -0
- data/lib/seam/routes/noise_sensors_simulate.rb +21 -0
- data/lib/seam/routes/phones.rb +44 -0
- data/lib/seam/routes/phones_simulate.rb +24 -0
- data/lib/seam/routes/spaces.rb +145 -0
- data/lib/seam/routes/thermostats.rb +238 -0
- data/lib/seam/routes/{clients/thermostats_daily_programs.rb → thermostats_daily_programs.rb} +13 -0
- data/lib/seam/routes/thermostats_schedules.rb +70 -0
- data/lib/seam/routes/thermostats_simulate.rb +37 -0
- data/lib/seam/routes/user_identities.rb +167 -0
- data/lib/seam/routes/user_identities_unmanaged.rb +46 -0
- data/lib/seam/routes/{clients/webhooks.rb → webhooks.rb} +16 -0
- data/lib/seam/routes/workspaces.rb +77 -0
- data/lib/seam/version.rb +1 -1
- data/lib/seam/webhook.rb +1 -1
- metadata +83 -80
- data/lib/seam/routes/clients/access_codes.rb +0 -80
- data/lib/seam/routes/clients/access_codes_simulate.rb +0 -18
- data/lib/seam/routes/clients/access_codes_unmanaged.rb +0 -42
- data/lib/seam/routes/clients/access_grants.rb +0 -58
- data/lib/seam/routes/clients/access_grants_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/access_methods.rb +0 -66
- data/lib/seam/routes/clients/access_methods_unmanaged.rb +0 -24
- data/lib/seam/routes/clients/acs_access_groups.rb +0 -54
- data/lib/seam/routes/clients/acs_credentials.rb +0 -60
- data/lib/seam/routes/clients/acs_encoders_simulate.rb +0 -36
- data/lib/seam/routes/clients/acs_entrances.rb +0 -46
- data/lib/seam/routes/clients/acs_systems.rb +0 -36
- data/lib/seam/routes/clients/acs_users.rb +0 -78
- data/lib/seam/routes/clients/client_sessions.rb +0 -54
- data/lib/seam/routes/clients/connect_webviews.rb +0 -36
- data/lib/seam/routes/clients/connected_accounts.rb +0 -46
- data/lib/seam/routes/clients/customers.rb +0 -30
- data/lib/seam/routes/clients/devices.rb +0 -50
- data/lib/seam/routes/clients/devices_simulate.rb +0 -48
- data/lib/seam/routes/clients/devices_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/events.rb +0 -24
- data/lib/seam/routes/clients/locks.rb +0 -54
- data/lib/seam/routes/clients/noise_sensors.rb +0 -26
- data/lib/seam/routes/clients/noise_sensors_noise_thresholds.rb +0 -42
- data/lib/seam/routes/clients/noise_sensors_simulate.rb +0 -18
- data/lib/seam/routes/clients/phones.rb +0 -34
- data/lib/seam/routes/clients/phones_simulate.rb +0 -18
- data/lib/seam/routes/clients/spaces.rb +0 -84
- data/lib/seam/routes/clients/thermostats.rb +0 -126
- data/lib/seam/routes/clients/thermostats_schedules.rb +0 -42
- data/lib/seam/routes/clients/thermostats_simulate.rb +0 -24
- data/lib/seam/routes/clients/user_identities.rb +0 -100
- data/lib/seam/routes/clients/user_identities_unmanaged.rb +0 -30
- data/lib/seam/routes/clients/workspaces.rb +0 -46
- data/lib/seam/routes/resources/access_code.rb +0 -14
- data/lib/seam/routes/resources/access_grant.rb +0 -14
- data/lib/seam/routes/resources/access_method.rb +0 -14
- data/lib/seam/routes/resources/acs_access_group.rb +0 -14
- data/lib/seam/routes/resources/acs_credential.rb +0 -14
- data/lib/seam/routes/resources/acs_encoder.rb +0 -13
- data/lib/seam/routes/resources/acs_entrance.rb +0 -14
- data/lib/seam/routes/resources/acs_system.rb +0 -14
- data/lib/seam/routes/resources/acs_user.rb +0 -14
- data/lib/seam/routes/resources/action_attempt.rb +0 -9
- data/lib/seam/routes/resources/batch.rb +0 -9
- data/lib/seam/routes/resources/client_session.rb +0 -11
- data/lib/seam/routes/resources/connect_webview.rb +0 -11
- data/lib/seam/routes/resources/connected_account.rb +0 -14
- data/lib/seam/routes/resources/customer_portal.rb +0 -11
- data/lib/seam/routes/resources/device.rb +0 -14
- data/lib/seam/routes/resources/device_provider.rb +0 -9
- data/lib/seam/routes/resources/event.rb +0 -11
- data/lib/seam/routes/resources/instant_key.rb +0 -11
- data/lib/seam/routes/resources/noise_threshold.rb +0 -9
- data/lib/seam/routes/resources/pagination.rb +0 -9
- data/lib/seam/routes/resources/phone.rb +0 -14
- data/lib/seam/routes/resources/space.rb +0 -11
- data/lib/seam/routes/resources/thermostat_daily_program.rb +0 -11
- data/lib/seam/routes/resources/thermostat_schedule.rb +0 -13
- data/lib/seam/routes/resources/unmanaged_access_code.rb +0 -14
- data/lib/seam/routes/resources/unmanaged_device.rb +0 -14
- data/lib/seam/routes/resources/user_identity.rb +0 -14
- data/lib/seam/routes/resources/webhook.rb +0 -9
- data/lib/seam/routes/resources/workspace.rb +0 -9
- /data/lib/seam/{routes/resources → resources}/resource_error.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_errors_support.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_warning.rb +0 -0
- /data/lib/seam/{routes/resources → resources}/resource_warnings_support.rb +0 -0
- /data/lib/seam/routes/{clients/acs.rb → acs.rb} +0 -0
- /data/lib/seam/routes/{clients/index.rb → index.rb} +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
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
|
+
# Adds a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) to a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
|
|
12
|
+
# @param acs_access_group_id ID of the access group to which you want to add an access system user.
|
|
13
|
+
# @param acs_user_id ID of the access system user that you want to add to an access group.
|
|
14
|
+
# @return [nil] OK
|
|
15
|
+
def add_to_access_group(acs_access_group_id:, acs_user_id:)
|
|
16
|
+
@client.post("/acs/users/add_to_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id}.compact)
|
|
17
|
+
|
|
18
|
+
nil
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Creates a new [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
22
|
+
# @param acs_system_id ID of the access system to which you want to add the new access system user.
|
|
23
|
+
# @param full_name Full name of the new access system user.
|
|
24
|
+
# @param access_schedule `starts_at` and `ends_at` timestamps for the new access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`.
|
|
25
|
+
# @param acs_access_group_ids Array of access group IDs to indicate the access groups to which you want to add the new access system user.
|
|
26
|
+
# @param email
|
|
27
|
+
# @deprecated email: use email_address.
|
|
28
|
+
# @param email_address Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
29
|
+
# @param phone_number Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`).
|
|
30
|
+
# @param user_identity_id ID of the user identity with which you want to associate the new access system user.
|
|
31
|
+
# @return [Seam::Resources::AcsUser] OK
|
|
32
|
+
def create(acs_system_id:, full_name:, access_schedule: nil, acs_access_group_ids: nil, email: nil, email_address: nil, phone_number: nil, user_identity_id: nil)
|
|
33
|
+
res = @client.post("/acs/users/create", {acs_system_id: acs_system_id, full_name: full_name, access_schedule: access_schedule, acs_access_group_ids: acs_access_group_ids, email: email, email_address: email_address, phone_number: phone_number, user_identity_id: user_identity_id}.compact)
|
|
34
|
+
|
|
35
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Deletes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) and invalidates the access system user's [credentials](https://docs.seam.co/low-level-apis/access-systems/managing-credentials).
|
|
39
|
+
# @param acs_system_id ID of the access system that you want to delete. You must provide acs_system_id with user_identity_id.
|
|
40
|
+
# @param acs_user_id ID of the access system user that you want to delete. You must provide either acs_user_id or user_identity_id
|
|
41
|
+
# @param user_identity_id ID of the user identity that you want to delete. You must provide either acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.
|
|
42
|
+
# @return [nil] OK
|
|
43
|
+
def delete(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
|
|
44
|
+
@client.post("/acs/users/delete", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
45
|
+
|
|
46
|
+
nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
50
|
+
# @param acs_user_id ID of the access system user that you want to get. You can only provide acs_user_id or user_identity_id.
|
|
51
|
+
# @param acs_system_id ID of the access system that you want to get. You can only provide acs_user_id or user_identity_id.
|
|
52
|
+
# @param user_identity_id ID of the user identity that you want to get. You can only provide acs_user_id or user_identity_id.
|
|
53
|
+
# @return [Seam::Resources::AcsUser] OK
|
|
54
|
+
def get(acs_user_id: nil, acs_system_id: nil, user_identity_id: nil)
|
|
55
|
+
res = @client.post("/acs/users/get", {acs_user_id: acs_user_id, acs_system_id: acs_system_id, user_identity_id: user_identity_id}.compact)
|
|
56
|
+
|
|
57
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_user"])
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Returns a list of all [access system users](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
61
|
+
# @param acs_system_id ID of the `acs_system` for which you want to retrieve all access system users.
|
|
62
|
+
# @param created_before Timestamp by which to limit returned access system users. Returns users created before this timestamp.
|
|
63
|
+
# @param limit Maximum number of records to return per page.
|
|
64
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
65
|
+
# @param search String for which to search. Filters returned access system users to include all records that satisfy a partial match using `full_name`, `phone_number`, `email_address`, `acs_user_id`, `user_identity_id`, `user_identity_full_name` or `user_identity_phone_number`.
|
|
66
|
+
# @param user_identity_email_address Email address of the user identity for which you want to retrieve all access system users.
|
|
67
|
+
# @param user_identity_id ID of the user identity for which you want to retrieve all access system users.
|
|
68
|
+
# @param user_identity_phone_number Phone number of the user identity for which you want to retrieve all access system users, in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, `+15555550100`).
|
|
69
|
+
# @return [Seam::Resources::AcsUser] OK
|
|
70
|
+
def list(acs_system_id: nil, created_before: nil, limit: nil, page_cursor: nil, search: nil, user_identity_email_address: nil, user_identity_id: nil, user_identity_phone_number: nil)
|
|
71
|
+
res = @client.post("/acs/users/list", {acs_system_id: acs_system_id, created_before: created_before, limit: limit, page_cursor: page_cursor, search: search, user_identity_email_address: user_identity_email_address, user_identity_id: user_identity_id, user_identity_phone_number: user_identity_phone_number}.compact)
|
|
72
|
+
|
|
73
|
+
Seam::Resources::AcsUser.load_from_response(res.body["acs_users"])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Lists the [entrances](https://docs.seam.co/api/acs/entrances) to which a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) has access.
|
|
77
|
+
# @param acs_system_id ID of the access system for which you want to list accessible entrances. You can only provide acs_system_id with user_identity_id.
|
|
78
|
+
# @param acs_user_id ID of the access system user for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id.
|
|
79
|
+
# @param user_identity_id ID of the user identity for whom you want to list accessible entrances. You can only provide acs_user_id or user_identity_id.
|
|
80
|
+
# @return [Seam::Resources::AcsEntrance] OK
|
|
81
|
+
def list_accessible_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
|
|
82
|
+
res = @client.post("/acs/users/list_accessible_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
83
|
+
|
|
84
|
+
Seam::Resources::AcsEntrance.load_from_response(res.body["acs_entrances"])
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [access group](https://docs.seam.co/low-level-apis/access-systems/user-management/assigning-users-to-access-groups).
|
|
88
|
+
# @param acs_access_group_id ID of the access group from which you want to remove an access system user.
|
|
89
|
+
# @param acs_user_id ID of the access system user that you want to remove from an access group. You can only provide acs_user_id or user_identity_id.
|
|
90
|
+
# @param user_identity_id ID of the user identity that you want to remove from an access group. You can only provide acs_user_id or user_identity_id.
|
|
91
|
+
# @return [nil] OK
|
|
92
|
+
def remove_from_access_group(acs_access_group_id:, acs_user_id: nil, user_identity_id: nil)
|
|
93
|
+
@client.post("/acs/users/remove_from_access_group", {acs_access_group_id: acs_access_group_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
94
|
+
|
|
95
|
+
nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Revokes access to all [entrances](https://docs.seam.co/api/acs/entrances) for a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
99
|
+
# @param acs_system_id ID of the access system for which you want to revoke access. You can only provide acs_system_id with user_identity_id.
|
|
100
|
+
# @param acs_user_id ID of the access system user for whom you want to revoke access. You can only provide acs_user_id or user_identity_id.
|
|
101
|
+
# @param user_identity_id ID of the user identity for whom you want to revoke access. You can only provide acs_user_id or user_identity_id.
|
|
102
|
+
# @return [nil] OK
|
|
103
|
+
def revoke_access_to_all_entrances(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
|
|
104
|
+
@client.post("/acs/users/revoke_access_to_all_entrances", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
105
|
+
|
|
106
|
+
nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# [Suspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#suspend-an-acs-user) a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). Suspending an access system user revokes their access temporarily. To restore an access system user's access, you can [unsuspend](https://docs.seam.co/api/acs/users/unsuspend) them.
|
|
110
|
+
# @param acs_system_id ID of the access system that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
|
|
111
|
+
# @param acs_user_id ID of the access system user that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
|
|
112
|
+
# @param user_identity_id ID of the user identity that you want to suspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
|
|
113
|
+
# @return [nil] OK
|
|
114
|
+
def suspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
|
|
115
|
+
@client.post("/acs/users/suspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
116
|
+
|
|
117
|
+
nil
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
# [Unsuspends](https://docs.seam.co/low-level-apis/access-systems/user-management/suspending-and-unsuspending-users#unsuspend-an-acs-user) a specified suspended [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management). While [suspending an access system user](https://docs.seam.co/api/acs/users/suspend) revokes their access temporarily, unsuspending the access system user restores their access.
|
|
121
|
+
# @param acs_system_id ID of the access system of the user that you want to unsuspend. You can only provide acs_system_id with user_identity_id.
|
|
122
|
+
# @param acs_user_id ID of the access system user that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
|
|
123
|
+
# @param user_identity_id ID of the user identity that you want to unsuspend. You can only provide acs_user_id or the combination of acs_system_id and user_identity_id.
|
|
124
|
+
# @return [nil] OK
|
|
125
|
+
def unsuspend(acs_system_id: nil, acs_user_id: nil, user_identity_id: nil)
|
|
126
|
+
@client.post("/acs/users/unsuspend", {acs_system_id: acs_system_id, acs_user_id: acs_user_id, user_identity_id: user_identity_id}.compact)
|
|
127
|
+
|
|
128
|
+
nil
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Updates the properties of a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
132
|
+
# @param access_schedule `starts_at` and `ends_at` timestamps for the access system user's access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. If you omit `starts_at`, it defaults to the current time. `ends_at` is optional and must be a time in the future and after `starts_at`.
|
|
133
|
+
# @param acs_system_id ID of the access system that you want to update. You can only provide acs_system_id with user_identity_id.
|
|
134
|
+
# @param acs_user_id ID of the access system user that you want to update. You can only provide acs_user_id or user_identity_id.
|
|
135
|
+
# @param email
|
|
136
|
+
# @deprecated email: use email_address.
|
|
137
|
+
# @param email_address Email address of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
138
|
+
# @param full_name Full name of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management).
|
|
139
|
+
# @param hid_acs_system_id ID of the HID access control system associated with the user.
|
|
140
|
+
# @param phone_number Phone number of the [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) in E.164 format (for example, `+15555550100`).
|
|
141
|
+
# @param user_identity_id ID of the user identity that you want to update. You can only provide acs_user_id or user_identity_id. If you provide user_identity_id, you must also provide acs_system_id.
|
|
142
|
+
# @return [nil] OK
|
|
143
|
+
def update(access_schedule: nil, acs_system_id: nil, acs_user_id: nil, email: nil, email_address: nil, full_name: nil, hid_acs_system_id: nil, phone_number: nil, user_identity_id: nil)
|
|
144
|
+
@client.post("/acs/users/update", {access_schedule: access_schedule, acs_system_id: acs_system_id, acs_user_id: acs_user_id, email: email, email_address: email_address, full_name: full_name, hid_acs_system_id: hid_acs_system_id, phone_number: phone_number, user_identity_id: user_identity_id}.compact)
|
|
145
|
+
|
|
146
|
+
nil
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -10,6 +10,9 @@ module Seam
|
|
|
10
10
|
@defaults = defaults
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
+
# Returns a specified [action attempt](https://docs.seam.co/core-concepts/action-attempts).
|
|
14
|
+
# @param action_attempt_id ID of the action attempt that you want to get.
|
|
15
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
13
16
|
def get(action_attempt_id:, wait_for_action_attempt: nil)
|
|
14
17
|
res = @client.post("/action_attempts/get", {action_attempt_id: action_attempt_id}.compact)
|
|
15
18
|
|
|
@@ -18,6 +21,12 @@ module Seam
|
|
|
18
21
|
Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt)
|
|
19
22
|
end
|
|
20
23
|
|
|
24
|
+
# Returns a list of the [action attempts](https://docs.seam.co/core-concepts/action-attempts) that you specify as an array of `action_attempt_id`s.
|
|
25
|
+
# @param action_attempt_ids IDs of the action attempts that you want to retrieve.
|
|
26
|
+
# @param device_id ID of the device to filter action attempts by.
|
|
27
|
+
# @param limit Maximum number of records to return per page.
|
|
28
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
29
|
+
# @return [Seam::Resources::ActionAttempt] OK
|
|
21
30
|
def list(action_attempt_ids: nil, device_id: nil, limit: nil, page_cursor: nil)
|
|
22
31
|
res = @client.post("/action_attempts/list", {action_attempt_ids: action_attempt_ids, device_id: device_id, limit: limit, page_cursor: page_cursor}.compact)
|
|
23
32
|
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
+
# Creates a new [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens).
|
|
12
|
+
# @param connect_webview_ids IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) for which you want to create a client session.
|
|
13
|
+
# @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) for which you want to create a client session.
|
|
14
|
+
# @param customer_id Customer ID that you want to associate with the new client session.
|
|
15
|
+
# @param customer_key Customer key that you want to associate with the new client session.
|
|
16
|
+
# @param expires_at 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
|
+
# @param user_identifier_key Your user ID for the user for whom you want to create a client session.
|
|
18
|
+
# @param user_identity_id ID of the [user identity](https://docs.seam.co/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 IDs of the [user identities](https://docs.seam.co/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
|
+
# @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, user_identity_ids: nil)
|
|
23
|
+
res = @client.post("/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, user_identity_ids: user_identity_ids}.compact)
|
|
24
|
+
|
|
25
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Deletes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens).
|
|
29
|
+
# @param client_session_id ID of the client session that you want to delete.
|
|
30
|
+
# @return [nil] OK
|
|
31
|
+
def delete(client_session_id:)
|
|
32
|
+
@client.post("/client_sessions/delete", {client_session_id: client_session_id}.compact)
|
|
33
|
+
|
|
34
|
+
nil
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns a specified [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens).
|
|
38
|
+
# @param client_session_id ID of the client session that you want to get.
|
|
39
|
+
# @param user_identifier_key User identifier key associated with the client session that you want to get.
|
|
40
|
+
# @return [Seam::Resources::ClientSession] OK
|
|
41
|
+
def get(client_session_id: nil, user_identifier_key: nil)
|
|
42
|
+
res = @client.post("/client_sessions/get", {client_session_id: client_session_id, user_identifier_key: user_identifier_key}.compact)
|
|
43
|
+
|
|
44
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) with specific characteristics or creates a new client session with these characteristics if it does not yet exist.
|
|
48
|
+
# @param connect_webview_ids IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session (or that are already associated with the existing client session).
|
|
49
|
+
# @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/api/connected_accounts) that you want to associate with the client session (or that are already associated with the existing client session).
|
|
50
|
+
# @param expires_at 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
|
+
# @param user_identifier_key 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).
|
|
52
|
+
# @param user_identity_id ID of the [user identity](https://docs.seam.co/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 IDs of the [user identities](https://docs.seam.co/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
|
+
# @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, user_identity_ids: 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, user_identity_ids: user_identity_ids}.compact)
|
|
58
|
+
|
|
59
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_session"])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Grants a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens) access to one or more resources, such as [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews), [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity), and so on.
|
|
63
|
+
# @param client_session_id ID of the client session to which you want to grant access to resources.
|
|
64
|
+
# @param connect_webview_ids IDs of the [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews) that you want to associate with the client session.
|
|
65
|
+
# @param connected_account_ids IDs of the [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that you want to associate with the client session.
|
|
66
|
+
# @param user_identifier_key Your user ID for the user that you want to associate with the client session.
|
|
67
|
+
# @param user_identity_id ID of the [user identity](https://docs.seam.co/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 IDs of the [user identities](https://docs.seam.co/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
|
+
# @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, user_identity_ids: nil)
|
|
72
|
+
@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_id: user_identity_id, user_identity_ids: user_identity_ids}.compact)
|
|
73
|
+
|
|
74
|
+
nil
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Returns a list of all [client sessions](https://docs.seam.co/core-concepts/authentication/client-session-tokens).
|
|
78
|
+
# @param client_session_id ID of the client session that you want to retrieve.
|
|
79
|
+
# @param connect_webview_id ID of the [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews) for which you want to retrieve client sessions.
|
|
80
|
+
# @param user_identifier_key Your user ID for the user by which you want to filter client sessions.
|
|
81
|
+
# @param user_identity_id ID of the [user identity](https://docs.seam.co/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.
|
|
82
|
+
# @param without_user_identifier_key Indicates whether to retrieve only client sessions without associated user identifier keys.
|
|
83
|
+
# @return [Seam::Resources::ClientSession] OK
|
|
84
|
+
def list(client_session_id: nil, connect_webview_id: nil, user_identifier_key: nil, user_identity_id: nil, without_user_identifier_key: nil)
|
|
85
|
+
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)
|
|
86
|
+
|
|
87
|
+
Seam::Resources::ClientSession.load_from_response(res.body["client_sessions"])
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Revokes a [client session](https://docs.seam.co/core-concepts/authentication/client-session-tokens).
|
|
91
|
+
#
|
|
92
|
+
# Note that [deleting a client session](https://docs.seam.co/api/client_sessions/delete) is a separate action.
|
|
93
|
+
# @param client_session_id ID of the client session that you want to revoke.
|
|
94
|
+
# @return [nil] OK
|
|
95
|
+
def revoke(client_session_id:)
|
|
96
|
+
@client.post("/client_sessions/revoke", {client_session_id: client_session_id}.compact)
|
|
97
|
+
|
|
98
|
+
nil
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
# Creates a new [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews).
|
|
12
|
+
#
|
|
13
|
+
# To enable a user to connect their devices or systems to Seam, they must sign in to their device or system account. To enable a user to sign in, you create a `connect_webview`. After creating the Connect Webview, you receive a URL that you can use to display the visual component of this Connect Webview for your user. You can open an iframe or new window to display the Connect Webview.
|
|
14
|
+
#
|
|
15
|
+
# You should make a new `connect_webview` for each unique login request. Each `connect_webview` tracks the user that signed in with it. You receive an error if you reuse a Connect Webview for the same user twice or if you use the same Connect Webview for multiple users.
|
|
16
|
+
#
|
|
17
|
+
# See also: [Connect Webview Process](https://docs.seam.co/core-concepts/connect-webviews/connect-webview-process).
|
|
18
|
+
# @param accepted_capabilities List of accepted device capabilities that restrict the types of devices that can be connected through the Connect Webview. If not provided, defaults will be determined based on the accepted providers.
|
|
19
|
+
# @param accepted_providers Accepted device provider keys as an alternative to `provider_category`. Use this parameter to specify accepted providers explicitly. See [Customize the Brands to Display in Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-brands-to-display-in-your-connect-webviews). To list all provider keys, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with no filters.
|
|
20
|
+
# @param automatically_manage_new_devices Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices). See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews).
|
|
21
|
+
# @param custom_metadata Custom metadata that you want to associate with the Connect Webview. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a Connect Webview](https://docs.seam.co/core-concepts/connect-webviews/attaching-custom-data-to-the-connect-webview) enables you to store custom information, like customer details or internal IDs from your application. The custom metadata is then transferred to any [connected accounts](https://docs.seam.co/core-concepts/connected-accounts) that were connected using the Connect Webview, making it easy to find and filter these resources in your [workspace](https://docs.seam.co/core-concepts/workspaces). You can also [filter Connect Webviews by custom metadata](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata).
|
|
22
|
+
# @param custom_redirect_failure_url Alternative URL that you want to redirect the user to on an error. If you do not set this parameter, the Connect Webview falls back to the `custom_redirect_url`.
|
|
23
|
+
# @param custom_redirect_url URL that you want to redirect the user to after the provider login is complete.
|
|
24
|
+
# @param customer_key Associate the Connect Webview, the connected account, and all resources under the connected account with a customer. If the connected account already exists, it will be associated with the customer. If the connected account already exists, but is already associated with a customer, the Connect Webview will show an error.
|
|
25
|
+
# @param excluded_providers List of provider keys to exclude from the Connect Webview. These providers will not be shown when the user tries to connect an account.
|
|
26
|
+
# @param provider_category Specifies the category of providers that you want to include. To list all providers within a category, use [`/devices/list_device_providers`](https://docs.seam.co/api/devices/list_device_providers) with the desired `provider_category` filter.
|
|
27
|
+
# @param wait_for_device_creation Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview. See also: [Customize the Behavior Settings of Your Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/customizing-connect-webviews#customize-the-behavior-settings-of-your-connect-webviews).
|
|
28
|
+
# @return [Seam::Resources::ConnectWebview] OK
|
|
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
|
+
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
|
+
|
|
32
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"])
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# Deletes a [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews).
|
|
36
|
+
#
|
|
37
|
+
# You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews.
|
|
38
|
+
# @param connect_webview_id ID of the Connect Webview that you want to delete.
|
|
39
|
+
# @return [nil] OK
|
|
40
|
+
def delete(connect_webview_id:)
|
|
41
|
+
@client.post("/connect_webviews/delete", {connect_webview_id: connect_webview_id}.compact)
|
|
42
|
+
|
|
43
|
+
nil
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Returns a specified [Connect Webview](https://docs.seam.co/core-concepts/connect-webviews).
|
|
47
|
+
#
|
|
48
|
+
# Unless you're using a `custom_redirect_url`, you should poll a newly-created `connect_webview` to find out if the user has signed in or to get details about what devices they've connected.
|
|
49
|
+
# @param connect_webview_id ID of the Connect Webview that you want to get.
|
|
50
|
+
# @return [Seam::Resources::ConnectWebview] OK
|
|
51
|
+
def get(connect_webview_id:)
|
|
52
|
+
res = @client.post("/connect_webviews/get", {connect_webview_id: connect_webview_id}.compact)
|
|
53
|
+
|
|
54
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns a list of all [Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews).
|
|
58
|
+
# @param custom_metadata_has Custom metadata pairs by which you want to [filter Connect Webviews](https://docs.seam.co/core-concepts/connect-webviews/filtering-connect-webviews-by-custom-metadata). Returns Connect Webviews with `custom_metadata` that contains all of the provided key:value pairs.
|
|
59
|
+
# @param customer_key Customer key for which you want to list connect webviews.
|
|
60
|
+
# @param limit Maximum number of records to return per page.
|
|
61
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
62
|
+
# @param search String for which to search. Filters returned Connect Webviews to include all records that satisfy a partial match using `connect_webview_id`, `accepted_providers`, `custom_metadata`, or `customer_key`.
|
|
63
|
+
# @param user_identifier_key Your user ID for the user by which you want to filter Connect Webviews.
|
|
64
|
+
# @return [Seam::Resources::ConnectWebview] OK
|
|
65
|
+
def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil)
|
|
66
|
+
res = @client.post("/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
|
+
|
|
68
|
+
Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webviews"])
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,77 @@
|
|
|
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 simulate
|
|
12
|
+
@simulate ||= Seam::Clients::ConnectedAccountsSimulate.new(client: @client, defaults: @defaults)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Deletes a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts).
|
|
16
|
+
#
|
|
17
|
+
# Deleting a connected account triggers a `connected_account.deleted` event and removes the connected account and all data associated with the connected account from Seam, including devices, events, access codes, and so on. For every deleted resource, Seam sends a corresponding deleted event, but the resource is not deleted from the provider.
|
|
18
|
+
#
|
|
19
|
+
# For example, if you delete a connected account with a device that has an access code, Seam sends a `connected_account.deleted` event, a `device.deleted` event, and an `access_code.deleted` event, but Seam does not remove the access code from the device.
|
|
20
|
+
# @param connected_account_id ID of the connected account that you want to delete.
|
|
21
|
+
# @return [nil] OK
|
|
22
|
+
def delete(connected_account_id:)
|
|
23
|
+
@client.post("/connected_accounts/delete", {connected_account_id: connected_account_id}.compact)
|
|
24
|
+
|
|
25
|
+
nil
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Returns a specified [connected account](https://docs.seam.co/core-concepts/connected-accounts).
|
|
29
|
+
# @param connected_account_id ID of the connected account that you want to get.
|
|
30
|
+
# @param email Email address associated with the connected account that you want to get.
|
|
31
|
+
# @return [Seam::Resources::ConnectedAccount] OK
|
|
32
|
+
def get(connected_account_id: nil, email: nil)
|
|
33
|
+
res = @client.post("/connected_accounts/get", {connected_account_id: connected_account_id, email: email}.compact)
|
|
34
|
+
|
|
35
|
+
Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_account"])
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns a list of all [connected accounts](https://docs.seam.co/core-concepts/connected-accounts).
|
|
39
|
+
# @param custom_metadata_has Custom metadata pairs by which you want to filter connected accounts. Returns connected accounts with `custom_metadata` that contains all of the provided key:value pairs.
|
|
40
|
+
# @param customer_key Customer key by which you want to filter connected accounts.
|
|
41
|
+
# @param limit Maximum number of records to return per page.
|
|
42
|
+
# @param page_cursor Identifies the specific page of results to return, obtained from the previous page's `next_page_cursor`.
|
|
43
|
+
# @param search String for which to search. Filters returned connected accounts to include all records that satisfy a partial match using `connected_account_id`, `account_type`, `customer_key`, `custom_metadata`, `user_identifier.username`, `user_identifier.email` or `user_identifier.phone`.
|
|
44
|
+
# @param space_id ID of the space by which you want to filter connected accounts.
|
|
45
|
+
# @param user_identifier_key Your user ID for the user by which you want to filter connected accounts.
|
|
46
|
+
# @return [Seam::Resources::ConnectedAccount] OK
|
|
47
|
+
def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, space_id: nil, user_identifier_key: nil)
|
|
48
|
+
res = @client.post("/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)
|
|
49
|
+
|
|
50
|
+
Seam::Resources::ConnectedAccount.load_from_response(res.body["connected_accounts"])
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Request a [connected account](https://docs.seam.co/core-concepts/connected-accounts) sync attempt for the specified `connected_account_id`.
|
|
54
|
+
# @param connected_account_id ID of the connected account that you want to sync.
|
|
55
|
+
# @return [nil] OK
|
|
56
|
+
def sync(connected_account_id:)
|
|
57
|
+
@client.post("/connected_accounts/sync", {connected_account_id: connected_account_id}.compact)
|
|
58
|
+
|
|
59
|
+
nil
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Updates a [connected account](https://docs.seam.co/core-concepts/connected-accounts).
|
|
63
|
+
# @param connected_account_id ID of the connected account that you want to update.
|
|
64
|
+
# @param accepted_capabilities List of accepted device capabilities that restrict the types of devices that can be connected through this connected account. Valid values are `lock`, `thermostat`, `noise_sensor`, and `access_control`.
|
|
65
|
+
# @param automatically_manage_new_devices Indicates whether newly-added devices should appear as [managed devices](https://docs.seam.co/core-concepts/devices/managed-and-unmanaged-devices).
|
|
66
|
+
# @param custom_metadata Custom metadata that you want to associate with the connected account. Entirely replaces the existing custom metadata object. If a new Connect Webview contains custom metadata and is used to reconnect a connected account, the custom metadata from the Connect Webview will entirely replace the entire custom metadata object on the connected account. Supports up to 50 JSON key:value pairs. [Adding custom metadata to a connected account](https://docs.seam.co/core-concepts/connected-accounts/adding-custom-metadata-to-a-connected-account) enables you to store custom information, like customer details or internal IDs from your application. Then, you can [filter connected accounts by the desired metadata](https://docs.seam.co/core-concepts/connected-accounts/filtering-connected-accounts-by-custom-metadata).
|
|
67
|
+
# @param customer_key The customer key to associate with this connected account. If provided, the connected account and all resources under the connected account will be moved to this customer. May only be provided if the connected account is not already associated with a customer.
|
|
68
|
+
# @param display_name Human-readable name for the connected account, shown in the dashboard. For example, `Booking from Airbnb House 1`.
|
|
69
|
+
# @return [nil] OK
|
|
70
|
+
def update(connected_account_id:, accepted_capabilities: nil, automatically_manage_new_devices: nil, custom_metadata: nil, customer_key: nil, display_name: nil)
|
|
71
|
+
@client.post("/connected_accounts/update", {connected_account_id: connected_account_id, accepted_capabilities: accepted_capabilities, automatically_manage_new_devices: automatically_manage_new_devices, custom_metadata: custom_metadata, customer_key: customer_key, display_name: display_name}.compact)
|
|
72
|
+
|
|
73
|
+
nil
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
data/lib/seam/routes/{clients/connected_accounts_simulate.rb → connected_accounts_simulate.rb}
RENAMED
|
@@ -8,6 +8,9 @@ module Seam
|
|
|
8
8
|
@defaults = defaults
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
+
# Simulates a connected account becoming disconnected from Seam. Only applicable for [sandbox workspaces](https://docs.seam.co/core-concepts/workspaces#sandbox-workspaces).
|
|
12
|
+
# @param connected_account_id ID of the connected account you want to simulate as disconnected.
|
|
13
|
+
# @return [nil] OK
|
|
11
14
|
def disconnect(connected_account_id:)
|
|
12
15
|
@client.post("/connected_accounts/simulate/disconnect", {connected_account_id: connected_account_id}.compact)
|
|
13
16
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Seam
|
|
4
|
+
module Clients
|
|
5
|
+
class Customers
|
|
6
|
+
def initialize(client:, defaults:)
|
|
7
|
+
@client = client
|
|
8
|
+
@defaults = defaults
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Creates a new customer portal magic link with configurable features.
|
|
12
|
+
# @param customer_resources_filters Filter configuration for resources based on their custom_metadata. Each filter specifies a field, operation, and value to match against resource custom_metadata.
|
|
13
|
+
# @param customization_profile_id The ID of the customization profile to use for the portal.
|
|
14
|
+
# @param deep_link Deep link target resource for initial redirect. When set, the portal will navigate directly to the specified resource.
|
|
15
|
+
# @param exclude_locale_picker Whether to exclude the option to select a locale within the portal UI.
|
|
16
|
+
# @param features
|
|
17
|
+
# @param is_embedded Whether the portal is embedded in another application.
|
|
18
|
+
# @param landing_page Configuration for the landing page when the portal loads.
|
|
19
|
+
# @param locale The locale to use for the portal.
|
|
20
|
+
# @param navigation_mode Navigation mode for the portal. 'restricted' tells frontend to hide navigation UI, typically used for embedded deep links.
|
|
21
|
+
# @param read_only 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.
|
|
22
|
+
# @param customer_data
|
|
23
|
+
# @return [Seam::Resources::CustomerPortal] OK
|
|
24
|
+
def create_portal(customer_resources_filters: nil, customization_profile_id: nil, deep_link: nil, exclude_locale_picker: nil, features: nil, is_embedded: nil, landing_page: nil, locale: nil, navigation_mode: nil, read_only: nil, customer_data: nil)
|
|
25
|
+
res = @client.post("/customers/create_portal", {customer_resources_filters: customer_resources_filters, customization_profile_id: customization_profile_id, deep_link: deep_link, 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, customer_data: customer_data}.compact)
|
|
26
|
+
|
|
27
|
+
Seam::Resources::CustomerPortal.load_from_response(res.body["customer_portal"])
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Deletes customer data including resources like spaces, properties, rooms, users, etc.
|
|
31
|
+
# This will delete the partner resources and any related Seam resources (user identities, access grants, spaces).
|
|
32
|
+
# @param access_grant_keys List of access grant keys to delete.
|
|
33
|
+
# @param booking_keys List of booking keys to delete.
|
|
34
|
+
# @param building_keys List of building keys to delete.
|
|
35
|
+
# @param common_area_keys List of common area keys to delete.
|
|
36
|
+
# @param customer_keys List of customer keys to delete all data for.
|
|
37
|
+
# @param facility_keys List of facility keys to delete.
|
|
38
|
+
# @param guest_keys List of guest keys to delete.
|
|
39
|
+
# @param listing_keys List of listing keys to delete.
|
|
40
|
+
# @param property_keys List of property keys to delete.
|
|
41
|
+
# @param property_listing_keys List of property listing keys to delete.
|
|
42
|
+
# @param reservation_keys List of reservation keys to delete.
|
|
43
|
+
# @param resident_keys List of resident keys to delete.
|
|
44
|
+
# @param room_keys List of room keys to delete.
|
|
45
|
+
# @param space_keys List of space keys to delete.
|
|
46
|
+
# @param staff_member_keys List of staff member keys to delete.
|
|
47
|
+
# @param tenant_keys List of tenant keys to delete.
|
|
48
|
+
# @param unit_keys List of unit keys to delete.
|
|
49
|
+
# @param user_identity_keys List of user identity keys to delete.
|
|
50
|
+
# @param user_keys List of user keys to delete.
|
|
51
|
+
# @return [nil] OK
|
|
52
|
+
def delete_data(access_grant_keys: nil, booking_keys: nil, building_keys: nil, common_area_keys: nil, customer_keys: nil, facility_keys: nil, guest_keys: nil, listing_keys: nil, property_keys: nil, property_listing_keys: nil, reservation_keys: nil, resident_keys: nil, room_keys: nil, space_keys: nil, staff_member_keys: nil, tenant_keys: nil, unit_keys: nil, user_identity_keys: nil, user_keys: nil)
|
|
53
|
+
@client.post("/customers/delete_data", {access_grant_keys: access_grant_keys, booking_keys: booking_keys, building_keys: building_keys, common_area_keys: common_area_keys, customer_keys: customer_keys, facility_keys: facility_keys, guest_keys: guest_keys, listing_keys: listing_keys, property_keys: property_keys, property_listing_keys: property_listing_keys, reservation_keys: reservation_keys, resident_keys: resident_keys, room_keys: room_keys, space_keys: space_keys, staff_member_keys: staff_member_keys, tenant_keys: tenant_keys, unit_keys: unit_keys, user_identity_keys: user_identity_keys, user_keys: user_keys}.compact)
|
|
54
|
+
|
|
55
|
+
nil
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Pushes customer data including resources like spaces, properties, rooms, users, etc.
|
|
59
|
+
# @param customer_key Your unique identifier for the customer.
|
|
60
|
+
# @param access_grants List of access grants.
|
|
61
|
+
# @param bookings List of bookings.
|
|
62
|
+
# @param buildings List of buildings.
|
|
63
|
+
# @param common_areas List of shared common areas.
|
|
64
|
+
# @param facilities List of gym or fitness facilities.
|
|
65
|
+
# @param guests List of guests.
|
|
66
|
+
# @param listings List of property listings.
|
|
67
|
+
# @param properties List of short-term rental properties.
|
|
68
|
+
# @param property_listings List of property listings.
|
|
69
|
+
# @param reservations List of reservations.
|
|
70
|
+
# @param residents List of residents.
|
|
71
|
+
# @param rooms List of hotel or hospitality rooms.
|
|
72
|
+
# @param sites List of general sites or areas.
|
|
73
|
+
# @param spaces List of general spaces or areas.
|
|
74
|
+
# @param staff_members List of staff members.
|
|
75
|
+
# @param tenants List of tenants.
|
|
76
|
+
# @param units List of multi-family residential units.
|
|
77
|
+
# @param user_identities List of user identities.
|
|
78
|
+
# @param users List of users.
|
|
79
|
+
# @return [nil] OK
|
|
80
|
+
def push_data(customer_key:, access_grants: nil, bookings: nil, buildings: nil, common_areas: nil, facilities: nil, guests: nil, listings: nil, properties: nil, property_listings: nil, reservations: nil, residents: nil, rooms: nil, sites: nil, spaces: nil, staff_members: nil, tenants: nil, units: nil, user_identities: nil, users: nil)
|
|
81
|
+
@client.post("/customers/push_data", {customer_key: customer_key, access_grants: access_grants, bookings: bookings, buildings: buildings, common_areas: common_areas, facilities: facilities, guests: guests, listings: listings, properties: properties, property_listings: property_listings, reservations: reservations, residents: residents, rooms: rooms, sites: sites, spaces: spaces, staff_members: staff_members, tenants: tenants, units: units, user_identities: user_identities, users: users}.compact)
|
|
82
|
+
|
|
83
|
+
nil
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|