Class: EmbedWorkflow::ActionTypesApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ActionTypesApi

Returns a new instance of ActionTypesApi.



19
20
21
# File 'lib/embed_workflow/api/action_types_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/action_types_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_action_type(name:, type:, **opts) ⇒ ListActionTypes200ResponseCollectionInner

Create action type

Parameters:

  • opts (Hash)

    the optional parameters

  • name (String)

    Name of resource

  • type (String)

    Type of action

Options Hash (**opts):

  • :description (String)

    Description of action type

  • :on (Boolean)

    Enable or disable the resource.

  • :params_draft (String)

    HTTP parameters as key:value pairs, one per line

  • :headers_draft (String)

    HTTP headers as key:value pairs, one per line

  • :url_draft (String)

    HTTP url

  • :http_method_draft (String)

    HTTP method

  • :code_draft (String)

    JavaScript code snippt

  • :publish (Boolean)

    Whether or not you want to publish on create

  • :form_draft (Array<CreateActionTypeRequestFormDraftInner>)

    Form field configuration

  • :response_data_schema_draft (Array<UpdateAccountRequestUserDataSchemaInner>)

    Data schema configuration

  • :groups (Array<String>)

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

  • :icon_draft (CreateActionTypeRequestIconDraft)
  • :primary_category (String)

    Primary category for the action type

  • :secondary_category (String)

    Secondary category for the action type

Returns:



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/embed_workflow/api/action_types_api.rb', line 41

def create_action_type(name:, type:, **opts)
  opts[:'create_action_type_request'] = CreateActionTypeRequest.new(
    name: name,
    description: opts.delete(:description),
    type: type,
    on: opts.delete(:on),
    params_draft: opts.delete(:params_draft),
    headers_draft: opts.delete(:headers_draft),
    url_draft: opts.delete(:url_draft),
    http_method_draft: opts.delete(:http_method_draft),
    code_draft: opts.delete(:code_draft),
    publish: opts.delete(:publish),
    form_draft: opts.delete(:form_draft),
    response_data_schema_draft: opts.delete(:response_data_schema_draft),
    groups: opts.delete(:groups),
    icon_draft: opts.delete(:icon_draft),
    primary_category: opts.delete(:primary_category),
    secondary_category: opts.delete(:secondary_category),
  )
  data, _status_code, _headers = create_action_type_with_http_info(opts)
  data
end

#create_action_type_with_http_info(opts = {}) ⇒ Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>

Create action type

Parameters:

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

    the optional parameters

Options Hash (opts):

Returns:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/embed_workflow/api/action_types_api.rb', line 68

def create_action_type_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.create_action_type ...'
  end
  # resource path
  local_var_path = '/api/v1/action_types'

  # 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[:'create_action_type_request'])

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

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.create_action_type",
    :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: ActionTypesApi#create_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_action_type(id:, **opts) ⇒ DeleteActionType200Response

Delete action type

Parameters:

  • id (String)

    System-generated unique identifier

  • opts (Hash)

    the optional parameters

Returns:



121
122
123
124
# File 'lib/embed_workflow/api/action_types_api.rb', line 121

def delete_action_type(id:, **opts)
  data, _status_code, _headers = delete_action_type_with_http_info(id, opts)
  data
end

#delete_action_type_with_http_info(id, opts = {}) ⇒ Array<(DeleteActionType200Response, Integer, Hash)>

Delete action type

Parameters:

  • id (String)

    System-generated unique identifier

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

    the optional parameters

Returns:

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

    DeleteActionType200Response data, response status code and response headers



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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/embed_workflow/api/action_types_api.rb', line 130

def delete_action_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.delete_action_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.delete_action_type"
  end
  # resource path
  local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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] || 'DeleteActionType200Response'

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.delete_action_type",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ActionTypesApi#delete_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#discard_action_type_draft(id:, **opts) ⇒ ListActionTypes200ResponseCollectionInner

Discard action type draft

Parameters:

  • id (String)

    System-generated unique identifier

  • opts (Hash)

    the optional parameters

Returns:



182
183
184
185
# File 'lib/embed_workflow/api/action_types_api.rb', line 182

def discard_action_type_draft(id:, **opts)
  data, _status_code, _headers = discard_action_type_draft_with_http_info(id, opts)
  data
end

#discard_action_type_draft_with_http_info(id, opts = {}) ⇒ Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>

Discard action type draft

Parameters:

  • id (String)

    System-generated unique identifier

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

    the optional parameters

Returns:



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
# File 'lib/embed_workflow/api/action_types_api.rb', line 191

def discard_action_type_draft_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.discard_action_type_draft ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.discard_action_type_draft"
  end
  # resource path
  local_var_path = '/api/v1/action_types/{id}/discard_draft'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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] || 'ListActionTypes200ResponseCollectionInner'

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.discard_action_type_draft",
    :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: ActionTypesApi#discard_action_type_draft\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_action_types(**opts) ⇒ ListActionTypes200Response

List action types

Parameters:

  • opts (Hash)

    the optional parameters

Options Hash (**opts):

  • :starting_after (String)

    Cursor for pagination - return results after this ID

  • :ending_before (String)

    Cursor for pagination - return results before this ID

  • :limit (Integer)

    Number of items to return (max 100)

  • :category (String)

    Filter by category (matches primary or secondary)

Returns:



246
247
248
249
# File 'lib/embed_workflow/api/action_types_api.rb', line 246

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

#list_action_types_with_http_info(opts = {}) ⇒ Array<(ListActionTypes200Response, Integer, Hash)>

List action types

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :starting_after (String)

    Cursor for pagination - return results after this ID

  • :ending_before (String)

    Cursor for pagination - return results before this ID

  • :limit (Integer)

    Number of items to return (max 100)

  • :category (String)

    Filter by category (matches primary or secondary)

Returns:

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

    ListActionTypes200Response data, response status code and response headers



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/embed_workflow/api/action_types_api.rb', line 258

def list_action_types_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.list_action_types ...'
  end
  # resource path
  local_var_path = '/api/v1/action_types'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil?
  query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'category'] = opts[:'category'] if !opts[:'category'].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] || 'ListActionTypes200Response'

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.list_action_types",
    :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: ActionTypesApi#list_action_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#publish_action_type(id:, **opts) ⇒ ListActionTypes200ResponseCollectionInner

Publish action type

Parameters:

  • id (String)

    System-generated unique identifier

  • opts (Hash)

    the optional parameters

Returns:



310
311
312
313
# File 'lib/embed_workflow/api/action_types_api.rb', line 310

def publish_action_type(id:, **opts)
  data, _status_code, _headers = publish_action_type_with_http_info(id, opts)
  data
end

#publish_action_type_with_http_info(id, opts = {}) ⇒ Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>

Publish action type

Parameters:

  • id (String)

    System-generated unique identifier

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

    the optional parameters

Returns:



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
363
364
365
# File 'lib/embed_workflow/api/action_types_api.rb', line 319

def publish_action_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.publish_action_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.publish_action_type"
  end
  # resource path
  local_var_path = '/api/v1/action_types/{id}/publish'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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] || 'ListActionTypes200ResponseCollectionInner'

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.publish_action_type",
    :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: ActionTypesApi#publish_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#retrieve_action_type(id:, **opts) ⇒ ListActionTypes200ResponseCollectionInner

Retrieve action type

Parameters:

  • id (String)

    System-generated unique identifier

  • opts (Hash)

    the optional parameters

Returns:



371
372
373
374
# File 'lib/embed_workflow/api/action_types_api.rb', line 371

def retrieve_action_type(id:, **opts)
  data, _status_code, _headers = retrieve_action_type_with_http_info(id, opts)
  data
end

#retrieve_action_type_with_http_info(id, opts = {}) ⇒ Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>

Retrieve action type

Parameters:

  • id (String)

    System-generated unique identifier

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

    the optional parameters

Returns:



380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/embed_workflow/api/action_types_api.rb', line 380

def retrieve_action_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.retrieve_action_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.retrieve_action_type"
  end
  # resource path
  local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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] || 'ListActionTypes200ResponseCollectionInner'

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.retrieve_action_type",
    :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: ActionTypesApi#retrieve_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_action_type(id:, **opts) ⇒ ListActionTypes200ResponseCollectionInner

Update action type

Parameters:

  • id (String)

    System-generated unique identifier

  • opts (Hash)

    the optional parameters

Options Hash (**opts):

  • :name (String)

    Name of resource

  • :description (String)

    Description of action type

  • :on (Boolean)

    Enable or disable the resource.

  • :params_draft (String)

    HTTP parameters as key:value pairs, one per line

  • :headers_draft (String)

    HTTP headers as key:value pairs, one per line

  • :url_draft (String)

    HTTP url

  • :http_method_draft (String)

    HTTP method

  • :code_draft (String)

    JavaScript code snippt

  • :form_draft (Array<CreateActionTypeRequestFormDraftInner>)

    Form field configuration

  • :response_data_schema_draft (Array<UpdateAccountRequestUserDataSchemaInner>)

    Data schema configuration

  • :groups (Array<String>)

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

  • :icon_draft (CreateActionTypeRequestIconDraft)
  • :primary_category (String)

    Primary category for the action type

  • :secondary_category (String)

    Secondary category for the action type

  • :wait_for_callback (Boolean)

    When true, actions fire the webhook but wait for an external callback before completing

  • :callback_timeout_n (Integer)

    Callback timeout duration value

  • :callback_timeout_unit (String)

    Callback timeout duration unit (sec, min, hour, day, week, month, year)

Returns:



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
# File 'lib/embed_workflow/api/action_types_api.rb', line 449

def update_action_type(id:, **opts)
  opts[:'update_action_type_request'] = UpdateActionTypeRequest.new(
    name: opts.delete(:name),
    description: opts.delete(:description),
    on: opts.delete(:on),
    params_draft: opts.delete(:params_draft),
    headers_draft: opts.delete(:headers_draft),
    url_draft: opts.delete(:url_draft),
    http_method_draft: opts.delete(:http_method_draft),
    code_draft: opts.delete(:code_draft),
    form_draft: opts.delete(:form_draft),
    response_data_schema_draft: opts.delete(:response_data_schema_draft),
    groups: opts.delete(:groups),
    icon_draft: opts.delete(:icon_draft),
    primary_category: opts.delete(:primary_category),
    secondary_category: opts.delete(:secondary_category),
    wait_for_callback: opts.delete(:wait_for_callback),
    callback_timeout_n: opts.delete(:callback_timeout_n),
    callback_timeout_unit: opts.delete(:callback_timeout_unit),
  )
  data, _status_code, _headers = update_action_type_with_http_info(id, opts)
  data
end

#update_action_type_with_http_info(id, opts = {}) ⇒ Array<(ListActionTypes200ResponseCollectionInner, Integer, Hash)>

Update action type

Parameters:

  • id (String)

    System-generated unique identifier

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

    the optional parameters

Options Hash (opts):

Returns:



478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/embed_workflow/api/action_types_api.rb', line 478

def update_action_type_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ActionTypesApi.update_action_type ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ActionTypesApi.update_action_type"
  end
  # resource path
  local_var_path = '/api/v1/action_types/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # 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_action_type_request'])

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

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

  new_options = opts.merge(
    :operation => :"ActionTypesApi.update_action_type",
    :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: ActionTypesApi#update_action_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end