hatchet-sdk 0.5.0 → 0.7.0
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/CHANGELOG.md +14 -0
- data/lib/hatchet/batch.rb +58 -0
- data/lib/hatchet/clients/grpc/dispatcher.rb +42 -0
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +9 -0
- data/lib/hatchet/clients/rest/README.md +16 -3
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/filter_api.rb +4 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/operator_api.rb +405 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/webhook_api.rb +2 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/worker_api.rb +3 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/api_meta.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/create_tenant_invite_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request.rb +105 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_pause.rb +343 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_unpause.rb +262 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_invite.rb +11 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member.rb +11 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member_role.rb +2 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_invite_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_member_request.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb +346 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_event.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator.rb +372 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator_list.rb +231 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_event_type.rb +3 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_summary.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb +252 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_workflow_run.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow.rb +43 -1
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_pause_scheduled_cron_run_queue_behavior.rb +40 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_update_request.rb +7 -8
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +9 -0
- data/lib/hatchet/concurrency.rb +5 -1
- data/lib/hatchet/context.rb +42 -3
- data/lib/hatchet/contracts/dispatcher/dispatcher_pb.rb +4 -1
- data/lib/hatchet/contracts/dispatcher/dispatcher_services_pb.rb +3 -0
- data/lib/hatchet/contracts/v1/workflows_pb.rb +2 -1
- data/lib/hatchet/durable_context.rb +5 -12
- data/lib/hatchet/features/cel.rb +2 -2
- data/lib/hatchet/features/cron.rb +5 -5
- data/lib/hatchet/features/events.rb +7 -7
- data/lib/hatchet/features/filters.rb +7 -7
- data/lib/hatchet/features/logs.rb +2 -2
- data/lib/hatchet/features/metrics.rb +6 -6
- data/lib/hatchet/features/rate_limits.rb +2 -2
- data/lib/hatchet/features/runs.rb +4 -5
- data/lib/hatchet/features/scheduled.rb +7 -7
- data/lib/hatchet/features/tenant.rb +2 -2
- data/lib/hatchet/features/workers.rb +5 -5
- data/lib/hatchet/features/workflows.rb +6 -6
- data/lib/hatchet/task.rb +13 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/worker/runner.rb +113 -0
- data/lib/hatchet/workflow.rb +77 -33
- data/lib/hatchet-sdk.rb +86 -28
- data/sig/hatchet/batch.rbs +12 -0
- data/sig/hatchet/task.rbs +2 -0
- metadata +13 -2
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Hatchet API
|
|
3
|
+
|
|
4
|
+
#The Hatchet API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module HatchetSdkRest
|
|
16
|
+
class OperatorApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Create an HTTP operator
|
|
23
|
+
# Create a new HTTP operator
|
|
24
|
+
# @param tenant [String] The tenant id
|
|
25
|
+
# @param v1_create_http_operator_request [V1CreateHTTPOperatorRequest] The input to the HTTP operator creation
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [V1HTTPOperator]
|
|
28
|
+
def v1_http_operator_create(tenant, v1_create_http_operator_request, opts = {})
|
|
29
|
+
data, _status_code, _headers = v1_http_operator_create_with_http_info(tenant, v1_create_http_operator_request, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Create an HTTP operator
|
|
34
|
+
# Create a new HTTP operator
|
|
35
|
+
# @param tenant [String] The tenant id
|
|
36
|
+
# @param v1_create_http_operator_request [V1CreateHTTPOperatorRequest] The input to the HTTP operator creation
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(V1HTTPOperator, Integer, Hash)>] V1HTTPOperator data, response status code and response headers
|
|
39
|
+
def v1_http_operator_create_with_http_info(tenant, v1_create_http_operator_request, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: OperatorApi.v1_http_operator_create ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'tenant' is set
|
|
44
|
+
if @api_client.config.client_side_validation && tenant.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'tenant' when calling OperatorApi.v1_http_operator_create"
|
|
46
|
+
end
|
|
47
|
+
if @api_client.config.client_side_validation && tenant.to_s.length > 36
|
|
48
|
+
fail ArgumentError, 'invalid value for "tenant" when calling OperatorApi.v1_http_operator_create, the character length must be smaller than or equal to 36.'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
if @api_client.config.client_side_validation && tenant.to_s.length < 36
|
|
52
|
+
fail ArgumentError, 'invalid value for "tenant" when calling OperatorApi.v1_http_operator_create, the character length must be greater than or equal to 36.'
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# verify the required parameter 'v1_create_http_operator_request' is set
|
|
56
|
+
if @api_client.config.client_side_validation && v1_create_http_operator_request.nil?
|
|
57
|
+
fail ArgumentError, "Missing the required parameter 'v1_create_http_operator_request' when calling OperatorApi.v1_http_operator_create"
|
|
58
|
+
end
|
|
59
|
+
# resource path
|
|
60
|
+
local_var_path = '/api/v1/stable/tenants/{tenant}/operators/http'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
|
|
61
|
+
|
|
62
|
+
# query parameters
|
|
63
|
+
query_params = opts[:query_params] || {}
|
|
64
|
+
|
|
65
|
+
# header parameters
|
|
66
|
+
header_params = opts[:header_params] || {}
|
|
67
|
+
# HTTP header 'Accept' (if needed)
|
|
68
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
69
|
+
# HTTP header 'Content-Type'
|
|
70
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
71
|
+
if !content_type.nil?
|
|
72
|
+
header_params['Content-Type'] = content_type
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# form parameters
|
|
76
|
+
form_params = opts[:form_params] || {}
|
|
77
|
+
|
|
78
|
+
# http body (model)
|
|
79
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(v1_create_http_operator_request)
|
|
80
|
+
|
|
81
|
+
# return_type
|
|
82
|
+
return_type = opts[:debug_return_type] || 'V1HTTPOperator'
|
|
83
|
+
|
|
84
|
+
# auth_names
|
|
85
|
+
auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
|
|
86
|
+
|
|
87
|
+
new_options = opts.merge(
|
|
88
|
+
:operation => :"OperatorApi.v1_http_operator_create",
|
|
89
|
+
:header_params => header_params,
|
|
90
|
+
:query_params => query_params,
|
|
91
|
+
:form_params => form_params,
|
|
92
|
+
:body => post_body,
|
|
93
|
+
:auth_names => auth_names,
|
|
94
|
+
:return_type => return_type
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
98
|
+
if @api_client.config.debugging
|
|
99
|
+
@api_client.config.logger.debug "API called: OperatorApi#v1_http_operator_create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
100
|
+
end
|
|
101
|
+
return data, status_code, headers
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Delete an HTTP operator
|
|
105
|
+
# Delete an HTTP operator
|
|
106
|
+
# @param v1_http_operator [String] The id of the HTTP operator to delete
|
|
107
|
+
# @param [Hash] opts the optional parameters
|
|
108
|
+
# @return [V1HTTPOperator]
|
|
109
|
+
def v1_http_operator_delete(v1_http_operator, opts = {})
|
|
110
|
+
data, _status_code, _headers = v1_http_operator_delete_with_http_info(v1_http_operator, opts)
|
|
111
|
+
data
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Delete an HTTP operator
|
|
115
|
+
# Delete an HTTP operator
|
|
116
|
+
# @param v1_http_operator [String] The id of the HTTP operator to delete
|
|
117
|
+
# @param [Hash] opts the optional parameters
|
|
118
|
+
# @return [Array<(V1HTTPOperator, Integer, Hash)>] V1HTTPOperator data, response status code and response headers
|
|
119
|
+
def v1_http_operator_delete_with_http_info(v1_http_operator, opts = {})
|
|
120
|
+
if @api_client.config.debugging
|
|
121
|
+
@api_client.config.logger.debug 'Calling API: OperatorApi.v1_http_operator_delete ...'
|
|
122
|
+
end
|
|
123
|
+
# verify the required parameter 'v1_http_operator' is set
|
|
124
|
+
if @api_client.config.client_side_validation && v1_http_operator.nil?
|
|
125
|
+
fail ArgumentError, "Missing the required parameter 'v1_http_operator' when calling OperatorApi.v1_http_operator_delete"
|
|
126
|
+
end
|
|
127
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length > 36
|
|
128
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_delete, the character length must be smaller than or equal to 36.'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length < 36
|
|
132
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_delete, the character length must be greater than or equal to 36.'
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# resource path
|
|
136
|
+
local_var_path = '/api/v1/stable/operators/http/{v1-http-operator}'.sub('{' + 'v1-http-operator' + '}', CGI.escape(v1_http_operator.to_s))
|
|
137
|
+
|
|
138
|
+
# query parameters
|
|
139
|
+
query_params = opts[:query_params] || {}
|
|
140
|
+
|
|
141
|
+
# header parameters
|
|
142
|
+
header_params = opts[:header_params] || {}
|
|
143
|
+
# HTTP header 'Accept' (if needed)
|
|
144
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
145
|
+
|
|
146
|
+
# form parameters
|
|
147
|
+
form_params = opts[:form_params] || {}
|
|
148
|
+
|
|
149
|
+
# http body (model)
|
|
150
|
+
post_body = opts[:debug_body]
|
|
151
|
+
|
|
152
|
+
# return_type
|
|
153
|
+
return_type = opts[:debug_return_type] || 'V1HTTPOperator'
|
|
154
|
+
|
|
155
|
+
# auth_names
|
|
156
|
+
auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
|
|
157
|
+
|
|
158
|
+
new_options = opts.merge(
|
|
159
|
+
:operation => :"OperatorApi.v1_http_operator_delete",
|
|
160
|
+
:header_params => header_params,
|
|
161
|
+
:query_params => query_params,
|
|
162
|
+
:form_params => form_params,
|
|
163
|
+
:body => post_body,
|
|
164
|
+
:auth_names => auth_names,
|
|
165
|
+
:return_type => return_type
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
169
|
+
if @api_client.config.debugging
|
|
170
|
+
@api_client.config.logger.debug "API called: OperatorApi#v1_http_operator_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
171
|
+
end
|
|
172
|
+
return data, status_code, headers
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Get an HTTP operator
|
|
176
|
+
# Get an HTTP operator by its id
|
|
177
|
+
# @param v1_http_operator [String] The HTTP operator id
|
|
178
|
+
# @param [Hash] opts the optional parameters
|
|
179
|
+
# @return [V1HTTPOperator]
|
|
180
|
+
def v1_http_operator_get(v1_http_operator, opts = {})
|
|
181
|
+
data, _status_code, _headers = v1_http_operator_get_with_http_info(v1_http_operator, opts)
|
|
182
|
+
data
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Get an HTTP operator
|
|
186
|
+
# Get an HTTP operator by its id
|
|
187
|
+
# @param v1_http_operator [String] The HTTP operator id
|
|
188
|
+
# @param [Hash] opts the optional parameters
|
|
189
|
+
# @return [Array<(V1HTTPOperator, Integer, Hash)>] V1HTTPOperator data, response status code and response headers
|
|
190
|
+
def v1_http_operator_get_with_http_info(v1_http_operator, opts = {})
|
|
191
|
+
if @api_client.config.debugging
|
|
192
|
+
@api_client.config.logger.debug 'Calling API: OperatorApi.v1_http_operator_get ...'
|
|
193
|
+
end
|
|
194
|
+
# verify the required parameter 'v1_http_operator' is set
|
|
195
|
+
if @api_client.config.client_side_validation && v1_http_operator.nil?
|
|
196
|
+
fail ArgumentError, "Missing the required parameter 'v1_http_operator' when calling OperatorApi.v1_http_operator_get"
|
|
197
|
+
end
|
|
198
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length > 36
|
|
199
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_get, the character length must be smaller than or equal to 36.'
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length < 36
|
|
203
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_get, the character length must be greater than or equal to 36.'
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# resource path
|
|
207
|
+
local_var_path = '/api/v1/stable/operators/http/{v1-http-operator}'.sub('{' + 'v1-http-operator' + '}', CGI.escape(v1_http_operator.to_s))
|
|
208
|
+
|
|
209
|
+
# query parameters
|
|
210
|
+
query_params = opts[:query_params] || {}
|
|
211
|
+
|
|
212
|
+
# header parameters
|
|
213
|
+
header_params = opts[:header_params] || {}
|
|
214
|
+
# HTTP header 'Accept' (if needed)
|
|
215
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
216
|
+
|
|
217
|
+
# form parameters
|
|
218
|
+
form_params = opts[:form_params] || {}
|
|
219
|
+
|
|
220
|
+
# http body (model)
|
|
221
|
+
post_body = opts[:debug_body]
|
|
222
|
+
|
|
223
|
+
# return_type
|
|
224
|
+
return_type = opts[:debug_return_type] || 'V1HTTPOperator'
|
|
225
|
+
|
|
226
|
+
# auth_names
|
|
227
|
+
auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
|
|
228
|
+
|
|
229
|
+
new_options = opts.merge(
|
|
230
|
+
:operation => :"OperatorApi.v1_http_operator_get",
|
|
231
|
+
:header_params => header_params,
|
|
232
|
+
:query_params => query_params,
|
|
233
|
+
:form_params => form_params,
|
|
234
|
+
:body => post_body,
|
|
235
|
+
:auth_names => auth_names,
|
|
236
|
+
:return_type => return_type
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
240
|
+
if @api_client.config.debugging
|
|
241
|
+
@api_client.config.logger.debug "API called: OperatorApi#v1_http_operator_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
242
|
+
end
|
|
243
|
+
return data, status_code, headers
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# List HTTP operators
|
|
247
|
+
# Lists all HTTP operators for a tenant.
|
|
248
|
+
# @param tenant [String] The tenant id
|
|
249
|
+
# @param [Hash] opts the optional parameters
|
|
250
|
+
# @option opts [Integer] :offset The number to skip
|
|
251
|
+
# @option opts [Integer] :limit The number to limit by
|
|
252
|
+
# @return [V1HTTPOperatorList]
|
|
253
|
+
def v1_http_operator_list(tenant, opts = {})
|
|
254
|
+
data, _status_code, _headers = v1_http_operator_list_with_http_info(tenant, opts)
|
|
255
|
+
data
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# List HTTP operators
|
|
259
|
+
# Lists all HTTP operators for a tenant.
|
|
260
|
+
# @param tenant [String] The tenant id
|
|
261
|
+
# @param [Hash] opts the optional parameters
|
|
262
|
+
# @option opts [Integer] :offset The number to skip
|
|
263
|
+
# @option opts [Integer] :limit The number to limit by
|
|
264
|
+
# @return [Array<(V1HTTPOperatorList, Integer, Hash)>] V1HTTPOperatorList data, response status code and response headers
|
|
265
|
+
def v1_http_operator_list_with_http_info(tenant, opts = {})
|
|
266
|
+
if @api_client.config.debugging
|
|
267
|
+
@api_client.config.logger.debug 'Calling API: OperatorApi.v1_http_operator_list ...'
|
|
268
|
+
end
|
|
269
|
+
# verify the required parameter 'tenant' is set
|
|
270
|
+
if @api_client.config.client_side_validation && tenant.nil?
|
|
271
|
+
fail ArgumentError, "Missing the required parameter 'tenant' when calling OperatorApi.v1_http_operator_list"
|
|
272
|
+
end
|
|
273
|
+
if @api_client.config.client_side_validation && tenant.to_s.length > 36
|
|
274
|
+
fail ArgumentError, 'invalid value for "tenant" when calling OperatorApi.v1_http_operator_list, the character length must be smaller than or equal to 36.'
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
if @api_client.config.client_side_validation && tenant.to_s.length < 36
|
|
278
|
+
fail ArgumentError, 'invalid value for "tenant" when calling OperatorApi.v1_http_operator_list, the character length must be greater than or equal to 36.'
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
# resource path
|
|
282
|
+
local_var_path = '/api/v1/stable/tenants/{tenant}/operators/http'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
|
|
283
|
+
|
|
284
|
+
# query parameters
|
|
285
|
+
query_params = opts[:query_params] || {}
|
|
286
|
+
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
287
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
288
|
+
|
|
289
|
+
# header parameters
|
|
290
|
+
header_params = opts[:header_params] || {}
|
|
291
|
+
# HTTP header 'Accept' (if needed)
|
|
292
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
293
|
+
|
|
294
|
+
# form parameters
|
|
295
|
+
form_params = opts[:form_params] || {}
|
|
296
|
+
|
|
297
|
+
# http body (model)
|
|
298
|
+
post_body = opts[:debug_body]
|
|
299
|
+
|
|
300
|
+
# return_type
|
|
301
|
+
return_type = opts[:debug_return_type] || 'V1HTTPOperatorList'
|
|
302
|
+
|
|
303
|
+
# auth_names
|
|
304
|
+
auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
|
|
305
|
+
|
|
306
|
+
new_options = opts.merge(
|
|
307
|
+
:operation => :"OperatorApi.v1_http_operator_list",
|
|
308
|
+
:header_params => header_params,
|
|
309
|
+
:query_params => query_params,
|
|
310
|
+
:form_params => form_params,
|
|
311
|
+
:body => post_body,
|
|
312
|
+
:auth_names => auth_names,
|
|
313
|
+
:return_type => return_type
|
|
314
|
+
)
|
|
315
|
+
|
|
316
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
317
|
+
if @api_client.config.debugging
|
|
318
|
+
@api_client.config.logger.debug "API called: OperatorApi#v1_http_operator_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
319
|
+
end
|
|
320
|
+
return data, status_code, headers
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Update an HTTP operator
|
|
324
|
+
# Update an HTTP operator
|
|
325
|
+
# @param v1_http_operator [String] The id of the HTTP operator to update
|
|
326
|
+
# @param v1_update_http_operator_request [V1UpdateHTTPOperatorRequest] The fields to update on the HTTP operator
|
|
327
|
+
# @param [Hash] opts the optional parameters
|
|
328
|
+
# @return [V1HTTPOperator]
|
|
329
|
+
def v1_http_operator_update(v1_http_operator, v1_update_http_operator_request, opts = {})
|
|
330
|
+
data, _status_code, _headers = v1_http_operator_update_with_http_info(v1_http_operator, v1_update_http_operator_request, opts)
|
|
331
|
+
data
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Update an HTTP operator
|
|
335
|
+
# Update an HTTP operator
|
|
336
|
+
# @param v1_http_operator [String] The id of the HTTP operator to update
|
|
337
|
+
# @param v1_update_http_operator_request [V1UpdateHTTPOperatorRequest] The fields to update on the HTTP operator
|
|
338
|
+
# @param [Hash] opts the optional parameters
|
|
339
|
+
# @return [Array<(V1HTTPOperator, Integer, Hash)>] V1HTTPOperator data, response status code and response headers
|
|
340
|
+
def v1_http_operator_update_with_http_info(v1_http_operator, v1_update_http_operator_request, opts = {})
|
|
341
|
+
if @api_client.config.debugging
|
|
342
|
+
@api_client.config.logger.debug 'Calling API: OperatorApi.v1_http_operator_update ...'
|
|
343
|
+
end
|
|
344
|
+
# verify the required parameter 'v1_http_operator' is set
|
|
345
|
+
if @api_client.config.client_side_validation && v1_http_operator.nil?
|
|
346
|
+
fail ArgumentError, "Missing the required parameter 'v1_http_operator' when calling OperatorApi.v1_http_operator_update"
|
|
347
|
+
end
|
|
348
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length > 36
|
|
349
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_update, the character length must be smaller than or equal to 36.'
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
if @api_client.config.client_side_validation && v1_http_operator.to_s.length < 36
|
|
353
|
+
fail ArgumentError, 'invalid value for "v1_http_operator" when calling OperatorApi.v1_http_operator_update, the character length must be greater than or equal to 36.'
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
# verify the required parameter 'v1_update_http_operator_request' is set
|
|
357
|
+
if @api_client.config.client_side_validation && v1_update_http_operator_request.nil?
|
|
358
|
+
fail ArgumentError, "Missing the required parameter 'v1_update_http_operator_request' when calling OperatorApi.v1_http_operator_update"
|
|
359
|
+
end
|
|
360
|
+
# resource path
|
|
361
|
+
local_var_path = '/api/v1/stable/operators/http/{v1-http-operator}'.sub('{' + 'v1-http-operator' + '}', CGI.escape(v1_http_operator.to_s))
|
|
362
|
+
|
|
363
|
+
# query parameters
|
|
364
|
+
query_params = opts[:query_params] || {}
|
|
365
|
+
|
|
366
|
+
# header parameters
|
|
367
|
+
header_params = opts[:header_params] || {}
|
|
368
|
+
# HTTP header 'Accept' (if needed)
|
|
369
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
370
|
+
# HTTP header 'Content-Type'
|
|
371
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
372
|
+
if !content_type.nil?
|
|
373
|
+
header_params['Content-Type'] = content_type
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
# form parameters
|
|
377
|
+
form_params = opts[:form_params] || {}
|
|
378
|
+
|
|
379
|
+
# http body (model)
|
|
380
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(v1_update_http_operator_request)
|
|
381
|
+
|
|
382
|
+
# return_type
|
|
383
|
+
return_type = opts[:debug_return_type] || 'V1HTTPOperator'
|
|
384
|
+
|
|
385
|
+
# auth_names
|
|
386
|
+
auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
|
|
387
|
+
|
|
388
|
+
new_options = opts.merge(
|
|
389
|
+
:operation => :"OperatorApi.v1_http_operator_update",
|
|
390
|
+
:header_params => header_params,
|
|
391
|
+
:query_params => query_params,
|
|
392
|
+
:form_params => form_params,
|
|
393
|
+
:body => post_body,
|
|
394
|
+
:auth_names => auth_names,
|
|
395
|
+
:return_type => return_type
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
|
399
|
+
if @api_client.config.debugging
|
|
400
|
+
@api_client.config.logger.debug "API called: OperatorApi#v1_http_operator_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
401
|
+
end
|
|
402
|
+
return data, status_code, headers
|
|
403
|
+
end
|
|
404
|
+
end
|
|
405
|
+
end
|
|
@@ -101,6 +101,7 @@ module HatchetSdkRest
|
|
|
101
101
|
return data, status_code, headers
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
+
# Delete a webhook
|
|
104
105
|
# Delete a webhook
|
|
105
106
|
# @param tenant [String] The tenant id
|
|
106
107
|
# @param v1_webhook [String] The name of the webhook to delete
|
|
@@ -111,6 +112,7 @@ module HatchetSdkRest
|
|
|
111
112
|
data
|
|
112
113
|
end
|
|
113
114
|
|
|
115
|
+
# Delete a webhook
|
|
114
116
|
# Delete a webhook
|
|
115
117
|
# @param tenant [String] The tenant id
|
|
116
118
|
# @param v1_webhook [String] The name of the webhook to delete
|
|
@@ -97,6 +97,7 @@ module HatchetSdkRest
|
|
|
97
97
|
# @option opts [Integer] :offset The number to skip
|
|
98
98
|
# @option opts [Integer] :limit The number to limit by
|
|
99
99
|
# @option opts [Array<WorkerStatus>] :statuses Filter by worker status
|
|
100
|
+
# @option opts [Array<String>] :labels Filter by worker labels
|
|
100
101
|
# @return [WorkerList]
|
|
101
102
|
def worker_list(tenant, opts = {})
|
|
102
103
|
data, _status_code, _headers = worker_list_with_http_info(tenant, opts)
|
|
@@ -110,6 +111,7 @@ module HatchetSdkRest
|
|
|
110
111
|
# @option opts [Integer] :offset The number to skip
|
|
111
112
|
# @option opts [Integer] :limit The number to limit by
|
|
112
113
|
# @option opts [Array<WorkerStatus>] :statuses Filter by worker status
|
|
114
|
+
# @option opts [Array<String>] :labels Filter by worker labels
|
|
113
115
|
# @return [Array<(WorkerList, Integer, Hash)>] WorkerList data, response status code and response headers
|
|
114
116
|
def worker_list_with_http_info(tenant, opts = {})
|
|
115
117
|
if @api_client.config.debugging
|
|
@@ -135,6 +137,7 @@ module HatchetSdkRest
|
|
|
135
137
|
query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
|
|
136
138
|
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
137
139
|
query_params[:'statuses'] = @api_client.build_collection_param(opts[:'statuses'], :multi) if !opts[:'statuses'].nil?
|
|
140
|
+
query_params[:'labels'] = @api_client.build_collection_param(opts[:'labels'], :multi) if !opts[:'labels'].nil?
|
|
138
141
|
|
|
139
142
|
# header parameters
|
|
140
143
|
header_params = opts[:header_params] || {}
|
|
@@ -46,6 +46,9 @@ module HatchetSdkRest
|
|
|
46
46
|
# the embedded worker API token, only set on authdisabled builds
|
|
47
47
|
attr_accessor :auth_disabled_token
|
|
48
48
|
|
|
49
|
+
# whether this instance is running in embedded mode
|
|
50
|
+
attr_accessor :embedded
|
|
51
|
+
|
|
49
52
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
50
53
|
def self.attribute_map
|
|
51
54
|
{
|
|
@@ -59,7 +62,8 @@ module HatchetSdkRest
|
|
|
59
62
|
:'observability_enabled' => :'observabilityEnabled',
|
|
60
63
|
:'prometheus_server_enabled' => :'prometheusServerEnabled',
|
|
61
64
|
:'auth_disabled' => :'authDisabled',
|
|
62
|
-
:'auth_disabled_token' => :'authDisabledToken'
|
|
65
|
+
:'auth_disabled_token' => :'authDisabledToken',
|
|
66
|
+
:'embedded' => :'embedded'
|
|
63
67
|
}
|
|
64
68
|
end
|
|
65
69
|
|
|
@@ -86,7 +90,8 @@ module HatchetSdkRest
|
|
|
86
90
|
:'observability_enabled' => :'Boolean',
|
|
87
91
|
:'prometheus_server_enabled' => :'Boolean',
|
|
88
92
|
:'auth_disabled' => :'Boolean',
|
|
89
|
-
:'auth_disabled_token' => :'String'
|
|
93
|
+
:'auth_disabled_token' => :'String',
|
|
94
|
+
:'embedded' => :'Boolean'
|
|
90
95
|
}
|
|
91
96
|
end
|
|
92
97
|
|
|
@@ -155,6 +160,10 @@ module HatchetSdkRest
|
|
|
155
160
|
if attributes.key?(:'auth_disabled_token')
|
|
156
161
|
self.auth_disabled_token = attributes[:'auth_disabled_token']
|
|
157
162
|
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'embedded')
|
|
165
|
+
self.embedded = attributes[:'embedded']
|
|
166
|
+
end
|
|
158
167
|
end
|
|
159
168
|
|
|
160
169
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -187,7 +196,8 @@ module HatchetSdkRest
|
|
|
187
196
|
observability_enabled == o.observability_enabled &&
|
|
188
197
|
prometheus_server_enabled == o.prometheus_server_enabled &&
|
|
189
198
|
auth_disabled == o.auth_disabled &&
|
|
190
|
-
auth_disabled_token == o.auth_disabled_token
|
|
199
|
+
auth_disabled_token == o.auth_disabled_token &&
|
|
200
|
+
embedded == o.embedded
|
|
191
201
|
end
|
|
192
202
|
|
|
193
203
|
# @see the `==` method
|
|
@@ -199,7 +209,7 @@ module HatchetSdkRest
|
|
|
199
209
|
# Calculates hash code according to all attributes.
|
|
200
210
|
# @return [Integer] Hash code
|
|
201
211
|
def hash
|
|
202
|
-
[auth, pylon_app_id, posthog, allow_signup, allow_invites, allow_create_tenant, allow_change_password, observability_enabled, prometheus_server_enabled, auth_disabled, auth_disabled_token].hash
|
|
212
|
+
[auth, pylon_app_id, posthog, allow_signup, allow_invites, allow_create_tenant, allow_change_password, observability_enabled, prometheus_server_enabled, auth_disabled, auth_disabled_token, embedded].hash
|
|
203
213
|
end
|
|
204
214
|
|
|
205
215
|
# Builds the object from hash
|
|
@@ -21,6 +21,9 @@ module HatchetSdkRest
|
|
|
21
21
|
# The role of the user in the tenant.
|
|
22
22
|
attr_accessor :role
|
|
23
23
|
|
|
24
|
+
# Whether the invited user can view payloads. Defaults to true.
|
|
25
|
+
attr_accessor :can_view_payloads
|
|
26
|
+
|
|
24
27
|
class EnumAttributeValidator
|
|
25
28
|
attr_reader :datatype
|
|
26
29
|
attr_reader :allowable_values
|
|
@@ -47,7 +50,8 @@ module HatchetSdkRest
|
|
|
47
50
|
def self.attribute_map
|
|
48
51
|
{
|
|
49
52
|
:'email' => :'email',
|
|
50
|
-
:'role' => :'role'
|
|
53
|
+
:'role' => :'role',
|
|
54
|
+
:'can_view_payloads' => :'canViewPayloads'
|
|
51
55
|
}
|
|
52
56
|
end
|
|
53
57
|
|
|
@@ -65,7 +69,8 @@ module HatchetSdkRest
|
|
|
65
69
|
def self.openapi_types
|
|
66
70
|
{
|
|
67
71
|
:'email' => :'String',
|
|
68
|
-
:'role' => :'TenantMemberRole'
|
|
72
|
+
:'role' => :'TenantMemberRole',
|
|
73
|
+
:'can_view_payloads' => :'Boolean'
|
|
69
74
|
}
|
|
70
75
|
end
|
|
71
76
|
|
|
@@ -102,6 +107,10 @@ module HatchetSdkRest
|
|
|
102
107
|
else
|
|
103
108
|
self.role = nil
|
|
104
109
|
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'can_view_payloads')
|
|
112
|
+
self.can_view_payloads = attributes[:'can_view_payloads']
|
|
113
|
+
end
|
|
105
114
|
end
|
|
106
115
|
|
|
107
116
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -155,7 +164,8 @@ module HatchetSdkRest
|
|
|
155
164
|
return true if self.equal?(o)
|
|
156
165
|
self.class == o.class &&
|
|
157
166
|
email == o.email &&
|
|
158
|
-
role == o.role
|
|
167
|
+
role == o.role &&
|
|
168
|
+
can_view_payloads == o.can_view_payloads
|
|
159
169
|
end
|
|
160
170
|
|
|
161
171
|
# @see the `==` method
|
|
@@ -167,7 +177,7 @@ module HatchetSdkRest
|
|
|
167
177
|
# Calculates hash code according to all attributes.
|
|
168
178
|
# @return [Integer] Hash code
|
|
169
179
|
def hash
|
|
170
|
-
[email, role].hash
|
|
180
|
+
[email, role, can_view_payloads].hash
|
|
171
181
|
end
|
|
172
182
|
|
|
173
183
|
# Builds the object from hash
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Hatchet API
|
|
3
|
+
|
|
4
|
+
#The Hatchet API
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.14.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module HatchetSdkRest
|
|
17
|
+
module PauseWorkflowRequest
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'PauseWorkflowRequestPause',
|
|
23
|
+
:'PauseWorkflowRequestUnpause'
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Builds the object
|
|
28
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
29
|
+
# @return [Object] Returns the model or the data itself
|
|
30
|
+
def build(data)
|
|
31
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
32
|
+
# Note:
|
|
33
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
34
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
35
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
36
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
37
|
+
# - TODO: logging when debugging is set.
|
|
38
|
+
openapi_one_of.each do |klass|
|
|
39
|
+
begin
|
|
40
|
+
next if klass == :AnyType # "nullable: true"
|
|
41
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
42
|
+
return typed_data if typed_data
|
|
43
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
private
|
|
51
|
+
|
|
52
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
53
|
+
|
|
54
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
55
|
+
def find_and_cast_into_type(klass, data)
|
|
56
|
+
return if data.nil?
|
|
57
|
+
|
|
58
|
+
case klass.to_s
|
|
59
|
+
when 'Boolean'
|
|
60
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
61
|
+
when 'Float'
|
|
62
|
+
return data if data.instance_of?(Float)
|
|
63
|
+
when 'Integer'
|
|
64
|
+
return data if data.instance_of?(Integer)
|
|
65
|
+
when 'Time'
|
|
66
|
+
return Time.parse(data)
|
|
67
|
+
when 'Date'
|
|
68
|
+
return Date.iso8601(data)
|
|
69
|
+
when 'String'
|
|
70
|
+
return data if data.instance_of?(String)
|
|
71
|
+
when 'Object' # "type: object"
|
|
72
|
+
return data if data.instance_of?(Hash)
|
|
73
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
74
|
+
if data.instance_of?(Array)
|
|
75
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
76
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
77
|
+
end
|
|
78
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
79
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
80
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
81
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
82
|
+
end
|
|
83
|
+
else # model
|
|
84
|
+
const = HatchetSdkRest.const_get(klass)
|
|
85
|
+
if const
|
|
86
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
87
|
+
model = const.build(data)
|
|
88
|
+
return model if model
|
|
89
|
+
else
|
|
90
|
+
# raise if data contains keys that are not known to the model
|
|
91
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
92
|
+
model = const.build_from_hash(data)
|
|
93
|
+
return model if model
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
raise # if no match by now, raise
|
|
99
|
+
rescue
|
|
100
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
end
|