hatchet-sdk 0.13.0 → 0.13.1

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.
@@ -0,0 +1,320 @@
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
+ # Tenant-wide counts. A run in a chain of strategies holds a slot in each of them, so these are not the sums of the per-strategy counts.
18
+ class V1ConcurrencyTotals
19
+ # Keys with a slot in use or a queued run, across all strategies.
20
+ attr_accessor :key_count
21
+
22
+ # Keys with at least one queued run, across all strategies.
23
+ attr_accessor :queued_key_count
24
+
25
+ # Runs that passed every strategy of their chain, each counted once.
26
+ attr_accessor :running_count
27
+
28
+ # Runs waiting at a strategy. A run waits at one strategy at a time.
29
+ attr_accessor :queued_count
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'key_count' => :'keyCount',
35
+ :'queued_key_count' => :'queuedKeyCount',
36
+ :'running_count' => :'runningCount',
37
+ :'queued_count' => :'queuedCount'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'key_count' => :'Integer',
55
+ :'queued_key_count' => :'Integer',
56
+ :'running_count' => :'Integer',
57
+ :'queued_count' => :'Integer'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1ConcurrencyTotals` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1ConcurrencyTotals`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'key_count')
84
+ self.key_count = attributes[:'key_count']
85
+ else
86
+ self.key_count = nil
87
+ end
88
+
89
+ if attributes.key?(:'queued_key_count')
90
+ self.queued_key_count = attributes[:'queued_key_count']
91
+ else
92
+ self.queued_key_count = nil
93
+ end
94
+
95
+ if attributes.key?(:'running_count')
96
+ self.running_count = attributes[:'running_count']
97
+ else
98
+ self.running_count = nil
99
+ end
100
+
101
+ if attributes.key?(:'queued_count')
102
+ self.queued_count = attributes[:'queued_count']
103
+ else
104
+ self.queued_count = nil
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @key_count.nil?
114
+ invalid_properties.push('invalid value for "key_count", key_count cannot be nil.')
115
+ end
116
+
117
+ if @queued_key_count.nil?
118
+ invalid_properties.push('invalid value for "queued_key_count", queued_key_count cannot be nil.')
119
+ end
120
+
121
+ if @running_count.nil?
122
+ invalid_properties.push('invalid value for "running_count", running_count cannot be nil.')
123
+ end
124
+
125
+ if @queued_count.nil?
126
+ invalid_properties.push('invalid value for "queued_count", queued_count cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @key_count.nil?
137
+ return false if @queued_key_count.nil?
138
+ return false if @running_count.nil?
139
+ return false if @queued_count.nil?
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] key_count Value to be assigned
145
+ def key_count=(key_count)
146
+ if key_count.nil?
147
+ fail ArgumentError, 'key_count cannot be nil'
148
+ end
149
+
150
+ @key_count = key_count
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] queued_key_count Value to be assigned
155
+ def queued_key_count=(queued_key_count)
156
+ if queued_key_count.nil?
157
+ fail ArgumentError, 'queued_key_count cannot be nil'
158
+ end
159
+
160
+ @queued_key_count = queued_key_count
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] running_count Value to be assigned
165
+ def running_count=(running_count)
166
+ if running_count.nil?
167
+ fail ArgumentError, 'running_count cannot be nil'
168
+ end
169
+
170
+ @running_count = running_count
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] queued_count Value to be assigned
175
+ def queued_count=(queued_count)
176
+ if queued_count.nil?
177
+ fail ArgumentError, 'queued_count cannot be nil'
178
+ end
179
+
180
+ @queued_count = queued_count
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ key_count == o.key_count &&
189
+ queued_key_count == o.queued_key_count &&
190
+ running_count == o.running_count &&
191
+ queued_count == o.queued_count
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [key_count, queued_key_count, running_count, queued_count].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Deserializes the data based on type
230
+ # @param string type Data type
231
+ # @param string value Value to be deserialized
232
+ # @return [Object] Deserialized data
233
+ def self._deserialize(type, value)
234
+ case type.to_sym
235
+ when :Time
236
+ Time.parse(value)
237
+ when :Date
238
+ Date.parse(value)
239
+ when :String
240
+ value.to_s
241
+ when :Integer
242
+ value.to_i
243
+ when :Float
244
+ value.to_f
245
+ when :Boolean
246
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
247
+ true
248
+ else
249
+ false
250
+ end
251
+ when :Object
252
+ # generic object (usually a Hash), return directly
253
+ value
254
+ when /\AArray<(?<inner_type>.+)>\z/
255
+ inner_type = Regexp.last_match[:inner_type]
256
+ value.map { |v| _deserialize(inner_type, v) }
257
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
258
+ k_type = Regexp.last_match[:k_type]
259
+ v_type = Regexp.last_match[:v_type]
260
+ {}.tap do |hash|
261
+ value.each do |k, v|
262
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
263
+ end
264
+ end
265
+ else # model
266
+ # models (e.g. Pet) or oneOf
267
+ klass = HatchetSdkRest.const_get(type)
268
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+
318
+ end
319
+
320
+ end
@@ -136,8 +136,12 @@ HatchetSdkRest.autoload :TenantQueueMetrics, 'hatchet-sdk-rest/models/tenant_que
136
136
  HatchetSdkRest.autoload :TenantResource, 'hatchet-sdk-rest/models/tenant_resource'
137
137
  HatchetSdkRest.autoload :TenantResourceLimit, 'hatchet-sdk-rest/models/tenant_resource_limit'
138
138
  HatchetSdkRest.autoload :TenantResourcePolicy, 'hatchet-sdk-rest/models/tenant_resource_policy'
139
+ HatchetSdkRest.autoload :TenantRole, 'hatchet-sdk-rest/models/tenant_role'
140
+ HatchetSdkRest.autoload :TenantRoleList, 'hatchet-sdk-rest/models/tenant_role_list'
139
141
  HatchetSdkRest.autoload :TenantStepRunQueueMetrics, 'hatchet-sdk-rest/models/tenant_step_run_queue_metrics'
140
142
  HatchetSdkRest.autoload :TenantVersion, 'hatchet-sdk-rest/models/tenant_version'
143
+ HatchetSdkRest.autoload :TokenCapability, 'hatchet-sdk-rest/models/token_capability'
144
+ HatchetSdkRest.autoload :TokenCapabilityList, 'hatchet-sdk-rest/models/token_capability_list'
141
145
  HatchetSdkRest.autoload :TriggerRunResult, 'hatchet-sdk-rest/models/trigger_run_result'
142
146
  HatchetSdkRest.autoload :TriggerWorkflowRunRequest, 'hatchet-sdk-rest/models/trigger_workflow_run_request'
143
147
  HatchetSdkRest.autoload :UpdateCronWorkflowTriggerRequest, 'hatchet-sdk-rest/models/update_cron_workflow_trigger_request'
@@ -169,6 +173,7 @@ HatchetSdkRest.autoload :V1ConcurrencyScope, 'hatchet-sdk-rest/models/v1_concurr
169
173
  HatchetSdkRest.autoload :V1ConcurrencyStrategy, 'hatchet-sdk-rest/models/v1_concurrency_strategy'
170
174
  HatchetSdkRest.autoload :V1ConcurrencyStrategyList, 'hatchet-sdk-rest/models/v1_concurrency_strategy_list'
171
175
  HatchetSdkRest.autoload :V1ConcurrencyStrategyUsage, 'hatchet-sdk-rest/models/v1_concurrency_strategy_usage'
176
+ HatchetSdkRest.autoload :V1ConcurrencyTotals, 'hatchet-sdk-rest/models/v1_concurrency_totals'
172
177
  HatchetSdkRest.autoload :V1CreateFilterRequest, 'hatchet-sdk-rest/models/v1_create_filter_request'
173
178
  HatchetSdkRest.autoload :V1CreateServerlessEndpointRequest, 'hatchet-sdk-rest/models/v1_create_serverless_endpoint_request'
174
179
  HatchetSdkRest.autoload :V1CreateWebhookRequest, 'hatchet-sdk-rest/models/v1_create_webhook_request'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Hatchet
4
- VERSION = "0.13.0"
4
+ VERSION = "0.13.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hatchet-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabriel ruttner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-24 00:00:00.000000000 Z
11
+ date: 2026-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -356,8 +356,12 @@ files:
356
356
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource.rb
357
357
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource_limit.rb
358
358
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_resource_policy.rb
359
+ - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role.rb
360
+ - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_role_list.rb
359
361
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_step_run_queue_metrics.rb
360
362
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_version.rb
363
+ - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability.rb
364
+ - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/token_capability_list.rb
361
365
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/trigger_run_result.rb
362
366
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/trigger_workflow_run_request.rb
363
367
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/update_cron_workflow_trigger_request.rb
@@ -389,6 +393,7 @@ files:
389
393
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy.rb
390
394
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy_list.rb
391
395
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_strategy_usage.rb
396
+ - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_concurrency_totals.rb
392
397
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
393
398
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb
394
399
  - lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb