Class: Seam::Clients::Workspaces
- Inherits:
-
Object
- Object
- Seam::Clients::Workspaces
- Defined in:
- lib/seam/routes/workspaces.rb
Instance Method Summary collapse
-
#create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, organization_id: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil) ⇒ Seam::Resources::Workspace
deprecated
Deprecated.
connect_partner_name: Use
company_nameinstead. -
#get ⇒ Seam::Resources::Workspace
Returns the workspace associated with the authentication value.
-
#initialize(client:, defaults:) ⇒ Workspaces
constructor
A new instance of Workspaces.
-
#list ⇒ Seam::Resources::Workspace
Returns a list of workspaces associated with the authentication value.
-
#reset_sandbox(wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Resets the sandbox workspace associated with the authentication value.
-
#update(connect_partner_name: nil, connect_webview_customization: nil, is_publishable_key_auth_enabled: nil, is_suspended: nil, name: nil, organization_id: nil) ⇒ nil
Updates the workspace associated with the authentication value.
Constructor Details
#initialize(client:, defaults:) ⇒ Workspaces
Returns a new instance of Workspaces.
8 9 10 11 |
# File 'lib/seam/routes/workspaces.rb', line 8 def initialize(client:, defaults:) @client = client @defaults = defaults end |
Instance Method Details
#create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, organization_id: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil) ⇒ Seam::Resources::Workspace
connect_partner_name: Use company_name instead.
Creates a new workspace.
30 31 32 33 34 |
# File 'lib/seam/routes/workspaces.rb', line 30 def create(name:, company_name: nil, connect_partner_name: nil, connect_webview_customization: nil, is_sandbox: nil, organization_id: nil, webview_logo_shape: nil, webview_primary_button_color: nil, webview_primary_button_text_color: nil, webview_success_message: nil) res = @client.post("/workspaces/create", {name: name, company_name: company_name, connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_sandbox: is_sandbox, organization_id: organization_id, webview_logo_shape: webview_logo_shape, webview_primary_button_color: , webview_primary_button_text_color: , webview_success_message: }.compact) Seam::Resources::Workspace.load_from_response(res.body["workspace"]) end |
#get ⇒ Seam::Resources::Workspace
Returns the workspace associated with the authentication value.
38 39 40 41 42 |
# File 'lib/seam/routes/workspaces.rb', line 38 def get res = @client.post("/workspaces/get") Seam::Resources::Workspace.load_from_response(res.body["workspace"]) end |
#list ⇒ Seam::Resources::Workspace
Returns a list of workspaces associated with the authentication value.
46 47 48 49 50 |
# File 'lib/seam/routes/workspaces.rb', line 46 def list res = @client.post("/workspaces/list") Seam::Resources::Workspace.load_from_response(res.body["workspaces"]) end |
#reset_sandbox(wait_for_action_attempt: nil) ⇒ Seam::Resources::ActionAttempt
Resets the sandbox workspace associated with the authentication value. Note that this endpoint is only available for sandbox workspaces.
54 55 56 57 58 59 60 |
# File 'lib/seam/routes/workspaces.rb', line 54 def reset_sandbox(wait_for_action_attempt: nil) res = @client.post("/workspaces/reset_sandbox") wait_for_action_attempt = wait_for_action_attempt.nil? ? @defaults.wait_for_action_attempt : wait_for_action_attempt Helpers::ActionAttempt.decide_and_wait(Seam::Resources::ActionAttempt.load_from_response(res.body["action_attempt"]), @client, wait_for_action_attempt) end |
#update(connect_partner_name: nil, connect_webview_customization: nil, is_publishable_key_auth_enabled: nil, is_suspended: nil, name: nil, organization_id: nil) ⇒ nil
Updates the workspace associated with the authentication value.
70 71 72 73 74 |
# File 'lib/seam/routes/workspaces.rb', line 70 def update(connect_partner_name: nil, connect_webview_customization: nil, is_publishable_key_auth_enabled: nil, is_suspended: nil, name: nil, organization_id: nil) @client.post("/workspaces/update", {connect_partner_name: connect_partner_name, connect_webview_customization: connect_webview_customization, is_publishable_key_auth_enabled: is_publishable_key_auth_enabled, is_suspended: is_suspended, name: name, organization_id: organization_id}.compact) nil end |