hatchet-sdk 0.10.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 +6 -0
- data/lib/hatchet/clients/grpc/admin.rb +20 -0
- data/lib/hatchet/clients/rest/.openapi-generator/FILES +10 -0
- data/lib/hatchet/clients/rest/README.md +16 -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 +80 -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/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_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/workflow.rb +14 -4
- data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +10 -0
- data/lib/hatchet/context.rb +13 -0
- data/lib/hatchet/contracts/workflows/workflows_pb.rb +3 -1
- data/lib/hatchet/contracts/workflows/workflows_services_pb.rb +1 -0
- data/lib/hatchet/features/rate_limits.rb +13 -0
- data/lib/hatchet/version.rb +1 -1
- 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 +12 -2
data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_serverless_endpoint_request.rb
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
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
|
+
# Fields to update on a serverless endpoint. Omitted fields are left unchanged.
|
|
18
|
+
class V1UpdateServerlessEndpointRequest
|
|
19
|
+
# The name of the endpoint. Unique within the tenant.
|
|
20
|
+
attr_accessor :name
|
|
21
|
+
|
|
22
|
+
attr_accessor :kind
|
|
23
|
+
|
|
24
|
+
# The HTTPS URL (port 443) polled periodically to discover the workflows this endpoint serves.
|
|
25
|
+
attr_accessor :healthcheck_url
|
|
26
|
+
|
|
27
|
+
# The HTTPS URL (port 443) that assigned tasks are delivered to.
|
|
28
|
+
attr_accessor :trigger_url
|
|
29
|
+
|
|
30
|
+
# A new secret used to HMAC-sign requests delivered to the endpoint. At least 32 characters. Provide a value to rotate the secret; it is never returned in responses.
|
|
31
|
+
attr_accessor :signing_secret
|
|
32
|
+
|
|
33
|
+
# The per-request timeout backstop for trigger requests, in seconds.
|
|
34
|
+
attr_accessor :request_timeout_seconds
|
|
35
|
+
|
|
36
|
+
# How often the healthcheck URL is polled, in seconds.
|
|
37
|
+
attr_accessor :poll_interval_seconds
|
|
38
|
+
|
|
39
|
+
# The inline wait budget for durable results, in milliseconds.
|
|
40
|
+
attr_accessor :inline_wait_budget_ms
|
|
41
|
+
|
|
42
|
+
# Worker labels applied to the worker the operator creates for this endpoint. Replaces the existing labels.
|
|
43
|
+
attr_accessor :labels
|
|
44
|
+
|
|
45
|
+
# Whether the operator polls and dispatches to this endpoint.
|
|
46
|
+
attr_accessor :enabled
|
|
47
|
+
|
|
48
|
+
class EnumAttributeValidator
|
|
49
|
+
attr_reader :datatype
|
|
50
|
+
attr_reader :allowable_values
|
|
51
|
+
|
|
52
|
+
def initialize(datatype, allowable_values)
|
|
53
|
+
@allowable_values = allowable_values.map do |value|
|
|
54
|
+
case datatype.to_s
|
|
55
|
+
when /Integer/i
|
|
56
|
+
value.to_i
|
|
57
|
+
when /Float/i
|
|
58
|
+
value.to_f
|
|
59
|
+
else
|
|
60
|
+
value
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def valid?(value)
|
|
66
|
+
!value || allowable_values.include?(value)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
71
|
+
def self.attribute_map
|
|
72
|
+
{
|
|
73
|
+
:'name' => :'name',
|
|
74
|
+
:'kind' => :'kind',
|
|
75
|
+
:'healthcheck_url' => :'healthcheckUrl',
|
|
76
|
+
:'trigger_url' => :'triggerUrl',
|
|
77
|
+
:'signing_secret' => :'signingSecret',
|
|
78
|
+
:'request_timeout_seconds' => :'requestTimeoutSeconds',
|
|
79
|
+
:'poll_interval_seconds' => :'pollIntervalSeconds',
|
|
80
|
+
:'inline_wait_budget_ms' => :'inlineWaitBudgetMs',
|
|
81
|
+
:'labels' => :'labels',
|
|
82
|
+
:'enabled' => :'enabled'
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Returns attribute mapping this model knows about
|
|
87
|
+
def self.acceptable_attribute_map
|
|
88
|
+
attribute_map
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Returns all the JSON keys this model knows about
|
|
92
|
+
def self.acceptable_attributes
|
|
93
|
+
acceptable_attribute_map.values
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# Attribute type mapping.
|
|
97
|
+
def self.openapi_types
|
|
98
|
+
{
|
|
99
|
+
:'name' => :'String',
|
|
100
|
+
:'kind' => :'V1ServerlessEndpointKind',
|
|
101
|
+
:'healthcheck_url' => :'String',
|
|
102
|
+
:'trigger_url' => :'String',
|
|
103
|
+
:'signing_secret' => :'String',
|
|
104
|
+
:'request_timeout_seconds' => :'Integer',
|
|
105
|
+
:'poll_interval_seconds' => :'Integer',
|
|
106
|
+
:'inline_wait_budget_ms' => :'Integer',
|
|
107
|
+
:'labels' => :'Hash<String, Object>',
|
|
108
|
+
:'enabled' => :'Boolean'
|
|
109
|
+
}
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# List of attributes with nullable: true
|
|
113
|
+
def self.openapi_nullable
|
|
114
|
+
Set.new([
|
|
115
|
+
])
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Initializes the object
|
|
119
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
120
|
+
def initialize(attributes = {})
|
|
121
|
+
if (!attributes.is_a?(Hash))
|
|
122
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `HatchetSdkRest::V1UpdateServerlessEndpointRequest` initialize method"
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
126
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
127
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
128
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
129
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `HatchetSdkRest::V1UpdateServerlessEndpointRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
130
|
+
end
|
|
131
|
+
h[k.to_sym] = v
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'name')
|
|
135
|
+
self.name = attributes[:'name']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'kind')
|
|
139
|
+
self.kind = attributes[:'kind']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'healthcheck_url')
|
|
143
|
+
self.healthcheck_url = attributes[:'healthcheck_url']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'trigger_url')
|
|
147
|
+
self.trigger_url = attributes[:'trigger_url']
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
if attributes.key?(:'signing_secret')
|
|
151
|
+
self.signing_secret = attributes[:'signing_secret']
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'request_timeout_seconds')
|
|
155
|
+
self.request_timeout_seconds = attributes[:'request_timeout_seconds']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'poll_interval_seconds')
|
|
159
|
+
self.poll_interval_seconds = attributes[:'poll_interval_seconds']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'inline_wait_budget_ms')
|
|
163
|
+
self.inline_wait_budget_ms = attributes[:'inline_wait_budget_ms']
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
if attributes.key?(:'labels')
|
|
167
|
+
if (value = attributes[:'labels']).is_a?(Hash)
|
|
168
|
+
self.labels = value
|
|
169
|
+
end
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'enabled')
|
|
173
|
+
self.enabled = attributes[:'enabled']
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
178
|
+
# @return Array for valid properties with the reasons
|
|
179
|
+
def list_invalid_properties
|
|
180
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
181
|
+
invalid_properties = Array.new
|
|
182
|
+
if !@signing_secret.nil? && @signing_secret.to_s.length < 32
|
|
183
|
+
invalid_properties.push('invalid value for "signing_secret", the character length must be greater than or equal to 32.')
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
invalid_properties
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Check to see if the all the properties in the model are valid
|
|
190
|
+
# @return true if the model is valid
|
|
191
|
+
def valid?
|
|
192
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
193
|
+
return false if !@signing_secret.nil? && @signing_secret.to_s.length < 32
|
|
194
|
+
true
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
# Custom attribute writer method with validation
|
|
198
|
+
# @param [Object] signing_secret Value to be assigned
|
|
199
|
+
def signing_secret=(signing_secret)
|
|
200
|
+
if signing_secret.nil?
|
|
201
|
+
fail ArgumentError, 'signing_secret cannot be nil'
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
if signing_secret.to_s.length < 32
|
|
205
|
+
fail ArgumentError, 'invalid value for "signing_secret", the character length must be greater than or equal to 32.'
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
@signing_secret = signing_secret
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Checks equality by comparing each attribute.
|
|
212
|
+
# @param [Object] Object to be compared
|
|
213
|
+
def ==(o)
|
|
214
|
+
return true if self.equal?(o)
|
|
215
|
+
self.class == o.class &&
|
|
216
|
+
name == o.name &&
|
|
217
|
+
kind == o.kind &&
|
|
218
|
+
healthcheck_url == o.healthcheck_url &&
|
|
219
|
+
trigger_url == o.trigger_url &&
|
|
220
|
+
signing_secret == o.signing_secret &&
|
|
221
|
+
request_timeout_seconds == o.request_timeout_seconds &&
|
|
222
|
+
poll_interval_seconds == o.poll_interval_seconds &&
|
|
223
|
+
inline_wait_budget_ms == o.inline_wait_budget_ms &&
|
|
224
|
+
labels == o.labels &&
|
|
225
|
+
enabled == o.enabled
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# @see the `==` method
|
|
229
|
+
# @param [Object] Object to be compared
|
|
230
|
+
def eql?(o)
|
|
231
|
+
self == o
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Calculates hash code according to all attributes.
|
|
235
|
+
# @return [Integer] Hash code
|
|
236
|
+
def hash
|
|
237
|
+
[name, kind, healthcheck_url, trigger_url, signing_secret, request_timeout_seconds, poll_interval_seconds, inline_wait_budget_ms, labels, enabled].hash
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Builds the object from hash
|
|
241
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
242
|
+
# @return [Object] Returns the model itself
|
|
243
|
+
def self.build_from_hash(attributes)
|
|
244
|
+
return nil unless attributes.is_a?(Hash)
|
|
245
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
246
|
+
transformed_hash = {}
|
|
247
|
+
openapi_types.each_pair do |key, type|
|
|
248
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
249
|
+
transformed_hash["#{key}"] = nil
|
|
250
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
251
|
+
# check to ensure the input is an array given that the attribute
|
|
252
|
+
# is documented as an array but the input is not
|
|
253
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
254
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
255
|
+
end
|
|
256
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
257
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
new(transformed_hash)
|
|
261
|
+
end
|
|
262
|
+
|
|
263
|
+
# Deserializes the data based on type
|
|
264
|
+
# @param string type Data type
|
|
265
|
+
# @param string value Value to be deserialized
|
|
266
|
+
# @return [Object] Deserialized data
|
|
267
|
+
def self._deserialize(type, value)
|
|
268
|
+
case type.to_sym
|
|
269
|
+
when :Time
|
|
270
|
+
Time.parse(value)
|
|
271
|
+
when :Date
|
|
272
|
+
Date.parse(value)
|
|
273
|
+
when :String
|
|
274
|
+
value.to_s
|
|
275
|
+
when :Integer
|
|
276
|
+
value.to_i
|
|
277
|
+
when :Float
|
|
278
|
+
value.to_f
|
|
279
|
+
when :Boolean
|
|
280
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
281
|
+
true
|
|
282
|
+
else
|
|
283
|
+
false
|
|
284
|
+
end
|
|
285
|
+
when :Object
|
|
286
|
+
# generic object (usually a Hash), return directly
|
|
287
|
+
value
|
|
288
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
289
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
290
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
291
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
292
|
+
k_type = Regexp.last_match[:k_type]
|
|
293
|
+
v_type = Regexp.last_match[:v_type]
|
|
294
|
+
{}.tap do |hash|
|
|
295
|
+
value.each do |k, v|
|
|
296
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
297
|
+
end
|
|
298
|
+
end
|
|
299
|
+
else # model
|
|
300
|
+
# models (e.g. Pet) or oneOf
|
|
301
|
+
klass = HatchetSdkRest.const_get(type)
|
|
302
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Returns the string representation of the object
|
|
307
|
+
# @return [String] String presentation of the object
|
|
308
|
+
def to_s
|
|
309
|
+
to_hash.to_s
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
313
|
+
# @return [Hash] Returns the object in the form of hash
|
|
314
|
+
def to_body
|
|
315
|
+
to_hash
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# Returns the object in the form of hash
|
|
319
|
+
# @return [Hash] Returns the object in the form of hash
|
|
320
|
+
def to_hash
|
|
321
|
+
hash = {}
|
|
322
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
323
|
+
value = self.send(attr)
|
|
324
|
+
if value.nil?
|
|
325
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
326
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
hash[param] = _to_hash(value)
|
|
330
|
+
end
|
|
331
|
+
hash
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# Outputs non-array value in the form of hash
|
|
335
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
336
|
+
# @param [Object] value Any valid value
|
|
337
|
+
# @return [Hash] Returns the value in the form of hash
|
|
338
|
+
def _to_hash(value)
|
|
339
|
+
if value.is_a?(Array)
|
|
340
|
+
value.compact.map { |v| _to_hash(v) }
|
|
341
|
+
elsif value.is_a?(Hash)
|
|
342
|
+
{}.tap do |hash|
|
|
343
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
344
|
+
end
|
|
345
|
+
elsif value.respond_to? :to_hash
|
|
346
|
+
value.to_hash
|
|
347
|
+
else
|
|
348
|
+
value
|
|
349
|
+
end
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
end
|
|
@@ -43,6 +43,9 @@ module HatchetSdkRest
|
|
|
43
43
|
# The jobs of the workflow.
|
|
44
44
|
attr_accessor :jobs
|
|
45
45
|
|
|
46
|
+
# The event and cron triggers declared on the latest workflow version.
|
|
47
|
+
attr_accessor :triggers
|
|
48
|
+
|
|
46
49
|
class EnumAttributeValidator
|
|
47
50
|
attr_reader :datatype
|
|
48
51
|
attr_reader :allowable_values
|
|
@@ -77,7 +80,8 @@ module HatchetSdkRest
|
|
|
77
80
|
:'paused_workflow_scheduled_run_queue_behavior' => :'pausedWorkflowScheduledRunQueueBehavior',
|
|
78
81
|
:'versions' => :'versions',
|
|
79
82
|
:'tags' => :'tags',
|
|
80
|
-
:'jobs' => :'jobs'
|
|
83
|
+
:'jobs' => :'jobs',
|
|
84
|
+
:'triggers' => :'triggers'
|
|
81
85
|
}
|
|
82
86
|
end
|
|
83
87
|
|
|
@@ -103,7 +107,8 @@ module HatchetSdkRest
|
|
|
103
107
|
:'paused_workflow_scheduled_run_queue_behavior' => :'WorkflowPauseScheduledCronRunQueueBehavior',
|
|
104
108
|
:'versions' => :'Array<WorkflowVersionMeta>',
|
|
105
109
|
:'tags' => :'Array<WorkflowTag>',
|
|
106
|
-
:'jobs' => :'Array<Job>'
|
|
110
|
+
:'jobs' => :'Array<Job>',
|
|
111
|
+
:'triggers' => :'WorkflowTriggers'
|
|
107
112
|
}
|
|
108
113
|
end
|
|
109
114
|
|
|
@@ -180,6 +185,10 @@ module HatchetSdkRest
|
|
|
180
185
|
self.jobs = value
|
|
181
186
|
end
|
|
182
187
|
end
|
|
188
|
+
|
|
189
|
+
if attributes.key?(:'triggers')
|
|
190
|
+
self.triggers = attributes[:'triggers']
|
|
191
|
+
end
|
|
183
192
|
end
|
|
184
193
|
|
|
185
194
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -256,7 +265,8 @@ module HatchetSdkRest
|
|
|
256
265
|
paused_workflow_scheduled_run_queue_behavior == o.paused_workflow_scheduled_run_queue_behavior &&
|
|
257
266
|
versions == o.versions &&
|
|
258
267
|
tags == o.tags &&
|
|
259
|
-
jobs == o.jobs
|
|
268
|
+
jobs == o.jobs &&
|
|
269
|
+
triggers == o.triggers
|
|
260
270
|
end
|
|
261
271
|
|
|
262
272
|
# @see the `==` method
|
|
@@ -268,7 +278,7 @@ module HatchetSdkRest
|
|
|
268
278
|
# Calculates hash code according to all attributes.
|
|
269
279
|
# @return [Integer] Hash code
|
|
270
280
|
def hash
|
|
271
|
-
[metadata, name, tenant_id, description, is_paused, paused_workflow_cron_run_queue_behavior, paused_workflow_scheduled_run_queue_behavior, versions, tags, jobs].hash
|
|
281
|
+
[metadata, name, tenant_id, description, is_paused, paused_workflow_cron_run_queue_behavior, paused_workflow_scheduled_run_queue_behavior, versions, tags, jobs, triggers].hash
|
|
272
282
|
end
|
|
273
283
|
|
|
274
284
|
# Builds the object from hash
|
|
@@ -124,6 +124,7 @@ HatchetSdkRest.autoload :Tenant, 'hatchet-sdk-rest/models/tenant'
|
|
|
124
124
|
HatchetSdkRest.autoload :TenantAlertEmailGroup, 'hatchet-sdk-rest/models/tenant_alert_email_group'
|
|
125
125
|
HatchetSdkRest.autoload :TenantAlertEmailGroupList, 'hatchet-sdk-rest/models/tenant_alert_email_group_list'
|
|
126
126
|
HatchetSdkRest.autoload :TenantAlertingSettings, 'hatchet-sdk-rest/models/tenant_alerting_settings'
|
|
127
|
+
HatchetSdkRest.autoload :TenantEntitlements, 'hatchet-sdk-rest/models/tenant_entitlements'
|
|
127
128
|
HatchetSdkRest.autoload :TenantEnvironment, 'hatchet-sdk-rest/models/tenant_environment'
|
|
128
129
|
HatchetSdkRest.autoload :TenantInvite, 'hatchet-sdk-rest/models/tenant_invite'
|
|
129
130
|
HatchetSdkRest.autoload :TenantInviteList, 'hatchet-sdk-rest/models/tenant_invite_list'
|
|
@@ -161,6 +162,7 @@ HatchetSdkRest.autoload :V1CELDebugResponseStatus, 'hatchet-sdk-rest/models/v1_c
|
|
|
161
162
|
HatchetSdkRest.autoload :V1CancelTaskRequest, 'hatchet-sdk-rest/models/v1_cancel_task_request'
|
|
162
163
|
HatchetSdkRest.autoload :V1CancelledTasks, 'hatchet-sdk-rest/models/v1_cancelled_tasks'
|
|
163
164
|
HatchetSdkRest.autoload :V1CreateFilterRequest, 'hatchet-sdk-rest/models/v1_create_filter_request'
|
|
165
|
+
HatchetSdkRest.autoload :V1CreateServerlessEndpointRequest, 'hatchet-sdk-rest/models/v1_create_serverless_endpoint_request'
|
|
164
166
|
HatchetSdkRest.autoload :V1CreateWebhookRequest, 'hatchet-sdk-rest/models/v1_create_webhook_request'
|
|
165
167
|
HatchetSdkRest.autoload :V1CreateWebhookRequestAPIKey, 'hatchet-sdk-rest/models/v1_create_webhook_request_api_key'
|
|
166
168
|
HatchetSdkRest.autoload :V1CreateWebhookRequestBase, 'hatchet-sdk-rest/models/v1_create_webhook_request_base'
|
|
@@ -188,7 +190,13 @@ HatchetSdkRest.autoload :V1ReplayedTasks, 'hatchet-sdk-rest/models/v1_replayed_t
|
|
|
188
190
|
HatchetSdkRest.autoload :V1RestoreTaskResponse, 'hatchet-sdk-rest/models/v1_restore_task_response'
|
|
189
191
|
HatchetSdkRest.autoload :V1RunningDetailCount, 'hatchet-sdk-rest/models/v1_running_detail_count'
|
|
190
192
|
HatchetSdkRest.autoload :V1RunningFilter, 'hatchet-sdk-rest/models/v1_running_filter'
|
|
193
|
+
HatchetSdkRest.autoload :V1ServerlessEndpoint, 'hatchet-sdk-rest/models/v1_serverless_endpoint'
|
|
194
|
+
HatchetSdkRest.autoload :V1ServerlessEndpointKind, 'hatchet-sdk-rest/models/v1_serverless_endpoint_kind'
|
|
195
|
+
HatchetSdkRest.autoload :V1ServerlessEndpointList, 'hatchet-sdk-rest/models/v1_serverless_endpoint_list'
|
|
196
|
+
HatchetSdkRest.autoload :V1ServerlessEndpointStatus, 'hatchet-sdk-rest/models/v1_serverless_endpoint_status'
|
|
191
197
|
HatchetSdkRest.autoload :V1StreamPayloadRef, 'hatchet-sdk-rest/models/v1_stream_payload_ref'
|
|
198
|
+
HatchetSdkRest.autoload :V1StreamTopic, 'hatchet-sdk-rest/models/v1_stream_topic'
|
|
199
|
+
HatchetSdkRest.autoload :V1StreamTopicList, 'hatchet-sdk-rest/models/v1_stream_topic_list'
|
|
192
200
|
HatchetSdkRest.autoload :V1TaskEvent, 'hatchet-sdk-rest/models/v1_task_event'
|
|
193
201
|
HatchetSdkRest.autoload :V1TaskEventList, 'hatchet-sdk-rest/models/v1_task_event_list'
|
|
194
202
|
HatchetSdkRest.autoload :V1TaskEventType, 'hatchet-sdk-rest/models/v1_task_event_type'
|
|
@@ -204,6 +212,7 @@ HatchetSdkRest.autoload :V1TaskTiming, 'hatchet-sdk-rest/models/v1_task_timing'
|
|
|
204
212
|
HatchetSdkRest.autoload :V1TaskTimingList, 'hatchet-sdk-rest/models/v1_task_timing_list'
|
|
205
213
|
HatchetSdkRest.autoload :V1TriggerWorkflowRunRequest, 'hatchet-sdk-rest/models/v1_trigger_workflow_run_request'
|
|
206
214
|
HatchetSdkRest.autoload :V1UpdateFilterRequest, 'hatchet-sdk-rest/models/v1_update_filter_request'
|
|
215
|
+
HatchetSdkRest.autoload :V1UpdateServerlessEndpointRequest, 'hatchet-sdk-rest/models/v1_update_serverless_endpoint_request'
|
|
207
216
|
HatchetSdkRest.autoload :V1UpdateWebhookRequest, 'hatchet-sdk-rest/models/v1_update_webhook_request'
|
|
208
217
|
HatchetSdkRest.autoload :V1WaitItem, 'hatchet-sdk-rest/models/v1_wait_item'
|
|
209
218
|
HatchetSdkRest.autoload :V1Webhook, 'hatchet-sdk-rest/models/v1_webhook'
|
|
@@ -280,6 +289,7 @@ HatchetSdkRest.autoload :MetadataApi, 'hatchet-sdk-rest/api/metadata_api'
|
|
|
280
289
|
HatchetSdkRest.autoload :ObservabilityApi, 'hatchet-sdk-rest/api/observability_api'
|
|
281
290
|
HatchetSdkRest.autoload :RateLimitsApi, 'hatchet-sdk-rest/api/rate_limits_api'
|
|
282
291
|
HatchetSdkRest.autoload :SNSApi, 'hatchet-sdk-rest/api/sns_api'
|
|
292
|
+
HatchetSdkRest.autoload :ServerlessApi, 'hatchet-sdk-rest/api/serverless_api'
|
|
283
293
|
HatchetSdkRest.autoload :SlackApi, 'hatchet-sdk-rest/api/slack_api'
|
|
284
294
|
HatchetSdkRest.autoload :StepRunApi, 'hatchet-sdk-rest/api/step_run_api'
|
|
285
295
|
HatchetSdkRest.autoload :StreamsApi, 'hatchet-sdk-rest/api/streams_api'
|
data/lib/hatchet/context.rb
CHANGED
|
@@ -188,6 +188,19 @@ module Hatchet
|
|
|
188
188
|
@dispatcher_client.release_slot(step_run_id: @step_run_id)
|
|
189
189
|
end
|
|
190
190
|
|
|
191
|
+
# Pause a rate limit key until the given time.
|
|
192
|
+
# Queued runs that consume it stay queued, while runs that are already executing, including this one, are unaffected.
|
|
193
|
+
#
|
|
194
|
+
# @param key [String] The rendered rate limit key to pause
|
|
195
|
+
# @param until_time [Time] The time to pause the key until. An earlier time never shortens an existing pause.
|
|
196
|
+
# @return [Time] The time the key is paused until
|
|
197
|
+
# @raise [Hatchet::Error] If the context has no client to pause with
|
|
198
|
+
def pause_rate_limit(key, until_time:)
|
|
199
|
+
raise Hatchet::Error, "cannot pause a rate limit without a client" unless @client
|
|
200
|
+
|
|
201
|
+
@client.admin_grpc.pause_rate_limit(key: key, until_time: until_time)
|
|
202
|
+
end
|
|
203
|
+
|
|
191
204
|
# Put a stream chunk for real-time streaming output.
|
|
192
205
|
#
|
|
193
206
|
# @param data [String] The chunk data to stream
|
|
@@ -8,7 +8,7 @@ require 'google/protobuf/timestamp_pb'
|
|
|
8
8
|
require 'v1/shared/trigger_pb'
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
descriptor_data = "\n\x19workflows/workflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17v1/shared/trigger.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"\xd0\x01\n\x17WorkflowConcurrencyOpts\x12\x13\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x36\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategyH\x02\x88\x01\x01\x12\x17\n\nexpression\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_actionB\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\r\n\x0b_expression\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xb8\x03\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x12\x1b\n\x0e\x62\x61\x63koff_factor\x18\n \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x62\x61\x63koff_max_seconds\x18\x0b \x01(\x05H\x01\x88\x01\x01\x1aL\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x11\n\x0f_backoff_factorB\x16\n\x14_backoff_max_seconds\"\xfa\x01\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\x05units\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08key_expr\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nunits_expr\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11limit_values_expr\x18\x05 \x01(\tH\x03\x88\x01\x01\x12)\n\x08\x64uration\x18\x06 \x01(\x0e\x32\x12.RateLimitDurationH\x04\x88\x01\x01\x42\x08\n\x06_unitsB\x0b\n\t_key_exprB\r\n\x0b_units_exprB\x14\n\x12_limit_values_exprB\x0b\n\t_duration\"\x16\n\x14ListWorkflowsRequest\"\x83\x03\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12(\n\x1bparent_task_run_external_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x05\x88\x01\x01\x42\x0c\n\n_parent_idB\x1e\n\x1c_parent_task_run_external_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x0b\n\t_priority\"O\n\x11ScheduledWorkflow\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ntrigger_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe3\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x03\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12/\n\x13scheduled_workflows\x18\x08 \x03(\x0b\x32\x12.ScheduledWorkflow\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"K\n\x1a\x42ulkTriggerWorkflowRequest\x12-\n\tworkflows\x18\x01 \x03(\x0b\x32\x1a.v1.TriggerWorkflowRequest\"7\n\x1b\x42ulkTriggerWorkflowResponse\x12\x18\n\x10workflow_run_ids\x18\x01 \x03(\t\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*\x7f\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03\x12\x11\n\rCANCEL_NEWEST\x10\x04*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\
|
|
11
|
+
descriptor_data = "\n\x19workflows/workflows.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17v1/shared/trigger.proto\">\n\x12PutWorkflowRequest\x12(\n\x04opts\x18\x01 \x01(\x0b\x32\x1a.CreateWorkflowVersionOpts\"\xbf\x04\n\x19\x43reateWorkflowVersionOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x03 \x01(\t\x12\x16\n\x0e\x65vent_triggers\x18\x04 \x03(\t\x12\x15\n\rcron_triggers\x18\x05 \x03(\t\x12\x36\n\x12scheduled_triggers\x18\x06 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12$\n\x04jobs\x18\x07 \x03(\x0b\x32\x16.CreateWorkflowJobOpts\x12-\n\x0b\x63oncurrency\x18\x08 \x01(\x0b\x32\x18.WorkflowConcurrencyOpts\x12\x1d\n\x10schedule_timeout\x18\t \x01(\tH\x00\x88\x01\x01\x12\x17\n\ncron_input\x18\n \x01(\tH\x01\x88\x01\x01\x12\x33\n\x0eon_failure_job\x18\x0b \x01(\x0b\x32\x16.CreateWorkflowJobOptsH\x02\x88\x01\x01\x12$\n\x06sticky\x18\x0c \x01(\x0e\x32\x0f.StickyStrategyH\x03\x88\x01\x01\x12 \n\x04kind\x18\r \x01(\x0e\x32\r.WorkflowKindH\x04\x88\x01\x01\x12\x1d\n\x10\x64\x65\x66\x61ult_priority\x18\x0e \x01(\x05H\x05\x88\x01\x01\x42\x13\n\x11_schedule_timeoutB\r\n\x0b_cron_inputB\x11\n\x0f_on_failure_jobB\t\n\x07_stickyB\x07\n\x05_kindB\x13\n\x11_default_priority\"\xd0\x01\n\x17WorkflowConcurrencyOpts\x12\x13\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x15\n\x08max_runs\x18\x02 \x01(\x05H\x01\x88\x01\x01\x12\x36\n\x0elimit_strategy\x18\x03 \x01(\x0e\x32\x19.ConcurrencyLimitStrategyH\x02\x88\x01\x01\x12\x17\n\nexpression\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\t\n\x07_actionB\x0b\n\t_max_runsB\x11\n\x0f_limit_strategyB\r\n\x0b_expression\"h\n\x15\x43reateWorkflowJobOpts\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12&\n\x05steps\x18\x04 \x03(\x0b\x32\x17.CreateWorkflowStepOptsJ\x04\x08\x03\x10\x04\"\xb8\x03\n\x16\x43reateWorkflowStepOpts\x12\x13\n\x0breadable_id\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12\x0f\n\x07timeout\x18\x03 \x01(\t\x12\x0e\n\x06inputs\x18\x04 \x01(\t\x12\x0f\n\x07parents\x18\x05 \x03(\t\x12\x11\n\tuser_data\x18\x06 \x01(\t\x12\x0f\n\x07retries\x18\x07 \x01(\x05\x12)\n\x0brate_limits\x18\x08 \x03(\x0b\x32\x14.CreateStepRateLimit\x12@\n\rworker_labels\x18\t \x03(\x0b\x32).CreateWorkflowStepOpts.WorkerLabelsEntry\x12\x1b\n\x0e\x62\x61\x63koff_factor\x18\n \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x62\x61\x63koff_max_seconds\x18\x0b \x01(\x05H\x01\x88\x01\x01\x1aL\n\x11WorkerLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12&\n\x05value\x18\x02 \x01(\x0b\x32\x17.v1.DesiredWorkerLabels:\x02\x38\x01\x42\x11\n\x0f_backoff_factorB\x16\n\x14_backoff_max_seconds\"\xfa\x01\n\x13\x43reateStepRateLimit\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x12\n\x05units\x18\x02 \x01(\x05H\x00\x88\x01\x01\x12\x15\n\x08key_expr\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nunits_expr\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1e\n\x11limit_values_expr\x18\x05 \x01(\tH\x03\x88\x01\x01\x12)\n\x08\x64uration\x18\x06 \x01(\x0e\x32\x12.RateLimitDurationH\x04\x88\x01\x01\x42\x08\n\x06_unitsB\x0b\n\t_key_exprB\r\n\x0b_units_exprB\x14\n\x12_limit_values_exprB\x0b\n\t_duration\"\x16\n\x14ListWorkflowsRequest\"\x83\x03\n\x17ScheduleWorkflowRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12-\n\tschedules\x18\x02 \x03(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05input\x18\x03 \x01(\t\x12\x16\n\tparent_id\x18\x04 \x01(\tH\x00\x88\x01\x01\x12(\n\x1bparent_task_run_external_id\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0b\x63hild_index\x18\x06 \x01(\x05H\x02\x88\x01\x01\x12\x16\n\tchild_key\x18\x07 \x01(\tH\x03\x88\x01\x01\x12 \n\x13\x61\x64\x64itional_metadata\x18\x08 \x01(\tH\x04\x88\x01\x01\x12\x15\n\x08priority\x18\t \x01(\x05H\x05\x88\x01\x01\x42\x0c\n\n_parent_idB\x1e\n\x1c_parent_task_run_external_idB\x0e\n\x0c_child_indexB\x0c\n\n_child_keyB\x16\n\x14_additional_metadataB\x0b\n\t_priority\"O\n\x11ScheduledWorkflow\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ntrigger_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xe3\x01\n\x0fWorkflowVersion\x12\n\n\x02id\x18\x01 \x01(\t\x12.\n\ncreated_at\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12.\n\nupdated_at\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07version\x18\x05 \x01(\t\x12\r\n\x05order\x18\x06 \x01(\x03\x12\x13\n\x0bworkflow_id\x18\x07 \x01(\t\x12/\n\x13scheduled_workflows\x18\x08 \x03(\x0b\x32\x12.ScheduledWorkflow\"?\n\x17WorkflowTriggerEventRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x11\n\tevent_key\x18\x02 \x01(\t\"9\n\x16WorkflowTriggerCronRef\x12\x11\n\tparent_id\x18\x01 \x01(\t\x12\x0c\n\x04\x63ron\x18\x02 \x01(\t\"K\n\x1a\x42ulkTriggerWorkflowRequest\x12-\n\tworkflows\x18\x01 \x03(\x0b\x32\x1a.v1.TriggerWorkflowRequest\"7\n\x1b\x42ulkTriggerWorkflowResponse\x12\x18\n\x10workflow_run_ids\x18\x01 \x03(\t\"2\n\x17TriggerWorkflowResponse\x12\x17\n\x0fworkflow_run_id\x18\x01 \x01(\t\"W\n\x13PutRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05limit\x18\x02 \x01(\x05\x12$\n\x08\x64uration\x18\x03 \x01(\x0e\x32\x12.RateLimitDuration\"\x16\n\x14PutRateLimitResponse\"V\n\x15PauseRateLimitRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x30\n\x0cpaused_until\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"J\n\x16PauseRateLimitResponse\x12\x30\n\x0cpaused_until\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp*$\n\x0eStickyStrategy\x12\x08\n\x04SOFT\x10\x00\x12\x08\n\x04HARD\x10\x01*2\n\x0cWorkflowKind\x12\x0c\n\x08\x46UNCTION\x10\x00\x12\x0b\n\x07\x44URABLE\x10\x01\x12\x07\n\x03\x44\x41G\x10\x02*\x7f\n\x18\x43oncurrencyLimitStrategy\x12\x16\n\x12\x43\x41NCEL_IN_PROGRESS\x10\x00\x12\x0f\n\x0b\x44ROP_NEWEST\x10\x01\x12\x10\n\x0cQUEUE_NEWEST\x10\x02\x12\x15\n\x11GROUP_ROUND_ROBIN\x10\x03\x12\x11\n\rCANCEL_NEWEST\x10\x04*]\n\x11RateLimitDuration\x12\n\n\x06SECOND\x10\x00\x12\n\n\x06MINUTE\x10\x01\x12\x08\n\x04HOUR\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x12\x08\n\x04WEEK\x10\x04\x12\t\n\x05MONTH\x10\x05\x12\x08\n\x04YEAR\x10\x06\x32\xa2\x03\n\x0fWorkflowService\x12\x34\n\x0bPutWorkflow\x12\x13.PutWorkflowRequest\x1a\x10.WorkflowVersion\x12>\n\x10ScheduleWorkflow\x12\x18.ScheduleWorkflowRequest\x1a\x10.WorkflowVersion\x12G\n\x0fTriggerWorkflow\x12\x1a.v1.TriggerWorkflowRequest\x1a\x18.TriggerWorkflowResponse\x12P\n\x13\x42ulkTriggerWorkflow\x12\x1b.BulkTriggerWorkflowRequest\x1a\x1c.BulkTriggerWorkflowResponse\x12;\n\x0cPutRateLimit\x12\x14.PutRateLimitRequest\x1a\x15.PutRateLimitResponse\x12\x41\n\x0ePauseRateLimit\x12\x16.PauseRateLimitRequest\x1a\x17.PauseRateLimitResponseBBZ@github.com/hatchet-dev/hatchet/internal/services/admin/contractsb\x06proto3"
|
|
12
12
|
|
|
13
13
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
14
14
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -30,6 +30,8 @@ BulkTriggerWorkflowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.
|
|
|
30
30
|
TriggerWorkflowResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("TriggerWorkflowResponse").msgclass
|
|
31
31
|
PutRateLimitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("PutRateLimitRequest").msgclass
|
|
32
32
|
PutRateLimitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("PutRateLimitResponse").msgclass
|
|
33
|
+
PauseRateLimitRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("PauseRateLimitRequest").msgclass
|
|
34
|
+
PauseRateLimitResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("PauseRateLimitResponse").msgclass
|
|
33
35
|
StickyStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("StickyStrategy").enummodule
|
|
34
36
|
WorkflowKind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("WorkflowKind").enummodule
|
|
35
37
|
ConcurrencyLimitStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("ConcurrencyLimitStrategy").enummodule
|
|
@@ -19,6 +19,7 @@ module WorkflowService
|
|
|
19
19
|
rpc :TriggerWorkflow, ::V1::TriggerWorkflowRequest, ::TriggerWorkflowResponse
|
|
20
20
|
rpc :BulkTriggerWorkflow, ::BulkTriggerWorkflowRequest, ::BulkTriggerWorkflowResponse
|
|
21
21
|
rpc :PutRateLimit, ::PutRateLimitRequest, ::PutRateLimitResponse
|
|
22
|
+
rpc :PauseRateLimit, ::PauseRateLimitRequest, ::PauseRateLimitResponse
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
Stub = Service.rpc_stub_class
|
|
@@ -35,6 +35,19 @@ module Hatchet
|
|
|
35
35
|
def put(key:, limit:, duration: :SECOND)
|
|
36
36
|
@admin_grpc.put_rate_limit(key: key, limit: limit, duration: duration)
|
|
37
37
|
end
|
|
38
|
+
|
|
39
|
+
# Pause a rate limit key.
|
|
40
|
+
# Queued runs that consume it stay queued until the given time.
|
|
41
|
+
#
|
|
42
|
+
# @param key [String] The rendered rate limit key to pause
|
|
43
|
+
# @param until_time [Time] The time to pause the key until. An earlier time never shortens an existing pause.
|
|
44
|
+
# @return [Time] The time the key is paused until
|
|
45
|
+
# @raise [GRPC::BadStatus] If the gRPC request fails
|
|
46
|
+
# @example
|
|
47
|
+
# hatchet.rate_limits.pause(key: "upstream-api:tenant-123", until_time: Time.now + 30)
|
|
48
|
+
def pause(key:, until_time:)
|
|
49
|
+
@admin_grpc.pause_rate_limit(key: key, until_time: until_time)
|
|
50
|
+
end
|
|
38
51
|
end
|
|
39
52
|
end
|
|
40
53
|
end
|
data/lib/hatchet/version.rb
CHANGED
data/sig/hatchet/context.rbs
CHANGED
|
@@ -32,6 +32,7 @@ module Hatchet
|
|
|
32
32
|
def cancel: () -> void
|
|
33
33
|
def refresh_timeout: (Integer | String duration) -> void
|
|
34
34
|
def release_slot: () -> void
|
|
35
|
+
def pause_rate_limit: (String key, until_time: Time) -> Time
|
|
35
36
|
def put_stream: (String data) -> void
|
|
36
37
|
def task_run_errors: () -> Array[TaskRunError]
|
|
37
38
|
def get_task_run_error: (Task | Symbol | String task_ref) -> TaskRunError?
|
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.
|
|
4
|
+
version: 0.11.0
|
|
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-10-
|
|
11
|
+
date: 2026-10-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|
|
@@ -218,6 +218,7 @@ files:
|
|
|
218
218
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/metadata_api.rb
|
|
219
219
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/observability_api.rb
|
|
220
220
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/rate_limits_api.rb
|
|
221
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/serverless_api.rb
|
|
221
222
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/slack_api.rb
|
|
222
223
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/sns_api.rb
|
|
223
224
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/step_run_api.rb
|
|
@@ -341,6 +342,7 @@ files:
|
|
|
341
342
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_alert_email_group.rb
|
|
342
343
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_alert_email_group_list.rb
|
|
343
344
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_alerting_settings.rb
|
|
345
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_entitlements.rb
|
|
344
346
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_environment.rb
|
|
345
347
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_invite.rb
|
|
346
348
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_invite_list.rb
|
|
@@ -378,6 +380,7 @@ files:
|
|
|
378
380
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_cel_debug_response.rb
|
|
379
381
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_cel_debug_response_status.rb
|
|
380
382
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
|
|
383
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb
|
|
381
384
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb
|
|
382
385
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request_api_key.rb
|
|
383
386
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_webhook_request_base.rb
|
|
@@ -405,7 +408,13 @@ files:
|
|
|
405
408
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_restore_task_response.rb
|
|
406
409
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_running_detail_count.rb
|
|
407
410
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_running_filter.rb
|
|
411
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint.rb
|
|
412
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_kind.rb
|
|
413
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_list.rb
|
|
414
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_status.rb
|
|
408
415
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_payload_ref.rb
|
|
416
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic.rb
|
|
417
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic_list.rb
|
|
409
418
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_event.rb
|
|
410
419
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_event_list.rb
|
|
411
420
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_event_type.rb
|
|
@@ -421,6 +430,7 @@ files:
|
|
|
421
430
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_task_timing_list.rb
|
|
422
431
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_trigger_workflow_run_request.rb
|
|
423
432
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_filter_request.rb
|
|
433
|
+
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_serverless_endpoint_request.rb
|
|
424
434
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_webhook_request.rb
|
|
425
435
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_wait_item.rb
|
|
426
436
|
- lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_webhook.rb
|