hatchet-sdk 0.6.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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/lib/hatchet/clients/rest/.openapi-generator/FILES +9 -0
  4. data/lib/hatchet/clients/rest/README.md +16 -3
  5. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/filter_api.rb +4 -0
  6. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/operator_api.rb +405 -0
  7. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/webhook_api.rb +2 -0
  8. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/api_meta.rb +14 -4
  9. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/create_tenant_invite_request.rb +14 -4
  10. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request.rb +105 -0
  11. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_pause.rb +343 -0
  12. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/pause_workflow_request_unpause.rb +262 -0
  13. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_invite.rb +11 -1
  14. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member.rb +11 -1
  15. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_member_role.rb +2 -1
  16. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_invite_request.rb +14 -4
  17. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_tenant_member_request.rb +14 -4
  18. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_http_operator_request.rb +346 -0
  19. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_event.rb +14 -4
  20. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator.rb +372 -0
  21. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_http_operator_list.rb +231 -0
  22. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_summary.rb +14 -4
  23. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_http_operator_request.rb +252 -0
  24. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_workflow_run.rb +14 -4
  25. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow.rb +43 -1
  26. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_pause_scheduled_cron_run_queue_behavior.rb +40 -0
  27. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow_update_request.rb +7 -8
  28. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +9 -0
  29. data/lib/hatchet/concurrency.rb +5 -1
  30. data/lib/hatchet/context.rb +5 -2
  31. data/lib/hatchet/contracts/v1/workflows_pb.rb +1 -1
  32. data/lib/hatchet/durable_context.rb +5 -12
  33. data/lib/hatchet/features/cel.rb +2 -2
  34. data/lib/hatchet/features/cron.rb +5 -5
  35. data/lib/hatchet/features/events.rb +7 -7
  36. data/lib/hatchet/features/filters.rb +7 -7
  37. data/lib/hatchet/features/logs.rb +2 -2
  38. data/lib/hatchet/features/metrics.rb +6 -6
  39. data/lib/hatchet/features/rate_limits.rb +2 -2
  40. data/lib/hatchet/features/runs.rb +4 -5
  41. data/lib/hatchet/features/scheduled.rb +7 -7
  42. data/lib/hatchet/features/tenant.rb +2 -2
  43. data/lib/hatchet/features/workers.rb +5 -5
  44. data/lib/hatchet/features/workflows.rb +6 -6
  45. data/lib/hatchet/version.rb +1 -1
  46. data/lib/hatchet/workflow.rb +58 -33
  47. data/lib/hatchet-sdk.rb +65 -32
  48. metadata +11 -2
@@ -0,0 +1,372 @@
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 V1HTTPOperator
18
+ attr_accessor :metadata
19
+
20
+ # The ID of the tenant associated with this operator.
21
+ attr_accessor :tenant_id
22
+
23
+ # The name of the operator.
24
+ attr_accessor :name
25
+
26
+ # The HTTPS endpoint (https, port 443) that assigned tasks are delivered to.
27
+ attr_accessor :trigger_endpoint
28
+
29
+ # The HTTPS endpoint polled periodically to discover the actions this operator handles.
30
+ attr_accessor :healthcheck_endpoint
31
+
32
+ # The per-request timeout backstop, in seconds.
33
+ attr_accessor :request_timeout_seconds
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'metadata' => :'metadata',
39
+ :'tenant_id' => :'tenantId',
40
+ :'name' => :'name',
41
+ :'trigger_endpoint' => :'triggerEndpoint',
42
+ :'healthcheck_endpoint' => :'healthcheckEndpoint',
43
+ :'request_timeout_seconds' => :'requestTimeoutSeconds'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'metadata' => :'APIResourceMeta',
61
+ :'tenant_id' => :'String',
62
+ :'name' => :'String',
63
+ :'trigger_endpoint' => :'String',
64
+ :'healthcheck_endpoint' => :'String',
65
+ :'request_timeout_seconds' => :'Integer'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ ])
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ if (!attributes.is_a?(Hash))
79
+ fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1HTTPOperator` initialize method"
80
+ end
81
+
82
+ # check to see if the attribute exists and convert string to symbol for hash key
83
+ acceptable_attribute_map = self.class.acceptable_attribute_map
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!acceptable_attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1HTTPOperator`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'metadata')
92
+ self.metadata = attributes[:'metadata']
93
+ else
94
+ self.metadata = nil
95
+ end
96
+
97
+ if attributes.key?(:'tenant_id')
98
+ self.tenant_id = attributes[:'tenant_id']
99
+ else
100
+ self.tenant_id = nil
101
+ end
102
+
103
+ if attributes.key?(:'name')
104
+ self.name = attributes[:'name']
105
+ else
106
+ self.name = nil
107
+ end
108
+
109
+ if attributes.key?(:'trigger_endpoint')
110
+ self.trigger_endpoint = attributes[:'trigger_endpoint']
111
+ else
112
+ self.trigger_endpoint = nil
113
+ end
114
+
115
+ if attributes.key?(:'healthcheck_endpoint')
116
+ self.healthcheck_endpoint = attributes[:'healthcheck_endpoint']
117
+ else
118
+ self.healthcheck_endpoint = nil
119
+ end
120
+
121
+ if attributes.key?(:'request_timeout_seconds')
122
+ self.request_timeout_seconds = attributes[:'request_timeout_seconds']
123
+ else
124
+ self.request_timeout_seconds = nil
125
+ end
126
+ end
127
+
128
+ # Show invalid properties with the reasons. Usually used together with valid?
129
+ # @return Array for valid properties with the reasons
130
+ def list_invalid_properties
131
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
132
+ invalid_properties = Array.new
133
+ if @metadata.nil?
134
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
135
+ end
136
+
137
+ if @tenant_id.nil?
138
+ invalid_properties.push('invalid value for "tenant_id", tenant_id cannot be nil.')
139
+ end
140
+
141
+ if @name.nil?
142
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
143
+ end
144
+
145
+ if @trigger_endpoint.nil?
146
+ invalid_properties.push('invalid value for "trigger_endpoint", trigger_endpoint cannot be nil.')
147
+ end
148
+
149
+ if @healthcheck_endpoint.nil?
150
+ invalid_properties.push('invalid value for "healthcheck_endpoint", healthcheck_endpoint cannot be nil.')
151
+ end
152
+
153
+ if @request_timeout_seconds.nil?
154
+ invalid_properties.push('invalid value for "request_timeout_seconds", request_timeout_seconds cannot be nil.')
155
+ end
156
+
157
+ invalid_properties
158
+ end
159
+
160
+ # Check to see if the all the properties in the model are valid
161
+ # @return true if the model is valid
162
+ def valid?
163
+ warn '[DEPRECATED] the `valid?` method is obsolete'
164
+ return false if @metadata.nil?
165
+ return false if @tenant_id.nil?
166
+ return false if @name.nil?
167
+ return false if @trigger_endpoint.nil?
168
+ return false if @healthcheck_endpoint.nil?
169
+ return false if @request_timeout_seconds.nil?
170
+ true
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] metadata Value to be assigned
175
+ def metadata=(metadata)
176
+ if metadata.nil?
177
+ fail ArgumentError, 'metadata cannot be nil'
178
+ end
179
+
180
+ @metadata = metadata
181
+ end
182
+
183
+ # Custom attribute writer method with validation
184
+ # @param [Object] tenant_id Value to be assigned
185
+ def tenant_id=(tenant_id)
186
+ if tenant_id.nil?
187
+ fail ArgumentError, 'tenant_id cannot be nil'
188
+ end
189
+
190
+ @tenant_id = tenant_id
191
+ end
192
+
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] name Value to be assigned
195
+ def name=(name)
196
+ if name.nil?
197
+ fail ArgumentError, 'name cannot be nil'
198
+ end
199
+
200
+ @name = name
201
+ end
202
+
203
+ # Custom attribute writer method with validation
204
+ # @param [Object] trigger_endpoint Value to be assigned
205
+ def trigger_endpoint=(trigger_endpoint)
206
+ if trigger_endpoint.nil?
207
+ fail ArgumentError, 'trigger_endpoint cannot be nil'
208
+ end
209
+
210
+ @trigger_endpoint = trigger_endpoint
211
+ end
212
+
213
+ # Custom attribute writer method with validation
214
+ # @param [Object] healthcheck_endpoint Value to be assigned
215
+ def healthcheck_endpoint=(healthcheck_endpoint)
216
+ if healthcheck_endpoint.nil?
217
+ fail ArgumentError, 'healthcheck_endpoint cannot be nil'
218
+ end
219
+
220
+ @healthcheck_endpoint = healthcheck_endpoint
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] request_timeout_seconds Value to be assigned
225
+ def request_timeout_seconds=(request_timeout_seconds)
226
+ if request_timeout_seconds.nil?
227
+ fail ArgumentError, 'request_timeout_seconds cannot be nil'
228
+ end
229
+
230
+ @request_timeout_seconds = request_timeout_seconds
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ metadata == o.metadata &&
239
+ tenant_id == o.tenant_id &&
240
+ name == o.name &&
241
+ trigger_endpoint == o.trigger_endpoint &&
242
+ healthcheck_endpoint == o.healthcheck_endpoint &&
243
+ request_timeout_seconds == o.request_timeout_seconds
244
+ end
245
+
246
+ # @see the `==` method
247
+ # @param [Object] Object to be compared
248
+ def eql?(o)
249
+ self == o
250
+ end
251
+
252
+ # Calculates hash code according to all attributes.
253
+ # @return [Integer] Hash code
254
+ def hash
255
+ [metadata, tenant_id, name, trigger_endpoint, healthcheck_endpoint, request_timeout_seconds].hash
256
+ end
257
+
258
+ # Builds the object from hash
259
+ # @param [Hash] attributes Model attributes in the form of hash
260
+ # @return [Object] Returns the model itself
261
+ def self.build_from_hash(attributes)
262
+ return nil unless attributes.is_a?(Hash)
263
+ attributes = attributes.transform_keys(&:to_sym)
264
+ transformed_hash = {}
265
+ openapi_types.each_pair do |key, type|
266
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
267
+ transformed_hash["#{key}"] = nil
268
+ elsif type =~ /\AArray<(.*)>/i
269
+ # check to ensure the input is an array given that the attribute
270
+ # is documented as an array but the input is not
271
+ if attributes[attribute_map[key]].is_a?(Array)
272
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
273
+ end
274
+ elsif !attributes[attribute_map[key]].nil?
275
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
276
+ end
277
+ end
278
+ new(transformed_hash)
279
+ end
280
+
281
+ # Deserializes the data based on type
282
+ # @param string type Data type
283
+ # @param string value Value to be deserialized
284
+ # @return [Object] Deserialized data
285
+ def self._deserialize(type, value)
286
+ case type.to_sym
287
+ when :Time
288
+ Time.parse(value)
289
+ when :Date
290
+ Date.parse(value)
291
+ when :String
292
+ value.to_s
293
+ when :Integer
294
+ value.to_i
295
+ when :Float
296
+ value.to_f
297
+ when :Boolean
298
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
299
+ true
300
+ else
301
+ false
302
+ end
303
+ when :Object
304
+ # generic object (usually a Hash), return directly
305
+ value
306
+ when /\AArray<(?<inner_type>.+)>\z/
307
+ inner_type = Regexp.last_match[:inner_type]
308
+ value.map { |v| _deserialize(inner_type, v) }
309
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
310
+ k_type = Regexp.last_match[:k_type]
311
+ v_type = Regexp.last_match[:v_type]
312
+ {}.tap do |hash|
313
+ value.each do |k, v|
314
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
315
+ end
316
+ end
317
+ else # model
318
+ # models (e.g. Pet) or oneOf
319
+ klass = HatchetSdkRest.const_get(type)
320
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
321
+ end
322
+ end
323
+
324
+ # Returns the string representation of the object
325
+ # @return [String] String presentation of the object
326
+ def to_s
327
+ to_hash.to_s
328
+ end
329
+
330
+ # to_body is an alias to to_hash (backward compatibility)
331
+ # @return [Hash] Returns the object in the form of hash
332
+ def to_body
333
+ to_hash
334
+ end
335
+
336
+ # Returns the object in the form of hash
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_hash
339
+ hash = {}
340
+ self.class.attribute_map.each_pair do |attr, param|
341
+ value = self.send(attr)
342
+ if value.nil?
343
+ is_nullable = self.class.openapi_nullable.include?(attr)
344
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
345
+ end
346
+
347
+ hash[param] = _to_hash(value)
348
+ end
349
+ hash
350
+ end
351
+
352
+ # Outputs non-array value in the form of hash
353
+ # For object, use to_hash. Otherwise, just return the value
354
+ # @param [Object] value Any valid value
355
+ # @return [Hash] Returns the value in the form of hash
356
+ def _to_hash(value)
357
+ if value.is_a?(Array)
358
+ value.compact.map { |v| _to_hash(v) }
359
+ elsif value.is_a?(Hash)
360
+ {}.tap do |hash|
361
+ value.each { |k, v| hash[k] = _to_hash(v) }
362
+ end
363
+ elsif value.respond_to? :to_hash
364
+ value.to_hash
365
+ else
366
+ value
367
+ end
368
+ end
369
+
370
+ end
371
+
372
+ end
@@ -0,0 +1,231 @@
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 V1HTTPOperatorList
18
+ attr_accessor :pagination
19
+
20
+ attr_accessor :rows
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'pagination' => :'pagination',
26
+ :'rows' => :'rows'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'pagination' => :'PaginationResponse',
44
+ :'rows' => :'Array<V1HTTPOperator>'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1HTTPOperatorList` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1HTTPOperatorList`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'pagination')
71
+ self.pagination = attributes[:'pagination']
72
+ end
73
+
74
+ if attributes.key?(:'rows')
75
+ if (value = attributes[:'rows']).is_a?(Array)
76
+ self.rows = value
77
+ end
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ pagination == o.pagination &&
102
+ rows == o.rows
103
+ end
104
+
105
+ # @see the `==` method
106
+ # @param [Object] Object to be compared
107
+ def eql?(o)
108
+ self == o
109
+ end
110
+
111
+ # Calculates hash code according to all attributes.
112
+ # @return [Integer] Hash code
113
+ def hash
114
+ [pagination, rows].hash
115
+ end
116
+
117
+ # Builds the object from hash
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ # @return [Object] Returns the model itself
120
+ def self.build_from_hash(attributes)
121
+ return nil unless attributes.is_a?(Hash)
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash["#{key}"] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ if attributes[attribute_map[key]].is_a?(Array)
131
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
132
+ end
133
+ elsif !attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
135
+ end
136
+ end
137
+ new(transformed_hash)
138
+ end
139
+
140
+ # Deserializes the data based on type
141
+ # @param string type Data type
142
+ # @param string value Value to be deserialized
143
+ # @return [Object] Deserialized data
144
+ def self._deserialize(type, value)
145
+ case type.to_sym
146
+ when :Time
147
+ Time.parse(value)
148
+ when :Date
149
+ Date.parse(value)
150
+ when :String
151
+ value.to_s
152
+ when :Integer
153
+ value.to_i
154
+ when :Float
155
+ value.to_f
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ # models (e.g. Pet) or oneOf
178
+ klass = HatchetSdkRest.const_get(type)
179
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
180
+ end
181
+ end
182
+
183
+ # Returns the string representation of the object
184
+ # @return [String] String presentation of the object
185
+ def to_s
186
+ to_hash.to_s
187
+ end
188
+
189
+ # to_body is an alias to to_hash (backward compatibility)
190
+ # @return [Hash] Returns the object in the form of hash
191
+ def to_body
192
+ to_hash
193
+ end
194
+
195
+ # Returns the object in the form of hash
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_hash
198
+ hash = {}
199
+ self.class.attribute_map.each_pair do |attr, param|
200
+ value = self.send(attr)
201
+ if value.nil?
202
+ is_nullable = self.class.openapi_nullable.include?(attr)
203
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
204
+ end
205
+
206
+ hash[param] = _to_hash(value)
207
+ end
208
+ hash
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value)
216
+ if value.is_a?(Array)
217
+ value.compact.map { |v| _to_hash(v) }
218
+ elsif value.is_a?(Hash)
219
+ {}.tap do |hash|
220
+ value.each { |k, v| hash[k] = _to_hash(v) }
221
+ end
222
+ elsif value.respond_to? :to_hash
223
+ value.to_hash
224
+ else
225
+ value
226
+ end
227
+ end
228
+
229
+ end
230
+
231
+ end
@@ -103,6 +103,9 @@ module HatchetSdkRest
103
103
  # The idempotency key that was claimed by the task run
104
104
  attr_accessor :idempotency_key
105
105
 
106
+ # True when input, output, and event payload fields were omitted because the caller cannot view payloads. Additional metadata is still included.
107
+ attr_accessor :payloads_restricted
108
+
106
109
  class EnumAttributeValidator
107
110
  attr_reader :datatype
108
111
  attr_reader :allowable_values
@@ -158,7 +161,8 @@ module HatchetSdkRest
158
161
  :'workflow_version_id' => :'workflowVersionId',
159
162
  :'workflow_config' => :'workflowConfig',
160
163
  :'parent_task_external_id' => :'parentTaskExternalId',
161
- :'idempotency_key' => :'idempotencyKey'
164
+ :'idempotency_key' => :'idempotencyKey',
165
+ :'payloads_restricted' => :'payloadsRestricted'
162
166
  }
163
167
  end
164
168
 
@@ -205,7 +209,8 @@ module HatchetSdkRest
205
209
  :'workflow_version_id' => :'String',
206
210
  :'workflow_config' => :'Object',
207
211
  :'parent_task_external_id' => :'String',
208
- :'idempotency_key' => :'String'
212
+ :'idempotency_key' => :'String',
213
+ :'payloads_restricted' => :'Boolean'
209
214
  }
210
215
  end
211
216
 
@@ -384,6 +389,10 @@ module HatchetSdkRest
384
389
  if attributes.key?(:'idempotency_key')
385
390
  self.idempotency_key = attributes[:'idempotency_key']
386
391
  end
392
+
393
+ if attributes.key?(:'payloads_restricted')
394
+ self.payloads_restricted = attributes[:'payloads_restricted']
395
+ end
387
396
  end
388
397
 
389
398
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -710,7 +719,8 @@ module HatchetSdkRest
710
719
  workflow_version_id == o.workflow_version_id &&
711
720
  workflow_config == o.workflow_config &&
712
721
  parent_task_external_id == o.parent_task_external_id &&
713
- idempotency_key == o.idempotency_key
722
+ idempotency_key == o.idempotency_key &&
723
+ payloads_restricted == o.payloads_restricted
714
724
  end
715
725
 
716
726
  # @see the `==` method
@@ -722,7 +732,7 @@ module HatchetSdkRest
722
732
  # Calculates hash code according to all attributes.
723
733
  # @return [Integer] Hash code
724
734
  def hash
725
- [metadata, created_at, display_name, input, num_spawned_children, output, status, task_external_id, task_id, task_inserted_at, tenant_id, type, workflow_id, workflow_run_external_id, action_id, retry_count, attempt, additional_metadata, children, duration, is_durable, error_message, finished_at, is_evicted, started_at, step_id, workflow_name, workflow_version_id, workflow_config, parent_task_external_id, idempotency_key].hash
735
+ [metadata, created_at, display_name, input, num_spawned_children, output, status, task_external_id, task_id, task_inserted_at, tenant_id, type, workflow_id, workflow_run_external_id, action_id, retry_count, attempt, additional_metadata, children, duration, is_durable, error_message, finished_at, is_evicted, started_at, step_id, workflow_name, workflow_version_id, workflow_config, parent_task_external_id, idempotency_key, payloads_restricted].hash
726
736
  end
727
737
 
728
738
  # Builds the object from hash