Class: Zyphr::WorkflowsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/zyphr/api/workflows_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ WorkflowsApi

Returns a new instance of WorkflowsApi.



19
20
21
# File 'lib/zyphr/api/workflows_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/zyphr/api/workflows_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_workflow_step(key, add_workflow_step_request, opts = {}) ⇒ AddWorkflowStep201Response

Add a workflow step Append a step to a workflow. Channel steps (email, push, sms, in_app, slack, discord, teams) carry message content in config; delay steps carry { amount, unit }; branch steps carry { conditions }.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/zyphr/api/workflows_api.rb', line 28

def add_workflow_step(key, add_workflow_step_request, opts = {})
  data, _status_code, _headers = add_workflow_step_with_http_info(key, add_workflow_step_request, opts)
  data
end

#add_workflow_step_with_http_info(key, add_workflow_step_request, opts = {}) ⇒ Array<(AddWorkflowStep201Response, Integer, Hash)>

Add a workflow step Append a step to a workflow. Channel steps (`email`, `push`, `sms`, `in_app`, `slack`, `discord`, `teams`) carry message content in `config`; `delay` steps carry `{ amount, unit }`; `branch` steps carry `{ conditions }`.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    AddWorkflowStep201Response data, response status code and response headers



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
90
91
92
93
94
# File 'lib/zyphr/api/workflows_api.rb', line 39

def add_workflow_step_with_http_info(key, add_workflow_step_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.add_workflow_step ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.add_workflow_step"
  end
  # verify the required parameter 'add_workflow_step_request' is set
  if @api_client.config.client_side_validation && add_workflow_step_request.nil?
    fail ArgumentError, "Missing the required parameter 'add_workflow_step_request' when calling WorkflowsApi.add_workflow_step"
  end
  # resource path
  local_var_path = '/workflows/{key}/steps'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']
  # 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(add_workflow_step_request)

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

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

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

#create_workflow(create_workflow_request, opts = {}) ⇒ CreateWorkflow201Response

Create a workflow Create a new notification workflow. A workflow is a named, multi-step notification sequence identified by a unique key within the project. If key is omitted, one is derived from the name.

Parameters:

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

    the optional parameters

Returns:



101
102
103
104
# File 'lib/zyphr/api/workflows_api.rb', line 101

def create_workflow(create_workflow_request, opts = {})
  data, _status_code, _headers = create_workflow_with_http_info(create_workflow_request, opts)
  data
end

#create_workflow_with_http_info(create_workflow_request, opts = {}) ⇒ Array<(CreateWorkflow201Response, Integer, Hash)>

Create a workflow Create a new notification workflow. A workflow is a named, multi-step notification sequence identified by a unique `key` within the project. If `key` is omitted, one is derived from the `name`.

Parameters:

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

    the optional parameters

Returns:

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

    CreateWorkflow201Response data, response status code and response headers



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
159
160
161
162
# File 'lib/zyphr/api/workflows_api.rb', line 111

def create_workflow_with_http_info(create_workflow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.create_workflow ...'
  end
  # verify the required parameter 'create_workflow_request' is set
  if @api_client.config.client_side_validation && create_workflow_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_workflow_request' when calling WorkflowsApi.create_workflow"
  end
  # resource path
  local_var_path = '/workflows'

  # 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']) unless header_params['Accept']
  # 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(create_workflow_request)

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

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

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

#delete_workflow(key, opts = {}) ⇒ DeleteWorkflow200Response

Delete a workflow Permanently delete a workflow and all of its steps.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



169
170
171
172
# File 'lib/zyphr/api/workflows_api.rb', line 169

def delete_workflow(key, opts = {})
  data, _status_code, _headers = delete_workflow_with_http_info(key, opts)
  data
end

#delete_workflow_step(key, step_key, opts = {}) ⇒ DeleteWorkflowStep200Response

Delete a workflow step Remove a step from a workflow.

Parameters:

  • key (String)

    The workflow key.

  • step_key (String)

    The step key.

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

    the optional parameters

Returns:



233
234
235
236
# File 'lib/zyphr/api/workflows_api.rb', line 233

def delete_workflow_step(key, step_key, opts = {})
  data, _status_code, _headers = delete_workflow_step_with_http_info(key, step_key, opts)
  data
end

#delete_workflow_step_with_http_info(key, step_key, opts = {}) ⇒ Array<(DeleteWorkflowStep200Response, Integer, Hash)>

Delete a workflow step Remove a step from a workflow.

Parameters:

  • key (String)

    The workflow key.

  • step_key (String)

    The step key.

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

    the optional parameters

Returns:



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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/zyphr/api/workflows_api.rb', line 244

def delete_workflow_step_with_http_info(key, step_key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workflow_step ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.delete_workflow_step"
  end
  # verify the required parameter 'step_key' is set
  if @api_client.config.client_side_validation && step_key.nil?
    fail ArgumentError, "Missing the required parameter 'step_key' when calling WorkflowsApi.delete_workflow_step"
  end
  # resource path
  local_var_path = '/workflows/{key}/steps/{stepKey}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'stepKey' + '}', CGI.escape(step_key.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']) unless header_params['Accept']

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

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

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

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

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

#delete_workflow_with_http_info(key, opts = {}) ⇒ Array<(DeleteWorkflow200Response, Integer, Hash)>

Delete a workflow Permanently delete a workflow and all of its steps.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    DeleteWorkflow200Response data, response status code and response headers



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
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/zyphr/api/workflows_api.rb', line 179

def delete_workflow_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workflow ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.delete_workflow"
  end
  # resource path
  local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']

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

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

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

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

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

#get_workflow(key, opts = {}) ⇒ CreateWorkflow201Response

Get a workflow Retrieve a single workflow by its key, including its ordered steps.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



301
302
303
304
# File 'lib/zyphr/api/workflows_api.rb', line 301

def get_workflow(key, opts = {})
  data, _status_code, _headers = get_workflow_with_http_info(key, opts)
  data
end

#get_workflow_with_http_info(key, opts = {}) ⇒ Array<(CreateWorkflow201Response, Integer, Hash)>

Get a workflow Retrieve a single workflow by its key, including its ordered steps.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    CreateWorkflow201Response data, response status code and response headers



311
312
313
314
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
# File 'lib/zyphr/api/workflows_api.rb', line 311

def get_workflow_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.get_workflow ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.get_workflow"
  end
  # resource path
  local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']

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

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

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

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

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

#list_workflow_executions(key, opts = {}) ⇒ ListWorkflowExecutions200Response

List workflow executions List the executions of a workflow, most recent first. Supports pagination.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :per_page (Integer)

    Number of executions per page (max 100). (default to 25)

Returns:



366
367
368
369
# File 'lib/zyphr/api/workflows_api.rb', line 366

def list_workflow_executions(key, opts = {})
  data, _status_code, _headers = list_workflow_executions_with_http_info(key, opts)
  data
end

#list_workflow_executions_with_http_info(key, opts = {}) ⇒ Array<(ListWorkflowExecutions200Response, Integer, Hash)>

List workflow executions List the executions of a workflow, most recent first. Supports pagination.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :per_page (Integer)

    Number of executions per page (max 100). (default to 25)

Returns:



378
379
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
427
428
429
430
431
432
433
434
435
436
437
438
# File 'lib/zyphr/api/workflows_api.rb', line 378

def list_workflow_executions_with_http_info(key, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflow_executions ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.list_workflow_executions"
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling WorkflowsApi.list_workflow_executions, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflow_executions, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflow_executions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/workflows/{key}/executions'.sub('{' + 'key' + '}', CGI.escape(key.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?

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

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

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

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

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

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

#list_workflows(opts = {}) ⇒ ListWorkflows200Response

List workflows List workflows in the project. Supports pagination, free-text search, and status filtering.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :per_page (Integer)

    Number of workflows per page (max 100). (default to 25)

  • :search (String)

    Free-text search over workflow name and key.

  • :status (WorkflowStatus)

    Filter by workflow status.

Returns:



448
449
450
451
# File 'lib/zyphr/api/workflows_api.rb', line 448

def list_workflows(opts = {})
  data, _status_code, _headers = list_workflows_with_http_info(opts)
  data
end

#list_workflows_with_http_info(opts = {}) ⇒ Array<(ListWorkflows200Response, Integer, Hash)>

List workflows List workflows in the project. Supports pagination, free-text search, and status filtering.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-based). (default to 1)

  • :per_page (Integer)

    Number of workflows per page (max 100). (default to 25)

  • :search (String)

    Free-text search over workflow name and key.

  • :status (WorkflowStatus)

    Filter by workflow status.

Returns:

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

    ListWorkflows200Response data, response status code and response headers



461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
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
# File 'lib/zyphr/api/workflows_api.rb', line 461

def list_workflows_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflows ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page"]" when calling WorkflowsApi.list_workflows, must be greater than or equal to 1.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflows, must be smaller than or equal to 100.'
  end

  if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
    fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflows, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/workflows'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
  query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?

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

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

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

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

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

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

#reorder_workflow_steps(key, reorder_workflow_steps_request, opts = {}) ⇒ CreateWorkflow201Response

Reorder workflow steps Reorder a workflow's steps. Provide the full set of step keys in the desired order — the array must contain exactly the workflow's existing step keys.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



527
528
529
530
# File 'lib/zyphr/api/workflows_api.rb', line 527

def reorder_workflow_steps(key, reorder_workflow_steps_request, opts = {})
  data, _status_code, _headers = reorder_workflow_steps_with_http_info(key, reorder_workflow_steps_request, opts)
  data
end

#reorder_workflow_steps_with_http_info(key, reorder_workflow_steps_request, opts = {}) ⇒ Array<(CreateWorkflow201Response, Integer, Hash)>

Reorder workflow steps Reorder a workflow's steps. Provide the full set of step keys in the desired order — the array must contain exactly the workflow's existing step keys.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    CreateWorkflow201Response data, response status code and response headers



538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
# File 'lib/zyphr/api/workflows_api.rb', line 538

def reorder_workflow_steps_with_http_info(key, reorder_workflow_steps_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.reorder_workflow_steps ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.reorder_workflow_steps"
  end
  # verify the required parameter 'reorder_workflow_steps_request' is set
  if @api_client.config.client_side_validation && reorder_workflow_steps_request.nil?
    fail ArgumentError, "Missing the required parameter 'reorder_workflow_steps_request' when calling WorkflowsApi.reorder_workflow_steps"
  end
  # resource path
  local_var_path = '/workflows/{key}/steps/reorder'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']
  # 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(reorder_workflow_steps_request)

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

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

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

#trigger_workflow(key, trigger_workflow_request, opts = {}) ⇒ TriggerWorkflow202Response

Trigger a workflow Trigger an execution of an active workflow for one or more recipients. The to field accepts a single recipient, an array of recipients, or a topic object ({ \"topic\": \"topic-key\" }) to trigger for all subscribers of a topic. One execution is created per resolved subscriber.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



601
602
603
604
# File 'lib/zyphr/api/workflows_api.rb', line 601

def trigger_workflow(key, trigger_workflow_request, opts = {})
  data, _status_code, _headers = trigger_workflow_with_http_info(key, trigger_workflow_request, opts)
  data
end

#trigger_workflow_with_http_info(key, trigger_workflow_request, opts = {}) ⇒ Array<(TriggerWorkflow202Response, Integer, Hash)>

Trigger a workflow Trigger an execution of an active workflow for one or more recipients. The `to` field accepts a single recipient, an array of recipients, or a topic object (`{ &quot;topic&quot;: &quot;topic-key&quot; }`) to trigger for all subscribers of a topic. One execution is created per resolved subscriber.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    TriggerWorkflow202Response data, response status code and response headers



612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
# File 'lib/zyphr/api/workflows_api.rb', line 612

def trigger_workflow_with_http_info(key, trigger_workflow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.trigger_workflow ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.trigger_workflow"
  end
  # verify the required parameter 'trigger_workflow_request' is set
  if @api_client.config.client_side_validation && trigger_workflow_request.nil?
    fail ArgumentError, "Missing the required parameter 'trigger_workflow_request' when calling WorkflowsApi.trigger_workflow"
  end
  # resource path
  local_var_path = '/workflows/{key}/trigger'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']
  # 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(trigger_workflow_request)

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

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

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

#update_workflow(key, update_workflow_request, opts = {}) ⇒ CreateWorkflow201Response

Update a workflow Update a workflow's metadata. Only the provided fields are changed. To change the status, use the dedicated status endpoint.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



675
676
677
678
# File 'lib/zyphr/api/workflows_api.rb', line 675

def update_workflow(key, update_workflow_request, opts = {})
  data, _status_code, _headers = update_workflow_with_http_info(key, update_workflow_request, opts)
  data
end

#update_workflow_status(key, update_workflow_status_request, opts = {}) ⇒ CreateWorkflow201Response

Update workflow status Change a workflow's lifecycle status. This is the single endpoint for activating, pausing, archiving, or returning a workflow to draft — there are no separate /activate or /pause endpoints. Set status to active to activate and paused to pause.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:



749
750
751
752
# File 'lib/zyphr/api/workflows_api.rb', line 749

def update_workflow_status(key, update_workflow_status_request, opts = {})
  data, _status_code, _headers = update_workflow_status_with_http_info(key, update_workflow_status_request, opts)
  data
end

#update_workflow_status_with_http_info(key, update_workflow_status_request, opts = {}) ⇒ Array<(CreateWorkflow201Response, Integer, Hash)>

Update workflow status Change a workflow's lifecycle status. This is the single endpoint for activating, pausing, archiving, or returning a workflow to draft — there are no separate `/activate` or `/pause` endpoints. Set `status` to `active` to activate and `paused` to pause.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    CreateWorkflow201Response data, response status code and response headers



760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/zyphr/api/workflows_api.rb', line 760

def update_workflow_status_with_http_info(key, update_workflow_status_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow_status ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow_status"
  end
  # verify the required parameter 'update_workflow_status_request' is set
  if @api_client.config.client_side_validation && update_workflow_status_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_workflow_status_request' when calling WorkflowsApi.update_workflow_status"
  end
  # resource path
  local_var_path = '/workflows/{key}/status'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']
  # 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(update_workflow_status_request)

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

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

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

#update_workflow_step(key, step_key, update_workflow_step_request, opts = {}) ⇒ AddWorkflowStep201Response

Update a workflow step Update a step's name and/or config. Only the provided fields are changed.

Parameters:

  • key (String)

    The workflow key.

  • step_key (String)

    The step key.

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

    the optional parameters

Returns:



824
825
826
827
# File 'lib/zyphr/api/workflows_api.rb', line 824

def update_workflow_step(key, step_key, update_workflow_step_request, opts = {})
  data, _status_code, _headers = update_workflow_step_with_http_info(key, step_key, update_workflow_step_request, opts)
  data
end

#update_workflow_step_with_http_info(key, step_key, update_workflow_step_request, opts = {}) ⇒ Array<(AddWorkflowStep201Response, Integer, Hash)>

Update a workflow step Update a step's name and/or config. Only the provided fields are changed.

Parameters:

  • key (String)

    The workflow key.

  • step_key (String)

    The step key.

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

    the optional parameters

Returns:

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

    AddWorkflowStep201Response data, response status code and response headers



836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/zyphr/api/workflows_api.rb', line 836

def update_workflow_step_with_http_info(key, step_key, update_workflow_step_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow_step ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow_step"
  end
  # verify the required parameter 'step_key' is set
  if @api_client.config.client_side_validation && step_key.nil?
    fail ArgumentError, "Missing the required parameter 'step_key' when calling WorkflowsApi.update_workflow_step"
  end
  # verify the required parameter 'update_workflow_step_request' is set
  if @api_client.config.client_side_validation && update_workflow_step_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_workflow_step_request' when calling WorkflowsApi.update_workflow_step"
  end
  # resource path
  local_var_path = '/workflows/{key}/steps/{stepKey}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'stepKey' + '}', CGI.escape(step_key.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']) unless header_params['Accept']
  # 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(update_workflow_step_request)

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

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

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

#update_workflow_with_http_info(key, update_workflow_request, opts = {}) ⇒ Array<(CreateWorkflow201Response, Integer, Hash)>

Update a workflow Update a workflow's metadata. Only the provided fields are changed. To change the status, use the dedicated status endpoint.

Parameters:

  • key (String)

    The workflow key.

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

    the optional parameters

Returns:

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

    CreateWorkflow201Response data, response status code and response headers



686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
# File 'lib/zyphr/api/workflows_api.rb', line 686

def update_workflow_with_http_info(key, update_workflow_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow ...'
  end
  # verify the required parameter 'key' is set
  if @api_client.config.client_side_validation && key.nil?
    fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow"
  end
  # verify the required parameter 'update_workflow_request' is set
  if @api_client.config.client_side_validation && update_workflow_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_workflow_request' when calling WorkflowsApi.update_workflow"
  end
  # resource path
  local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.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']) unless header_params['Accept']
  # 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(update_workflow_request)

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

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

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