Class: EmbedWorkflow::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/embed_workflow.rb

Overview

Convenience client for the EmbedWorkflow API.

Examples:

client = EmbedWorkflow::Client.new("sk-live-your-api-key")
workflows = client.workflows.list_workflows
users = client.users.list_users

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, base_url: 'https://embedworkflow.com') ⇒ Client

Create a new EmbedWorkflow client.

Parameters:

  • api_key (String)

    Your EmbedWorkflow API key

  • base_url (String) (defaults to: 'https://embedworkflow.com')

    Optional custom base URL (defaults to embedworkflow.com)



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/embed_workflow.rb', line 235

def initialize(api_key, base_url: 'https://embedworkflow.com')
  config = EmbedWorkflow::Configuration.default.clone
  config.access_token = api_key
  config.host = base_url.sub(%r{^https://}, '')
  api_client = EmbedWorkflow::ApiClient.new(config)

  @accounts = EmbedWorkflow::AccountsApi.new(api_client)
  @action_types = EmbedWorkflow::ActionTypesApi.new(api_client)
  @actions = EmbedWorkflow::ActionsApi.new(api_client)
  @app_connections = EmbedWorkflow::AppConnectionsApi.new(api_client)
  @available_apps = EmbedWorkflow::AvailableAppsApi.new(api_client)
  @data_fields = EmbedWorkflow::DataFieldsApi.new(api_client)
  @events = EmbedWorkflow::EventsApi.new(api_client)
  @executions = EmbedWorkflow::ExecutionsApi.new(api_client)
  @installed_apps = EmbedWorkflow::InstalledAppsApi.new(api_client)
  @payments = EmbedWorkflow::PaymentsApi.new(api_client)
  @triggers = EmbedWorkflow::TriggersApi.new(api_client)
  @users = EmbedWorkflow::UsersApi.new(api_client)
  @workflows = EmbedWorkflow::WorkflowsApi.new(api_client)
end

Instance Attribute Details

#accountsEmbedWorkflow::AccountsApi (readonly)



205
206
207
# File 'lib/embed_workflow.rb', line 205

def accounts
  @accounts
end

#action_typesEmbedWorkflow::ActionTypesApi (readonly)



207
208
209
# File 'lib/embed_workflow.rb', line 207

def action_types
  @action_types
end

#actionsEmbedWorkflow::ActionsApi (readonly)



209
210
211
# File 'lib/embed_workflow.rb', line 209

def actions
  @actions
end

#app_connectionsEmbedWorkflow::AppConnectionsApi (readonly)



211
212
213
# File 'lib/embed_workflow.rb', line 211

def app_connections
  @app_connections
end

#available_appsEmbedWorkflow::AvailableAppsApi (readonly)



213
214
215
# File 'lib/embed_workflow.rb', line 213

def available_apps
  @available_apps
end

#data_fieldsEmbedWorkflow::DataFieldsApi (readonly)



215
216
217
# File 'lib/embed_workflow.rb', line 215

def data_fields
  @data_fields
end

#eventsEmbedWorkflow::EventsApi (readonly)



217
218
219
# File 'lib/embed_workflow.rb', line 217

def events
  @events
end

#executionsEmbedWorkflow::ExecutionsApi (readonly)



219
220
221
# File 'lib/embed_workflow.rb', line 219

def executions
  @executions
end

#installed_appsEmbedWorkflow::InstalledAppsApi (readonly)



221
222
223
# File 'lib/embed_workflow.rb', line 221

def installed_apps
  @installed_apps
end

#paymentsEmbedWorkflow::PaymentsApi (readonly)



223
224
225
# File 'lib/embed_workflow.rb', line 223

def payments
  @payments
end

#triggersEmbedWorkflow::TriggersApi (readonly)



225
226
227
# File 'lib/embed_workflow.rb', line 225

def triggers
  @triggers
end

#usersEmbedWorkflow::UsersApi (readonly)



227
228
229
# File 'lib/embed_workflow.rb', line 227

def users
  @users
end

#workflowsEmbedWorkflow::WorkflowsApi (readonly)



229
230
231
# File 'lib/embed_workflow.rb', line 229

def workflows
  @workflows
end