hatchet-sdk 0.12.4 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb6f313f116b6014c7dd189acf125a9b007982be663ada731d531976ca110882
4
- data.tar.gz: c15815dff2aa4b86bcdb1e741b518d86d4c726edd835e6f22dfd099553801953
3
+ metadata.gz: f2910f4674c6c6da4e01c681ce91e116fec66bac44af1bc5d85c3b5fdcbd192f
4
+ data.tar.gz: 681ed6599409e60e36d5e8a34f407f72a0420a216cc0c0a53b51c9fa06a0cd7c
5
5
  SHA512:
6
- metadata.gz: 828340d3c9f6b48df569028ff8778a38a656774370f8c0c32ce5596f43ddfd159a5c11cc600095b057e4f6e4b996f640a9b3eb3edb2ce7698c70aff357757e1a
7
- data.tar.gz: cb5480cf9131f5da3c4964c949aca9bbdfd4a9eab3b8a5e0e1ef7aff45c6f5c7fe085c9cc15f8a01f8d8126078f6a1727713dd15536c6e4c05676395634e7574
6
+ metadata.gz: 639ff393bc22c421f570cc5be723ac299323c49594739c84f4b782170e3145f8f444b0de050a32b8098bee038894191d329573e2eaf3286e6201cd5c5b1b0d35
7
+ data.tar.gz: b028b8932db4725d7f105dd8c24a468500a5cea1648e4a760bb966c70c40dfe1f8a64138afa3f0a37175c71f8abe742a55aa9880323edbe58d5ce91a6a80d2cb
data/CHANGELOG.md CHANGED
@@ -5,6 +5,23 @@ All notable changes to Hatchet's Ruby SDK will be documented in this changelog.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.13.1] - 2026-11-30
9
+
10
+ ### Added
11
+
12
+ - Optional field `capabilities` on the `APIToken` and `CreateAPITokenRequest` REST types, the capabilities that limit which REST operations and gRPC procedures an API token can call. Tokens created without it hold `all`.
13
+ - `api_token_capability_list` and `tenant_role_list` REST methods, which list the capabilities an API token can hold and the roles a tenant member can hold.
14
+
15
+ ## [0.13.0] - 2026-11-23
16
+
17
+ ### Added
18
+
19
+ - `max_reassignments_allowed:` option on tasks and durable tasks, the number of times a task can be reassigned to a new worker (when its worker stops heartbeating or never acknowledges the assignment) before it fails instead. Set it to `0` to never reassign a task, for example when re-running it is unsafe or when it crashes its worker. When unset, the server's default limit applies; the server's limit also caps this value. Raises `ArgumentError` for negative values.
20
+
21
+ ### Fixed
22
+
23
+ - The `Hatchet::BatchTaskConfig` docs no longer say a batch flushes once `group_max_runs` is exceeded. While a group has `group_max_runs` batches running, its ready batches stay buffered. The docs also give the engine defaults: `max_interval_ms` is 1000, measured from when a batch's first item is buffered, and `group_max_runs` is 100.
24
+
8
25
  ## [0.12.4] - 2026-11-17
9
26
 
10
27
  ### Fixed
data/lib/hatchet/batch.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Hatchet
4
4
  # Configures a task as a batch task: concurrent runs are buffered and dispatched together
5
- # as a single execution once max_size is reached, max_interval_ms elapses, or (if
6
- # group_key is set) once group_max_runs concurrent batches per group are exceeded.
5
+ # as a single execution once max_size is reached or max_interval_ms elapses. While a group
6
+ # has group_max_runs batches running, its ready batches stay buffered.
7
7
  #
8
8
  # When batch is set on a task, the task's block receives a single Hash argument mapping
9
9
  # each buffered run's task-run external id to that run's input, instead of a single input
@@ -16,22 +16,22 @@ module Hatchet
16
16
  # @return [Integer] Maximum number of items buffered before the batch is flushed
17
17
  attr_reader :max_size
18
18
 
19
- # @return [Integer, nil] Maximum time to wait before flushing a partially-filled batch, in milliseconds
19
+ # @return [Integer, nil] Maximum time to wait before flushing a partially-filled batch, in milliseconds. Defaults to 1000.
20
20
  attr_reader :max_interval_ms
21
21
 
22
22
  # @return [String, nil] CEL expression evaluated against each item's input to partition items into independent batches
23
23
  attr_reader :group_key
24
24
 
25
- # @return [Integer, nil] Maximum number of concurrent batches per group
25
+ # @return [Integer, nil] Maximum number of batches per group that can run at once. Defaults to 100.
26
26
  attr_reader :group_max_runs
27
27
 
28
28
  # @return [Boolean] When true, the block returns a single value broadcast to every member of the batch
29
29
  attr_reader :broadcast_output
30
30
 
31
31
  # @param max_size [Integer] Maximum items per batch. Must be positive.
32
- # @param max_interval_ms [Integer, nil] Time before batch flushes, in milliseconds. Must be positive when provided.
32
+ # @param max_interval_ms [Integer, nil] Time before batch flushes, in milliseconds, measured from the first buffered item. Defaults to 1000; must be positive when provided.
33
33
  # @param group_key [String, nil] CEL expression to partition batches, e.g. "input.group"
34
- # @param group_max_runs [Integer, nil] Concurrent batches per group. Must be positive when provided.
34
+ # @param group_max_runs [Integer, nil] Batches per group that can run at once. Defaults to 100; must be positive when provided.
35
35
  # @param broadcast_output [Boolean] Whether the block's return value is broadcast to every batch member
36
36
  def initialize(max_size:, max_interval_ms: nil, group_key: nil, group_max_runs: nil, broadcast_output: false)
37
37
  raise ArgumentError, "max_size must be positive" unless max_size.positive?
@@ -158,8 +158,12 @@ lib/hatchet-sdk-rest/models/tenant_queue_metrics.rb
158
158
  lib/hatchet-sdk-rest/models/tenant_resource.rb
159
159
  lib/hatchet-sdk-rest/models/tenant_resource_limit.rb
160
160
  lib/hatchet-sdk-rest/models/tenant_resource_policy.rb
161
+ lib/hatchet-sdk-rest/models/tenant_role.rb
162
+ lib/hatchet-sdk-rest/models/tenant_role_list.rb
161
163
  lib/hatchet-sdk-rest/models/tenant_step_run_queue_metrics.rb
162
164
  lib/hatchet-sdk-rest/models/tenant_version.rb
165
+ lib/hatchet-sdk-rest/models/token_capability.rb
166
+ lib/hatchet-sdk-rest/models/token_capability_list.rb
163
167
  lib/hatchet-sdk-rest/models/trigger_run_result.rb
164
168
  lib/hatchet-sdk-rest/models/trigger_workflow_run_request.rb
165
169
  lib/hatchet-sdk-rest/models/update_cron_workflow_trigger_request.rb
@@ -191,6 +195,7 @@ lib/hatchet-sdk-rest/models/v1_concurrency_scope.rb
191
195
  lib/hatchet-sdk-rest/models/v1_concurrency_strategy.rb
192
196
  lib/hatchet-sdk-rest/models/v1_concurrency_strategy_list.rb
193
197
  lib/hatchet-sdk-rest/models/v1_concurrency_strategy_usage.rb
198
+ lib/hatchet-sdk-rest/models/v1_concurrency_totals.rb
194
199
  lib/hatchet-sdk-rest/models/v1_create_filter_request.rb
195
200
  lib/hatchet-sdk-rest/models/v1_create_serverless_endpoint_request.rb
196
201
  lib/hatchet-sdk-rest/models/v1_create_webhook_request.rb
@@ -76,16 +76,13 @@ end
76
76
 
77
77
  api_instance = HatchetSdkRest::APITokenApi.new
78
78
  tenant = '38400000-8cf0-11bd-b23e-10b96e4ef00d' # String | The tenant id
79
- opts = {
80
- create_api_token_request: HatchetSdkRest::CreateAPITokenRequest.new({name: 'name_example'}) # CreateAPITokenRequest |
81
- }
82
79
 
83
80
  begin
84
- #Create API Token
85
- result = api_instance.api_token_create(tenant, opts)
81
+ #List API token capabilities
82
+ result = api_instance.api_token_capability_list(tenant)
86
83
  p result
87
84
  rescue HatchetSdkRest::ApiError => e
88
- puts "Exception when calling APITokenApi->api_token_create: #{e}"
85
+ puts "Exception when calling APITokenApi->api_token_capability_list: #{e}"
89
86
  end
90
87
 
91
88
  ```
@@ -96,12 +93,14 @@ All URIs are relative to *http://localhost*
96
93
 
97
94
  Class | Method | HTTP request | Description
98
95
  ------------ | ------------- | ------------- | -------------
96
+ *HatchetSdkRest::APITokenApi* | [**api_token_capability_list**](docs/APITokenApi.md#api_token_capability_list) | **GET** /api/v1/tenants/{tenant}/api-tokens/capabilities | List API token capabilities
99
97
  *HatchetSdkRest::APITokenApi* | [**api_token_create**](docs/APITokenApi.md#api_token_create) | **POST** /api/v1/tenants/{tenant}/api-tokens | Create API Token
100
98
  *HatchetSdkRest::APITokenApi* | [**api_token_list**](docs/APITokenApi.md#api_token_list) | **GET** /api/v1/tenants/{tenant}/api-tokens | List API Tokens
101
99
  *HatchetSdkRest::APITokenApi* | [**api_token_update_revoke**](docs/APITokenApi.md#api_token_update_revoke) | **POST** /api/v1/api-tokens/{api-token} | Revoke API Token
102
100
  *HatchetSdkRest::CELApi* | [**v1_cel_debug**](docs/CELApi.md#v1_cel_debug) | **POST** /api/v1/stable/tenants/{tenant}/cel/debug | Debug a CEL expression
103
101
  *HatchetSdkRest::ConcurrencyApi* | [**v1_concurrency_key_list**](docs/ConcurrencyApi.md#v1_concurrency_key_list) | **GET** /api/v1/stable/tenants/{tenant}/concurrency/strategies/{scope}/{strategy}/keys | List concurrency keys
104
102
  *HatchetSdkRest::ConcurrencyApi* | [**v1_concurrency_strategy_list**](docs/ConcurrencyApi.md#v1_concurrency_strategy_list) | **GET** /api/v1/stable/tenants/{tenant}/concurrency/strategies | List concurrency strategies
103
+ *HatchetSdkRest::ConcurrencyApi* | [**v1_concurrency_totals_get**](docs/ConcurrencyApi.md#v1_concurrency_totals_get) | **GET** /api/v1/stable/tenants/{tenant}/concurrency/totals | Get concurrency totals
105
104
  *HatchetSdkRest::DefaultApi* | [**info_get_version**](docs/DefaultApi.md#info_get_version) | **GET** /api/v1/version | We return the version for the currently running server
106
105
  *HatchetSdkRest::DefaultApi* | [**monitoring_post_run_probe**](docs/DefaultApi.md#monitoring_post_run_probe) | **POST** /api/v1/monitoring/{tenant}/probe | Detailed Health Probe For the Instance
107
106
  *HatchetSdkRest::DefaultApi* | [**tenant_invite_delete**](docs/DefaultApi.md#tenant_invite_delete) | **DELETE** /api/v1/tenants/{tenant}/invites/{tenant-invite} | Delete invite
@@ -190,6 +189,7 @@ Class | Method | HTTP request | Description
190
189
  *HatchetSdkRest::TenantApi* | [**tenant_member_list**](docs/TenantApi.md#tenant_member_list) | **GET** /api/v1/tenants/{tenant}/members | List tenant members
191
190
  *HatchetSdkRest::TenantApi* | [**tenant_member_update**](docs/TenantApi.md#tenant_member_update) | **PATCH** /api/v1/tenants/{tenant}/members/{member} | Update a tenant member
192
191
  *HatchetSdkRest::TenantApi* | [**tenant_resource_policy_get**](docs/TenantApi.md#tenant_resource_policy_get) | **GET** /api/v1/tenants/{tenant}/resource-policy | Create tenant alert email group
192
+ *HatchetSdkRest::TenantApi* | [**tenant_role_list**](docs/TenantApi.md#tenant_role_list) | **GET** /api/v1/tenants/{tenant}/roles | List tenant roles
193
193
  *HatchetSdkRest::TenantApi* | [**tenant_update**](docs/TenantApi.md#tenant_update) | **PATCH** /api/v1/tenants/{tenant} | Update tenant
194
194
  *HatchetSdkRest::TenantApi* | [**user_list_tenant_invites**](docs/TenantApi.md#user_list_tenant_invites) | **GET** /api/v1/users/invites | List tenant invites
195
195
  *HatchetSdkRest::UserApi* | [**tenant_memberships_list**](docs/UserApi.md#tenant_memberships_list) | **GET** /api/v1/users/memberships | List tenant memberships
@@ -376,8 +376,12 @@ Class | Method | HTTP request | Description
376
376
  - [HatchetSdkRest::TenantResource](docs/TenantResource.md)
377
377
  - [HatchetSdkRest::TenantResourceLimit](docs/TenantResourceLimit.md)
378
378
  - [HatchetSdkRest::TenantResourcePolicy](docs/TenantResourcePolicy.md)
379
+ - [HatchetSdkRest::TenantRole](docs/TenantRole.md)
380
+ - [HatchetSdkRest::TenantRoleList](docs/TenantRoleList.md)
379
381
  - [HatchetSdkRest::TenantStepRunQueueMetrics](docs/TenantStepRunQueueMetrics.md)
380
382
  - [HatchetSdkRest::TenantVersion](docs/TenantVersion.md)
383
+ - [HatchetSdkRest::TokenCapability](docs/TokenCapability.md)
384
+ - [HatchetSdkRest::TokenCapabilityList](docs/TokenCapabilityList.md)
381
385
  - [HatchetSdkRest::TriggerRunResult](docs/TriggerRunResult.md)
382
386
  - [HatchetSdkRest::TriggerWorkflowRunRequest](docs/TriggerWorkflowRunRequest.md)
383
387
  - [HatchetSdkRest::UpdateCronWorkflowTriggerRequest](docs/UpdateCronWorkflowTriggerRequest.md)
@@ -409,6 +413,7 @@ Class | Method | HTTP request | Description
409
413
  - [HatchetSdkRest::V1ConcurrencyStrategy](docs/V1ConcurrencyStrategy.md)
410
414
  - [HatchetSdkRest::V1ConcurrencyStrategyList](docs/V1ConcurrencyStrategyList.md)
411
415
  - [HatchetSdkRest::V1ConcurrencyStrategyUsage](docs/V1ConcurrencyStrategyUsage.md)
416
+ - [HatchetSdkRest::V1ConcurrencyTotals](docs/V1ConcurrencyTotals.md)
412
417
  - [HatchetSdkRest::V1CreateFilterRequest](docs/V1CreateFilterRequest.md)
413
418
  - [HatchetSdkRest::V1CreateServerlessEndpointRequest](docs/V1CreateServerlessEndpointRequest.md)
414
419
  - [HatchetSdkRest::V1CreateWebhookRequest](docs/V1CreateWebhookRequest.md)
@@ -19,6 +19,77 @@ module HatchetSdkRest
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # List API token capabilities
23
+ # List the capabilities an API token in this tenant can hold, with the bundles that group them
24
+ # @param tenant [String] The tenant id
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [TokenCapabilityList]
27
+ def api_token_capability_list(tenant, opts = {})
28
+ data, _status_code, _headers = api_token_capability_list_with_http_info(tenant, opts)
29
+ data
30
+ end
31
+
32
+ # List API token capabilities
33
+ # List the capabilities an API token in this tenant can hold, with the bundles that group them
34
+ # @param tenant [String] The tenant id
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(TokenCapabilityList, Integer, Hash)>] TokenCapabilityList data, response status code and response headers
37
+ def api_token_capability_list_with_http_info(tenant, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: APITokenApi.api_token_capability_list ...'
40
+ end
41
+ # verify the required parameter 'tenant' is set
42
+ if @api_client.config.client_side_validation && tenant.nil?
43
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling APITokenApi.api_token_capability_list"
44
+ end
45
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
46
+ fail ArgumentError, 'invalid value for "tenant" when calling APITokenApi.api_token_capability_list, the character length must be smaller than or equal to 36.'
47
+ end
48
+
49
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
50
+ fail ArgumentError, 'invalid value for "tenant" when calling APITokenApi.api_token_capability_list, the character length must be greater than or equal to 36.'
51
+ end
52
+
53
+ # resource path
54
+ local_var_path = '/api/v1/tenants/{tenant}/api-tokens/capabilities'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
55
+
56
+ # query parameters
57
+ query_params = opts[:query_params] || {}
58
+
59
+ # header parameters
60
+ header_params = opts[:header_params] || {}
61
+ # HTTP header 'Accept' (if needed)
62
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body]
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'TokenCapabilityList'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"APITokenApi.api_token_capability_list",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: APITokenApi#api_token_capability_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
22
93
  # Create API Token
23
94
  # Create an API token for a tenant
24
95
  # @param tenant [String] The tenant id
@@ -184,5 +184,76 @@ module HatchetSdkRest
184
184
  end
185
185
  return data, status_code, headers
186
186
  end
187
+
188
+ # Get concurrency totals
189
+ # Gets the tenant-wide concurrency totals. 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.
190
+ # @param tenant [String] The tenant id
191
+ # @param [Hash] opts the optional parameters
192
+ # @return [V1ConcurrencyTotals]
193
+ def v1_concurrency_totals_get(tenant, opts = {})
194
+ data, _status_code, _headers = v1_concurrency_totals_get_with_http_info(tenant, opts)
195
+ data
196
+ end
197
+
198
+ # Get concurrency totals
199
+ # Gets the tenant-wide concurrency totals. 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.
200
+ # @param tenant [String] The tenant id
201
+ # @param [Hash] opts the optional parameters
202
+ # @return [Array<(V1ConcurrencyTotals, Integer, Hash)>] V1ConcurrencyTotals data, response status code and response headers
203
+ def v1_concurrency_totals_get_with_http_info(tenant, opts = {})
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug 'Calling API: ConcurrencyApi.v1_concurrency_totals_get ...'
206
+ end
207
+ # verify the required parameter 'tenant' is set
208
+ if @api_client.config.client_side_validation && tenant.nil?
209
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling ConcurrencyApi.v1_concurrency_totals_get"
210
+ end
211
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
212
+ fail ArgumentError, 'invalid value for "tenant" when calling ConcurrencyApi.v1_concurrency_totals_get, the character length must be smaller than or equal to 36.'
213
+ end
214
+
215
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
216
+ fail ArgumentError, 'invalid value for "tenant" when calling ConcurrencyApi.v1_concurrency_totals_get, the character length must be greater than or equal to 36.'
217
+ end
218
+
219
+ # resource path
220
+ local_var_path = '/api/v1/stable/tenants/{tenant}/concurrency/totals'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
221
+
222
+ # query parameters
223
+ query_params = opts[:query_params] || {}
224
+
225
+ # header parameters
226
+ header_params = opts[:header_params] || {}
227
+ # HTTP header 'Accept' (if needed)
228
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
229
+
230
+ # form parameters
231
+ form_params = opts[:form_params] || {}
232
+
233
+ # http body (model)
234
+ post_body = opts[:debug_body]
235
+
236
+ # return_type
237
+ return_type = opts[:debug_return_type] || 'V1ConcurrencyTotals'
238
+
239
+ # auth_names
240
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
241
+
242
+ new_options = opts.merge(
243
+ :operation => :"ConcurrencyApi.v1_concurrency_totals_get",
244
+ :header_params => header_params,
245
+ :query_params => query_params,
246
+ :form_params => form_params,
247
+ :body => post_body,
248
+ :auth_names => auth_names,
249
+ :return_type => return_type
250
+ )
251
+
252
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug "API called: ConcurrencyApi#v1_concurrency_totals_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
255
+ end
256
+ return data, status_code, headers
257
+ end
187
258
  end
188
259
  end
@@ -1508,6 +1508,77 @@ module HatchetSdkRest
1508
1508
  return data, status_code, headers
1509
1509
  end
1510
1510
 
1511
+ # List tenant roles
1512
+ # List the roles a tenant member can hold, with the operations each allows
1513
+ # @param tenant [String] The tenant id
1514
+ # @param [Hash] opts the optional parameters
1515
+ # @return [TenantRoleList]
1516
+ def tenant_role_list(tenant, opts = {})
1517
+ data, _status_code, _headers = tenant_role_list_with_http_info(tenant, opts)
1518
+ data
1519
+ end
1520
+
1521
+ # List tenant roles
1522
+ # List the roles a tenant member can hold, with the operations each allows
1523
+ # @param tenant [String] The tenant id
1524
+ # @param [Hash] opts the optional parameters
1525
+ # @return [Array<(TenantRoleList, Integer, Hash)>] TenantRoleList data, response status code and response headers
1526
+ def tenant_role_list_with_http_info(tenant, opts = {})
1527
+ if @api_client.config.debugging
1528
+ @api_client.config.logger.debug 'Calling API: TenantApi.tenant_role_list ...'
1529
+ end
1530
+ # verify the required parameter 'tenant' is set
1531
+ if @api_client.config.client_side_validation && tenant.nil?
1532
+ fail ArgumentError, "Missing the required parameter 'tenant' when calling TenantApi.tenant_role_list"
1533
+ end
1534
+ if @api_client.config.client_side_validation && tenant.to_s.length > 36
1535
+ fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_role_list, the character length must be smaller than or equal to 36.'
1536
+ end
1537
+
1538
+ if @api_client.config.client_side_validation && tenant.to_s.length < 36
1539
+ fail ArgumentError, 'invalid value for "tenant" when calling TenantApi.tenant_role_list, the character length must be greater than or equal to 36.'
1540
+ end
1541
+
1542
+ # resource path
1543
+ local_var_path = '/api/v1/tenants/{tenant}/roles'.sub('{' + 'tenant' + '}', CGI.escape(tenant.to_s))
1544
+
1545
+ # query parameters
1546
+ query_params = opts[:query_params] || {}
1547
+
1548
+ # header parameters
1549
+ header_params = opts[:header_params] || {}
1550
+ # HTTP header 'Accept' (if needed)
1551
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
1552
+
1553
+ # form parameters
1554
+ form_params = opts[:form_params] || {}
1555
+
1556
+ # http body (model)
1557
+ post_body = opts[:debug_body]
1558
+
1559
+ # return_type
1560
+ return_type = opts[:debug_return_type] || 'TenantRoleList'
1561
+
1562
+ # auth_names
1563
+ auth_names = opts[:debug_auth_names] || ['cookieAuth', 'bearerAuth']
1564
+
1565
+ new_options = opts.merge(
1566
+ :operation => :"TenantApi.tenant_role_list",
1567
+ :header_params => header_params,
1568
+ :query_params => query_params,
1569
+ :form_params => form_params,
1570
+ :body => post_body,
1571
+ :auth_names => auth_names,
1572
+ :return_type => return_type
1573
+ )
1574
+
1575
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1576
+ if @api_client.config.debugging
1577
+ @api_client.config.logger.debug "API called: TenantApi#tenant_role_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1578
+ end
1579
+ return data, status_code, headers
1580
+ end
1581
+
1511
1582
  # Update tenant
1512
1583
  # Update an existing tenant
1513
1584
  # @param tenant [String] The tenant id
@@ -26,13 +26,17 @@ module HatchetSdkRest
26
26
  # When the API token expires.
27
27
  attr_accessor :expires_at
28
28
 
29
+ # The capabilities the token holds, which grant REST operations and gRPC procedures. Tokens created without capabilities hold \"all\", or \"read-only\" if they are read-only.
30
+ attr_accessor :capabilities
31
+
29
32
  # Attribute mapping from ruby-style variable name to JSON key.
30
33
  def self.attribute_map
31
34
  {
32
35
  :'metadata' => :'metadata',
33
36
  :'name' => :'name',
34
37
  :'read_only' => :'readOnly',
35
- :'expires_at' => :'expiresAt'
38
+ :'expires_at' => :'expiresAt',
39
+ :'capabilities' => :'capabilities'
36
40
  }
37
41
  end
38
42
 
@@ -52,7 +56,8 @@ module HatchetSdkRest
52
56
  :'metadata' => :'APIResourceMeta',
53
57
  :'name' => :'String',
54
58
  :'read_only' => :'Boolean',
55
- :'expires_at' => :'Time'
59
+ :'expires_at' => :'Time',
60
+ :'capabilities' => :'Array<String>'
56
61
  }
57
62
  end
58
63
 
@@ -101,6 +106,12 @@ module HatchetSdkRest
101
106
  else
102
107
  self.expires_at = nil
103
108
  end
109
+
110
+ if attributes.key?(:'capabilities')
111
+ if (value = attributes[:'capabilities']).is_a?(Array)
112
+ self.capabilities = value
113
+ end
114
+ end
104
115
  end
105
116
 
106
117
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -195,7 +206,8 @@ module HatchetSdkRest
195
206
  metadata == o.metadata &&
196
207
  name == o.name &&
197
208
  read_only == o.read_only &&
198
- expires_at == o.expires_at
209
+ expires_at == o.expires_at &&
210
+ capabilities == o.capabilities
199
211
  end
200
212
 
201
213
  # @see the `==` method
@@ -207,7 +219,7 @@ module HatchetSdkRest
207
219
  # Calculates hash code according to all attributes.
208
220
  # @return [Integer] Hash code
209
221
  def hash
210
- [metadata, name, read_only, expires_at].hash
222
+ [metadata, name, read_only, expires_at, capabilities].hash
211
223
  end
212
224
 
213
225
  # Builds the object from hash
@@ -21,6 +21,9 @@ module HatchetSdkRest
21
21
  # Limit the token to viewer access over REST and deny all gRPC calls. Defaults to false.
22
22
  attr_accessor :read_only
23
23
 
24
+ # The capabilities that decide which REST operations and gRPC procedures the token can call, e.g. [\"worker\"] or [\"events:push\"]. Defaults to [\"all\"].
25
+ attr_accessor :capabilities
26
+
24
27
  # The duration for which the token is valid.
25
28
  attr_accessor :expires_in
26
29
 
@@ -29,6 +32,7 @@ module HatchetSdkRest
29
32
  {
30
33
  :'name' => :'name',
31
34
  :'read_only' => :'readOnly',
35
+ :'capabilities' => :'capabilities',
32
36
  :'expires_in' => :'expiresIn'
33
37
  }
34
38
  end
@@ -48,6 +52,7 @@ module HatchetSdkRest
48
52
  {
49
53
  :'name' => :'String',
50
54
  :'read_only' => :'Boolean',
55
+ :'capabilities' => :'Array<String>',
51
56
  :'expires_in' => :'String'
52
57
  }
53
58
  end
@@ -84,6 +89,12 @@ module HatchetSdkRest
84
89
  self.read_only = attributes[:'read_only']
85
90
  end
86
91
 
92
+ if attributes.key?(:'capabilities')
93
+ if (value = attributes[:'capabilities']).is_a?(Array)
94
+ self.capabilities = value
95
+ end
96
+ end
97
+
87
98
  if attributes.key?(:'expires_in')
88
99
  self.expires_in = attributes[:'expires_in']
89
100
  end
@@ -102,6 +113,10 @@ module HatchetSdkRest
102
113
  invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.')
103
114
  end
104
115
 
116
+ if !@capabilities.nil? && @capabilities.length < 1
117
+ invalid_properties.push('invalid value for "capabilities", number of items must be greater than or equal to 1.')
118
+ end
119
+
105
120
  invalid_properties
106
121
  end
107
122
 
@@ -111,6 +126,7 @@ module HatchetSdkRest
111
126
  warn '[DEPRECATED] the `valid?` method is obsolete'
112
127
  return false if @name.nil?
113
128
  return false if @name.to_s.length > 255
129
+ return false if !@capabilities.nil? && @capabilities.length < 1
114
130
  true
115
131
  end
116
132
 
@@ -128,6 +144,20 @@ module HatchetSdkRest
128
144
  @name = name
129
145
  end
130
146
 
147
+ # Custom attribute writer method with validation
148
+ # @param [Object] capabilities Value to be assigned
149
+ def capabilities=(capabilities)
150
+ if capabilities.nil?
151
+ fail ArgumentError, 'capabilities cannot be nil'
152
+ end
153
+
154
+ if capabilities.length < 1
155
+ fail ArgumentError, 'invalid value for "capabilities", number of items must be greater than or equal to 1.'
156
+ end
157
+
158
+ @capabilities = capabilities
159
+ end
160
+
131
161
  # Checks equality by comparing each attribute.
132
162
  # @param [Object] Object to be compared
133
163
  def ==(o)
@@ -135,6 +165,7 @@ module HatchetSdkRest
135
165
  self.class == o.class &&
136
166
  name == o.name &&
137
167
  read_only == o.read_only &&
168
+ capabilities == o.capabilities &&
138
169
  expires_in == o.expires_in
139
170
  end
140
171
 
@@ -147,7 +178,7 @@ module HatchetSdkRest
147
178
  # Calculates hash code according to all attributes.
148
179
  # @return [Integer] Hash code
149
180
  def hash
150
- [name, read_only, expires_in].hash
181
+ [name, read_only, capabilities, expires_in].hash
151
182
  end
152
183
 
153
184
  # Builds the object from hash