Class: EmbedWorkflow::AccountsApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AccountsApi

Returns a new instance of AccountsApi.



19
20
21
# File 'lib/embed_workflow/api/accounts_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/embed_workflow/api/accounts_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#export_configuration(**opts) ⇒ ExportConfiguration200Response

Export configuration

Parameters:

  • opts (Hash)

    the optional parameters

Options Hash (**opts):

  • :schema_format (String) — default: default to 'yaml'
  • :sections (Array<String>)

Returns:



27
28
29
30
# File 'lib/embed_workflow/api/accounts_api.rb', line 27

def export_configuration(**opts)
  data, _status_code, _headers = export_configuration_with_http_info(opts)
  data
end

#export_configuration_with_http_info(opts = {}) ⇒ Array<(ExportConfiguration200Response, Integer, Hash)>

Export configuration

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :schema_format (String) — default: default to 'yaml'
  • :sections (Array<String>)

Returns:



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/embed_workflow/api/accounts_api.rb', line 37

def export_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.export_configuration ...'
  end
  allowable_values = ["yaml", "json"]
  if @api_client.config.client_side_validation && opts[:'schema_format'] && !allowable_values.include?(opts[:'schema_format'])
    fail ArgumentError, "invalid value for \"schema_format\", must be one of #{allowable_values}"
  end
  allowable_values = ["action_types", "triggers", "workflows", "apps", "user_data_schema", "account_data_schema"]
  if @api_client.config.client_side_validation && opts[:'sections'] && !opts[:'sections'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"sections\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/v1/configurations/export'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'schema_format'] = opts[:'schema_format'] if !opts[:'schema_format'].nil?
  query_params[:'sections'] = @api_client.build_collection_param(opts[:'sections'], :multi) if !opts[:'sections'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ExportConfiguration200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer']

  new_options = opts.merge(
    :operation => :"AccountsApi.export_configuration",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#export_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#import_configuration(**opts) ⇒ ImportConfiguration201Response

Import configuration

Parameters:

  • opts (Hash)

    the optional parameters

  • **extra (Hash)

    Additional properties to include in the request body

Options Hash (**opts):

Returns:



97
98
99
100
101
102
103
104
105
# File 'lib/embed_workflow/api/accounts_api.rb', line 97

def import_configuration(**opts)
  opts[:'import_configuration_request'] = {
    schema: opts.delete(:schema),
    schema_format: opts.delete(:schema_format),
    **opts.reject { |k, _| k.to_s.start_with?('debug_') }
  }
  data, _status_code, _headers = import_configuration_with_http_info(opts)
  data
end

#import_configuration_with_http_info(opts = {}) ⇒ Array<(ImportConfiguration201Response, Integer, Hash)>

Import configuration

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/embed_workflow/api/accounts_api.rb', line 111

def import_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.import_configuration ...'
  end
  # resource path
  local_var_path = '/api/v1/configurations/import'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'import_configuration_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'ImportConfiguration201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer']

  new_options = opts.merge(
    :operation => :"AccountsApi.import_configuration",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#import_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_account(**opts) ⇒ RetrieveAccount200Response

Retrieve account

Parameters:

  • opts (Hash)

    the optional parameters

Returns:



163
164
165
166
# File 'lib/embed_workflow/api/accounts_api.rb', line 163

def (**opts)
  data, _status_code, _headers = (opts)
  data
end

#retrieve_account_usage(**opts) ⇒ RetrieveAccountUsage200Response

Retrieve account usage

Parameters:

  • opts (Hash)

    the optional parameters

Options Hash (**opts):

  • :start_time (Time)
  • :end_time (Time)
  • :user_key (String)

    User key to filter usage for a specific user

Returns:



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

def (**opts)
  data, _status_code, _headers = (opts)
  data
end

#retrieve_account_usage_with_http_info(opts = {}) ⇒ Array<(RetrieveAccountUsage200Response, Integer, Hash)>

Retrieve account usage

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :start_time (Time)
  • :end_time (Time)
  • :user_key (String)

    User key to filter usage for a specific user

Returns:



232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
# File 'lib/embed_workflow/api/accounts_api.rb', line 232

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.retrieve_account_usage ...'
  end
  # resource path
  local_var_path = '/api/v1/account/usage'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'start_time'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'user_key'] = opts[:'user_key'] if !opts[:'user_key'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RetrieveAccountUsage200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer']

  new_options = opts.merge(
    :operation => :"AccountsApi.retrieve_account_usage",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#retrieve_account_usage\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_account_with_http_info(opts = {}) ⇒ Array<(RetrieveAccount200Response, Integer, Hash)>

Retrieve account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(RetrieveAccount200Response, Integer, Hash)>)

    RetrieveAccount200Response data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/embed_workflow/api/accounts_api.rb', line 171

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.retrieve_account ...'
  end
  # resource path
  local_var_path = '/api/v1/account'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RetrieveAccount200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer']

  new_options = opts.merge(
    :operation => :"AccountsApi.retrieve_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#retrieve_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_account(**opts) ⇒ RetrieveAccount200Response

Update account

Parameters:

  • opts (Hash)

    the optional parameters

Options Hash (**opts):

  • :company_name (String)

    Company name associated with the account

  • :user_name (String)

    User name for the account

  • :theme (String)

    Theme setting for the account

  • :time_zone (String)

    Time zone setting for the account

  • :custom_domain (String)

    Custom domain for the account

  • :groups (Array<String>)

    User permission groups. Only available to users with admin role.

  • :action_type_categories_enabled (Boolean)

    Enable or disable action type categories display

  • :action_type_categories (Array<UpdateAccountRequestActionTypeCategoriesInner>)

    Action type categories for the account.

  • :data (Hash<String, Object>)

    Additional account data

  • :user_data_schema (Array<UpdateAccountRequestUserDataSchemaInner>)

    Data schema configuration

  • :data_schema (Array<UpdateAccountRequestUserDataSchemaInner>)

    Data schema configuration

Returns:



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
# File 'lib/embed_workflow/api/accounts_api.rb', line 293

def (**opts)
  opts[:'update_account_request'] = UpdateAccountRequest.new(
    company_name: opts.delete(:company_name),
    user_name: opts.delete(:user_name),
    theme: opts.delete(:theme),
    time_zone: opts.delete(:time_zone),
    custom_domain: opts.delete(:custom_domain),
    groups: opts.delete(:groups),
    action_type_categories_enabled: opts.delete(:action_type_categories_enabled),
    action_type_categories: opts.delete(:action_type_categories),
    data: opts.delete(:data),
    user_data_schema: opts.delete(:user_data_schema),
    data_schema: opts.delete(:data_schema),
  )
  data, _status_code, _headers = (opts)
  data
end

#update_account_with_http_info(opts = {}) ⇒ Array<(RetrieveAccount200Response, Integer, Hash)>

Update account

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(RetrieveAccount200Response, Integer, Hash)>)

    RetrieveAccount200Response data, response status code and response headers



315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/embed_workflow/api/accounts_api.rb', line 315

def (opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AccountsApi.update_account ...'
  end
  # resource path
  local_var_path = '/api/v1/account'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_account_request'])

  # return_type
  return_type = opts[:debug_return_type] || 'RetrieveAccount200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['bearer']

  new_options = opts.merge(
    :operation => :"AccountsApi.update_account",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AccountsApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end