Class: Seam::Resources::ConnectWebview
- Inherits:
-
BaseResource
- Object
- BaseResource
- Seam::Resources::ConnectWebview
- Defined in:
- lib/seam/resources/connect_webview.rb
Overview
Represents a Connect Webview.
Connect Webviews are fully-embedded client-side components that you add to your app. Your users interact with your embedded Connect Webviews to link their IoT device or system accounts to Seam. That is, Connect Webviews walk your users through the process of logging in to their device or system accounts. Seam handles all the authentication steps, and—once your user has completed the authorization through your app—you can access and control their devices or systems using the Seam API.
Connect Webviews perform credential validation, multifactor authentication (when applicable), and error handling for each brand that Seam supports. Further, Connect Webviews work across all modern browsers and platforms, including Chrome, Safari, and Firefox.
To enable a user to connect their device or system account to Seam through your app, first create a connect_webview. Once created, this connect_webview includes a URL that you can use to open an iframe or new window containing the Connect Webview for your user.
When you create a Connect Webview, specify the desired provider category key in the provider_category parameter. Alternately, to specify a list of providers explicitly, use the accepted_providers parameter with a list of device provider keys.
To list all providers within a category, use /devices/list_device_providers with the desired provider_category filter. To list all provider keys, use /devices/list_device_providers with no filters.
Instance Attribute Summary collapse
-
#accepted_capabilities ⇒ Array<String>
High-level device capabilities that the Connect Webview can accept.
-
#accepted_providers ⇒ Array<String>
List of accepted provider keys.
-
#any_provider_allowed ⇒ Boolean
Indicates whether any provider is allowed.
-
#automatically_manage_new_devices ⇒ Boolean
Indicates whether Seam should import all new devices for the connected account to make these devices available for use and management by the Seam API.
-
#connect_webview_id ⇒ String
ID of the Connect Webview.
-
#connected_account_id ⇒ String?
ID of the connected account associated with the Connect Webview.
-
#custom_metadata ⇒ Hash
Set of key:value pairs.
-
#custom_redirect_failure_url ⇒ String?
URL to which the Connect Webview should redirect when an unexpected error occurs.
-
#custom_redirect_url ⇒ String?
URL to which the Connect Webview should redirect when the user successfully pairs a device or system.
-
#customer_key ⇒ String?
The customer key associated with this webview, if any.
-
#device_selection_mode ⇒ String
Device selection mode of the Connect Webview.
-
#login_successful ⇒ Boolean
Indicates whether the user logged in successfully using the Connect Webview.
-
#selected_provider ⇒ String?
Selected provider of the Connect Webview, one of the provider keys.
-
#status ⇒ String
Status of the Connect Webview.
-
#url ⇒ String
URL for the Connect Webview.
-
#wait_for_device_creation ⇒ Boolean
Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview.
-
#workspace_id ⇒ String
ID of the workspace that contains the Connect Webview.
Attributes inherited from BaseResource
Instance Method Summary collapse
-
#authorized_at ⇒ Time?
Date and time at which the user authorized (through the Connect Webview) the management of their devices.
-
#created_at ⇒ Time
Date and time at which the Connect Webview was created.
Methods inherited from BaseResource
#[], date_accessor, #initialize, #inspect, load_from_response, resource_accessor, resource_accessors, resource_list_accessor, resource_list_accessors, #update_from_response
Constructor Details
This class inherits a constructor from Seam::Resources::BaseResource
Instance Attribute Details
#accepted_capabilities ⇒ Array<String>
High-level device capabilities that the Connect Webview can accept. When creating a Connect Webview, you can specify the types of devices that it can connect to Seam. If you do not set custom accepted_capabilities, Seam uses a default set of accepted_capabilities for each provider. For example, if you create a Connect Webview that accepts SmartThing devices, without specifying accepted_capabilities, Seam accepts only SmartThings locks. To connect SmartThings thermostats and locks to Seam, create a Connect Webview and include both thermostat and lock in the accepted_capabilities.
19 20 21 |
# File 'lib/seam/resources/connect_webview.rb', line 19 def accepted_capabilities @accepted_capabilities end |
#accepted_providers ⇒ Array<String>
List of accepted provider keys.
22 23 24 |
# File 'lib/seam/resources/connect_webview.rb', line 22 def accepted_providers @accepted_providers end |
#any_provider_allowed ⇒ Boolean
Indicates whether any provider is allowed.
25 26 27 |
# File 'lib/seam/resources/connect_webview.rb', line 25 def any_provider_allowed @any_provider_allowed end |
#automatically_manage_new_devices ⇒ Boolean
Indicates whether Seam should import all new devices for the connected account to make these devices available for use and management by the Seam API.
28 29 30 |
# File 'lib/seam/resources/connect_webview.rb', line 28 def automatically_manage_new_devices @automatically_manage_new_devices end |
#connect_webview_id ⇒ String
ID of the Connect Webview.
31 32 33 |
# File 'lib/seam/resources/connect_webview.rb', line 31 def connect_webview_id @connect_webview_id end |
#connected_account_id ⇒ String?
ID of the connected account associated with the Connect Webview.
34 35 36 |
# File 'lib/seam/resources/connect_webview.rb', line 34 def connected_account_id @connected_account_id end |
#custom_metadata ⇒ Hash
Set of key:value pairs. Adding custom metadata to a resource, such as a Connect Webview, connected account, or device, enables you to store custom information, like customer details or internal IDs from your application.
37 38 39 |
# File 'lib/seam/resources/connect_webview.rb', line 37 def @custom_metadata end |
#custom_redirect_failure_url ⇒ String?
URL to which the Connect Webview should redirect when an unexpected error occurs.
40 41 42 |
# File 'lib/seam/resources/connect_webview.rb', line 40 def custom_redirect_failure_url @custom_redirect_failure_url end |
#custom_redirect_url ⇒ String?
URL to which the Connect Webview should redirect when the user successfully pairs a device or system. If you do not set the custom_redirect_failure_url, the Connect Webview redirects to the custom_redirect_url when an unexpected error occurs.
43 44 45 |
# File 'lib/seam/resources/connect_webview.rb', line 43 def custom_redirect_url @custom_redirect_url end |
#customer_key ⇒ String?
The customer key associated with this webview, if any.
46 47 48 |
# File 'lib/seam/resources/connect_webview.rb', line 46 def customer_key @customer_key end |
#device_selection_mode ⇒ String
Device selection mode of the Connect Webview. Supported values: none, single, multiple.
49 50 51 |
# File 'lib/seam/resources/connect_webview.rb', line 49 def device_selection_mode @device_selection_mode end |
#login_successful ⇒ Boolean
Indicates whether the user logged in successfully using the Connect Webview.
52 53 54 |
# File 'lib/seam/resources/connect_webview.rb', line 52 def login_successful @login_successful end |
#selected_provider ⇒ String?
Selected provider of the Connect Webview, one of the provider keys.
55 56 57 |
# File 'lib/seam/resources/connect_webview.rb', line 55 def selected_provider @selected_provider end |
#status ⇒ String
Status of the Connect Webview. authorized indicates that the user has successfully logged into their device or system account, thereby completing the Connect Webview.
58 59 60 |
# File 'lib/seam/resources/connect_webview.rb', line 58 def status @status end |
#url ⇒ String
URL for the Connect Webview. You use the URL to display the Connect Webview flow to your user.
61 62 63 |
# File 'lib/seam/resources/connect_webview.rb', line 61 def url @url end |
#wait_for_device_creation ⇒ Boolean
Indicates whether Seam should finish syncing all devices in a newly-connected account before completing the associated Connect Webview.
64 65 66 |
# File 'lib/seam/resources/connect_webview.rb', line 64 def wait_for_device_creation @wait_for_device_creation end |
#workspace_id ⇒ String
ID of the workspace that contains the Connect Webview.
67 68 69 |
# File 'lib/seam/resources/connect_webview.rb', line 67 def workspace_id @workspace_id end |
Instance Method Details
#authorized_at ⇒ Time?
Date and time at which the user authorized (through the Connect Webview) the management of their devices.
71 |
# File 'lib/seam/resources/connect_webview.rb', line 71 date_accessor :authorized_at |
#created_at ⇒ Time
Date and time at which the Connect Webview was created.
75 |
# File 'lib/seam/resources/connect_webview.rb', line 75 date_accessor :created_at |