Class: Seam::Clients::ConnectWebviews
- Inherits:
-
Object
- Object
- Seam::Clients::ConnectWebviews
- Defined in:
- lib/seam/routes/connect_webviews.rb
Instance Method Summary collapse
-
#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) ⇒ Seam::Resources::ConnectWebview
Creates a new Connect Webview.
-
#delete(connect_webview_id:) ⇒ nil
Deletes a Connect Webview.
-
#get(connect_webview_id:) ⇒ Seam::Resources::ConnectWebview
Returns a specified Connect Webview.
-
#initialize(client:, defaults:) ⇒ ConnectWebviews
constructor
A new instance of ConnectWebviews.
-
#list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) ⇒ Seam::Resources::ConnectWebview
Returns a list of all Connect Webviews.
Constructor Details
#initialize(client:, defaults:) ⇒ ConnectWebviews
Returns a new instance of ConnectWebviews.
6 7 8 9 |
# File 'lib/seam/routes/connect_webviews.rb', line 6 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#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) ⇒ Seam::Resources::ConnectWebview
Creates a new Connect Webview.
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.
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.
See also: Connect Webview Process.
29 30 31 32 33 |
# File 'lib/seam/routes/connect_webviews.rb', line 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) 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_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) Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"]) end |
#delete(connect_webview_id:) ⇒ nil
Deletes a Connect Webview.
You do not need to delete a Connect Webview once a user completes it. Instead, you can simply ignore completed Connect Webviews.
40 41 42 43 44 |
# File 'lib/seam/routes/connect_webviews.rb', line 40 def delete(connect_webview_id:) @client.post("/connect_webviews/delete", {connect_webview_id: connect_webview_id}.compact) nil end |
#get(connect_webview_id:) ⇒ Seam::Resources::ConnectWebview
Returns a specified Connect Webview.
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.
51 52 53 54 55 |
# File 'lib/seam/routes/connect_webviews.rb', line 51 def get(connect_webview_id:) res = @client.post("/connect_webviews/get", {connect_webview_id: connect_webview_id}.compact) Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webview"]) end |
#list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) ⇒ Seam::Resources::ConnectWebview
Returns a list of all Connect Webviews.
65 66 67 68 69 |
# File 'lib/seam/routes/connect_webviews.rb', line 65 def list(custom_metadata_has: nil, customer_key: nil, limit: nil, page_cursor: nil, search: nil, user_identifier_key: nil) res = @client.post("/connect_webviews/list", {custom_metadata_has: , customer_key: customer_key, limit: limit, page_cursor: page_cursor, search: search, user_identifier_key: user_identifier_key}.compact) Seam::Resources::ConnectWebview.load_from_response(res.body["connect_webviews"]) end |