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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/lib/hatchet/clients/grpc/admin.rb +20 -0
  4. data/lib/hatchet/clients/grpc/dispatcher.rb +6 -2
  5. data/lib/hatchet/clients/rest/.openapi-generator/FILES +13 -0
  6. data/lib/hatchet/clients/rest/README.md +21 -0
  7. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/serverless_api.rb +405 -0
  8. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/streams_api.rb +263 -0
  9. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/tenant_api.rb +71 -0
  10. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/api/workflow_runs_api.rb +142 -0
  11. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/rate_limit.rb +14 -4
  12. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/tenant_entitlements.rb +367 -0
  13. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb +411 -0
  14. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint.rb +556 -0
  15. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_kind.rb +40 -0
  16. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_list.rb +231 -0
  17. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_serverless_endpoint_status.rb +271 -0
  18. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_payload_ref.rb +238 -0
  19. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic.rb +343 -0
  20. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_stream_topic_list.rb +292 -0
  21. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_update_serverless_endpoint_request.rb +354 -0
  22. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/v1_workflow_run_count.rb +238 -0
  23. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest/models/workflow.rb +14 -4
  24. data/lib/hatchet/clients/rest/lib/hatchet-sdk-rest.rb +13 -0
  25. data/lib/hatchet/context.rb +13 -0
  26. data/lib/hatchet/contracts/dispatcher/dispatcher_pb.rb +1 -1
  27. data/lib/hatchet/contracts/workflows/workflows_pb.rb +3 -1
  28. data/lib/hatchet/contracts/workflows/workflows_services_pb.rb +1 -0
  29. data/lib/hatchet/engine_version.rb +1 -0
  30. data/lib/hatchet/exceptions.rb +18 -0
  31. data/lib/hatchet/features/rate_limits.rb +13 -0
  32. data/lib/hatchet/version.rb +1 -1
  33. data/lib/hatchet/worker/runner.rb +24 -2
  34. data/sig/hatchet/clients/grpc/admin.rbs +1 -0
  35. data/sig/hatchet/context.rbs +1 -0
  36. data/sig/hatchet/features/rate_limits.rbs +1 -0
  37. metadata +15 -2
@@ -0,0 +1,263 @@
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 'cgi'
14
+
15
+ module HatchetSdkRest
16
+ class StreamsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get stream payload
23
+ # Get a durable stream payload uploaded ahead of its publish, by the payload_ref of the message that references it.
24
+ # @param tenant [String] The tenant id
25
+ # @param ref [String] The payload_ref of the stream message
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [File]
28
+ def v1_stream_payload_get(tenant, ref, opts = {})
29
+ data, _status_code, _headers = v1_stream_payload_get_with_http_info(tenant, ref, opts)
30
+ data
31
+ end
32
+
33
+ # Get stream payload
34
+ # Get a durable stream payload uploaded ahead of its publish, by the payload_ref of the message that references it.
35
+ # @param tenant [String] The tenant id
36
+ # @param ref [String] The payload_ref of the stream message
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
39
+ def v1_stream_payload_get_with_http_info(tenant, ref, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: StreamsApi.v1_stream_payload_get ...'
42
+ end
43
+ # verify the required parameter 'tenant' is set
44
+ if @api_client.config.client_side_validation && tenant.nil?
45
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling StreamsApi.v1_stream_payload_get"
46
+ end
47
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
48
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_payload_get, the character length must be smaller than or equal to 36.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
52
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_payload_get, the character length must be greater than or equal to 36.'
53
+ end
54
+
55
+ # verify the required parameter 'ref' is set
56
+ if @api_client.config.client_side_validation && ref.nil?
57
+ fail ArgumentError, "Missing the required parameter 'ref' when calling StreamsApi.v1_stream_payload_get"
58
+ end
59
+ # resource path
60
+ local_var_path = '/api/v1/stable/tenants/{tenant}/streams/payloads'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
61
+
62
+ # query parameters
63
+ query_params = opts[:query_params] || {}
64
+ query_params[:'ref'] = ref
65
+
66
+ # header parameters
67
+ header_params = opts[:header_params] || {}
68
+ # HTTP header 'Accept' (if needed)
69
+ header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept']
70
+
71
+ # form parameters
72
+ form_params = opts[:form_params] || {}
73
+
74
+ # http body (model)
75
+ post_body = opts[:debug_body]
76
+
77
+ # return_type
78
+ return_type = opts[:debug_return_type] || 'File'
79
+
80
+ # auth_names
81
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
82
+
83
+ new_options = opts.merge(
84
+ :operation => :"StreamsApi.v1_stream_payload_get",
85
+ :header_params => header_params,
86
+ :query_params => query_params,
87
+ :form_params => form_params,
88
+ :body => post_body,
89
+ :auth_names => auth_names,
90
+ :return_type => return_type
91
+ )
92
+
93
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "API called: StreamsApi#v1_stream_payload_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
96
+ end
97
+ return data, status_code, headers
98
+ end
99
+
100
+ # Upload stream payload
101
+ # Upload a payload too large for a gRPC publish, then publish the message with the returned ref as its payload_ref.
102
+ # @param tenant [String] The tenant id
103
+ # @param payload [File]
104
+ # @param [Hash] opts the optional parameters
105
+ # @return [V1StreamPayloadRef]
106
+ def v1_stream_payload_upload(tenant, payload, opts = {})
107
+ data, _status_code, _headers = v1_stream_payload_upload_with_http_info(tenant, payload, opts)
108
+ data
109
+ end
110
+
111
+ # Upload stream payload
112
+ # Upload a payload too large for a gRPC publish, then publish the message with the returned ref as its payload_ref.
113
+ # @param tenant [String] The tenant id
114
+ # @param payload [File]
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Array<(V1StreamPayloadRef, Integer, Hash)>] V1StreamPayloadRef data, response status code and response headers
117
+ def v1_stream_payload_upload_with_http_info(tenant, payload, opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug 'Calling API: StreamsApi.v1_stream_payload_upload ...'
120
+ end
121
+ # verify the required parameter 'tenant' is set
122
+ if @api_client.config.client_side_validation && tenant.nil?
123
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling StreamsApi.v1_stream_payload_upload"
124
+ end
125
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
126
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_payload_upload, the character length must be smaller than or equal to 36.'
127
+ end
128
+
129
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
130
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_payload_upload, the character length must be greater than or equal to 36.'
131
+ end
132
+
133
+ # verify the required parameter 'payload' is set
134
+ if @api_client.config.client_side_validation && payload.nil?
135
+ fail ArgumentError, "Missing the required parameter 'payload' when calling StreamsApi.v1_stream_payload_upload"
136
+ end
137
+ # resource path
138
+ local_var_path = '/api/v1/stable/tenants/{tenant}/streams/payloads'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
139
+
140
+ # query parameters
141
+ query_params = opts[:query_params] || {}
142
+
143
+ # header parameters
144
+ header_params = opts[:header_params] || {}
145
+ # HTTP header 'Accept' (if needed)
146
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
147
+ # HTTP header 'Content-Type'
148
+ content_type = @api_client.select_header_content_type(['multipart/form-data'])
149
+ if !content_type.nil?
150
+ header_params['Content-Type'] = content_type
151
+ end
152
+
153
+ # form parameters
154
+ form_params = opts[:form_params] || {}
155
+ form_params['payload'] = payload
156
+
157
+ # http body (model)
158
+ post_body = opts[:debug_body]
159
+
160
+ # return_type
161
+ return_type = opts[:debug_return_type] || 'V1StreamPayloadRef'
162
+
163
+ # auth_names
164
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
165
+
166
+ new_options = opts.merge(
167
+ :operation => :"StreamsApi.v1_stream_payload_upload",
168
+ :header_params => header_params,
169
+ :query_params => query_params,
170
+ :form_params => form_params,
171
+ :body => post_body,
172
+ :auth_names => auth_names,
173
+ :return_type => return_type
174
+ )
175
+
176
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug "API called: StreamsApi#v1_stream_payload_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
179
+ end
180
+ return data, status_code, headers
181
+ end
182
+
183
+ # List stream topics
184
+ # List the tenant's durable stream topics, with the number of messages each has within the tenant's retention.
185
+ # @param tenant [String] The tenant id
186
+ # @param [Hash] opts the optional parameters
187
+ # @option opts [Integer] :offset The number to skip
188
+ # @option opts [Integer] :limit The number to limit by
189
+ # @option opts [String] :search Matches topics or namespaces containing it
190
+ # @return [V1StreamTopicList]
191
+ def v1_stream_topic_list(tenant, opts = {})
192
+ data, _status_code, _headers = v1_stream_topic_list_with_http_info(tenant, opts)
193
+ data
194
+ end
195
+
196
+ # List stream topics
197
+ # List the tenant&#39;s durable stream topics, with the number of messages each has within the tenant&#39;s retention.
198
+ # @param tenant [String] The tenant id
199
+ # @param [Hash] opts the optional parameters
200
+ # @option opts [Integer] :offset The number to skip
201
+ # @option opts [Integer] :limit The number to limit by
202
+ # @option opts [String] :search Matches topics or namespaces containing it
203
+ # @return [Array<(V1StreamTopicList, Integer, Hash)>] V1StreamTopicList data, response status code and response headers
204
+ def v1_stream_topic_list_with_http_info(tenant, opts = {})
205
+ if @api_client.config.debugging
206
+ @api_client.config.logger.debug 'Calling API: StreamsApi.v1_stream_topic_list ...'
207
+ end
208
+ # verify the required parameter 'tenant' is set
209
+ if @api_client.config.client_side_validation && tenant.nil?
210
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling StreamsApi.v1_stream_topic_list"
211
+ end
212
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
213
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_topic_list, the character length must be smaller than or equal to 36.'
214
+ end
215
+
216
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
217
+ fail ArgumentError, 'invalid value for "tenant" when calling StreamsApi.v1_stream_topic_list, the character length must be greater than or equal to 36.'
218
+ end
219
+
220
+ # resource path
221
+ local_var_path = '/api/v1/stable/tenants/{tenant}/streams/topics'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
222
+
223
+ # query parameters
224
+ query_params = opts[:query_params] || {}
225
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
226
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
227
+ query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil?
228
+
229
+ # header parameters
230
+ header_params = opts[:header_params] || {}
231
+ # HTTP header 'Accept' (if needed)
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
233
+
234
+ # form parameters
235
+ form_params = opts[:form_params] || {}
236
+
237
+ # http body (model)
238
+ post_body = opts[:debug_body]
239
+
240
+ # return_type
241
+ return_type = opts[:debug_return_type] || 'V1StreamTopicList'
242
+
243
+ # auth_names
244
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
245
+
246
+ new_options = opts.merge(
247
+ :operation => :"StreamsApi.v1_stream_topic_list",
248
+ :header_params => header_params,
249
+ :query_params => query_params,
250
+ :form_params => form_params,
251
+ :body => post_body,
252
+ :auth_names => auth_names,
253
+ :return_type => return_type
254
+ )
255
+
256
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug "API called: StreamsApi#v1_stream_topic_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
+ end
260
+ return data, status_code, headers
261
+ end
262
+ end
263
+ end
@@ -464,6 +464,77 @@ module HatchetSdkRest
464
464
  return data, status_code, headers
465
465
  end
466
466
 
467
+ # Get tenant entitlements
468
+ # Gets the features the tenant is entitled to
469
+ # @param tenant [String] The tenant id
470
+ # @param [Hash] opts the optional parameters
471
+ # @return [TenantEntitlements]
472
+ def tenant_entitlements_get(tenant, opts = {})
473
+ data, _status_code, _headers = tenant_entitlements_get_with_http_info(tenant, opts)
474
+ data
475
+ end
476
+
477
+ # Get tenant entitlements
478
+ # Gets the features the tenant is entitled to
479
+ # @param tenant [String] The tenant id
480
+ # @param [Hash] opts the optional parameters
481
+ # @return [Array<(TenantEntitlements, Integer, Hash)>] TenantEntitlements data, response status code and response headers
482
+ def tenant_entitlements_get_with_http_info(tenant, opts = {})
483
+ if @api_client.config.debugging
484
+ @api_client.config.logger.debug 'Calling API: TenantApi.tenant_entitlements_get ...'
485
+ end
486
+ # verify the required parameter 'tenant' is set
487
+ if @api_client.config.client_side_validation && tenant.nil?
488
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_entitlements_get"
489
+ end
490
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
491
+ fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_entitlements_get, the character length must be smaller than or equal to 36.'
492
+ end
493
+
494
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
495
+ fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_entitlements_get, the character length must be greater than or equal to 36.'
496
+ end
497
+
498
+ # resource path
499
+ local_var_path = '/api/v1/tenants/{tenant}/entitlements'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
500
+
501
+ # query parameters
502
+ query_params = opts[:query_params] || {}
503
+
504
+ # header parameters
505
+ header_params = opts[:header_params] || {}
506
+ # HTTP header 'Accept' (if needed)
507
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
508
+
509
+ # form parameters
510
+ form_params = opts[:form_params] || {}
511
+
512
+ # http body (model)
513
+ post_body = opts[:debug_body]
514
+
515
+ # return_type
516
+ return_type = opts[:debug_return_type] || 'TenantEntitlements'
517
+
518
+ # auth_names
519
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
520
+
521
+ new_options = opts.merge(
522
+ :operation => :"TenantApi.tenant_entitlements_get",
523
+ :header_params => header_params,
524
+ :query_params => query_params,
525
+ :form_params => form_params,
526
+ :body => post_body,
527
+ :auth_names => auth_names,
528
+ :return_type => return_type
529
+ )
530
+
531
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
532
+ if @api_client.config.debugging
533
+ @api_client.config.logger.debug "API called: TenantApi#tenant_entitlements_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
534
+ end
535
+ return data, status_code, headers
536
+ end
537
+
467
538
  # Get tenant
468
539
  # Get the details of a tenant
469
540
  # @param tenant [String] The tenant id to get details for
@@ -101,6 +101,145 @@ module HatchetSdkRest
101
101
  return data, status_code, headers
102
102
  end
103
103
 
104
+ # Count workflow runs
105
+ # Counts the workflow runs for a tenant matching the provided filters. The count is capped, so it is a lower bound when it reaches the cap.
106
+ # @param tenant [String] The tenant id
107
+ # @param since [Time] The earliest date to filter by
108
+ # @param only_tasks [Boolean] Whether to include DAGs or only to include tasks
109
+ # @param [Hash] opts the optional parameters
110
+ # @option opts [Array<V1TaskStatus>] :statuses A list of statuses to filter by
111
+ # @option opts [Time] :_until The latest date to filter by
112
+ # @option opts [Array<String>] :additional_metadata Additional metadata k-v pairs to filter by
113
+ # @option opts [V1AdditionalMetadataOperator] :additional_metadata_operator How to combine multiple additional_metadata pairs. OR matches runs containing any pair, AND matches runs containing all pairs. Defaults to OR.
114
+ # @option opts [Array<String>] :workflow_ids The workflow ids to find runs for
115
+ # @option opts [String] :worker_id The worker id to filter by
116
+ # @option opts [String] :parent_task_external_id The parent task external id to filter by
117
+ # @option opts [String] :triggering_event_external_id The external id of the event that triggered the workflow run
118
+ # @option opts [V1RunningFilter] :running_filter Filter within the RUNNING status bucket. ALL returns both on-worker and evicted tasks, ON_WORKER returns only tasks running on a worker, EVICTED returns only evicted tasks. Defaults to ALL.
119
+ # @option opts [Array<String>] :idempotency_keys The idempotency key(s) to filter for
120
+ # @return [V1WorkflowRunCount]
121
+ def v1_workflow_run_count_get(tenant, since, only_tasks, opts = {})
122
+ data, _status_code, _headers = v1_workflow_run_count_get_with_http_info(tenant, since, only_tasks, opts)
123
+ data
124
+ end
125
+
126
+ # Count workflow runs
127
+ # Counts the workflow runs for a tenant matching the provided filters. The count is capped, so it is a lower bound when it reaches the cap.
128
+ # @param tenant [String] The tenant id
129
+ # @param since [Time] The earliest date to filter by
130
+ # @param only_tasks [Boolean] Whether to include DAGs or only to include tasks
131
+ # @param [Hash] opts the optional parameters
132
+ # @option opts [Array<V1TaskStatus>] :statuses A list of statuses to filter by
133
+ # @option opts [Time] :_until The latest date to filter by
134
+ # @option opts [Array<String>] :additional_metadata Additional metadata k-v pairs to filter by
135
+ # @option opts [V1AdditionalMetadataOperator] :additional_metadata_operator How to combine multiple additional_metadata pairs. OR matches runs containing any pair, AND matches runs containing all pairs. Defaults to OR.
136
+ # @option opts [Array<String>] :workflow_ids The workflow ids to find runs for
137
+ # @option opts [String] :worker_id The worker id to filter by
138
+ # @option opts [String] :parent_task_external_id The parent task external id to filter by
139
+ # @option opts [String] :triggering_event_external_id The external id of the event that triggered the workflow run
140
+ # @option opts [V1RunningFilter] :running_filter Filter within the RUNNING status bucket. ALL returns both on-worker and evicted tasks, ON_WORKER returns only tasks running on a worker, EVICTED returns only evicted tasks. Defaults to ALL.
141
+ # @option opts [Array<String>] :idempotency_keys The idempotency key(s) to filter for
142
+ # @return [Array<(V1WorkflowRunCount, Integer, Hash)>] V1WorkflowRunCount data, response status code and response headers
143
+ def v1_workflow_run_count_get_with_http_info(tenant, since, only_tasks, opts = {})
144
+ if @api_client.config.debugging
145
+ @api_client.config.logger.debug 'Calling API: WorkflowRunsApi.v1_workflow_run_count_get ...'
146
+ end
147
+ # verify the required parameter 'tenant' is set
148
+ if @api_client.config.client_side_validation && tenant.nil?
149
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling WorkflowRunsApi.v1_workflow_run_count_get"
150
+ end
151
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
152
+ fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be smaller than or equal to 36.'
153
+ end
154
+
155
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
156
+ fail ArgumentError, 'invalid value for "tenant" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be greater than or equal to 36.'
157
+ end
158
+
159
+ # verify the required parameter 'since' is set
160
+ if @api_client.config.client_side_validation && since.nil?
161
+ fail ArgumentError, "Missing the required parameter 'since' when calling WorkflowRunsApi.v1_workflow_run_count_get"
162
+ end
163
+ # verify the required parameter 'only_tasks' is set
164
+ if @api_client.config.client_side_validation && only_tasks.nil?
165
+ fail ArgumentError, "Missing the required parameter 'only_tasks' when calling WorkflowRunsApi.v1_workflow_run_count_get"
166
+ end
167
+ if @api_client.config.client_side_validation && !opts[:'worker_id'].nil? && opts[:'worker_id'].to_s.length > 36
168
+ fail ArgumentError, 'invalid value for "opts[:"worker_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be smaller than or equal to 36.'
169
+ end
170
+
171
+ if @api_client.config.client_side_validation && !opts[:'worker_id'].nil? && opts[:'worker_id'].to_s.length < 36
172
+ fail ArgumentError, 'invalid value for "opts[:"worker_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be greater than or equal to 36.'
173
+ end
174
+
175
+ if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length > 36
176
+ fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be smaller than or equal to 36.'
177
+ end
178
+
179
+ if @api_client.config.client_side_validation && !opts[:'parent_task_external_id'].nil? && opts[:'parent_task_external_id'].to_s.length < 36
180
+ fail ArgumentError, 'invalid value for "opts[:"parent_task_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be greater than or equal to 36.'
181
+ end
182
+
183
+ if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length > 36
184
+ fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be smaller than or equal to 36.'
185
+ end
186
+
187
+ if @api_client.config.client_side_validation && !opts[:'triggering_event_external_id'].nil? && opts[:'triggering_event_external_id'].to_s.length < 36
188
+ fail ArgumentError, 'invalid value for "opts[:"triggering_event_external_id"]" when calling WorkflowRunsApi.v1_workflow_run_count_get, the character length must be greater than or equal to 36.'
189
+ end
190
+
191
+ # resource path
192
+ local_var_path = '/api/v1/stable/tenants/{tenant}/workflow-runs/count'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
193
+
194
+ # query parameters
195
+ query_params = opts[:query_params] || {}
196
+ query_params[:'since'] = since
197
+ query_params[:'only_tasks'] = only_tasks
198
+ query_params[:'statuses'] = @api_client.build_collection_param(opts[:'statuses'], :multi) if !opts[:'statuses'].nil?
199
+ query_params[:'until'] = opts[:'_until'] if !opts[:'_until'].nil?
200
+ query_params[:'additional_metadata'] = @api_client.build_collection_param(opts[:'additional_metadata'], :multi) if !opts[:'additional_metadata'].nil?
201
+ query_params[:'additional_metadata_operator'] = opts[:'additional_metadata_operator'] if !opts[:'additional_metadata_operator'].nil?
202
+ query_params[:'workflow_ids'] = @api_client.build_collection_param(opts[:'workflow_ids'], :multi) if !opts[:'workflow_ids'].nil?
203
+ query_params[:'worker_id'] = opts[:'worker_id'] if !opts[:'worker_id'].nil?
204
+ query_params[:'parent_task_external_id'] = opts[:'parent_task_external_id'] if !opts[:'parent_task_external_id'].nil?
205
+ query_params[:'triggering_event_external_id'] = opts[:'triggering_event_external_id'] if !opts[:'triggering_event_external_id'].nil?
206
+ query_params[:'running_filter'] = opts[:'running_filter'] if !opts[:'running_filter'].nil?
207
+ query_params[:'idempotency_keys'] = @api_client.build_collection_param(opts[:'idempotency_keys'], :multi) if !opts[:'idempotency_keys'].nil?
208
+
209
+ # header parameters
210
+ header_params = opts[:header_params] || {}
211
+ # HTTP header 'Accept' (if needed)
212
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
213
+
214
+ # form parameters
215
+ form_params = opts[:form_params] || {}
216
+
217
+ # http body (model)
218
+ post_body = opts[:debug_body]
219
+
220
+ # return_type
221
+ return_type = opts[:debug_return_type] || 'V1WorkflowRunCount'
222
+
223
+ # auth_names
224
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
225
+
226
+ new_options = opts.merge(
227
+ :operation => :"WorkflowRunsApi.v1_workflow_run_count_get",
228
+ :header_params => header_params,
229
+ :query_params => query_params,
230
+ :form_params => form_params,
231
+ :body => post_body,
232
+ :auth_names => auth_names,
233
+ :return_type => return_type
234
+ )
235
+
236
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug "API called: WorkflowRunsApi#v1_workflow_run_count_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ return data, status_code, headers
241
+ end
242
+
104
243
  # Create workflow run
105
244
  # Trigger a new workflow run
106
245
  # @param tenant [String] The tenant id
@@ -592,6 +731,7 @@ module HatchetSdkRest
592
731
  # @option opts [Boolean] :include_payloads A flag for whether or not to include the input and output payloads in the response. Defaults to &#x60;true&#x60; if unset.
593
732
  # @option opts [V1RunningFilter] :running_filter Filter within the RUNNING status bucket. ALL returns both on-worker and evicted tasks, ON_WORKER returns only tasks running on a worker, EVICTED returns only evicted tasks. Defaults to ALL.
594
733
  # @option opts [Array<String>] :idempotency_keys The idempotency key(s) to filter for
734
+ # @option opts [Boolean] :include_num_pages A flag for whether or not to count the matching runs in order to populate &#x60;pagination.num_pages&#x60;. Defaults to &#x60;true&#x60; if unset. When &#x60;false&#x60;, &#x60;pagination.num_pages&#x60; is &#x60;0&#x60;, and the count can be fetched separately from the count endpoint.
595
735
  # @return [V1TaskSummaryList]
596
736
  def v1_workflow_run_list(tenant, since, only_tasks, opts = {})
597
737
  data, _status_code, _headers = v1_workflow_run_list_with_http_info(tenant, since, only_tasks, opts)
@@ -617,6 +757,7 @@ module HatchetSdkRest
617
757
  # @option opts [Boolean] :include_payloads A flag for whether or not to include the input and output payloads in the response. Defaults to &#x60;true&#x60; if unset.
618
758
  # @option opts [V1RunningFilter] :running_filter Filter within the RUNNING status bucket. ALL returns both on-worker and evicted tasks, ON_WORKER returns only tasks running on a worker, EVICTED returns only evicted tasks. Defaults to ALL.
619
759
  # @option opts [Array<String>] :idempotency_keys The idempotency key(s) to filter for
760
+ # @option opts [Boolean] :include_num_pages A flag for whether or not to count the matching runs in order to populate &#x60;pagination.num_pages&#x60;. Defaults to &#x60;true&#x60; if unset. When &#x60;false&#x60;, &#x60;pagination.num_pages&#x60; is &#x60;0&#x60;, and the count can be fetched separately from the count endpoint.
620
761
  # @return [Array<(V1TaskSummaryList, Integer, Hash)>] V1TaskSummaryList data, response status code and response headers
621
762
  def v1_workflow_run_list_with_http_info(tenant, since, only_tasks, opts = {})
622
763
  if @api_client.config.debugging
@@ -686,6 +827,7 @@ module HatchetSdkRest
686
827
  query_params[:'include_payloads'] = opts[:'include_payloads'] if !opts[:'include_payloads'].nil?
687
828
  query_params[:'running_filter'] = opts[:'running_filter'] if !opts[:'running_filter'].nil?
688
829
  query_params[:'idempotency_keys'] = @api_client.build_collection_param(opts[:'idempotency_keys'], :multi) if !opts[:'idempotency_keys'].nil?
830
+ query_params[:'include_num_pages'] = opts[:'include_num_pages'] if !opts[:'include_num_pages'].nil?
689
831
 
690
832
  # header parameters
691
833
  header_params = opts[:header_params] || {}
@@ -33,6 +33,9 @@ module HatchetSdkRest
33
33
  # The last time the rate limit was refilled.
34
34
  attr_accessor :last_refill
35
35
 
36
+ # When the rate limit's pause ends, if it is paused. Runs that consume a paused key stay queued until then.
37
+ attr_accessor :paused_until
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -41,7 +44,8 @@ module HatchetSdkRest
41
44
  :'limit_value' => :'limitValue',
42
45
  :'value' => :'value',
43
46
  :'window' => :'window',
44
- :'last_refill' => :'lastRefill'
47
+ :'last_refill' => :'lastRefill',
48
+ :'paused_until' => :'pausedUntil'
45
49
  }
46
50
  end
47
51
 
@@ -63,7 +67,8 @@ module HatchetSdkRest
63
67
  :'limit_value' => :'Integer',
64
68
  :'value' => :'Integer',
65
69
  :'window' => :'String',
66
- :'last_refill' => :'Time'
70
+ :'last_refill' => :'Time',
71
+ :'paused_until' => :'Time'
67
72
  }
68
73
  end
69
74
 
@@ -124,6 +129,10 @@ module HatchetSdkRest
124
129
  else
125
130
  self.last_refill = nil
126
131
  end
132
+
133
+ if attributes.key?(:'paused_until')
134
+ self.paused_until = attributes[:'paused_until']
135
+ end
127
136
  end
128
137
 
129
138
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -241,7 +250,8 @@ module HatchetSdkRest
241
250
  limit_value == o.limit_value &&
242
251
  value == o.value &&
243
252
  window == o.window &&
244
- last_refill == o.last_refill
253
+ last_refill == o.last_refill &&
254
+ paused_until == o.paused_until
245
255
  end
246
256
 
247
257
  # @see the `==` method
@@ -253,7 +263,7 @@ module HatchetSdkRest
253
263
  # Calculates hash code according to all attributes.
254
264
  # @return [Integer] Hash code
255
265
  def hash
256
- [key, tenant_id, limit_value, value, window, last_refill].hash
266
+ [key, tenant_id, limit_value, value, window, last_refill, paused_until].hash
257
267
  end
258
268
 
259
269
  # Builds the object from hash