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,367 @@
|
|
|
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 TenantEntitlements
|
|
18
|
+
attr_accessor :audit_logs
|
|
19
|
+
|
|
20
|
+
attr_accessor :prometheus_metrics
|
|
21
|
+
|
|
22
|
+
attr_accessor :strict_additional_metadata_filters
|
|
23
|
+
|
|
24
|
+
attr_accessor :dag_operator
|
|
25
|
+
|
|
26
|
+
attr_accessor :durable_streams
|
|
27
|
+
|
|
28
|
+
attr_accessor :serverless_operator
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'audit_logs' => :'auditLogs',
|
|
34
|
+
:'prometheus_metrics' => :'prometheusMetrics',
|
|
35
|
+
:'strict_additional_metadata_filters' => :'strictAdditionalMetadataFilters',
|
|
36
|
+
:'dag_operator' => :'dagOperator',
|
|
37
|
+
:'durable_streams' => :'durableStreams',
|
|
38
|
+
:'serverless_operator' => :'serverlessOperator'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'audit_logs' => :'Boolean',
|
|
56
|
+
:'prometheus_metrics' => :'Boolean',
|
|
57
|
+
:'strict_additional_metadata_filters' => :'Boolean',
|
|
58
|
+
:'dag_operator' => :'Boolean',
|
|
59
|
+
:'durable_streams' => :'Boolean',
|
|
60
|
+
:'serverless_operator' => :'Boolean'
|
|
61
|
+
}
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# List of attributes with nullable: true
|
|
65
|
+
def self.openapi_nullable
|
|
66
|
+
Set.new([
|
|
67
|
+
])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Initializes the object
|
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
if (!attributes.is_a?(Hash))
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::TenantEntitlements` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::TenantEntitlements`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'audit_logs')
|
|
87
|
+
self.audit_logs = attributes[:'audit_logs']
|
|
88
|
+
else
|
|
89
|
+
self.audit_logs = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'prometheus_metrics')
|
|
93
|
+
self.prometheus_metrics = attributes[:'prometheus_metrics']
|
|
94
|
+
else
|
|
95
|
+
self.prometheus_metrics = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'strict_additional_metadata_filters')
|
|
99
|
+
self.strict_additional_metadata_filters = attributes[:'strict_additional_metadata_filters']
|
|
100
|
+
else
|
|
101
|
+
self.strict_additional_metadata_filters = nil
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'dag_operator')
|
|
105
|
+
self.dag_operator = attributes[:'dag_operator']
|
|
106
|
+
else
|
|
107
|
+
self.dag_operator = nil
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
if attributes.key?(:'durable_streams')
|
|
111
|
+
self.durable_streams = attributes[:'durable_streams']
|
|
112
|
+
else
|
|
113
|
+
self.durable_streams = nil
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes.key?(:'serverless_operator')
|
|
117
|
+
self.serverless_operator = attributes[:'serverless_operator']
|
|
118
|
+
else
|
|
119
|
+
self.serverless_operator = nil
|
|
120
|
+
end
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
124
|
+
# @return Array for valid properties with the reasons
|
|
125
|
+
def list_invalid_properties
|
|
126
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
127
|
+
invalid_properties = Array.new
|
|
128
|
+
if @audit_logs.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "audit_logs", audit_logs cannot be nil.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if @prometheus_metrics.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "prometheus_metrics", prometheus_metrics cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @strict_additional_metadata_filters.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "strict_additional_metadata_filters", strict_additional_metadata_filters cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if @dag_operator.nil?
|
|
141
|
+
invalid_properties.push('invalid value for "dag_operator", dag_operator cannot be nil.')
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if @durable_streams.nil?
|
|
145
|
+
invalid_properties.push('invalid value for "durable_streams", durable_streams cannot be nil.')
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if @serverless_operator.nil?
|
|
149
|
+
invalid_properties.push('invalid value for "serverless_operator", serverless_operator cannot be nil.')
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
invalid_properties
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Check to see if the all the properties in the model are valid
|
|
156
|
+
# @return true if the model is valid
|
|
157
|
+
def valid?
|
|
158
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
159
|
+
return false if @audit_logs.nil?
|
|
160
|
+
return false if @prometheus_metrics.nil?
|
|
161
|
+
return false if @strict_additional_metadata_filters.nil?
|
|
162
|
+
return false if @dag_operator.nil?
|
|
163
|
+
return false if @durable_streams.nil?
|
|
164
|
+
return false if @serverless_operator.nil?
|
|
165
|
+
true
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Custom attribute writer method with validation
|
|
169
|
+
# @param [Object] audit_logs Value to be assigned
|
|
170
|
+
def audit_logs=(audit_logs)
|
|
171
|
+
if audit_logs.nil?
|
|
172
|
+
fail ArgumentError, 'audit_logs cannot be nil'
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
@audit_logs = audit_logs
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Custom attribute writer method with validation
|
|
179
|
+
# @param [Object] prometheus_metrics Value to be assigned
|
|
180
|
+
def prometheus_metrics=(prometheus_metrics)
|
|
181
|
+
if prometheus_metrics.nil?
|
|
182
|
+
fail ArgumentError, 'prometheus_metrics cannot be nil'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
@prometheus_metrics = prometheus_metrics
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Custom attribute writer method with validation
|
|
189
|
+
# @param [Object] strict_additional_metadata_filters Value to be assigned
|
|
190
|
+
def strict_additional_metadata_filters=(strict_additional_metadata_filters)
|
|
191
|
+
if strict_additional_metadata_filters.nil?
|
|
192
|
+
fail ArgumentError, 'strict_additional_metadata_filters cannot be nil'
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
@strict_additional_metadata_filters = strict_additional_metadata_filters
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] dag_operator Value to be assigned
|
|
200
|
+
def dag_operator=(dag_operator)
|
|
201
|
+
if dag_operator.nil?
|
|
202
|
+
fail ArgumentError, 'dag_operator cannot be nil'
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
@dag_operator = dag_operator
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Custom attribute writer method with validation
|
|
209
|
+
# @param [Object] durable_streams Value to be assigned
|
|
210
|
+
def durable_streams=(durable_streams)
|
|
211
|
+
if durable_streams.nil?
|
|
212
|
+
fail ArgumentError, 'durable_streams cannot be nil'
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
@durable_streams = durable_streams
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] serverless_operator Value to be assigned
|
|
220
|
+
def serverless_operator=(serverless_operator)
|
|
221
|
+
if serverless_operator.nil?
|
|
222
|
+
fail ArgumentError, 'serverless_operator cannot be nil'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@serverless_operator = serverless_operator
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Checks equality by comparing each attribute.
|
|
229
|
+
# @param [Object] Object to be compared
|
|
230
|
+
def ==(o)
|
|
231
|
+
return true if self.equal?(o)
|
|
232
|
+
self.class == o.class &&
|
|
233
|
+
audit_logs == o.audit_logs &&
|
|
234
|
+
prometheus_metrics == o.prometheus_metrics &&
|
|
235
|
+
strict_additional_metadata_filters == o.strict_additional_metadata_filters &&
|
|
236
|
+
dag_operator == o.dag_operator &&
|
|
237
|
+
durable_streams == o.durable_streams &&
|
|
238
|
+
serverless_operator == o.serverless_operator
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# @see the `==` method
|
|
242
|
+
# @param [Object] Object to be compared
|
|
243
|
+
def eql?(o)
|
|
244
|
+
self == o
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Calculates hash code according to all attributes.
|
|
248
|
+
# @return [Integer] Hash code
|
|
249
|
+
def hash
|
|
250
|
+
[audit_logs, prometheus_metrics, strict_additional_metadata_filters, dag_operator, durable_streams, serverless_operator].hash
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
# Builds the object from hash
|
|
254
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
255
|
+
# @return [Object] Returns the model itself
|
|
256
|
+
def self.build_from_hash(attributes)
|
|
257
|
+
return nil unless attributes.is_a?(Hash)
|
|
258
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
259
|
+
transformed_hash = {}
|
|
260
|
+
openapi_types.each_pair do |key, type|
|
|
261
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
262
|
+
transformed_hash["#{key}"] = nil
|
|
263
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
264
|
+
# check to ensure the input is an array given that the attribute
|
|
265
|
+
# is documented as an array but the input is not
|
|
266
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
267
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
268
|
+
end
|
|
269
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
270
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
new(transformed_hash)
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# Deserializes the data based on type
|
|
277
|
+
# @param string type Data type
|
|
278
|
+
# @param string value Value to be deserialized
|
|
279
|
+
# @return [Object] Deserialized data
|
|
280
|
+
def self._deserialize(type, value)
|
|
281
|
+
case type.to_sym
|
|
282
|
+
when :Time
|
|
283
|
+
Time.parse(value)
|
|
284
|
+
when :Date
|
|
285
|
+
Date.parse(value)
|
|
286
|
+
when :String
|
|
287
|
+
value.to_s
|
|
288
|
+
when :Integer
|
|
289
|
+
value.to_i
|
|
290
|
+
when :Float
|
|
291
|
+
value.to_f
|
|
292
|
+
when :Boolean
|
|
293
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
294
|
+
true
|
|
295
|
+
else
|
|
296
|
+
false
|
|
297
|
+
end
|
|
298
|
+
when :Object
|
|
299
|
+
# generic object (usually a Hash), return directly
|
|
300
|
+
value
|
|
301
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
302
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
303
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
304
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
305
|
+
k_type = Regexp.last_match[:k_type]
|
|
306
|
+
v_type = Regexp.last_match[:v_type]
|
|
307
|
+
{}.tap do |hash|
|
|
308
|
+
value.each do |k, v|
|
|
309
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
else # model
|
|
313
|
+
# models (e.g. Pet) or oneOf
|
|
314
|
+
klass = HatchetSdkRest.const_get(type)
|
|
315
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
316
|
+
end
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
# Returns the string representation of the object
|
|
320
|
+
# @return [String] String presentation of the object
|
|
321
|
+
def to_s
|
|
322
|
+
to_hash.to_s
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
326
|
+
# @return [Hash] Returns the object in the form of hash
|
|
327
|
+
def to_body
|
|
328
|
+
to_hash
|
|
329
|
+
end
|
|
330
|
+
|
|
331
|
+
# Returns the object in the form of hash
|
|
332
|
+
# @return [Hash] Returns the object in the form of hash
|
|
333
|
+
def to_hash
|
|
334
|
+
hash = {}
|
|
335
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
336
|
+
value = self.send(attr)
|
|
337
|
+
if value.nil?
|
|
338
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
339
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
hash[param] = _to_hash(value)
|
|
343
|
+
end
|
|
344
|
+
hash
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
# Outputs non-array value in the form of hash
|
|
348
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
349
|
+
# @param [Object] value Any valid value
|
|
350
|
+
# @return [Hash] Returns the value in the form of hash
|
|
351
|
+
def _to_hash(value)
|
|
352
|
+
if value.is_a?(Array)
|
|
353
|
+
value.compact.map { |v| _to_hash(v) }
|
|
354
|
+
elsif value.is_a?(Hash)
|
|
355
|
+
{}.tap do |hash|
|
|
356
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
357
|
+
end
|
|
358
|
+
elsif value.respond_to? :to_hash
|
|
359
|
+
value.to_hash
|
|
360
|
+
else
|
|
361
|
+
value
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
end
|
|
366
|
+
|
|
367
|
+
end
|