zyphr 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +35 -14
- data/docs/AddWorkflowStep201Response.md +20 -0
- data/docs/AddWorkflowStepRequest.md +30 -0
- data/docs/AuthRegistrationApi.md +1 -1
- data/docs/CreateWorkflow201Response.md +20 -0
- data/docs/CreateWorkflowRequest.md +26 -0
- data/docs/DeleteWorkflow200Response.md +20 -0
- data/docs/{TopicDeleteResponseData.md → DeleteWorkflow200ResponseData.md} +2 -2
- data/docs/DeleteWorkflowStep200Response.md +20 -0
- data/docs/DeleteWorkflowStep200ResponseData.md +22 -0
- data/docs/ListWorkflowExecutions200Response.md +20 -0
- data/docs/{SmsListResponseMeta.md → ListWorkflowExecutions200ResponseMeta.md} +2 -2
- data/docs/ListWorkflows200Response.md +20 -0
- data/docs/ListWorkflows200ResponseMeta.md +32 -0
- data/docs/ReorderWorkflowStepsRequest.md +18 -0
- data/docs/SignInWithGameCenterRequest.md +1 -1
- data/docs/SmsListResponse.md +1 -1
- data/docs/TopicDeleteResponse.md +1 -1
- data/docs/TriggerWorkflow202Response.md +20 -0
- data/docs/TriggerWorkflow202ResponseData.md +22 -0
- data/docs/TriggerWorkflowRequest.md +24 -0
- data/docs/UpdateWorkflowRequest.md +24 -0
- data/docs/UpdateWorkflowStatusRequest.md +18 -0
- data/docs/UpdateWorkflowStepRequest.md +20 -0
- data/docs/Workflow.md +42 -0
- data/docs/WorkflowStatus.md +15 -0
- data/docs/WorkflowStep.md +38 -0
- data/docs/WorkflowStepType.md +15 -0
- data/docs/WorkflowsApi.md +901 -0
- data/lib/zyphr/api/auth_registration_api.rb +2 -2
- data/lib/zyphr/api/workflows_api.rb +897 -0
- data/lib/zyphr/models/add_workflow_step201_response.rb +229 -0
- data/lib/zyphr/models/add_workflow_step_request.rb +384 -0
- data/lib/zyphr/models/create_workflow201_response.rb +229 -0
- data/lib/zyphr/models/create_workflow_request.rb +292 -0
- data/lib/zyphr/models/delete_workflow200_response.rb +229 -0
- data/lib/zyphr/models/{topic_delete_response_data.rb → delete_workflow200_response_data.rb} +3 -3
- data/lib/zyphr/models/delete_workflow_step200_response.rb +229 -0
- data/lib/zyphr/models/delete_workflow_step200_response_data.rb +238 -0
- data/lib/zyphr/models/list_workflow_executions200_response.rb +231 -0
- data/lib/zyphr/models/{sms_list_response_meta.rb → list_workflow_executions200_response_meta.rb} +3 -3
- data/lib/zyphr/models/list_workflows200_response.rb +231 -0
- data/lib/zyphr/models/list_workflows200_response_meta.rb +284 -0
- data/lib/zyphr/models/reorder_workflow_steps_request.rb +249 -0
- data/lib/zyphr/models/sign_in_with_game_center_request.rb +1 -1
- data/lib/zyphr/models/sms_list_response.rb +1 -1
- data/lib/zyphr/models/topic_delete_response.rb +1 -1
- data/lib/zyphr/models/trigger_workflow202_response.rb +229 -0
- data/lib/zyphr/models/trigger_workflow202_response_data.rb +240 -0
- data/lib/zyphr/models/trigger_workflow_request.rb +272 -0
- data/lib/zyphr/models/update_workflow_request.rb +269 -0
- data/lib/zyphr/models/{v1_muse_subjects_suggest_post_request.rb → update_workflow_status_request.rb} +19 -86
- data/lib/zyphr/models/update_workflow_step_request.rb +232 -0
- data/lib/zyphr/models/workflow.rb +514 -0
- data/lib/zyphr/models/workflow_status.rb +42 -0
- data/lib/zyphr/models/workflow_step.rb +505 -0
- data/lib/zyphr/models/workflow_step_type.rb +47 -0
- data/lib/zyphr.rb +24 -4
- data/spec/api/auth_registration_api_spec.rb +1 -1
- data/spec/api/workflows_api_spec.rb +192 -0
- data/spec/models/add_workflow_step201_response_spec.rb +42 -0
- data/spec/models/add_workflow_step_request_spec.rb +76 -0
- data/spec/models/create_workflow201_response_spec.rb +42 -0
- data/spec/models/{v1_muse_subjects_suggest_post_request_spec.rb → create_workflow_request_spec.rb} +16 -14
- data/spec/models/{topic_delete_response_data_spec.rb → delete_workflow200_response_data_spec.rb} +6 -6
- data/spec/models/delete_workflow200_response_spec.rb +42 -0
- data/spec/models/delete_workflow_step200_response_data_spec.rb +48 -0
- data/spec/models/delete_workflow_step200_response_spec.rb +42 -0
- data/spec/models/{sms_list_response_meta_spec.rb → list_workflow_executions200_response_meta_spec.rb} +6 -6
- data/spec/models/list_workflow_executions200_response_spec.rb +42 -0
- data/spec/models/list_workflows200_response_meta_spec.rb +78 -0
- data/spec/models/list_workflows200_response_spec.rb +42 -0
- data/spec/models/reorder_workflow_steps_request_spec.rb +36 -0
- data/spec/models/trigger_workflow202_response_data_spec.rb +48 -0
- data/spec/models/trigger_workflow202_response_spec.rb +42 -0
- data/spec/models/trigger_workflow_request_spec.rb +54 -0
- data/spec/models/update_workflow_request_spec.rb +54 -0
- data/spec/models/update_workflow_status_request_spec.rb +36 -0
- data/spec/models/update_workflow_step_request_spec.rb +42 -0
- data/spec/models/workflow_spec.rb +108 -0
- data/spec/models/workflow_status_spec.rb +30 -0
- data/spec/models/workflow_step_spec.rb +100 -0
- data/spec/models/workflow_step_type_spec.rb +30 -0
- data/zyphr.gemspec +1 -1
- metadata +97 -17
- data/docs/MuseApi.md +0 -681
- data/docs/V1MuseSubjectsSuggestPostRequest.md +0 -24
- data/lib/zyphr/api/muse_api.rb +0 -644
- data/spec/api/muse_api_spec.rb +0 -156
|
@@ -0,0 +1,897 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zyphr API
|
|
3
|
+
|
|
4
|
+
#Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Account Sending Status Every authenticated response carries the account's current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@zyphr.dev
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.12.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zyphr
|
|
16
|
+
class WorkflowsApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Add a workflow step
|
|
23
|
+
# 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 }`.
|
|
24
|
+
# @param key [String] The workflow key.
|
|
25
|
+
# @param add_workflow_step_request [AddWorkflowStepRequest]
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [AddWorkflowStep201Response]
|
|
28
|
+
def add_workflow_step(key, add_workflow_step_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = add_workflow_step_with_http_info(key, add_workflow_step_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Add a workflow step
|
|
34
|
+
# 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 }`.
|
|
35
|
+
# @param key [String] The workflow key.
|
|
36
|
+
# @param add_workflow_step_request [AddWorkflowStepRequest]
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(AddWorkflowStep201Response, Integer, Hash)>] AddWorkflowStep201Response data, response status code and response headers
|
|
39
|
+
def add_workflow_step_with_http_info(key, add_workflow_step_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.add_workflow_step ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'key' is set
|
|
44
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.add_workflow_step"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'add_workflow_step_request' is set
|
|
48
|
+
if @api_client.config.client_side_validation && add_workflow_step_request.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'add_workflow_step_request' when calling WorkflowsApi.add_workflow_step"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/workflows/{key}/steps'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
|
|
57
|
+
# header parameters
|
|
58
|
+
header_params = opts[:header_params] || {}
|
|
59
|
+
# HTTP header 'Accept' (if needed)
|
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
61
|
+
# HTTP header 'Content-Type'
|
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
63
|
+
if !content_type.nil?
|
|
64
|
+
header_params['Content-Type'] = content_type
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# form parameters
|
|
68
|
+
form_params = opts[:form_params] || {}
|
|
69
|
+
|
|
70
|
+
# http body (model)
|
|
71
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(add_workflow_step_request)
|
|
72
|
+
|
|
73
|
+
# return_type
|
|
74
|
+
return_type = opts[:debug_return_type] || 'AddWorkflowStep201Response'
|
|
75
|
+
|
|
76
|
+
# auth_names
|
|
77
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
78
|
+
|
|
79
|
+
new_options = opts.merge(
|
|
80
|
+
:operation => :"WorkflowsApi.add_workflow_step",
|
|
81
|
+
:header_params => header_params,
|
|
82
|
+
:query_params => query_params,
|
|
83
|
+
:form_params => form_params,
|
|
84
|
+
:body => post_body,
|
|
85
|
+
:auth_names => auth_names,
|
|
86
|
+
:return_type => return_type
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
90
|
+
if @api_client.config.debugging
|
|
91
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#add_workflow_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
92
|
+
end
|
|
93
|
+
return data, status_code, headers
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Create a workflow
|
|
97
|
+
# 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`.
|
|
98
|
+
# @param create_workflow_request [CreateWorkflowRequest]
|
|
99
|
+
# @param [Hash] opts the optional parameters
|
|
100
|
+
# @return [CreateWorkflow201Response]
|
|
101
|
+
def create_workflow(create_workflow_request, opts = {})
|
|
102
|
+
data, _status_code, _headers = create_workflow_with_http_info(create_workflow_request, opts)
|
|
103
|
+
data
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# Create a workflow
|
|
107
|
+
# 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`.
|
|
108
|
+
# @param create_workflow_request [CreateWorkflowRequest]
|
|
109
|
+
# @param [Hash] opts the optional parameters
|
|
110
|
+
# @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers
|
|
111
|
+
def create_workflow_with_http_info(create_workflow_request, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.create_workflow ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'create_workflow_request' is set
|
|
116
|
+
if @api_client.config.client_side_validation && create_workflow_request.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'create_workflow_request' when calling WorkflowsApi.create_workflow"
|
|
118
|
+
end
|
|
119
|
+
# resource path
|
|
120
|
+
local_var_path = '/workflows'
|
|
121
|
+
|
|
122
|
+
# query parameters
|
|
123
|
+
query_params = opts[:query_params] || {}
|
|
124
|
+
|
|
125
|
+
# header parameters
|
|
126
|
+
header_params = opts[:header_params] || {}
|
|
127
|
+
# HTTP header 'Accept' (if needed)
|
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
129
|
+
# HTTP header 'Content-Type'
|
|
130
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
131
|
+
if !content_type.nil?
|
|
132
|
+
header_params['Content-Type'] = content_type
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# form parameters
|
|
136
|
+
form_params = opts[:form_params] || {}
|
|
137
|
+
|
|
138
|
+
# http body (model)
|
|
139
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_workflow_request)
|
|
140
|
+
|
|
141
|
+
# return_type
|
|
142
|
+
return_type = opts[:debug_return_type] || 'CreateWorkflow201Response'
|
|
143
|
+
|
|
144
|
+
# auth_names
|
|
145
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
146
|
+
|
|
147
|
+
new_options = opts.merge(
|
|
148
|
+
:operation => :"WorkflowsApi.create_workflow",
|
|
149
|
+
:header_params => header_params,
|
|
150
|
+
:query_params => query_params,
|
|
151
|
+
:form_params => form_params,
|
|
152
|
+
:body => post_body,
|
|
153
|
+
:auth_names => auth_names,
|
|
154
|
+
:return_type => return_type
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
158
|
+
if @api_client.config.debugging
|
|
159
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#create_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
160
|
+
end
|
|
161
|
+
return data, status_code, headers
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Delete a workflow
|
|
165
|
+
# Permanently delete a workflow and all of its steps.
|
|
166
|
+
# @param key [String] The workflow key.
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @return [DeleteWorkflow200Response]
|
|
169
|
+
def delete_workflow(key, opts = {})
|
|
170
|
+
data, _status_code, _headers = delete_workflow_with_http_info(key, opts)
|
|
171
|
+
data
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Delete a workflow
|
|
175
|
+
# Permanently delete a workflow and all of its steps.
|
|
176
|
+
# @param key [String] The workflow key.
|
|
177
|
+
# @param [Hash] opts the optional parameters
|
|
178
|
+
# @return [Array<(DeleteWorkflow200Response, Integer, Hash)>] DeleteWorkflow200Response data, response status code and response headers
|
|
179
|
+
def delete_workflow_with_http_info(key, opts = {})
|
|
180
|
+
if @api_client.config.debugging
|
|
181
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workflow ...'
|
|
182
|
+
end
|
|
183
|
+
# verify the required parameter 'key' is set
|
|
184
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
185
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.delete_workflow"
|
|
186
|
+
end
|
|
187
|
+
# resource path
|
|
188
|
+
local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
189
|
+
|
|
190
|
+
# query parameters
|
|
191
|
+
query_params = opts[:query_params] || {}
|
|
192
|
+
|
|
193
|
+
# header parameters
|
|
194
|
+
header_params = opts[:header_params] || {}
|
|
195
|
+
# HTTP header 'Accept' (if needed)
|
|
196
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
197
|
+
|
|
198
|
+
# form parameters
|
|
199
|
+
form_params = opts[:form_params] || {}
|
|
200
|
+
|
|
201
|
+
# http body (model)
|
|
202
|
+
post_body = opts[:debug_body]
|
|
203
|
+
|
|
204
|
+
# return_type
|
|
205
|
+
return_type = opts[:debug_return_type] || 'DeleteWorkflow200Response'
|
|
206
|
+
|
|
207
|
+
# auth_names
|
|
208
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
209
|
+
|
|
210
|
+
new_options = opts.merge(
|
|
211
|
+
:operation => :"WorkflowsApi.delete_workflow",
|
|
212
|
+
:header_params => header_params,
|
|
213
|
+
:query_params => query_params,
|
|
214
|
+
:form_params => form_params,
|
|
215
|
+
:body => post_body,
|
|
216
|
+
:auth_names => auth_names,
|
|
217
|
+
:return_type => return_type
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
221
|
+
if @api_client.config.debugging
|
|
222
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#delete_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
223
|
+
end
|
|
224
|
+
return data, status_code, headers
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Delete a workflow step
|
|
228
|
+
# Remove a step from a workflow.
|
|
229
|
+
# @param key [String] The workflow key.
|
|
230
|
+
# @param step_key [String] The step key.
|
|
231
|
+
# @param [Hash] opts the optional parameters
|
|
232
|
+
# @return [DeleteWorkflowStep200Response]
|
|
233
|
+
def delete_workflow_step(key, step_key, opts = {})
|
|
234
|
+
data, _status_code, _headers = delete_workflow_step_with_http_info(key, step_key, opts)
|
|
235
|
+
data
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Delete a workflow step
|
|
239
|
+
# Remove a step from a workflow.
|
|
240
|
+
# @param key [String] The workflow key.
|
|
241
|
+
# @param step_key [String] The step key.
|
|
242
|
+
# @param [Hash] opts the optional parameters
|
|
243
|
+
# @return [Array<(DeleteWorkflowStep200Response, Integer, Hash)>] DeleteWorkflowStep200Response data, response status code and response headers
|
|
244
|
+
def delete_workflow_step_with_http_info(key, step_key, opts = {})
|
|
245
|
+
if @api_client.config.debugging
|
|
246
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.delete_workflow_step ...'
|
|
247
|
+
end
|
|
248
|
+
# verify the required parameter 'key' is set
|
|
249
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
250
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.delete_workflow_step"
|
|
251
|
+
end
|
|
252
|
+
# verify the required parameter 'step_key' is set
|
|
253
|
+
if @api_client.config.client_side_validation && step_key.nil?
|
|
254
|
+
fail ArgumentError, "Missing the required parameter 'step_key' when calling WorkflowsApi.delete_workflow_step"
|
|
255
|
+
end
|
|
256
|
+
# resource path
|
|
257
|
+
local_var_path = '/workflows/{key}/steps/{stepKey}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'stepKey' + '}', CGI.escape(step_key.to_s))
|
|
258
|
+
|
|
259
|
+
# query parameters
|
|
260
|
+
query_params = opts[:query_params] || {}
|
|
261
|
+
|
|
262
|
+
# header parameters
|
|
263
|
+
header_params = opts[:header_params] || {}
|
|
264
|
+
# HTTP header 'Accept' (if needed)
|
|
265
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
266
|
+
|
|
267
|
+
# form parameters
|
|
268
|
+
form_params = opts[:form_params] || {}
|
|
269
|
+
|
|
270
|
+
# http body (model)
|
|
271
|
+
post_body = opts[:debug_body]
|
|
272
|
+
|
|
273
|
+
# return_type
|
|
274
|
+
return_type = opts[:debug_return_type] || 'DeleteWorkflowStep200Response'
|
|
275
|
+
|
|
276
|
+
# auth_names
|
|
277
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
278
|
+
|
|
279
|
+
new_options = opts.merge(
|
|
280
|
+
:operation => :"WorkflowsApi.delete_workflow_step",
|
|
281
|
+
:header_params => header_params,
|
|
282
|
+
:query_params => query_params,
|
|
283
|
+
:form_params => form_params,
|
|
284
|
+
:body => post_body,
|
|
285
|
+
:auth_names => auth_names,
|
|
286
|
+
:return_type => return_type
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
290
|
+
if @api_client.config.debugging
|
|
291
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#delete_workflow_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
292
|
+
end
|
|
293
|
+
return data, status_code, headers
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Get a workflow
|
|
297
|
+
# Retrieve a single workflow by its key, including its ordered steps.
|
|
298
|
+
# @param key [String] The workflow key.
|
|
299
|
+
# @param [Hash] opts the optional parameters
|
|
300
|
+
# @return [CreateWorkflow201Response]
|
|
301
|
+
def get_workflow(key, opts = {})
|
|
302
|
+
data, _status_code, _headers = get_workflow_with_http_info(key, opts)
|
|
303
|
+
data
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Get a workflow
|
|
307
|
+
# Retrieve a single workflow by its key, including its ordered steps.
|
|
308
|
+
# @param key [String] The workflow key.
|
|
309
|
+
# @param [Hash] opts the optional parameters
|
|
310
|
+
# @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers
|
|
311
|
+
def get_workflow_with_http_info(key, opts = {})
|
|
312
|
+
if @api_client.config.debugging
|
|
313
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.get_workflow ...'
|
|
314
|
+
end
|
|
315
|
+
# verify the required parameter 'key' is set
|
|
316
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
317
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.get_workflow"
|
|
318
|
+
end
|
|
319
|
+
# resource path
|
|
320
|
+
local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
321
|
+
|
|
322
|
+
# query parameters
|
|
323
|
+
query_params = opts[:query_params] || {}
|
|
324
|
+
|
|
325
|
+
# header parameters
|
|
326
|
+
header_params = opts[:header_params] || {}
|
|
327
|
+
# HTTP header 'Accept' (if needed)
|
|
328
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
329
|
+
|
|
330
|
+
# form parameters
|
|
331
|
+
form_params = opts[:form_params] || {}
|
|
332
|
+
|
|
333
|
+
# http body (model)
|
|
334
|
+
post_body = opts[:debug_body]
|
|
335
|
+
|
|
336
|
+
# return_type
|
|
337
|
+
return_type = opts[:debug_return_type] || 'CreateWorkflow201Response'
|
|
338
|
+
|
|
339
|
+
# auth_names
|
|
340
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
341
|
+
|
|
342
|
+
new_options = opts.merge(
|
|
343
|
+
:operation => :"WorkflowsApi.get_workflow",
|
|
344
|
+
:header_params => header_params,
|
|
345
|
+
:query_params => query_params,
|
|
346
|
+
:form_params => form_params,
|
|
347
|
+
:body => post_body,
|
|
348
|
+
:auth_names => auth_names,
|
|
349
|
+
:return_type => return_type
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
353
|
+
if @api_client.config.debugging
|
|
354
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#get_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
355
|
+
end
|
|
356
|
+
return data, status_code, headers
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
# List workflow executions
|
|
360
|
+
# List the executions of a workflow, most recent first. Supports pagination.
|
|
361
|
+
# @param key [String] The workflow key.
|
|
362
|
+
# @param [Hash] opts the optional parameters
|
|
363
|
+
# @option opts [Integer] :page Page number (1-based). (default to 1)
|
|
364
|
+
# @option opts [Integer] :per_page Number of executions per page (max 100). (default to 25)
|
|
365
|
+
# @return [ListWorkflowExecutions200Response]
|
|
366
|
+
def list_workflow_executions(key, opts = {})
|
|
367
|
+
data, _status_code, _headers = list_workflow_executions_with_http_info(key, opts)
|
|
368
|
+
data
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# List workflow executions
|
|
372
|
+
# List the executions of a workflow, most recent first. Supports pagination.
|
|
373
|
+
# @param key [String] The workflow key.
|
|
374
|
+
# @param [Hash] opts the optional parameters
|
|
375
|
+
# @option opts [Integer] :page Page number (1-based). (default to 1)
|
|
376
|
+
# @option opts [Integer] :per_page Number of executions per page (max 100). (default to 25)
|
|
377
|
+
# @return [Array<(ListWorkflowExecutions200Response, Integer, Hash)>] ListWorkflowExecutions200Response data, response status code and response headers
|
|
378
|
+
def list_workflow_executions_with_http_info(key, opts = {})
|
|
379
|
+
if @api_client.config.debugging
|
|
380
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflow_executions ...'
|
|
381
|
+
end
|
|
382
|
+
# verify the required parameter 'key' is set
|
|
383
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
384
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.list_workflow_executions"
|
|
385
|
+
end
|
|
386
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
387
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling WorkflowsApi.list_workflow_executions, must be greater than or equal to 1.'
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
|
391
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflow_executions, must be smaller than or equal to 100.'
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
395
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflow_executions, must be greater than or equal to 1.'
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
# resource path
|
|
399
|
+
local_var_path = '/workflows/{key}/executions'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
400
|
+
|
|
401
|
+
# query parameters
|
|
402
|
+
query_params = opts[:query_params] || {}
|
|
403
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
404
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
405
|
+
|
|
406
|
+
# header parameters
|
|
407
|
+
header_params = opts[:header_params] || {}
|
|
408
|
+
# HTTP header 'Accept' (if needed)
|
|
409
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
410
|
+
|
|
411
|
+
# form parameters
|
|
412
|
+
form_params = opts[:form_params] || {}
|
|
413
|
+
|
|
414
|
+
# http body (model)
|
|
415
|
+
post_body = opts[:debug_body]
|
|
416
|
+
|
|
417
|
+
# return_type
|
|
418
|
+
return_type = opts[:debug_return_type] || 'ListWorkflowExecutions200Response'
|
|
419
|
+
|
|
420
|
+
# auth_names
|
|
421
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
422
|
+
|
|
423
|
+
new_options = opts.merge(
|
|
424
|
+
:operation => :"WorkflowsApi.list_workflow_executions",
|
|
425
|
+
:header_params => header_params,
|
|
426
|
+
:query_params => query_params,
|
|
427
|
+
:form_params => form_params,
|
|
428
|
+
:body => post_body,
|
|
429
|
+
:auth_names => auth_names,
|
|
430
|
+
:return_type => return_type
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
434
|
+
if @api_client.config.debugging
|
|
435
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#list_workflow_executions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
436
|
+
end
|
|
437
|
+
return data, status_code, headers
|
|
438
|
+
end
|
|
439
|
+
|
|
440
|
+
# List workflows
|
|
441
|
+
# List workflows in the project. Supports pagination, free-text search, and status filtering.
|
|
442
|
+
# @param [Hash] opts the optional parameters
|
|
443
|
+
# @option opts [Integer] :page Page number (1-based). (default to 1)
|
|
444
|
+
# @option opts [Integer] :per_page Number of workflows per page (max 100). (default to 25)
|
|
445
|
+
# @option opts [String] :search Free-text search over workflow name and key.
|
|
446
|
+
# @option opts [WorkflowStatus] :status Filter by workflow status.
|
|
447
|
+
# @return [ListWorkflows200Response]
|
|
448
|
+
def list_workflows(opts = {})
|
|
449
|
+
data, _status_code, _headers = list_workflows_with_http_info(opts)
|
|
450
|
+
data
|
|
451
|
+
end
|
|
452
|
+
|
|
453
|
+
# List workflows
|
|
454
|
+
# List workflows in the project. Supports pagination, free-text search, and status filtering.
|
|
455
|
+
# @param [Hash] opts the optional parameters
|
|
456
|
+
# @option opts [Integer] :page Page number (1-based). (default to 1)
|
|
457
|
+
# @option opts [Integer] :per_page Number of workflows per page (max 100). (default to 25)
|
|
458
|
+
# @option opts [String] :search Free-text search over workflow name and key.
|
|
459
|
+
# @option opts [WorkflowStatus] :status Filter by workflow status.
|
|
460
|
+
# @return [Array<(ListWorkflows200Response, Integer, Hash)>] ListWorkflows200Response data, response status code and response headers
|
|
461
|
+
def list_workflows_with_http_info(opts = {})
|
|
462
|
+
if @api_client.config.debugging
|
|
463
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.list_workflows ...'
|
|
464
|
+
end
|
|
465
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
|
466
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling WorkflowsApi.list_workflows, must be greater than or equal to 1.'
|
|
467
|
+
end
|
|
468
|
+
|
|
469
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] > 100
|
|
470
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflows, must be smaller than or equal to 100.'
|
|
471
|
+
end
|
|
472
|
+
|
|
473
|
+
if @api_client.config.client_side_validation && !opts[:'per_page'].nil? && opts[:'per_page'] < 1
|
|
474
|
+
fail ArgumentError, 'invalid value for "opts[:"per_page"]" when calling WorkflowsApi.list_workflows, must be greater than or equal to 1.'
|
|
475
|
+
end
|
|
476
|
+
|
|
477
|
+
# resource path
|
|
478
|
+
local_var_path = '/workflows'
|
|
479
|
+
|
|
480
|
+
# query parameters
|
|
481
|
+
query_params = opts[:query_params] || {}
|
|
482
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
483
|
+
query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].nil?
|
|
484
|
+
query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
|
|
485
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
|
486
|
+
|
|
487
|
+
# header parameters
|
|
488
|
+
header_params = opts[:header_params] || {}
|
|
489
|
+
# HTTP header 'Accept' (if needed)
|
|
490
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
491
|
+
|
|
492
|
+
# form parameters
|
|
493
|
+
form_params = opts[:form_params] || {}
|
|
494
|
+
|
|
495
|
+
# http body (model)
|
|
496
|
+
post_body = opts[:debug_body]
|
|
497
|
+
|
|
498
|
+
# return_type
|
|
499
|
+
return_type = opts[:debug_return_type] || 'ListWorkflows200Response'
|
|
500
|
+
|
|
501
|
+
# auth_names
|
|
502
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
503
|
+
|
|
504
|
+
new_options = opts.merge(
|
|
505
|
+
:operation => :"WorkflowsApi.list_workflows",
|
|
506
|
+
:header_params => header_params,
|
|
507
|
+
:query_params => query_params,
|
|
508
|
+
:form_params => form_params,
|
|
509
|
+
:body => post_body,
|
|
510
|
+
:auth_names => auth_names,
|
|
511
|
+
:return_type => return_type
|
|
512
|
+
)
|
|
513
|
+
|
|
514
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
515
|
+
if @api_client.config.debugging
|
|
516
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#list_workflows\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
517
|
+
end
|
|
518
|
+
return data, status_code, headers
|
|
519
|
+
end
|
|
520
|
+
|
|
521
|
+
# Reorder workflow steps
|
|
522
|
+
# 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.
|
|
523
|
+
# @param key [String] The workflow key.
|
|
524
|
+
# @param reorder_workflow_steps_request [ReorderWorkflowStepsRequest]
|
|
525
|
+
# @param [Hash] opts the optional parameters
|
|
526
|
+
# @return [CreateWorkflow201Response]
|
|
527
|
+
def reorder_workflow_steps(key, reorder_workflow_steps_request, opts = {})
|
|
528
|
+
data, _status_code, _headers = reorder_workflow_steps_with_http_info(key, reorder_workflow_steps_request, opts)
|
|
529
|
+
data
|
|
530
|
+
end
|
|
531
|
+
|
|
532
|
+
# Reorder workflow steps
|
|
533
|
+
# 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.
|
|
534
|
+
# @param key [String] The workflow key.
|
|
535
|
+
# @param reorder_workflow_steps_request [ReorderWorkflowStepsRequest]
|
|
536
|
+
# @param [Hash] opts the optional parameters
|
|
537
|
+
# @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers
|
|
538
|
+
def reorder_workflow_steps_with_http_info(key, reorder_workflow_steps_request, opts = {})
|
|
539
|
+
if @api_client.config.debugging
|
|
540
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.reorder_workflow_steps ...'
|
|
541
|
+
end
|
|
542
|
+
# verify the required parameter 'key' is set
|
|
543
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
544
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.reorder_workflow_steps"
|
|
545
|
+
end
|
|
546
|
+
# verify the required parameter 'reorder_workflow_steps_request' is set
|
|
547
|
+
if @api_client.config.client_side_validation && reorder_workflow_steps_request.nil?
|
|
548
|
+
fail ArgumentError, "Missing the required parameter 'reorder_workflow_steps_request' when calling WorkflowsApi.reorder_workflow_steps"
|
|
549
|
+
end
|
|
550
|
+
# resource path
|
|
551
|
+
local_var_path = '/workflows/{key}/steps/reorder'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
552
|
+
|
|
553
|
+
# query parameters
|
|
554
|
+
query_params = opts[:query_params] || {}
|
|
555
|
+
|
|
556
|
+
# header parameters
|
|
557
|
+
header_params = opts[:header_params] || {}
|
|
558
|
+
# HTTP header 'Accept' (if needed)
|
|
559
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
560
|
+
# HTTP header 'Content-Type'
|
|
561
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
562
|
+
if !content_type.nil?
|
|
563
|
+
header_params['Content-Type'] = content_type
|
|
564
|
+
end
|
|
565
|
+
|
|
566
|
+
# form parameters
|
|
567
|
+
form_params = opts[:form_params] || {}
|
|
568
|
+
|
|
569
|
+
# http body (model)
|
|
570
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(reorder_workflow_steps_request)
|
|
571
|
+
|
|
572
|
+
# return_type
|
|
573
|
+
return_type = opts[:debug_return_type] || 'CreateWorkflow201Response'
|
|
574
|
+
|
|
575
|
+
# auth_names
|
|
576
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
577
|
+
|
|
578
|
+
new_options = opts.merge(
|
|
579
|
+
:operation => :"WorkflowsApi.reorder_workflow_steps",
|
|
580
|
+
:header_params => header_params,
|
|
581
|
+
:query_params => query_params,
|
|
582
|
+
:form_params => form_params,
|
|
583
|
+
:body => post_body,
|
|
584
|
+
:auth_names => auth_names,
|
|
585
|
+
:return_type => return_type
|
|
586
|
+
)
|
|
587
|
+
|
|
588
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
589
|
+
if @api_client.config.debugging
|
|
590
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#reorder_workflow_steps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
591
|
+
end
|
|
592
|
+
return data, status_code, headers
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# Trigger a workflow
|
|
596
|
+
# 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.
|
|
597
|
+
# @param key [String] The workflow key.
|
|
598
|
+
# @param trigger_workflow_request [TriggerWorkflowRequest]
|
|
599
|
+
# @param [Hash] opts the optional parameters
|
|
600
|
+
# @return [TriggerWorkflow202Response]
|
|
601
|
+
def trigger_workflow(key, trigger_workflow_request, opts = {})
|
|
602
|
+
data, _status_code, _headers = trigger_workflow_with_http_info(key, trigger_workflow_request, opts)
|
|
603
|
+
data
|
|
604
|
+
end
|
|
605
|
+
|
|
606
|
+
# Trigger a workflow
|
|
607
|
+
# 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.
|
|
608
|
+
# @param key [String] The workflow key.
|
|
609
|
+
# @param trigger_workflow_request [TriggerWorkflowRequest]
|
|
610
|
+
# @param [Hash] opts the optional parameters
|
|
611
|
+
# @return [Array<(TriggerWorkflow202Response, Integer, Hash)>] TriggerWorkflow202Response data, response status code and response headers
|
|
612
|
+
def trigger_workflow_with_http_info(key, trigger_workflow_request, opts = {})
|
|
613
|
+
if @api_client.config.debugging
|
|
614
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.trigger_workflow ...'
|
|
615
|
+
end
|
|
616
|
+
# verify the required parameter 'key' is set
|
|
617
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
618
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.trigger_workflow"
|
|
619
|
+
end
|
|
620
|
+
# verify the required parameter 'trigger_workflow_request' is set
|
|
621
|
+
if @api_client.config.client_side_validation && trigger_workflow_request.nil?
|
|
622
|
+
fail ArgumentError, "Missing the required parameter 'trigger_workflow_request' when calling WorkflowsApi.trigger_workflow"
|
|
623
|
+
end
|
|
624
|
+
# resource path
|
|
625
|
+
local_var_path = '/workflows/{key}/trigger'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
626
|
+
|
|
627
|
+
# query parameters
|
|
628
|
+
query_params = opts[:query_params] || {}
|
|
629
|
+
|
|
630
|
+
# header parameters
|
|
631
|
+
header_params = opts[:header_params] || {}
|
|
632
|
+
# HTTP header 'Accept' (if needed)
|
|
633
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
634
|
+
# HTTP header 'Content-Type'
|
|
635
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
636
|
+
if !content_type.nil?
|
|
637
|
+
header_params['Content-Type'] = content_type
|
|
638
|
+
end
|
|
639
|
+
|
|
640
|
+
# form parameters
|
|
641
|
+
form_params = opts[:form_params] || {}
|
|
642
|
+
|
|
643
|
+
# http body (model)
|
|
644
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(trigger_workflow_request)
|
|
645
|
+
|
|
646
|
+
# return_type
|
|
647
|
+
return_type = opts[:debug_return_type] || 'TriggerWorkflow202Response'
|
|
648
|
+
|
|
649
|
+
# auth_names
|
|
650
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
651
|
+
|
|
652
|
+
new_options = opts.merge(
|
|
653
|
+
:operation => :"WorkflowsApi.trigger_workflow",
|
|
654
|
+
:header_params => header_params,
|
|
655
|
+
:query_params => query_params,
|
|
656
|
+
:form_params => form_params,
|
|
657
|
+
:body => post_body,
|
|
658
|
+
:auth_names => auth_names,
|
|
659
|
+
:return_type => return_type
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
663
|
+
if @api_client.config.debugging
|
|
664
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#trigger_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
665
|
+
end
|
|
666
|
+
return data, status_code, headers
|
|
667
|
+
end
|
|
668
|
+
|
|
669
|
+
# Update a workflow
|
|
670
|
+
# Update a workflow's metadata. Only the provided fields are changed. To change the status, use the dedicated status endpoint.
|
|
671
|
+
# @param key [String] The workflow key.
|
|
672
|
+
# @param update_workflow_request [UpdateWorkflowRequest]
|
|
673
|
+
# @param [Hash] opts the optional parameters
|
|
674
|
+
# @return [CreateWorkflow201Response]
|
|
675
|
+
def update_workflow(key, update_workflow_request, opts = {})
|
|
676
|
+
data, _status_code, _headers = update_workflow_with_http_info(key, update_workflow_request, opts)
|
|
677
|
+
data
|
|
678
|
+
end
|
|
679
|
+
|
|
680
|
+
# Update a workflow
|
|
681
|
+
# Update a workflow's metadata. Only the provided fields are changed. To change the status, use the dedicated status endpoint.
|
|
682
|
+
# @param key [String] The workflow key.
|
|
683
|
+
# @param update_workflow_request [UpdateWorkflowRequest]
|
|
684
|
+
# @param [Hash] opts the optional parameters
|
|
685
|
+
# @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers
|
|
686
|
+
def update_workflow_with_http_info(key, update_workflow_request, opts = {})
|
|
687
|
+
if @api_client.config.debugging
|
|
688
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow ...'
|
|
689
|
+
end
|
|
690
|
+
# verify the required parameter 'key' is set
|
|
691
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
692
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow"
|
|
693
|
+
end
|
|
694
|
+
# verify the required parameter 'update_workflow_request' is set
|
|
695
|
+
if @api_client.config.client_side_validation && update_workflow_request.nil?
|
|
696
|
+
fail ArgumentError, "Missing the required parameter 'update_workflow_request' when calling WorkflowsApi.update_workflow"
|
|
697
|
+
end
|
|
698
|
+
# resource path
|
|
699
|
+
local_var_path = '/workflows/{key}'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
700
|
+
|
|
701
|
+
# query parameters
|
|
702
|
+
query_params = opts[:query_params] || {}
|
|
703
|
+
|
|
704
|
+
# header parameters
|
|
705
|
+
header_params = opts[:header_params] || {}
|
|
706
|
+
# HTTP header 'Accept' (if needed)
|
|
707
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
708
|
+
# HTTP header 'Content-Type'
|
|
709
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
710
|
+
if !content_type.nil?
|
|
711
|
+
header_params['Content-Type'] = content_type
|
|
712
|
+
end
|
|
713
|
+
|
|
714
|
+
# form parameters
|
|
715
|
+
form_params = opts[:form_params] || {}
|
|
716
|
+
|
|
717
|
+
# http body (model)
|
|
718
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_workflow_request)
|
|
719
|
+
|
|
720
|
+
# return_type
|
|
721
|
+
return_type = opts[:debug_return_type] || 'CreateWorkflow201Response'
|
|
722
|
+
|
|
723
|
+
# auth_names
|
|
724
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
725
|
+
|
|
726
|
+
new_options = opts.merge(
|
|
727
|
+
:operation => :"WorkflowsApi.update_workflow",
|
|
728
|
+
:header_params => header_params,
|
|
729
|
+
:query_params => query_params,
|
|
730
|
+
:form_params => form_params,
|
|
731
|
+
:body => post_body,
|
|
732
|
+
:auth_names => auth_names,
|
|
733
|
+
:return_type => return_type
|
|
734
|
+
)
|
|
735
|
+
|
|
736
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
737
|
+
if @api_client.config.debugging
|
|
738
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#update_workflow\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
739
|
+
end
|
|
740
|
+
return data, status_code, headers
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
# Update workflow status
|
|
744
|
+
# 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.
|
|
745
|
+
# @param key [String] The workflow key.
|
|
746
|
+
# @param update_workflow_status_request [UpdateWorkflowStatusRequest]
|
|
747
|
+
# @param [Hash] opts the optional parameters
|
|
748
|
+
# @return [CreateWorkflow201Response]
|
|
749
|
+
def update_workflow_status(key, update_workflow_status_request, opts = {})
|
|
750
|
+
data, _status_code, _headers = update_workflow_status_with_http_info(key, update_workflow_status_request, opts)
|
|
751
|
+
data
|
|
752
|
+
end
|
|
753
|
+
|
|
754
|
+
# Update workflow status
|
|
755
|
+
# 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.
|
|
756
|
+
# @param key [String] The workflow key.
|
|
757
|
+
# @param update_workflow_status_request [UpdateWorkflowStatusRequest]
|
|
758
|
+
# @param [Hash] opts the optional parameters
|
|
759
|
+
# @return [Array<(CreateWorkflow201Response, Integer, Hash)>] CreateWorkflow201Response data, response status code and response headers
|
|
760
|
+
def update_workflow_status_with_http_info(key, update_workflow_status_request, opts = {})
|
|
761
|
+
if @api_client.config.debugging
|
|
762
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow_status ...'
|
|
763
|
+
end
|
|
764
|
+
# verify the required parameter 'key' is set
|
|
765
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
766
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow_status"
|
|
767
|
+
end
|
|
768
|
+
# verify the required parameter 'update_workflow_status_request' is set
|
|
769
|
+
if @api_client.config.client_side_validation && update_workflow_status_request.nil?
|
|
770
|
+
fail ArgumentError, "Missing the required parameter 'update_workflow_status_request' when calling WorkflowsApi.update_workflow_status"
|
|
771
|
+
end
|
|
772
|
+
# resource path
|
|
773
|
+
local_var_path = '/workflows/{key}/status'.sub('{' + 'key' + '}', CGI.escape(key.to_s))
|
|
774
|
+
|
|
775
|
+
# query parameters
|
|
776
|
+
query_params = opts[:query_params] || {}
|
|
777
|
+
|
|
778
|
+
# header parameters
|
|
779
|
+
header_params = opts[:header_params] || {}
|
|
780
|
+
# HTTP header 'Accept' (if needed)
|
|
781
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
782
|
+
# HTTP header 'Content-Type'
|
|
783
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
784
|
+
if !content_type.nil?
|
|
785
|
+
header_params['Content-Type'] = content_type
|
|
786
|
+
end
|
|
787
|
+
|
|
788
|
+
# form parameters
|
|
789
|
+
form_params = opts[:form_params] || {}
|
|
790
|
+
|
|
791
|
+
# http body (model)
|
|
792
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_workflow_status_request)
|
|
793
|
+
|
|
794
|
+
# return_type
|
|
795
|
+
return_type = opts[:debug_return_type] || 'CreateWorkflow201Response'
|
|
796
|
+
|
|
797
|
+
# auth_names
|
|
798
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
799
|
+
|
|
800
|
+
new_options = opts.merge(
|
|
801
|
+
:operation => :"WorkflowsApi.update_workflow_status",
|
|
802
|
+
:header_params => header_params,
|
|
803
|
+
:query_params => query_params,
|
|
804
|
+
:form_params => form_params,
|
|
805
|
+
:body => post_body,
|
|
806
|
+
:auth_names => auth_names,
|
|
807
|
+
:return_type => return_type
|
|
808
|
+
)
|
|
809
|
+
|
|
810
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
811
|
+
if @api_client.config.debugging
|
|
812
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#update_workflow_status\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
813
|
+
end
|
|
814
|
+
return data, status_code, headers
|
|
815
|
+
end
|
|
816
|
+
|
|
817
|
+
# Update a workflow step
|
|
818
|
+
# Update a step's name and/or config. Only the provided fields are changed.
|
|
819
|
+
# @param key [String] The workflow key.
|
|
820
|
+
# @param step_key [String] The step key.
|
|
821
|
+
# @param update_workflow_step_request [UpdateWorkflowStepRequest]
|
|
822
|
+
# @param [Hash] opts the optional parameters
|
|
823
|
+
# @return [AddWorkflowStep201Response]
|
|
824
|
+
def update_workflow_step(key, step_key, update_workflow_step_request, opts = {})
|
|
825
|
+
data, _status_code, _headers = update_workflow_step_with_http_info(key, step_key, update_workflow_step_request, opts)
|
|
826
|
+
data
|
|
827
|
+
end
|
|
828
|
+
|
|
829
|
+
# Update a workflow step
|
|
830
|
+
# Update a step's name and/or config. Only the provided fields are changed.
|
|
831
|
+
# @param key [String] The workflow key.
|
|
832
|
+
# @param step_key [String] The step key.
|
|
833
|
+
# @param update_workflow_step_request [UpdateWorkflowStepRequest]
|
|
834
|
+
# @param [Hash] opts the optional parameters
|
|
835
|
+
# @return [Array<(AddWorkflowStep201Response, Integer, Hash)>] AddWorkflowStep201Response data, response status code and response headers
|
|
836
|
+
def update_workflow_step_with_http_info(key, step_key, update_workflow_step_request, opts = {})
|
|
837
|
+
if @api_client.config.debugging
|
|
838
|
+
@api_client.config.logger.debug 'Calling API: WorkflowsApi.update_workflow_step ...'
|
|
839
|
+
end
|
|
840
|
+
# verify the required parameter 'key' is set
|
|
841
|
+
if @api_client.config.client_side_validation && key.nil?
|
|
842
|
+
fail ArgumentError, "Missing the required parameter 'key' when calling WorkflowsApi.update_workflow_step"
|
|
843
|
+
end
|
|
844
|
+
# verify the required parameter 'step_key' is set
|
|
845
|
+
if @api_client.config.client_side_validation && step_key.nil?
|
|
846
|
+
fail ArgumentError, "Missing the required parameter 'step_key' when calling WorkflowsApi.update_workflow_step"
|
|
847
|
+
end
|
|
848
|
+
# verify the required parameter 'update_workflow_step_request' is set
|
|
849
|
+
if @api_client.config.client_side_validation && update_workflow_step_request.nil?
|
|
850
|
+
fail ArgumentError, "Missing the required parameter 'update_workflow_step_request' when calling WorkflowsApi.update_workflow_step"
|
|
851
|
+
end
|
|
852
|
+
# resource path
|
|
853
|
+
local_var_path = '/workflows/{key}/steps/{stepKey}'.sub('{' + 'key' + '}', CGI.escape(key.to_s)).sub('{' + 'stepKey' + '}', CGI.escape(step_key.to_s))
|
|
854
|
+
|
|
855
|
+
# query parameters
|
|
856
|
+
query_params = opts[:query_params] || {}
|
|
857
|
+
|
|
858
|
+
# header parameters
|
|
859
|
+
header_params = opts[:header_params] || {}
|
|
860
|
+
# HTTP header 'Accept' (if needed)
|
|
861
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
862
|
+
# HTTP header 'Content-Type'
|
|
863
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
864
|
+
if !content_type.nil?
|
|
865
|
+
header_params['Content-Type'] = content_type
|
|
866
|
+
end
|
|
867
|
+
|
|
868
|
+
# form parameters
|
|
869
|
+
form_params = opts[:form_params] || {}
|
|
870
|
+
|
|
871
|
+
# http body (model)
|
|
872
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_workflow_step_request)
|
|
873
|
+
|
|
874
|
+
# return_type
|
|
875
|
+
return_type = opts[:debug_return_type] || 'AddWorkflowStep201Response'
|
|
876
|
+
|
|
877
|
+
# auth_names
|
|
878
|
+
auth_names = opts[:debug_auth_names] || ['ApiKeyAuth']
|
|
879
|
+
|
|
880
|
+
new_options = opts.merge(
|
|
881
|
+
:operation => :"WorkflowsApi.update_workflow_step",
|
|
882
|
+
:header_params => header_params,
|
|
883
|
+
:query_params => query_params,
|
|
884
|
+
:form_params => form_params,
|
|
885
|
+
:body => post_body,
|
|
886
|
+
:auth_names => auth_names,
|
|
887
|
+
:return_type => return_type
|
|
888
|
+
)
|
|
889
|
+
|
|
890
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
891
|
+
if @api_client.config.debugging
|
|
892
|
+
@api_client.config.logger.debug "API called: WorkflowsApi#update_workflow_step\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
893
|
+
end
|
|
894
|
+
return data, status_code, headers
|
|
895
|
+
end
|
|
896
|
+
end
|
|
897
|
+
end
|