hatchet-sdk 0.9.0 → 0.11.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 +12 -0
- data/lib/hatchet/clients/grpc/admin.rb +20 -0
- data/lib/hatchet/clients/grpc/dispatcher.rb +6 -2
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +13 -0
- data/lib/hatchet/clients/rest/README.md +21 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/serverless_api.rb +405 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/streams_api.rb +263 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/tenant_api.rb +71 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb +142 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/rate_limit.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_entitlements.rb +367 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb +411 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint.rb +556 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_kind.rb +40 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_list.rb +231 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_status.rb +271 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_payload_ref.rb +238 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic.rb +343 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic_list.rb +292 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_serverless_endpoint_request.rb +354 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_workflow_run_count.rb +238 -0
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +13 -0
- data/lib/hatchet/context.rb +13 -0
- data/lib/hatchet/contracts/dispatcher/dispatcher_pb.rb +1 -1
- data/lib/hatchet/contracts/workflows/workflows_pb.rb +3 -1
- data/lib/hatchet/contracts/workflows/workflows_services_pb.rb +1 -0
- data/lib/hatchet/engine_version.rb +1 -0
- data/lib/hatchet/exceptions.rb +18 -0
- data/lib/hatchet/features/rate_limits.rb +13 -0
- data/lib/hatchet/version.rb +1 -1
- data/lib/hatchet/worker/runner.rb +24 -2
- data/sig/hatchet/clients/grpc/admin.rbs +1 -0
- data/sig/hatchet/context.rbs +1 -0
- data/sig/hatchet/features/rate_limits.rbs +1 -0
- metadata +15 -2
|
@@ -0,0 +1,556 @@
|
|
|
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
|
+
class V1ServerlessEndpoint
|
|
18
|
+
attr_accessor :metadata
|
|
19
|
+
|
|
20
|
+
# The ID of the tenant that owns this endpoint.
|
|
21
|
+
attr_accessor :tenant_id
|
|
22
|
+
|
|
23
|
+
# The name of the endpoint. Unique within the tenant.
|
|
24
|
+
attr_accessor :name
|
|
25
|
+
|
|
26
|
+
attr_accessor :kind
|
|
27
|
+
|
|
28
|
+
# The HTTPS URL (port 443) polled periodically to discover the workflows this endpoint serves.
|
|
29
|
+
attr_accessor :healthcheck_url
|
|
30
|
+
|
|
31
|
+
# The HTTPS URL (port 443) that assigned tasks are delivered to.
|
|
32
|
+
attr_accessor :trigger_url
|
|
33
|
+
|
|
34
|
+
# The per-request timeout backstop for trigger requests, in seconds.
|
|
35
|
+
attr_accessor :request_timeout_seconds
|
|
36
|
+
|
|
37
|
+
# How often the healthcheck URL is polled, in seconds.
|
|
38
|
+
attr_accessor :poll_interval_seconds
|
|
39
|
+
|
|
40
|
+
# How long a trigger request may block waiting for a durable result before the operator falls back to the websocket durable protocol, in milliseconds.
|
|
41
|
+
attr_accessor :inline_wait_budget_ms
|
|
42
|
+
|
|
43
|
+
# Worker labels applied to the connection-backed worker the operator creates for this endpoint.
|
|
44
|
+
attr_accessor :labels
|
|
45
|
+
|
|
46
|
+
# Whether the operator polls and dispatches to this endpoint.
|
|
47
|
+
attr_accessor :enabled
|
|
48
|
+
|
|
49
|
+
attr_accessor :status
|
|
50
|
+
|
|
51
|
+
class EnumAttributeValidator
|
|
52
|
+
attr_reader :datatype
|
|
53
|
+
attr_reader :allowable_values
|
|
54
|
+
|
|
55
|
+
def initialize(datatype, allowable_values)
|
|
56
|
+
@allowable_values = allowable_values.map do |value|
|
|
57
|
+
case datatype.to_s
|
|
58
|
+
when /Integer/i
|
|
59
|
+
value.to_i
|
|
60
|
+
when /Float/i
|
|
61
|
+
value.to_f
|
|
62
|
+
else
|
|
63
|
+
value
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def valid?(value)
|
|
69
|
+
!value || allowable_values.include?(value)
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
|
+
def self.attribute_map
|
|
75
|
+
{
|
|
76
|
+
:'metadata' => :'metadata',
|
|
77
|
+
:'tenant_id' => :'tenantId',
|
|
78
|
+
:'name' => :'name',
|
|
79
|
+
:'kind' => :'kind',
|
|
80
|
+
:'healthcheck_url' => :'healthcheckUrl',
|
|
81
|
+
:'trigger_url' => :'triggerUrl',
|
|
82
|
+
:'request_timeout_seconds' => :'requestTimeoutSeconds',
|
|
83
|
+
:'poll_interval_seconds' => :'pollIntervalSeconds',
|
|
84
|
+
:'inline_wait_budget_ms' => :'inlineWaitBudgetMs',
|
|
85
|
+
:'labels' => :'labels',
|
|
86
|
+
:'enabled' => :'enabled',
|
|
87
|
+
:'status' => :'status'
|
|
88
|
+
}
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Returns attribute mapping this model knows about
|
|
92
|
+
def self.acceptable_attribute_map
|
|
93
|
+
attribute_map
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Returns all the JSON keys this model knows about
|
|
97
|
+
def self.acceptable_attributes
|
|
98
|
+
acceptable_attribute_map.values
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Attribute type mapping.
|
|
102
|
+
def self.openapi_types
|
|
103
|
+
{
|
|
104
|
+
:'metadata' => :'APIResourceMeta',
|
|
105
|
+
:'tenant_id' => :'String',
|
|
106
|
+
:'name' => :'String',
|
|
107
|
+
:'kind' => :'V1ServerlessEndpointKind',
|
|
108
|
+
:'healthcheck_url' => :'String',
|
|
109
|
+
:'trigger_url' => :'String',
|
|
110
|
+
:'request_timeout_seconds' => :'Integer',
|
|
111
|
+
:'poll_interval_seconds' => :'Integer',
|
|
112
|
+
:'inline_wait_budget_ms' => :'Integer',
|
|
113
|
+
:'labels' => :'Hash<String, Object>',
|
|
114
|
+
:'enabled' => :'Boolean',
|
|
115
|
+
:'status' => :'V1ServerlessEndpointStatus'
|
|
116
|
+
}
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# List of attributes with nullable: true
|
|
120
|
+
def self.openapi_nullable
|
|
121
|
+
Set.new([
|
|
122
|
+
])
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Initializes the object
|
|
126
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
127
|
+
def initialize(attributes = {})
|
|
128
|
+
if (!attributes.is_a?(Hash))
|
|
129
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1ServerlessEndpoint` initialize method"
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
133
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
134
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
135
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
136
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1ServerlessEndpoint`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
137
|
+
end
|
|
138
|
+
h[k.to_sym] = v
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if attributes.key?(:'metadata')
|
|
142
|
+
self.metadata = attributes[:'metadata']
|
|
143
|
+
else
|
|
144
|
+
self.metadata = nil
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if attributes.key?(:'tenant_id')
|
|
148
|
+
self.tenant_id = attributes[:'tenant_id']
|
|
149
|
+
else
|
|
150
|
+
self.tenant_id = nil
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
if attributes.key?(:'name')
|
|
154
|
+
self.name = attributes[:'name']
|
|
155
|
+
else
|
|
156
|
+
self.name = nil
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if attributes.key?(:'kind')
|
|
160
|
+
self.kind = attributes[:'kind']
|
|
161
|
+
else
|
|
162
|
+
self.kind = nil
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if attributes.key?(:'healthcheck_url')
|
|
166
|
+
self.healthcheck_url = attributes[:'healthcheck_url']
|
|
167
|
+
else
|
|
168
|
+
self.healthcheck_url = nil
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if attributes.key?(:'trigger_url')
|
|
172
|
+
self.trigger_url = attributes[:'trigger_url']
|
|
173
|
+
else
|
|
174
|
+
self.trigger_url = nil
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
if attributes.key?(:'request_timeout_seconds')
|
|
178
|
+
self.request_timeout_seconds = attributes[:'request_timeout_seconds']
|
|
179
|
+
else
|
|
180
|
+
self.request_timeout_seconds = nil
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
if attributes.key?(:'poll_interval_seconds')
|
|
184
|
+
self.poll_interval_seconds = attributes[:'poll_interval_seconds']
|
|
185
|
+
else
|
|
186
|
+
self.poll_interval_seconds = nil
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'inline_wait_budget_ms')
|
|
190
|
+
self.inline_wait_budget_ms = attributes[:'inline_wait_budget_ms']
|
|
191
|
+
else
|
|
192
|
+
self.inline_wait_budget_ms = nil
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
if attributes.key?(:'labels')
|
|
196
|
+
if (value = attributes[:'labels']).is_a?(Hash)
|
|
197
|
+
self.labels = value
|
|
198
|
+
end
|
|
199
|
+
else
|
|
200
|
+
self.labels = nil
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if attributes.key?(:'enabled')
|
|
204
|
+
self.enabled = attributes[:'enabled']
|
|
205
|
+
else
|
|
206
|
+
self.enabled = nil
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
if attributes.key?(:'status')
|
|
210
|
+
self.status = attributes[:'status']
|
|
211
|
+
else
|
|
212
|
+
self.status = nil
|
|
213
|
+
end
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
217
|
+
# @return Array for valid properties with the reasons
|
|
218
|
+
def list_invalid_properties
|
|
219
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
220
|
+
invalid_properties = Array.new
|
|
221
|
+
if @metadata.nil?
|
|
222
|
+
invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if @tenant_id.nil?
|
|
226
|
+
invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if @name.nil?
|
|
230
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
if @kind.nil?
|
|
234
|
+
invalid_properties.push('invalid value for "kind", kind cannot be nil.')
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if @healthcheck_url.nil?
|
|
238
|
+
invalid_properties.push('invalid value for "healthcheck_url", healthcheck_url cannot be nil.')
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
if @trigger_url.nil?
|
|
242
|
+
invalid_properties.push('invalid value for "trigger_url", trigger_url cannot be nil.')
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
if @request_timeout_seconds.nil?
|
|
246
|
+
invalid_properties.push('invalid value for "request_timeout_seconds", request_timeout_seconds cannot be nil.')
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
if @poll_interval_seconds.nil?
|
|
250
|
+
invalid_properties.push('invalid value for "poll_interval_seconds", poll_interval_seconds cannot be nil.')
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
if @inline_wait_budget_ms.nil?
|
|
254
|
+
invalid_properties.push('invalid value for "inline_wait_budget_ms", inline_wait_budget_ms cannot be nil.')
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
if @labels.nil?
|
|
258
|
+
invalid_properties.push('invalid value for "labels", labels cannot be nil.')
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
if @enabled.nil?
|
|
262
|
+
invalid_properties.push('invalid value for "enabled", enabled cannot be nil.')
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
if @status.nil?
|
|
266
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
invalid_properties
|
|
270
|
+
end
|
|
271
|
+
|
|
272
|
+
# Check to see if the all the properties in the model are valid
|
|
273
|
+
# @return true if the model is valid
|
|
274
|
+
def valid?
|
|
275
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
276
|
+
return false if @metadata.nil?
|
|
277
|
+
return false if @tenant_id.nil?
|
|
278
|
+
return false if @name.nil?
|
|
279
|
+
return false if @kind.nil?
|
|
280
|
+
return false if @healthcheck_url.nil?
|
|
281
|
+
return false if @trigger_url.nil?
|
|
282
|
+
return false if @request_timeout_seconds.nil?
|
|
283
|
+
return false if @poll_interval_seconds.nil?
|
|
284
|
+
return false if @inline_wait_budget_ms.nil?
|
|
285
|
+
return false if @labels.nil?
|
|
286
|
+
return false if @enabled.nil?
|
|
287
|
+
return false if @status.nil?
|
|
288
|
+
true
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
# Custom attribute writer method with validation
|
|
292
|
+
# @param [Object] metadata Value to be assigned
|
|
293
|
+
def metadata=(metadata)
|
|
294
|
+
if metadata.nil?
|
|
295
|
+
fail ArgumentError, 'metadata cannot be nil'
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
@metadata = metadata
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Custom attribute writer method with validation
|
|
302
|
+
# @param [Object] tenant_id Value to be assigned
|
|
303
|
+
def tenant_id=(tenant_id)
|
|
304
|
+
if tenant_id.nil?
|
|
305
|
+
fail ArgumentError, 'tenant_id cannot be nil'
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
@tenant_id = tenant_id
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Custom attribute writer method with validation
|
|
312
|
+
# @param [Object] name Value to be assigned
|
|
313
|
+
def name=(name)
|
|
314
|
+
if name.nil?
|
|
315
|
+
fail ArgumentError, 'name cannot be nil'
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
@name = name
|
|
319
|
+
end
|
|
320
|
+
|
|
321
|
+
# Custom attribute writer method with validation
|
|
322
|
+
# @param [Object] kind Value to be assigned
|
|
323
|
+
def kind=(kind)
|
|
324
|
+
if kind.nil?
|
|
325
|
+
fail ArgumentError, 'kind cannot be nil'
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
@kind = kind
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# Custom attribute writer method with validation
|
|
332
|
+
# @param [Object] healthcheck_url Value to be assigned
|
|
333
|
+
def healthcheck_url=(healthcheck_url)
|
|
334
|
+
if healthcheck_url.nil?
|
|
335
|
+
fail ArgumentError, 'healthcheck_url cannot be nil'
|
|
336
|
+
end
|
|
337
|
+
|
|
338
|
+
@healthcheck_url = healthcheck_url
|
|
339
|
+
end
|
|
340
|
+
|
|
341
|
+
# Custom attribute writer method with validation
|
|
342
|
+
# @param [Object] trigger_url Value to be assigned
|
|
343
|
+
def trigger_url=(trigger_url)
|
|
344
|
+
if trigger_url.nil?
|
|
345
|
+
fail ArgumentError, 'trigger_url cannot be nil'
|
|
346
|
+
end
|
|
347
|
+
|
|
348
|
+
@trigger_url = trigger_url
|
|
349
|
+
end
|
|
350
|
+
|
|
351
|
+
# Custom attribute writer method with validation
|
|
352
|
+
# @param [Object] request_timeout_seconds Value to be assigned
|
|
353
|
+
def request_timeout_seconds=(request_timeout_seconds)
|
|
354
|
+
if request_timeout_seconds.nil?
|
|
355
|
+
fail ArgumentError, 'request_timeout_seconds cannot be nil'
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
@request_timeout_seconds = request_timeout_seconds
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Custom attribute writer method with validation
|
|
362
|
+
# @param [Object] poll_interval_seconds Value to be assigned
|
|
363
|
+
def poll_interval_seconds=(poll_interval_seconds)
|
|
364
|
+
if poll_interval_seconds.nil?
|
|
365
|
+
fail ArgumentError, 'poll_interval_seconds cannot be nil'
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
@poll_interval_seconds = poll_interval_seconds
|
|
369
|
+
end
|
|
370
|
+
|
|
371
|
+
# Custom attribute writer method with validation
|
|
372
|
+
# @param [Object] inline_wait_budget_ms Value to be assigned
|
|
373
|
+
def inline_wait_budget_ms=(inline_wait_budget_ms)
|
|
374
|
+
if inline_wait_budget_ms.nil?
|
|
375
|
+
fail ArgumentError, 'inline_wait_budget_ms cannot be nil'
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
@inline_wait_budget_ms = inline_wait_budget_ms
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# Custom attribute writer method with validation
|
|
382
|
+
# @param [Object] labels Value to be assigned
|
|
383
|
+
def labels=(labels)
|
|
384
|
+
if labels.nil?
|
|
385
|
+
fail ArgumentError, 'labels cannot be nil'
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
@labels = labels
|
|
389
|
+
end
|
|
390
|
+
|
|
391
|
+
# Custom attribute writer method with validation
|
|
392
|
+
# @param [Object] enabled Value to be assigned
|
|
393
|
+
def enabled=(enabled)
|
|
394
|
+
if enabled.nil?
|
|
395
|
+
fail ArgumentError, 'enabled cannot be nil'
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
@enabled = enabled
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
# Custom attribute writer method with validation
|
|
402
|
+
# @param [Object] status Value to be assigned
|
|
403
|
+
def status=(status)
|
|
404
|
+
if status.nil?
|
|
405
|
+
fail ArgumentError, 'status cannot be nil'
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
@status = status
|
|
409
|
+
end
|
|
410
|
+
|
|
411
|
+
# Checks equality by comparing each attribute.
|
|
412
|
+
# @param [Object] Object to be compared
|
|
413
|
+
def ==(o)
|
|
414
|
+
return true if self.equal?(o)
|
|
415
|
+
self.class == o.class &&
|
|
416
|
+
metadata == o.metadata &&
|
|
417
|
+
tenant_id == o.tenant_id &&
|
|
418
|
+
name == o.name &&
|
|
419
|
+
kind == o.kind &&
|
|
420
|
+
healthcheck_url == o.healthcheck_url &&
|
|
421
|
+
trigger_url == o.trigger_url &&
|
|
422
|
+
request_timeout_seconds == o.request_timeout_seconds &&
|
|
423
|
+
poll_interval_seconds == o.poll_interval_seconds &&
|
|
424
|
+
inline_wait_budget_ms == o.inline_wait_budget_ms &&
|
|
425
|
+
labels == o.labels &&
|
|
426
|
+
enabled == o.enabled &&
|
|
427
|
+
status == o.status
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
# @see the `==` method
|
|
431
|
+
# @param [Object] Object to be compared
|
|
432
|
+
def eql?(o)
|
|
433
|
+
self == o
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
# Calculates hash code according to all attributes.
|
|
437
|
+
# @return [Integer] Hash code
|
|
438
|
+
def hash
|
|
439
|
+
[metadata, tenant_id, name, kind, healthcheck_url, trigger_url, request_timeout_seconds, poll_interval_seconds, inline_wait_budget_ms, labels, enabled, status].hash
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
# Builds the object from hash
|
|
443
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
444
|
+
# @return [Object] Returns the model itself
|
|
445
|
+
def self.build_from_hash(attributes)
|
|
446
|
+
return nil unless attributes.is_a?(Hash)
|
|
447
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
448
|
+
transformed_hash = {}
|
|
449
|
+
openapi_types.each_pair do |key, type|
|
|
450
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
451
|
+
transformed_hash["#{key}"] = nil
|
|
452
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
453
|
+
# check to ensure the input is an array given that the attribute
|
|
454
|
+
# is documented as an array but the input is not
|
|
455
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
456
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
457
|
+
end
|
|
458
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
459
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
460
|
+
end
|
|
461
|
+
end
|
|
462
|
+
new(transformed_hash)
|
|
463
|
+
end
|
|
464
|
+
|
|
465
|
+
# Deserializes the data based on type
|
|
466
|
+
# @param string type Data type
|
|
467
|
+
# @param string value Value to be deserialized
|
|
468
|
+
# @return [Object] Deserialized data
|
|
469
|
+
def self._deserialize(type, value)
|
|
470
|
+
case type.to_sym
|
|
471
|
+
when :Time
|
|
472
|
+
Time.parse(value)
|
|
473
|
+
when :Date
|
|
474
|
+
Date.parse(value)
|
|
475
|
+
when :String
|
|
476
|
+
value.to_s
|
|
477
|
+
when :Integer
|
|
478
|
+
value.to_i
|
|
479
|
+
when :Float
|
|
480
|
+
value.to_f
|
|
481
|
+
when :Boolean
|
|
482
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
483
|
+
true
|
|
484
|
+
else
|
|
485
|
+
false
|
|
486
|
+
end
|
|
487
|
+
when :Object
|
|
488
|
+
# generic object (usually a Hash), return directly
|
|
489
|
+
value
|
|
490
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
491
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
492
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
493
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
494
|
+
k_type = Regexp.last_match[:k_type]
|
|
495
|
+
v_type = Regexp.last_match[:v_type]
|
|
496
|
+
{}.tap do |hash|
|
|
497
|
+
value.each do |k, v|
|
|
498
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
499
|
+
end
|
|
500
|
+
end
|
|
501
|
+
else # model
|
|
502
|
+
# models (e.g. Pet) or oneOf
|
|
503
|
+
klass = HatchetSdkRest.const_get(type)
|
|
504
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
505
|
+
end
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# Returns the string representation of the object
|
|
509
|
+
# @return [String] String presentation of the object
|
|
510
|
+
def to_s
|
|
511
|
+
to_hash.to_s
|
|
512
|
+
end
|
|
513
|
+
|
|
514
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
515
|
+
# @return [Hash] Returns the object in the form of hash
|
|
516
|
+
def to_body
|
|
517
|
+
to_hash
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
# Returns the object in the form of hash
|
|
521
|
+
# @return [Hash] Returns the object in the form of hash
|
|
522
|
+
def to_hash
|
|
523
|
+
hash = {}
|
|
524
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
525
|
+
value = self.send(attr)
|
|
526
|
+
if value.nil?
|
|
527
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
528
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
529
|
+
end
|
|
530
|
+
|
|
531
|
+
hash[param] = _to_hash(value)
|
|
532
|
+
end
|
|
533
|
+
hash
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Outputs non-array value in the form of hash
|
|
537
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
538
|
+
# @param [Object] value Any valid value
|
|
539
|
+
# @return [Hash] Returns the value in the form of hash
|
|
540
|
+
def _to_hash(value)
|
|
541
|
+
if value.is_a?(Array)
|
|
542
|
+
value.compact.map { |v| _to_hash(v) }
|
|
543
|
+
elsif value.is_a?(Hash)
|
|
544
|
+
{}.tap do |hash|
|
|
545
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
546
|
+
end
|
|
547
|
+
elsif value.respond_to? :to_hash
|
|
548
|
+
value.to_hash
|
|
549
|
+
else
|
|
550
|
+
value
|
|
551
|
+
end
|
|
552
|
+
end
|
|
553
|
+
|
|
554
|
+
end
|
|
555
|
+
|
|
556
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
class V1ServerlessEndpointKind
|
|
18
|
+
GENERIC_HTTP = "GENERIC_HTTP".freeze
|
|
19
|
+
CLOUDFLARE_WORKERS = "CLOUDFLARE_WORKERS".freeze
|
|
20
|
+
|
|
21
|
+
def self.all_vars
|
|
22
|
+
@all_vars ||= [GENERIC_HTTP, CLOUDFLARE_WORKERS].freeze
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
return value if V1ServerlessEndpointKind.all_vars.include?(value)
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #V1ServerlessEndpointKind"
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|