seatschart 0.3.0 → 0.5.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +79 -11
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/auth_api.rb +85 -8
  5. data/lib/seatschart/api/billing_api.rb +93 -8
  6. data/lib/seatschart/api/charts_api.rb +63 -63
  7. data/lib/seatschart/api/events_api.rb +130 -124
  8. data/lib/seatschart/api/public_api.rb +6 -6
  9. data/lib/seatschart/api/seasons_api.rb +88 -88
  10. data/lib/seatschart/api/seats_api.rb +6 -6
  11. data/lib/seatschart/api/usage_api.rb +4 -4
  12. data/lib/seatschart/api/workspace_api.rb +1229 -51
  13. data/lib/seatschart/models/{api_error.rb → api_error_body.rb} +7 -7
  14. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +237 -0
  15. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_members_by_user_id200_response.rb +221 -0
  16. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +50 -4
  17. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response.rb +239 -0
  18. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_invitations200_response_invitations_inner.rb +286 -0
  19. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb +239 -0
  20. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb +321 -0
  21. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response.rb +239 -0
  22. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_members200_response_members_inner.rb +288 -0
  23. data/lib/seatschart/models/get_api_workspaces_overview200_response.rb +288 -0
  24. data/lib/seatschart/models/get_api_workspaces_overview200_response_account.rb +270 -0
  25. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_charts.rb +233 -0
  26. data/lib/seatschart/models/get_api_workspaces_overview200_response_account_plan.rb +237 -0
  27. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner.rb +439 -0
  28. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_revenue.rb +234 -0
  29. data/lib/seatschart/models/get_api_workspaces_overview200_response_items_inner_usage.rb +271 -0
  30. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats.rb +431 -0
  31. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_overage.rb +233 -0
  32. data/lib/seatschart/models/get_api_workspaces_overview200_response_seats_projected.rb +237 -0
  33. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals.rb +318 -0
  34. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_revenue.rb +238 -0
  35. data/lib/seatschart/models/get_api_workspaces_overview200_response_totals_seats.rb +253 -0
  36. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +15 -15
  37. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +221 -0
  38. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb +292 -0
  39. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb +288 -0
  40. data/lib/seatschart/models/post_api_auth_new_workspace_request.rb +294 -0
  41. data/lib/seatschart/models/post_api_billing_actions_change_plan_request.rb +256 -0
  42. data/lib/seatschart/models/post_api_events_by_event_id_actions_update_extra_data_request_objects_inner.rb +0 -2
  43. data/lib/seatschart/models/post_api_sandboxes201_response.rb +0 -4
  44. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +0 -2
  45. data/lib/seatschart/models/post_api_workspaces200_response.rb +464 -0
  46. data/lib/seatschart/models/post_api_workspaces200_response_api_key.rb +332 -0
  47. data/lib/seatschart/models/post_api_workspaces200_response_template.rb +260 -0
  48. data/lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb +284 -0
  49. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb +319 -0
  50. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb +281 -0
  51. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response.rb +238 -0
  52. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations201_response_invitation.rb +286 -0
  53. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb +300 -0
  54. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb +237 -0
  55. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb +338 -0
  56. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb +299 -0
  57. data/lib/seatschart/models/post_api_workspaces_request.rb +100 -4
  58. data/lib/seatschart/models/post_api_workspaces_request_issue_key.rb +294 -0
  59. data/lib/seatschart/version.rb +1 -1
  60. data/lib/seatschart/workspaces.rb +172 -0
  61. data/lib/seatschart.rb +41 -2
  62. metadata +43 -4
  63. data/lib/seatschart/models/put_api_charts_by_chart_id_map_draft_request.rb +0 -349
@@ -19,8 +19,8 @@ module SeatsChart
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Delete (soft) a workspace
23
- # Workspaces are never hard-deleted: their charts, events, orders and audit history are kept for accounting and reconciliation. DELETE is a **soft delete** — exactly POST /workspaces/{workspaceId}/actions/deactivate (reversible with …/actions/activate). Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`).
22
+ # Deactivate a workspace (legacy DELETE)
23
+ # Kept for compatibility: DELETE is exactly POST /workspaces/{workspaceId}/actions/deactivate (reversible with …/actions/activate). To delete a workspace for good from the product, use POST /workspaces/{workspaceId}/actions/delete. Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`). `{workspaceId}` may also be the external id of a workspace you administer (one workspace per organizer).
24
24
  # @param workspace_id [String]
25
25
  # @param [Hash] opts the optional parameters
26
26
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -30,8 +30,8 @@ module SeatsChart
30
30
  data
31
31
  end
32
32
 
33
- # Delete (soft) a workspace
34
- # Workspaces are never hard-deleted: their charts, events, orders and audit history are kept for accounting and reconciliation. DELETE is a **soft delete** — exactly POST /workspaces/{workspaceId}/actions/deactivate (reversible with …/actions/activate). Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`).
33
+ # Deactivate a workspace (legacy DELETE)
34
+ # Kept for compatibility: DELETE is exactly POST /workspaces/{workspaceId}/actions/deactivate (reversible with …/actions/activate). To delete a workspace for good from the product, use POST /workspaces/{workspaceId}/actions/delete. Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`). `{workspaceId}` may also be the external id of a workspace you administer (one workspace per organizer).
35
35
  # @param workspace_id [String]
36
36
  # @param [Hash] opts the optional parameters
37
37
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -101,6 +101,270 @@ module SeatsChart
101
101
  return data, status_code, headers
102
102
  end
103
103
 
104
+ # Revoke a pending invitation of a workspace you administer
105
+ # Audited (`team.invitation_revoked`).
106
+ # @param workspace_id [String] Workspace id or its external id.
107
+ # @param invitation_id [String]
108
+ # @param [Hash] opts the optional parameters
109
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
110
+ # @return [DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response]
111
+ def delete_api_workspaces_by_workspace_id_invitations_by_invitation_id(workspace_id, invitation_id, opts = {})
112
+ data, _status_code, _headers = delete_api_workspaces_by_workspace_id_invitations_by_invitation_id_with_http_info(workspace_id, invitation_id, opts)
113
+ data
114
+ end
115
+
116
+ # Revoke a pending invitation of a workspace you administer
117
+ # Audited (`team.invitation_revoked`).
118
+ # @param workspace_id [String] Workspace id or its external id.
119
+ # @param invitation_id [String]
120
+ # @param [Hash] opts the optional parameters
121
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
122
+ # @return [Array<(DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response, Integer, Hash)>] DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response data, response status code and response headers
123
+ def delete_api_workspaces_by_workspace_id_invitations_by_invitation_id_with_http_info(workspace_id, invitation_id, opts = {})
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id ...'
126
+ end
127
+ # verify the required parameter 'workspace_id' is set
128
+ if @api_client.config.client_side_validation && workspace_id.nil?
129
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id"
130
+ end
131
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
132
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id, the character length must be smaller than or equal to 128.'
133
+ end
134
+
135
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
136
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id, the character length must be great than or equal to 1.'
137
+ end
138
+
139
+ # verify the required parameter 'invitation_id' is set
140
+ if @api_client.config.client_side_validation && invitation_id.nil?
141
+ fail ArgumentError, "Missing the required parameter 'invitation_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id"
142
+ end
143
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
144
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id, the character length must be smaller than or equal to 255.'
145
+ end
146
+
147
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
148
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id, the character length must be great than or equal to 1.'
149
+ end
150
+
151
+ # resource path
152
+ local_var_path = '/api/workspaces/{workspaceId}/invitations/{invitationId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'invitationId' + '}', CGI.escape(invitation_id.to_s))
153
+
154
+ # query parameters
155
+ query_params = opts[:query_params] || {}
156
+
157
+ # header parameters
158
+ header_params = opts[:header_params] || {}
159
+ # HTTP header 'Accept' (if needed)
160
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
161
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
162
+
163
+ # form parameters
164
+ form_params = opts[:form_params] || {}
165
+
166
+ # http body (model)
167
+ post_body = opts[:debug_body]
168
+
169
+ # return_type
170
+ return_type = opts[:debug_return_type] || 'DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response'
171
+
172
+ # auth_names
173
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
174
+
175
+ new_options = opts.merge(
176
+ :operation => :"WorkspaceApi.delete_api_workspaces_by_workspace_id_invitations_by_invitation_id",
177
+ :header_params => header_params,
178
+ :query_params => query_params,
179
+ :form_params => form_params,
180
+ :body => post_body,
181
+ :auth_names => auth_names,
182
+ :return_type => return_type
183
+ )
184
+
185
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
186
+ if @api_client.config.debugging
187
+ @api_client.config.logger.debug "API called: WorkspaceApi#delete_api_workspaces_by_workspace_id_invitations_by_invitation_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
188
+ end
189
+ return data, status_code, headers
190
+ end
191
+
192
+ # Revoke a key of a workspace you administer
193
+ # The key stops working at once on every API instance (idempotent: `alreadyRevoked`). Workspace admin keys answer 403 `ERR_ADMIN_KEY_DASHBOARD_ONLY`. Audited (`api_key.revoked`).
194
+ # @param workspace_id [String] Workspace id or its external id.
195
+ # @param key_id [String]
196
+ # @param [Hash] opts the optional parameters
197
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
198
+ # @return [DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response]
199
+ def delete_api_workspaces_by_workspace_id_keys_by_key_id(workspace_id, key_id, opts = {})
200
+ data, _status_code, _headers = delete_api_workspaces_by_workspace_id_keys_by_key_id_with_http_info(workspace_id, key_id, opts)
201
+ data
202
+ end
203
+
204
+ # Revoke a key of a workspace you administer
205
+ # The key stops working at once on every API instance (idempotent: &#x60;alreadyRevoked&#x60;). Workspace admin keys answer 403 &#x60;ERR_ADMIN_KEY_DASHBOARD_ONLY&#x60;. Audited (&#x60;api_key.revoked&#x60;).
206
+ # @param workspace_id [String] Workspace id or its external id.
207
+ # @param key_id [String]
208
+ # @param [Hash] opts the optional parameters
209
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
210
+ # @return [Array<(DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response, Integer, Hash)>] DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response data, response status code and response headers
211
+ def delete_api_workspaces_by_workspace_id_keys_by_key_id_with_http_info(workspace_id, key_id, opts = {})
212
+ if @api_client.config.debugging
213
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id ...'
214
+ end
215
+ # verify the required parameter 'workspace_id' is set
216
+ if @api_client.config.client_side_validation && workspace_id.nil?
217
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id"
218
+ end
219
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
220
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be smaller than or equal to 128.'
221
+ end
222
+
223
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
224
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be great than or equal to 1.'
225
+ end
226
+
227
+ # verify the required parameter 'key_id' is set
228
+ if @api_client.config.client_side_validation && key_id.nil?
229
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id"
230
+ end
231
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
232
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be smaller than or equal to 255.'
233
+ end
234
+
235
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
236
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be great than or equal to 1.'
237
+ end
238
+
239
+ # resource path
240
+ local_var_path = '/api/workspaces/{workspaceId}/keys/{keyId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'keyId' + '}', CGI.escape(key_id.to_s))
241
+
242
+ # query parameters
243
+ query_params = opts[:query_params] || {}
244
+
245
+ # header parameters
246
+ header_params = opts[:header_params] || {}
247
+ # HTTP header 'Accept' (if needed)
248
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
249
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
250
+
251
+ # form parameters
252
+ form_params = opts[:form_params] || {}
253
+
254
+ # http body (model)
255
+ post_body = opts[:debug_body]
256
+
257
+ # return_type
258
+ return_type = opts[:debug_return_type] || 'DeleteApiWorkspacesByWorkspaceIdKeysByKeyId200Response'
259
+
260
+ # auth_names
261
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
262
+
263
+ new_options = opts.merge(
264
+ :operation => :"WorkspaceApi.delete_api_workspaces_by_workspace_id_keys_by_key_id",
265
+ :header_params => header_params,
266
+ :query_params => query_params,
267
+ :form_params => form_params,
268
+ :body => post_body,
269
+ :auth_names => auth_names,
270
+ :return_type => return_type
271
+ )
272
+
273
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
274
+ if @api_client.config.debugging
275
+ @api_client.config.logger.debug "API called: WorkspaceApi#delete_api_workspaces_by_workspace_id_keys_by_key_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
276
+ end
277
+ return data, status_code, headers
278
+ end
279
+
280
+ # Remove a member from a workspace you administer
281
+ # Revokes the member's dashboard sessions there at once (and in the workspace's sandboxes). The last admin and the caller itself cannot be removed (409). Audited (`team.member_removed`).
282
+ # @param workspace_id [String] Workspace id or its external id.
283
+ # @param user_id [String]
284
+ # @param [Hash] opts the optional parameters
285
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
286
+ # @return [DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response]
287
+ def delete_api_workspaces_by_workspace_id_members_by_user_id(workspace_id, user_id, opts = {})
288
+ data, _status_code, _headers = delete_api_workspaces_by_workspace_id_members_by_user_id_with_http_info(workspace_id, user_id, opts)
289
+ data
290
+ end
291
+
292
+ # Remove a member from a workspace you administer
293
+ # Revokes the member&#39;s dashboard sessions there at once (and in the workspace&#39;s sandboxes). The last admin and the caller itself cannot be removed (409). Audited (&#x60;team.member_removed&#x60;).
294
+ # @param workspace_id [String] Workspace id or its external id.
295
+ # @param user_id [String]
296
+ # @param [Hash] opts the optional parameters
297
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
298
+ # @return [Array<(DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response, Integer, Hash)>] DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response data, response status code and response headers
299
+ def delete_api_workspaces_by_workspace_id_members_by_user_id_with_http_info(workspace_id, user_id, opts = {})
300
+ if @api_client.config.debugging
301
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id ...'
302
+ end
303
+ # verify the required parameter 'workspace_id' is set
304
+ if @api_client.config.client_side_validation && workspace_id.nil?
305
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id"
306
+ end
307
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
308
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id, the character length must be smaller than or equal to 128.'
309
+ end
310
+
311
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
312
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id, the character length must be great than or equal to 1.'
313
+ end
314
+
315
+ # verify the required parameter 'user_id' is set
316
+ if @api_client.config.client_side_validation && user_id.nil?
317
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id"
318
+ end
319
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
320
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id, the character length must be smaller than or equal to 255.'
321
+ end
322
+
323
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
324
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id, the character length must be great than or equal to 1.'
325
+ end
326
+
327
+ # resource path
328
+ local_var_path = '/api/workspaces/{workspaceId}/members/{userId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'userId' + '}', CGI.escape(user_id.to_s))
329
+
330
+ # query parameters
331
+ query_params = opts[:query_params] || {}
332
+
333
+ # header parameters
334
+ header_params = opts[:header_params] || {}
335
+ # HTTP header 'Accept' (if needed)
336
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
337
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
338
+
339
+ # form parameters
340
+ form_params = opts[:form_params] || {}
341
+
342
+ # http body (model)
343
+ post_body = opts[:debug_body]
344
+
345
+ # return_type
346
+ return_type = opts[:debug_return_type] || 'DeleteApiWorkspacesByWorkspaceIdMembersByUserId200Response'
347
+
348
+ # auth_names
349
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
350
+
351
+ new_options = opts.merge(
352
+ :operation => :"WorkspaceApi.delete_api_workspaces_by_workspace_id_members_by_user_id",
353
+ :header_params => header_params,
354
+ :query_params => query_params,
355
+ :form_params => form_params,
356
+ :body => post_body,
357
+ :auth_names => auth_names,
358
+ :return_type => return_type
359
+ )
360
+
361
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
362
+ if @api_client.config.debugging
363
+ @api_client.config.logger.debug "API called: WorkspaceApi#delete_api_workspaces_by_workspace_id_members_by_user_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
364
+ end
365
+ return data, status_code, headers
366
+ end
367
+
104
368
  # Get workspace profile for the authenticated tenant
105
369
  # Includes `publicKey` (`pub_…`) for `?workspaceKey=` on the viewer. The public key is not authentication — Bearer JWT or embed token is still required. `kind` is `sandbox` for a sandbox (`isTest: true`, see `/sandboxes`), with its production workspace in `parentWorkspaceId` and its last reset in `lastResetAt`.
106
370
  # @param [Hash] opts the optional parameters
@@ -444,6 +708,8 @@ module SeatsChart
444
708
  # @param [Hash] opts the optional parameters
445
709
  # @option opts [String] :filter Case-insensitive substring of the workspace name or id (seats.io &#x60;filter&#x60;).
446
710
  # @option opts [String] :status &#x60;active&#x60; (seats.io listActive), &#x60;inactive&#x60; (deactivated; seats.io listInactive) or &#x60;all&#x60; (default).
711
+ # @option opts [String] :external_id Only the workspace with this external id (your organizer id; exact match).
712
+ # @option opts [Boolean] :created_by_api &#x60;true&#x60;: only workspaces provisioned by a workspace admin key; &#x60;false&#x60;: only the others.
447
713
  # @return [GetApiWorkspaces200Response]
448
714
  def get_api_workspaces(opts = {})
449
715
  data, _status_code, _headers = get_api_workspaces_with_http_info(opts)
@@ -455,6 +721,8 @@ module SeatsChart
455
721
  # @param [Hash] opts the optional parameters
456
722
  # @option opts [String] :filter Case-insensitive substring of the workspace name or id (seats.io &#x60;filter&#x60;).
457
723
  # @option opts [String] :status &#x60;active&#x60; (seats.io listActive), &#x60;inactive&#x60; (deactivated; seats.io listInactive) or &#x60;all&#x60; (default).
724
+ # @option opts [String] :external_id Only the workspace with this external id (your organizer id; exact match).
725
+ # @option opts [Boolean] :created_by_api &#x60;true&#x60;: only workspaces provisioned by a workspace admin key; &#x60;false&#x60;: only the others.
458
726
  # @return [Array<(GetApiWorkspaces200Response, Integer, Hash)>] GetApiWorkspaces200Response data, response status code and response headers
459
727
  def get_api_workspaces_with_http_info(opts = {})
460
728
  if @api_client.config.debugging
@@ -472,6 +740,19 @@ module SeatsChart
472
740
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
473
741
  fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
474
742
  end
743
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'].to_s.length > 128
744
+ fail ArgumentError, 'invalid value for "opts[:"external_id"]" when calling WorkspaceApi.get_api_workspaces, the character length must be smaller than or equal to 128.'
745
+ end
746
+
747
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'].to_s.length < 1
748
+ fail ArgumentError, 'invalid value for "opts[:"external_id"]" when calling WorkspaceApi.get_api_workspaces, the character length must be great than or equal to 1.'
749
+ end
750
+
751
+ pattern = Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
752
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'] !~ pattern
753
+ fail ArgumentError, "invalid value for 'opts[:\"external_id\"]' when calling WorkspaceApi.get_api_workspaces, must conform to the pattern #{pattern}."
754
+ end
755
+
475
756
  # resource path
476
757
  local_var_path = '/api/workspaces'
477
758
 
@@ -479,6 +760,8 @@ module SeatsChart
479
760
  query_params = opts[:query_params] || {}
480
761
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
481
762
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
763
+ query_params[:'externalId'] = opts[:'external_id'] if !opts[:'external_id'].nil?
764
+ query_params[:'createdByApi'] = opts[:'created_by_api'] if !opts[:'created_by_api'].nil?
482
765
 
483
766
  # header parameters
484
767
  header_params = opts[:header_params] || {}
@@ -514,6 +797,82 @@ module SeatsChart
514
797
  return data, status_code, headers
515
798
  end
516
799
 
800
+ # Get one of my workspaces by its external id
801
+ # The workspace whose `externalId` (your organizer id, set at `POST /workspaces` or with `PATCH /workspaces/{workspaceId}`) is this value, among the workspaces the caller is a member of (404 otherwise: the call never reveals other accounts' workspaces). Same item as `GET /workspaces`. Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`).
802
+ # @param external_id [String]
803
+ # @param [Hash] opts the optional parameters
804
+ # @return [GetApiWorkspaces200ResponseItemsInner]
805
+ def get_api_workspaces_by_external_id_by_external_id(external_id, opts = {})
806
+ data, _status_code, _headers = get_api_workspaces_by_external_id_by_external_id_with_http_info(external_id, opts)
807
+ data
808
+ end
809
+
810
+ # Get one of my workspaces by its external id
811
+ # The workspace whose &#x60;externalId&#x60; (your organizer id, set at &#x60;POST /workspaces&#x60; or with &#x60;PATCH /workspaces/{workspaceId}&#x60;) is this value, among the workspaces the caller is a member of (404 otherwise: the call never reveals other accounts&#39; workspaces). Same item as &#x60;GET /workspaces&#x60;. Dashboard session or a **workspace admin API key** (other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;).
812
+ # @param external_id [String]
813
+ # @param [Hash] opts the optional parameters
814
+ # @return [Array<(GetApiWorkspaces200ResponseItemsInner, Integer, Hash)>] GetApiWorkspaces200ResponseItemsInner data, response status code and response headers
815
+ def get_api_workspaces_by_external_id_by_external_id_with_http_info(external_id, opts = {})
816
+ if @api_client.config.debugging
817
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_api_workspaces_by_external_id_by_external_id ...'
818
+ end
819
+ # verify the required parameter 'external_id' is set
820
+ if @api_client.config.client_side_validation && external_id.nil?
821
+ fail ArgumentError, "Missing the required parameter 'external_id' when calling WorkspaceApi.get_api_workspaces_by_external_id_by_external_id"
822
+ end
823
+ if @api_client.config.client_side_validation && external_id.to_s.length > 128
824
+ fail ArgumentError, 'invalid value for "external_id" when calling WorkspaceApi.get_api_workspaces_by_external_id_by_external_id, the character length must be smaller than or equal to 128.'
825
+ end
826
+
827
+ if @api_client.config.client_side_validation && external_id.to_s.length < 1
828
+ fail ArgumentError, 'invalid value for "external_id" when calling WorkspaceApi.get_api_workspaces_by_external_id_by_external_id, the character length must be great than or equal to 1.'
829
+ end
830
+
831
+ pattern = Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
832
+ if @api_client.config.client_side_validation && external_id !~ pattern
833
+ fail ArgumentError, "invalid value for 'external_id' when calling WorkspaceApi.get_api_workspaces_by_external_id_by_external_id, must conform to the pattern #{pattern}."
834
+ end
835
+
836
+ # resource path
837
+ local_var_path = '/api/workspaces/by-external-id/{externalId}'.sub('{' + 'externalId' + '}', CGI.escape(external_id.to_s))
838
+
839
+ # query parameters
840
+ query_params = opts[:query_params] || {}
841
+
842
+ # header parameters
843
+ header_params = opts[:header_params] || {}
844
+ # HTTP header 'Accept' (if needed)
845
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
846
+
847
+ # form parameters
848
+ form_params = opts[:form_params] || {}
849
+
850
+ # http body (model)
851
+ post_body = opts[:debug_body]
852
+
853
+ # return_type
854
+ return_type = opts[:debug_return_type] || 'GetApiWorkspaces200ResponseItemsInner'
855
+
856
+ # auth_names
857
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
858
+
859
+ new_options = opts.merge(
860
+ :operation => :"WorkspaceApi.get_api_workspaces_by_external_id_by_external_id",
861
+ :header_params => header_params,
862
+ :query_params => query_params,
863
+ :form_params => form_params,
864
+ :body => post_body,
865
+ :auth_names => auth_names,
866
+ :return_type => return_type
867
+ )
868
+
869
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
870
+ if @api_client.config.debugging
871
+ @api_client.config.logger.debug "API called: WorkspaceApi#get_api_workspaces_by_external_id_by_external_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
872
+ end
873
+ return data, status_code, headers
874
+ end
875
+
517
876
  # Get one of my workspaces
518
877
  # Same item as GET /workspaces for one workspace the caller is a member of (404 otherwise). Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`).
519
878
  # @param workspace_id [String]
@@ -585,20 +944,371 @@ module SeatsChart
585
944
  return data, status_code, headers
586
945
  end
587
946
 
588
- # Update workspace display name
589
- # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
947
+ # List the pending invitations of a workspace you administer
948
+ # @param workspace_id [String] Workspace id or its external id.
590
949
  # @param [Hash] opts the optional parameters
591
- # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
592
- # @return [nil]
593
- def patch_api_workspace(patch_api_workspace_request, opts = {})
594
- patch_api_workspace_with_http_info(patch_api_workspace_request, opts)
595
- nil
950
+ # @return [GetApiWorkspacesByWorkspaceIdInvitations200Response]
951
+ def get_api_workspaces_by_workspace_id_invitations(workspace_id, opts = {})
952
+ data, _status_code, _headers = get_api_workspaces_by_workspace_id_invitations_with_http_info(workspace_id, opts)
953
+ data
596
954
  end
597
955
 
598
- # Update workspace display name
599
- # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
956
+ # List the pending invitations of a workspace you administer
957
+ # @param workspace_id [String] Workspace id or its external id.
600
958
  # @param [Hash] opts the optional parameters
601
- # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
959
+ # @return [Array<(GetApiWorkspacesByWorkspaceIdInvitations200Response, Integer, Hash)>] GetApiWorkspacesByWorkspaceIdInvitations200Response data, response status code and response headers
960
+ def get_api_workspaces_by_workspace_id_invitations_with_http_info(workspace_id, opts = {})
961
+ if @api_client.config.debugging
962
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_api_workspaces_by_workspace_id_invitations ...'
963
+ end
964
+ # verify the required parameter 'workspace_id' is set
965
+ if @api_client.config.client_side_validation && workspace_id.nil?
966
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_api_workspaces_by_workspace_id_invitations"
967
+ end
968
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
969
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_invitations, the character length must be smaller than or equal to 128.'
970
+ end
971
+
972
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
973
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_invitations, the character length must be great than or equal to 1.'
974
+ end
975
+
976
+ # resource path
977
+ local_var_path = '/api/workspaces/{workspaceId}/invitations'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
978
+
979
+ # query parameters
980
+ query_params = opts[:query_params] || {}
981
+
982
+ # header parameters
983
+ header_params = opts[:header_params] || {}
984
+ # HTTP header 'Accept' (if needed)
985
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
986
+
987
+ # form parameters
988
+ form_params = opts[:form_params] || {}
989
+
990
+ # http body (model)
991
+ post_body = opts[:debug_body]
992
+
993
+ # return_type
994
+ return_type = opts[:debug_return_type] || 'GetApiWorkspacesByWorkspaceIdInvitations200Response'
995
+
996
+ # auth_names
997
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
998
+
999
+ new_options = opts.merge(
1000
+ :operation => :"WorkspaceApi.get_api_workspaces_by_workspace_id_invitations",
1001
+ :header_params => header_params,
1002
+ :query_params => query_params,
1003
+ :form_params => form_params,
1004
+ :body => post_body,
1005
+ :auth_names => auth_names,
1006
+ :return_type => return_type
1007
+ )
1008
+
1009
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1010
+ if @api_client.config.debugging
1011
+ @api_client.config.logger.debug "API called: WorkspaceApi#get_api_workspaces_by_workspace_id_invitations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1012
+ end
1013
+ return data, status_code, headers
1014
+ end
1015
+
1016
+ # List the API keys of a workspace you administer
1017
+ # Live keys of the workspace (prefix fingerprint only, never a secret), newest first. Dashboard session or a **workspace admin API key**; the caller (for a key: the admin it is bound to, re-checked on every call) must administer the workspace: 404 otherwise, also for another account's workspace.
1018
+ # @param workspace_id [String] Workspace id or its external id.
1019
+ # @param [Hash] opts the optional parameters
1020
+ # @return [GetApiWorkspacesByWorkspaceIdKeys200Response]
1021
+ def get_api_workspaces_by_workspace_id_keys(workspace_id, opts = {})
1022
+ data, _status_code, _headers = get_api_workspaces_by_workspace_id_keys_with_http_info(workspace_id, opts)
1023
+ data
1024
+ end
1025
+
1026
+ # List the API keys of a workspace you administer
1027
+ # Live keys of the workspace (prefix fingerprint only, never a secret), newest first. Dashboard session or a **workspace admin API key**; the caller (for a key: the admin it is bound to, re-checked on every call) must administer the workspace: 404 otherwise, also for another account&#39;s workspace.
1028
+ # @param workspace_id [String] Workspace id or its external id.
1029
+ # @param [Hash] opts the optional parameters
1030
+ # @return [Array<(GetApiWorkspacesByWorkspaceIdKeys200Response, Integer, Hash)>] GetApiWorkspacesByWorkspaceIdKeys200Response data, response status code and response headers
1031
+ def get_api_workspaces_by_workspace_id_keys_with_http_info(workspace_id, opts = {})
1032
+ if @api_client.config.debugging
1033
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_api_workspaces_by_workspace_id_keys ...'
1034
+ end
1035
+ # verify the required parameter 'workspace_id' is set
1036
+ if @api_client.config.client_side_validation && workspace_id.nil?
1037
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_api_workspaces_by_workspace_id_keys"
1038
+ end
1039
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
1040
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_keys, the character length must be smaller than or equal to 128.'
1041
+ end
1042
+
1043
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
1044
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_keys, the character length must be great than or equal to 1.'
1045
+ end
1046
+
1047
+ # resource path
1048
+ local_var_path = '/api/workspaces/{workspaceId}/keys'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
1049
+
1050
+ # query parameters
1051
+ query_params = opts[:query_params] || {}
1052
+
1053
+ # header parameters
1054
+ header_params = opts[:header_params] || {}
1055
+ # HTTP header 'Accept' (if needed)
1056
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
1057
+
1058
+ # form parameters
1059
+ form_params = opts[:form_params] || {}
1060
+
1061
+ # http body (model)
1062
+ post_body = opts[:debug_body]
1063
+
1064
+ # return_type
1065
+ return_type = opts[:debug_return_type] || 'GetApiWorkspacesByWorkspaceIdKeys200Response'
1066
+
1067
+ # auth_names
1068
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
1069
+
1070
+ new_options = opts.merge(
1071
+ :operation => :"WorkspaceApi.get_api_workspaces_by_workspace_id_keys",
1072
+ :header_params => header_params,
1073
+ :query_params => query_params,
1074
+ :form_params => form_params,
1075
+ :body => post_body,
1076
+ :auth_names => auth_names,
1077
+ :return_type => return_type
1078
+ )
1079
+
1080
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1081
+ if @api_client.config.debugging
1082
+ @api_client.config.logger.debug "API called: WorkspaceApi#get_api_workspaces_by_workspace_id_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1083
+ end
1084
+ return data, status_code, headers
1085
+ end
1086
+
1087
+ # List the members of a workspace you administer
1088
+ # Dashboard members with role, join date and `twoFactorEnabled`. Dashboard session or a workspace admin API key.
1089
+ # @param workspace_id [String] Workspace id or its external id.
1090
+ # @param [Hash] opts the optional parameters
1091
+ # @return [GetApiWorkspacesByWorkspaceIdMembers200Response]
1092
+ def get_api_workspaces_by_workspace_id_members(workspace_id, opts = {})
1093
+ data, _status_code, _headers = get_api_workspaces_by_workspace_id_members_with_http_info(workspace_id, opts)
1094
+ data
1095
+ end
1096
+
1097
+ # List the members of a workspace you administer
1098
+ # Dashboard members with role, join date and &#x60;twoFactorEnabled&#x60;. Dashboard session or a workspace admin API key.
1099
+ # @param workspace_id [String] Workspace id or its external id.
1100
+ # @param [Hash] opts the optional parameters
1101
+ # @return [Array<(GetApiWorkspacesByWorkspaceIdMembers200Response, Integer, Hash)>] GetApiWorkspacesByWorkspaceIdMembers200Response data, response status code and response headers
1102
+ def get_api_workspaces_by_workspace_id_members_with_http_info(workspace_id, opts = {})
1103
+ if @api_client.config.debugging
1104
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_api_workspaces_by_workspace_id_members ...'
1105
+ end
1106
+ # verify the required parameter 'workspace_id' is set
1107
+ if @api_client.config.client_side_validation && workspace_id.nil?
1108
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.get_api_workspaces_by_workspace_id_members"
1109
+ end
1110
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
1111
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_members, the character length must be smaller than or equal to 128.'
1112
+ end
1113
+
1114
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
1115
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.get_api_workspaces_by_workspace_id_members, the character length must be great than or equal to 1.'
1116
+ end
1117
+
1118
+ # resource path
1119
+ local_var_path = '/api/workspaces/{workspaceId}/members'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
1120
+
1121
+ # query parameters
1122
+ query_params = opts[:query_params] || {}
1123
+
1124
+ # header parameters
1125
+ header_params = opts[:header_params] || {}
1126
+ # HTTP header 'Accept' (if needed)
1127
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
1128
+
1129
+ # form parameters
1130
+ form_params = opts[:form_params] || {}
1131
+
1132
+ # http body (model)
1133
+ post_body = opts[:debug_body]
1134
+
1135
+ # return_type
1136
+ return_type = opts[:debug_return_type] || 'GetApiWorkspacesByWorkspaceIdMembers200Response'
1137
+
1138
+ # auth_names
1139
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
1140
+
1141
+ new_options = opts.merge(
1142
+ :operation => :"WorkspaceApi.get_api_workspaces_by_workspace_id_members",
1143
+ :header_params => header_params,
1144
+ :query_params => query_params,
1145
+ :form_params => form_params,
1146
+ :body => post_body,
1147
+ :auth_names => auth_names,
1148
+ :return_type => return_type
1149
+ )
1150
+
1151
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1152
+ if @api_client.config.debugging
1153
+ @api_client.config.logger.debug "API called: WorkspaceApi#get_api_workspaces_by_workspace_id_members\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1154
+ end
1155
+ return data, status_code, headers
1156
+ end
1157
+
1158
+ # Consolidated overview of the organizer workspaces you administer
1159
+ # One call for the platform view: every production workspace the caller administers (for a workspace admin key: its admin), newest first, with charts (not archived), events, seats `sold` / `held` / `available` (numbered seats for sale plus general admission places; held = numbered seats under a hold now, read from Redis for current and upcoming events), `revenue` and the used objects of `month`, plus `totals` over every workspace matching the filters (not only this page). `revenue.cents` is the catalog price of the sold seats and is known only when the workspace takes prices from SeatsChart (`pricingSource: seatschart_catalog`); with partner or synced pricing the platform owns the amounts (`known: false`, `cents: null`; `totals.revenue.complete` says whether every workspace was known). Sold and available come from PostgreSQL, holds from Redis. `usage.usedSeats` is each workspace's used seats of the month (the billing unit) and `usage.projectedSeats` its projection at the current pace. `seats` is the seat billing of the caller's billing account for the month: the seats of every production workspace of the account (its own and the organizer workspaces it provisioned) together, against the account's plan (`includedSeats`, `overage` and `projected` with their cost); `account` holds the account's totals (`workspaceCount`, `plan`, `charts` and `events` against the plan caps, which count them together); both `null` when the caller has no billing account. Filters: `externalId`, `status`, `createdByApi`, creation date range `createdFrom` / `createdTo`. Paginated with `limit` / `nextCursor`. Dashboard session or a workspace admin API key.
1160
+ # @param [Hash] opts the optional parameters
1161
+ # @option opts [String] :external_id Only this organizer.
1162
+ # @option opts [String] :status Default &#x60;all&#x60;.
1163
+ # @option opts [Boolean] :created_by_api &#x60;true&#x60;: only workspaces provisioned by a workspace admin key.
1164
+ # @option opts [String] :created_from Workspaces created at or after this date / date-time (ISO 8601).
1165
+ # @option opts [String] :created_to Workspaces created at or before this date (whole UTC day) / date-time.
1166
+ # @option opts [String] :month Usage month &#x60;YYYY-MM&#x60; (default: the current UTC month).
1167
+ # @option opts [Float] :limit Page size (1..200, default 50).
1168
+ # @option opts [String] :cursor Opaque &#x60;nextCursor&#x60; of the previous page.
1169
+ # @return [GetApiWorkspacesOverview200Response]
1170
+ def get_api_workspaces_overview(opts = {})
1171
+ data, _status_code, _headers = get_api_workspaces_overview_with_http_info(opts)
1172
+ data
1173
+ end
1174
+
1175
+ # Consolidated overview of the organizer workspaces you administer
1176
+ # One call for the platform view: every production workspace the caller administers (for a workspace admin key: its admin), newest first, with charts (not archived), events, seats &#x60;sold&#x60; / &#x60;held&#x60; / &#x60;available&#x60; (numbered seats for sale plus general admission places; held &#x3D; numbered seats under a hold now, read from Redis for current and upcoming events), &#x60;revenue&#x60; and the used objects of &#x60;month&#x60;, plus &#x60;totals&#x60; over every workspace matching the filters (not only this page). &#x60;revenue.cents&#x60; is the catalog price of the sold seats and is known only when the workspace takes prices from SeatsChart (&#x60;pricingSource: seatschart_catalog&#x60;); with partner or synced pricing the platform owns the amounts (&#x60;known: false&#x60;, &#x60;cents: null&#x60;; &#x60;totals.revenue.complete&#x60; says whether every workspace was known). Sold and available come from PostgreSQL, holds from Redis. &#x60;usage.usedSeats&#x60; is each workspace&#39;s used seats of the month (the billing unit) and &#x60;usage.projectedSeats&#x60; its projection at the current pace. &#x60;seats&#x60; is the seat billing of the caller&#39;s billing account for the month: the seats of every production workspace of the account (its own and the organizer workspaces it provisioned) together, against the account&#39;s plan (&#x60;includedSeats&#x60;, &#x60;overage&#x60; and &#x60;projected&#x60; with their cost); &#x60;account&#x60; holds the account&#39;s totals (&#x60;workspaceCount&#x60;, &#x60;plan&#x60;, &#x60;charts&#x60; and &#x60;events&#x60; against the plan caps, which count them together); both &#x60;null&#x60; when the caller has no billing account. Filters: &#x60;externalId&#x60;, &#x60;status&#x60;, &#x60;createdByApi&#x60;, creation date range &#x60;createdFrom&#x60; / &#x60;createdTo&#x60;. Paginated with &#x60;limit&#x60; / &#x60;nextCursor&#x60;. Dashboard session or a workspace admin API key.
1177
+ # @param [Hash] opts the optional parameters
1178
+ # @option opts [String] :external_id Only this organizer.
1179
+ # @option opts [String] :status Default &#x60;all&#x60;.
1180
+ # @option opts [Boolean] :created_by_api &#x60;true&#x60;: only workspaces provisioned by a workspace admin key.
1181
+ # @option opts [String] :created_from Workspaces created at or after this date / date-time (ISO 8601).
1182
+ # @option opts [String] :created_to Workspaces created at or before this date (whole UTC day) / date-time.
1183
+ # @option opts [String] :month Usage month &#x60;YYYY-MM&#x60; (default: the current UTC month).
1184
+ # @option opts [Float] :limit Page size (1..200, default 50).
1185
+ # @option opts [String] :cursor Opaque &#x60;nextCursor&#x60; of the previous page.
1186
+ # @return [Array<(GetApiWorkspacesOverview200Response, Integer, Hash)>] GetApiWorkspacesOverview200Response data, response status code and response headers
1187
+ def get_api_workspaces_overview_with_http_info(opts = {})
1188
+ if @api_client.config.debugging
1189
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.get_api_workspaces_overview ...'
1190
+ end
1191
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'].to_s.length > 128
1192
+ fail ArgumentError, 'invalid value for "opts[:"external_id"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be smaller than or equal to 128.'
1193
+ end
1194
+
1195
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'].to_s.length < 1
1196
+ fail ArgumentError, 'invalid value for "opts[:"external_id"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be great than or equal to 1.'
1197
+ end
1198
+
1199
+ pattern = Regexp.new(/^[A-Za-z0-9_.~-]{1,128}$/)
1200
+ if @api_client.config.client_side_validation && !opts[:'external_id'].nil? && opts[:'external_id'] !~ pattern
1201
+ fail ArgumentError, "invalid value for 'opts[:\"external_id\"]' when calling WorkspaceApi.get_api_workspaces_overview, must conform to the pattern #{pattern}."
1202
+ end
1203
+
1204
+ allowable_values = ["active", "inactive", "all"]
1205
+ if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
1206
+ fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
1207
+ end
1208
+ if @api_client.config.client_side_validation && !opts[:'created_from'].nil? && opts[:'created_from'].to_s.length > 40
1209
+ fail ArgumentError, 'invalid value for "opts[:"created_from"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be smaller than or equal to 40.'
1210
+ end
1211
+
1212
+ if @api_client.config.client_side_validation && !opts[:'created_from'].nil? && opts[:'created_from'].to_s.length < 10
1213
+ fail ArgumentError, 'invalid value for "opts[:"created_from"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be great than or equal to 10.'
1214
+ end
1215
+
1216
+ if @api_client.config.client_side_validation && !opts[:'created_to'].nil? && opts[:'created_to'].to_s.length > 40
1217
+ fail ArgumentError, 'invalid value for "opts[:"created_to"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be smaller than or equal to 40.'
1218
+ end
1219
+
1220
+ if @api_client.config.client_side_validation && !opts[:'created_to'].nil? && opts[:'created_to'].to_s.length < 10
1221
+ fail ArgumentError, 'invalid value for "opts[:"created_to"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be great than or equal to 10.'
1222
+ end
1223
+
1224
+ pattern = Regexp.new(/^\d{4}-\d{2}$/)
1225
+ if @api_client.config.client_side_validation && !opts[:'month'].nil? && opts[:'month'] !~ pattern
1226
+ fail ArgumentError, "invalid value for 'opts[:\"month\"]' when calling WorkspaceApi.get_api_workspaces_overview, must conform to the pattern #{pattern}."
1227
+ end
1228
+
1229
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
1230
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WorkspaceApi.get_api_workspaces_overview, must be smaller than or equal to 200.'
1231
+ end
1232
+
1233
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
1234
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling WorkspaceApi.get_api_workspaces_overview, must be greater than or equal to 1.'
1235
+ end
1236
+
1237
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'].to_s.length > 64
1238
+ fail ArgumentError, 'invalid value for "opts[:"cursor"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be smaller than or equal to 64.'
1239
+ end
1240
+
1241
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'].to_s.length < 1
1242
+ fail ArgumentError, 'invalid value for "opts[:"cursor"]" when calling WorkspaceApi.get_api_workspaces_overview, the character length must be great than or equal to 1.'
1243
+ end
1244
+
1245
+ pattern = Regexp.new(/^[A-Za-z0-9_-]+$/)
1246
+ if @api_client.config.client_side_validation && !opts[:'cursor'].nil? && opts[:'cursor'] !~ pattern
1247
+ fail ArgumentError, "invalid value for 'opts[:\"cursor\"]' when calling WorkspaceApi.get_api_workspaces_overview, must conform to the pattern #{pattern}."
1248
+ end
1249
+
1250
+ # resource path
1251
+ local_var_path = '/api/workspaces/overview'
1252
+
1253
+ # query parameters
1254
+ query_params = opts[:query_params] || {}
1255
+ query_params[:'externalId'] = opts[:'external_id'] if !opts[:'external_id'].nil?
1256
+ query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
1257
+ query_params[:'createdByApi'] = opts[:'created_by_api'] if !opts[:'created_by_api'].nil?
1258
+ query_params[:'createdFrom'] = opts[:'created_from'] if !opts[:'created_from'].nil?
1259
+ query_params[:'createdTo'] = opts[:'created_to'] if !opts[:'created_to'].nil?
1260
+ query_params[:'month'] = opts[:'month'] if !opts[:'month'].nil?
1261
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1262
+ query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
1263
+
1264
+ # header parameters
1265
+ header_params = opts[:header_params] || {}
1266
+ # HTTP header 'Accept' (if needed)
1267
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
1268
+
1269
+ # form parameters
1270
+ form_params = opts[:form_params] || {}
1271
+
1272
+ # http body (model)
1273
+ post_body = opts[:debug_body]
1274
+
1275
+ # return_type
1276
+ return_type = opts[:debug_return_type] || 'GetApiWorkspacesOverview200Response'
1277
+
1278
+ # auth_names
1279
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
1280
+
1281
+ new_options = opts.merge(
1282
+ :operation => :"WorkspaceApi.get_api_workspaces_overview",
1283
+ :header_params => header_params,
1284
+ :query_params => query_params,
1285
+ :form_params => form_params,
1286
+ :body => post_body,
1287
+ :auth_names => auth_names,
1288
+ :return_type => return_type
1289
+ )
1290
+
1291
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1292
+ if @api_client.config.debugging
1293
+ @api_client.config.logger.debug "API called: WorkspaceApi#get_api_workspaces_overview\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1294
+ end
1295
+ return data, status_code, headers
1296
+ end
1297
+
1298
+ # Update workspace display name
1299
+ # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
1300
+ # @param [Hash] opts the optional parameters
1301
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1302
+ # @return [nil]
1303
+ def patch_api_workspace(patch_api_workspace_request, opts = {})
1304
+ patch_api_workspace_with_http_info(patch_api_workspace_request, opts)
1305
+ nil
1306
+ end
1307
+
1308
+ # Update workspace display name
1309
+ # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
1310
+ # @param [Hash] opts the optional parameters
1311
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
602
1312
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
603
1313
  def patch_api_workspace_with_http_info(patch_api_workspace_request, opts = {})
604
1314
  if @api_client.config.debugging
@@ -968,26 +1678,26 @@ module SeatsChart
968
1678
  return data, status_code, headers
969
1679
  end
970
1680
 
971
- # Rename one of my workspaces
972
- # Sets `displayName` (1–512 characters). The caller (for a workspace admin key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent; written to the audit log (`workspace.rename`).
1681
+ # Rename one of my workspaces or change its external id
1682
+ # Sets `displayName` (1–512 characters) and/or `externalId`. The caller (for a workspace admin key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent; written to the audit log (`workspace.rename`, `workspace.external_id.update`). A changed external id takes effect at once for `X-Workspace-Key` on every API instance (the old value stops resolving).
973
1683
  # @param workspace_id [String]
974
- # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
1684
+ # @param patch_api_workspaces_by_workspace_id_request [PatchApiWorkspacesByWorkspaceIdRequest]
975
1685
  # @param [Hash] opts the optional parameters
976
1686
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
977
1687
  # @return [GetApiWorkspaces200ResponseItemsInner]
978
- def patch_api_workspaces_by_workspace_id(workspace_id, patch_api_workspace_request, opts = {})
979
- data, _status_code, _headers = patch_api_workspaces_by_workspace_id_with_http_info(workspace_id, patch_api_workspace_request, opts)
1688
+ def patch_api_workspaces_by_workspace_id(workspace_id, patch_api_workspaces_by_workspace_id_request, opts = {})
1689
+ data, _status_code, _headers = patch_api_workspaces_by_workspace_id_with_http_info(workspace_id, patch_api_workspaces_by_workspace_id_request, opts)
980
1690
  data
981
1691
  end
982
1692
 
983
- # Rename one of my workspaces
984
- # Sets &#x60;displayName&#x60; (1–512 characters). The caller (for a workspace admin key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent; written to the audit log (&#x60;workspace.rename&#x60;).
1693
+ # Rename one of my workspaces or change its external id
1694
+ # Sets &#x60;displayName&#x60; (1–512 characters) and/or &#x60;externalId&#x60;. The caller (for a workspace admin key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent; written to the audit log (&#x60;workspace.rename&#x60;, &#x60;workspace.external_id.update&#x60;). A changed external id takes effect at once for &#x60;X-Workspace-Key&#x60; on every API instance (the old value stops resolving).
985
1695
  # @param workspace_id [String]
986
- # @param patch_api_workspace_request [PatchApiWorkspaceRequest]
1696
+ # @param patch_api_workspaces_by_workspace_id_request [PatchApiWorkspacesByWorkspaceIdRequest]
987
1697
  # @param [Hash] opts the optional parameters
988
1698
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
989
1699
  # @return [Array<(GetApiWorkspaces200ResponseItemsInner, Integer, Hash)>] GetApiWorkspaces200ResponseItemsInner data, response status code and response headers
990
- def patch_api_workspaces_by_workspace_id_with_http_info(workspace_id, patch_api_workspace_request, opts = {})
1700
+ def patch_api_workspaces_by_workspace_id_with_http_info(workspace_id, patch_api_workspaces_by_workspace_id_request, opts = {})
991
1701
  if @api_client.config.debugging
992
1702
  @api_client.config.logger.debug 'Calling API: WorkspaceApi.patch_api_workspaces_by_workspace_id ...'
993
1703
  end
@@ -1003,9 +1713,9 @@ module SeatsChart
1003
1713
  fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id, the character length must be great than or equal to 1.'
1004
1714
  end
1005
1715
 
1006
- # verify the required parameter 'patch_api_workspace_request' is set
1007
- if @api_client.config.client_side_validation && patch_api_workspace_request.nil?
1008
- fail ArgumentError, "Missing the required parameter 'patch_api_workspace_request' when calling WorkspaceApi.patch_api_workspaces_by_workspace_id"
1716
+ # verify the required parameter 'patch_api_workspaces_by_workspace_id_request' is set
1717
+ if @api_client.config.client_side_validation && patch_api_workspaces_by_workspace_id_request.nil?
1718
+ fail ArgumentError, "Missing the required parameter 'patch_api_workspaces_by_workspace_id_request' when calling WorkspaceApi.patch_api_workspaces_by_workspace_id"
1009
1719
  end
1010
1720
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
1011
1721
  fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id, the character length must be smaller than or equal to 255.'
@@ -1036,7 +1746,7 @@ module SeatsChart
1036
1746
  form_params = opts[:form_params] || {}
1037
1747
 
1038
1748
  # http body (model)
1039
- post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_api_workspace_request)
1749
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_api_workspaces_by_workspace_id_request)
1040
1750
 
1041
1751
  # return_type
1042
1752
  return_type = opts[:debug_return_type] || 'GetApiWorkspaces200ResponseItemsInner'
@@ -1061,24 +1771,123 @@ module SeatsChart
1061
1771
  return data, status_code, headers
1062
1772
  end
1063
1773
 
1064
- # Rotate the public workspace key
1065
- # Issues a new `pub_…` key. Requires workspace_admin. The public key is not authentication — rotating it does not invalidate JWTs or API keys.
1774
+ # Rename a key of a workspace you administer or change its scopes
1775
+ # Takes effect on the next request (the auth cache entry is dropped); the secret is unchanged. Workspace admin keys answer 403 `ERR_ADMIN_KEY_DASHBOARD_ONLY`. Audited (`api_key.updated`).
1776
+ # @param workspace_id [String] Workspace id or its external id.
1777
+ # @param key_id [String]
1778
+ # @param patch_api_workspaces_by_workspace_id_keys_by_key_id_request [PatchApiWorkspacesByWorkspaceIdKeysByKeyIdRequest]
1066
1779
  # @param [Hash] opts the optional parameters
1067
1780
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1068
- # @return [nil]
1069
- def post_api_workspace_public_key_rotate(opts = {})
1070
- post_api_workspace_public_key_rotate_with_http_info(opts)
1071
- nil
1781
+ # @return [PatchApiWorkspacesByWorkspaceIdKeysByKeyId200Response]
1782
+ def patch_api_workspaces_by_workspace_id_keys_by_key_id(workspace_id, key_id, patch_api_workspaces_by_workspace_id_keys_by_key_id_request, opts = {})
1783
+ data, _status_code, _headers = patch_api_workspaces_by_workspace_id_keys_by_key_id_with_http_info(workspace_id, key_id, patch_api_workspaces_by_workspace_id_keys_by_key_id_request, opts)
1784
+ data
1072
1785
  end
1073
1786
 
1074
- # Rotate the public workspace key
1075
- # Issues a new &#x60;pub_…&#x60; key. Requires workspace_admin. The public key is not authentication — rotating it does not invalidate JWTs or API keys.
1787
+ # Rename a key of a workspace you administer or change its scopes
1788
+ # Takes effect on the next request (the auth cache entry is dropped); the secret is unchanged. Workspace admin keys answer 403 &#x60;ERR_ADMIN_KEY_DASHBOARD_ONLY&#x60;. Audited (&#x60;api_key.updated&#x60;).
1789
+ # @param workspace_id [String] Workspace id or its external id.
1790
+ # @param key_id [String]
1791
+ # @param patch_api_workspaces_by_workspace_id_keys_by_key_id_request [PatchApiWorkspacesByWorkspaceIdKeysByKeyIdRequest]
1076
1792
  # @param [Hash] opts the optional parameters
1077
1793
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1078
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1079
- def post_api_workspace_public_key_rotate_with_http_info(opts = {})
1794
+ # @return [Array<(PatchApiWorkspacesByWorkspaceIdKeysByKeyId200Response, Integer, Hash)>] PatchApiWorkspacesByWorkspaceIdKeysByKeyId200Response data, response status code and response headers
1795
+ def patch_api_workspaces_by_workspace_id_keys_by_key_id_with_http_info(workspace_id, key_id, patch_api_workspaces_by_workspace_id_keys_by_key_id_request, opts = {})
1080
1796
  if @api_client.config.debugging
1081
- @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspace_public_key_rotate ...'
1797
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id ...'
1798
+ end
1799
+ # verify the required parameter 'workspace_id' is set
1800
+ if @api_client.config.client_side_validation && workspace_id.nil?
1801
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id"
1802
+ end
1803
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
1804
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be smaller than or equal to 128.'
1805
+ end
1806
+
1807
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
1808
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be great than or equal to 1.'
1809
+ end
1810
+
1811
+ # verify the required parameter 'key_id' is set
1812
+ if @api_client.config.client_side_validation && key_id.nil?
1813
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id"
1814
+ end
1815
+ # verify the required parameter 'patch_api_workspaces_by_workspace_id_keys_by_key_id_request' is set
1816
+ if @api_client.config.client_side_validation && patch_api_workspaces_by_workspace_id_keys_by_key_id_request.nil?
1817
+ fail ArgumentError, "Missing the required parameter 'patch_api_workspaces_by_workspace_id_keys_by_key_id_request' when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id"
1818
+ end
1819
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
1820
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be smaller than or equal to 255.'
1821
+ end
1822
+
1823
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
1824
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id, the character length must be great than or equal to 1.'
1825
+ end
1826
+
1827
+ # resource path
1828
+ local_var_path = '/api/workspaces/{workspaceId}/keys/{keyId}'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'keyId' + '}', CGI.escape(key_id.to_s))
1829
+
1830
+ # query parameters
1831
+ query_params = opts[:query_params] || {}
1832
+
1833
+ # header parameters
1834
+ header_params = opts[:header_params] || {}
1835
+ # HTTP header 'Accept' (if needed)
1836
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
1837
+ # HTTP header 'Content-Type'
1838
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
1839
+ if !content_type.nil?
1840
+ header_params['Content-Type'] = content_type
1841
+ end
1842
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1843
+
1844
+ # form parameters
1845
+ form_params = opts[:form_params] || {}
1846
+
1847
+ # http body (model)
1848
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(patch_api_workspaces_by_workspace_id_keys_by_key_id_request)
1849
+
1850
+ # return_type
1851
+ return_type = opts[:debug_return_type] || 'PatchApiWorkspacesByWorkspaceIdKeysByKeyId200Response'
1852
+
1853
+ # auth_names
1854
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
1855
+
1856
+ new_options = opts.merge(
1857
+ :operation => :"WorkspaceApi.patch_api_workspaces_by_workspace_id_keys_by_key_id",
1858
+ :header_params => header_params,
1859
+ :query_params => query_params,
1860
+ :form_params => form_params,
1861
+ :body => post_body,
1862
+ :auth_names => auth_names,
1863
+ :return_type => return_type
1864
+ )
1865
+
1866
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1867
+ if @api_client.config.debugging
1868
+ @api_client.config.logger.debug "API called: WorkspaceApi#patch_api_workspaces_by_workspace_id_keys_by_key_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1869
+ end
1870
+ return data, status_code, headers
1871
+ end
1872
+
1873
+ # Rotate the public workspace key
1874
+ # Issues a new `pub_…` key. Requires workspace_admin. The public key is not authentication — rotating it does not invalidate JWTs or API keys.
1875
+ # @param [Hash] opts the optional parameters
1876
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1877
+ # @return [nil]
1878
+ def post_api_workspace_public_key_rotate(opts = {})
1879
+ post_api_workspace_public_key_rotate_with_http_info(opts)
1880
+ nil
1881
+ end
1882
+
1883
+ # Rotate the public workspace key
1884
+ # Issues a new &#x60;pub_…&#x60; key. Requires workspace_admin. The public key is not authentication — rotating it does not invalidate JWTs or API keys.
1885
+ # @param [Hash] opts the optional parameters
1886
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1887
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1888
+ def post_api_workspace_public_key_rotate_with_http_info(opts = {})
1889
+ if @api_client.config.debugging
1890
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspace_public_key_rotate ...'
1082
1891
  end
1083
1892
  if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
1084
1893
  fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspace_public_key_rotate, the character length must be smaller than or equal to 255.'
@@ -1127,23 +1936,23 @@ module SeatsChart
1127
1936
  return data, status_code, headers
1128
1937
  end
1129
1938
 
1130
- # Create an additional workspace
1131
- # Provisions a free-plan tenant and admin membership for the caller: a dashboard admin session, or a **workspace admin API key** (`POST /api/keys` with `workspaceAdmin: true`; it must be a full-access key), whose bound admin becomes the admin of the new workspace. Other API keys: 403 `ERR_PARTNER_SCOPE`. `isTest: true` creates a test workspace linked to the current production workspace (`parentWorkspaceId`), optionally copying its charts (`copyCharts`). Written to the audit log of the current workspace (`workspace.create` / `workspace.create_test`). Returns a new `publicKey` — not a secret and not a Bearer substitute.
1939
+ # Create a workspace (provision an organizer)
1940
+ # Provisions a workspace and admin membership for the caller: a dashboard admin session, or a **full-access workspace admin API key** (`POST /api/keys` with `workspaceAdmin: true`), whose bound admin becomes the admin of the new workspace. Other API keys: 403 `ERR_PARTNER_SCOPE`. **Ticketing platforms (one workspace per organizer):** send `externalId` (your organizer id), `templateWorkspaceId` (a workspace whose integration settings, embed domains and webhooks to copy) and `issueKey` (mint the organizer's API key in the same call). A workspace created by a workspace admin key is marked `createdByApi`, joins the platform admin's billing account (one plan for every workspace of the account, e.g. Ultra On-Demand: its charts, events and seats count with the others) and is billed to the platform: its members never see checkout or upgrade prompts. A workspace created in the dashboard joins the creator's billing account the same way, and a sandbox its parent's. Without a template it starts with partner pricing and the platform defaults. Then call any partner route in it with the same admin key and `X-Workspace-Key: <workspaceId or externalId>`. **Idempotency:** send `Idempotency-Key` (1–255 characters): the same key and body within 24 hours returns the first result with `idempotentReplay: true` and every secret `null` (secrets are never stored; rotate the key if the first response was lost). The same key with another body: 422 `idempotency_key_reused`; while the first call still runs: 409. `isTest: true` creates a test workspace linked to the current production workspace (`parentWorkspaceId`), optionally copying its charts (`copyCharts`). Written to the audit log of the current workspace (`workspace.create` / `workspace.create_test`) and, for a production workspace, of the new one. Returns a new `publicKey`: not a secret and not a Bearer substitute.
1132
1941
  # @param post_api_workspaces_request [PostApiWorkspacesRequest]
1133
1942
  # @param [Hash] opts the optional parameters
1134
1943
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1135
- # @return [nil]
1944
+ # @return [PostApiWorkspaces200Response]
1136
1945
  def post_api_workspaces(post_api_workspaces_request, opts = {})
1137
- post_api_workspaces_with_http_info(post_api_workspaces_request, opts)
1138
- nil
1946
+ data, _status_code, _headers = post_api_workspaces_with_http_info(post_api_workspaces_request, opts)
1947
+ data
1139
1948
  end
1140
1949
 
1141
- # Create an additional workspace
1142
- # Provisions a free-plan tenant and admin membership for the caller: a dashboard admin session, or a **workspace admin API key** (&#x60;POST /api/keys&#x60; with &#x60;workspaceAdmin: true&#x60;; it must be a full-access key), whose bound admin becomes the admin of the new workspace. Other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;. &#x60;isTest: true&#x60; creates a test workspace linked to the current production workspace (&#x60;parentWorkspaceId&#x60;), optionally copying its charts (&#x60;copyCharts&#x60;). Written to the audit log of the current workspace (&#x60;workspace.create&#x60; / &#x60;workspace.create_test&#x60;). Returns a new &#x60;publicKey&#x60; — not a secret and not a Bearer substitute.
1950
+ # Create a workspace (provision an organizer)
1951
+ # Provisions a workspace and admin membership for the caller: a dashboard admin session, or a **full-access workspace admin API key** (&#x60;POST /api/keys&#x60; with &#x60;workspaceAdmin: true&#x60;), whose bound admin becomes the admin of the new workspace. Other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;. **Ticketing platforms (one workspace per organizer):** send &#x60;externalId&#x60; (your organizer id), &#x60;templateWorkspaceId&#x60; (a workspace whose integration settings, embed domains and webhooks to copy) and &#x60;issueKey&#x60; (mint the organizer&#39;s API key in the same call). A workspace created by a workspace admin key is marked &#x60;createdByApi&#x60;, joins the platform admin&#39;s billing account (one plan for every workspace of the account, e.g. Ultra On-Demand: its charts, events and seats count with the others) and is billed to the platform: its members never see checkout or upgrade prompts. A workspace created in the dashboard joins the creator&#39;s billing account the same way, and a sandbox its parent&#39;s. Without a template it starts with partner pricing and the platform defaults. Then call any partner route in it with the same admin key and &#x60;X-Workspace-Key: &lt;workspaceId or externalId&gt;&#x60;. **Idempotency:** send &#x60;Idempotency-Key&#x60; (1–255 characters): the same key and body within 24 hours returns the first result with &#x60;idempotentReplay: true&#x60; and every secret &#x60;null&#x60; (secrets are never stored; rotate the key if the first response was lost). The same key with another body: 422 &#x60;idempotency_key_reused&#x60;; while the first call still runs: 409. &#x60;isTest: true&#x60; creates a test workspace linked to the current production workspace (&#x60;parentWorkspaceId&#x60;), optionally copying its charts (&#x60;copyCharts&#x60;). Written to the audit log of the current workspace (&#x60;workspace.create&#x60; / &#x60;workspace.create_test&#x60;) and, for a production workspace, of the new one. Returns a new &#x60;publicKey&#x60;: not a secret and not a Bearer substitute.
1143
1952
  # @param post_api_workspaces_request [PostApiWorkspacesRequest]
1144
1953
  # @param [Hash] opts the optional parameters
1145
1954
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
1146
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1955
+ # @return [Array<(PostApiWorkspaces200Response, Integer, Hash)>] PostApiWorkspaces200Response data, response status code and response headers
1147
1956
  def post_api_workspaces_with_http_info(post_api_workspaces_request, opts = {})
1148
1957
  if @api_client.config.debugging
1149
1958
  @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspaces ...'
@@ -1168,6 +1977,8 @@ module SeatsChart
1168
1977
 
1169
1978
  # header parameters
1170
1979
  header_params = opts[:header_params] || {}
1980
+ # HTTP header 'Accept' (if needed)
1981
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
1171
1982
  # HTTP header 'Content-Type'
1172
1983
  content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
1173
1984
  if !content_type.nil?
@@ -1182,7 +1993,7 @@ module SeatsChart
1182
1993
  post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_workspaces_request)
1183
1994
 
1184
1995
  # return_type
1185
- return_type = opts[:debug_return_type]
1996
+ return_type = opts[:debug_return_type] || 'PostApiWorkspaces200Response'
1186
1997
 
1187
1998
  # auth_names
1188
1999
  auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
@@ -1205,7 +2016,7 @@ module SeatsChart
1205
2016
  end
1206
2017
 
1207
2018
  # Reactivate a workspace
1208
- # Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`).
2019
+ # Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`). `{workspaceId}` may also be the external id of a workspace you administer (one workspace per organizer).
1209
2020
  # @param workspace_id [String]
1210
2021
  # @param [Hash] opts the optional parameters
1211
2022
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -1216,7 +2027,7 @@ module SeatsChart
1216
2027
  end
1217
2028
 
1218
2029
  # Reactivate a workspace
1219
- # Dashboard session or a **workspace admin API key** (other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 &#x60;workspace_deactivated&#x60; (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 &#x60;own_workspace&#x60;).
2030
+ # Dashboard session or a **workspace admin API key** (other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 &#x60;workspace_deactivated&#x60; (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 &#x60;own_workspace&#x60;). &#x60;{workspaceId}&#x60; may also be the external id of a workspace you administer (one workspace per organizer).
1220
2031
  # @param workspace_id [String]
1221
2032
  # @param [Hash] opts the optional parameters
1222
2033
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -1287,7 +2098,7 @@ module SeatsChart
1287
2098
  end
1288
2099
 
1289
2100
  # Deactivate a workspace
1290
- # Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`). You cannot deactivate your last active workspace (409 `last_active_workspace`).
2101
+ # Dashboard session or a **workspace admin API key** (other API keys: 403 `ERR_PARTNER_SCOPE`); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 `workspace_deactivated` (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 `own_workspace`). `{workspaceId}` may also be the external id of a workspace you administer (one workspace per organizer). You cannot deactivate your last active workspace (409 `last_active_workspace`).
1291
2102
  # @param workspace_id [String]
1292
2103
  # @param [Hash] opts the optional parameters
1293
2104
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -1298,7 +2109,7 @@ module SeatsChart
1298
2109
  end
1299
2110
 
1300
2111
  # Deactivate a workspace
1301
- # Dashboard session or a **workspace admin API key** (other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 &#x60;workspace_deactivated&#x60; (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 &#x60;own_workspace&#x60;). You cannot deactivate your last active workspace (409 &#x60;last_active_workspace&#x60;).
2112
+ # Dashboard session or a **workspace admin API key** (other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;); the caller (for a key: the admin it is bound to) must be an **admin** of the target workspace (403 otherwise, 404 when not a member). Idempotent. A deactivated workspace keeps all its data; its API keys, viewer/embed JWTs and public CDN reads are refused with 403 &#x60;workspace_deactivated&#x60; (effective at once on every API instance through a Redis invalidation message, 5 seconds at most if it is lost), while dashboard members can still sign in so an admin can reactivate it. An admin key cannot deactivate its own workspace (409 &#x60;own_workspace&#x60;). &#x60;{workspaceId}&#x60; may also be the external id of a workspace you administer (one workspace per organizer). You cannot deactivate your last active workspace (409 &#x60;last_active_workspace&#x60;).
1302
2113
  # @param workspace_id [String]
1303
2114
  # @param [Hash] opts the optional parameters
1304
2115
  # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
@@ -1368,6 +2179,99 @@ module SeatsChart
1368
2179
  return data, status_code, headers
1369
2180
  end
1370
2181
 
2182
+ # Delete a workspace
2183
+ # Soft delete: the workspace and every chart, event, order and audit entry stay in the database, but it leaves every list and switcher (including GET /workspaces), its members lose access, and its API keys, embed and viewer tokens and public reads are refused like a deactivated workspace (403 `workspace_deactivated`, at once on every API instance); `X-Workspace-Key` calls to it answer 404. Its sandboxes are deleted with it. It cannot be reactivated from the product (restoring is a support request). Dashboard session, or a **workspace admin API key** (offboarding an organizer; it cannot delete its own workspace: 409 `own_workspace`); other API keys: 403 `ERR_PARTNER_SCOPE`. The caller must be an **admin** of the workspace (403 `ERR_FORBIDDEN_ROLE`; 404 when not a member or already deleted). Send `confirmName` (the workspace name) or `confirmWorkspaceId` (its id); a mismatch answers 400 `confirmation_mismatch`. Refused for the last workspace of a billing account whose paid subscription is active (409 `subscription_active`: cancel it in Billing first), for your only remaining workspace (409 `last_workspace`) and for a sandbox (409 `sandbox_workspace`). When it is the workspace of the calling session, `switchTo` names the workspace to switch to. Written to the audit log (`workspace.delete`) of the deleted workspace and of the one the session switches to.
2184
+ # @param workspace_id [String]
2185
+ # @param post_api_workspaces_by_workspace_id_actions_delete_request [PostApiWorkspacesByWorkspaceIdActionsDeleteRequest]
2186
+ # @param [Hash] opts the optional parameters
2187
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2188
+ # @return [PostApiWorkspacesByWorkspaceIdActionsDelete200Response]
2189
+ def post_api_workspaces_by_workspace_id_actions_delete(workspace_id, post_api_workspaces_by_workspace_id_actions_delete_request, opts = {})
2190
+ data, _status_code, _headers = post_api_workspaces_by_workspace_id_actions_delete_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_actions_delete_request, opts)
2191
+ data
2192
+ end
2193
+
2194
+ # Delete a workspace
2195
+ # Soft delete: the workspace and every chart, event, order and audit entry stay in the database, but it leaves every list and switcher (including GET /workspaces), its members lose access, and its API keys, embed and viewer tokens and public reads are refused like a deactivated workspace (403 &#x60;workspace_deactivated&#x60;, at once on every API instance); &#x60;X-Workspace-Key&#x60; calls to it answer 404. Its sandboxes are deleted with it. It cannot be reactivated from the product (restoring is a support request). Dashboard session, or a **workspace admin API key** (offboarding an organizer; it cannot delete its own workspace: 409 &#x60;own_workspace&#x60;); other API keys: 403 &#x60;ERR_PARTNER_SCOPE&#x60;. The caller must be an **admin** of the workspace (403 &#x60;ERR_FORBIDDEN_ROLE&#x60;; 404 when not a member or already deleted). Send &#x60;confirmName&#x60; (the workspace name) or &#x60;confirmWorkspaceId&#x60; (its id); a mismatch answers 400 &#x60;confirmation_mismatch&#x60;. Refused for the last workspace of a billing account whose paid subscription is active (409 &#x60;subscription_active&#x60;: cancel it in Billing first), for your only remaining workspace (409 &#x60;last_workspace&#x60;) and for a sandbox (409 &#x60;sandbox_workspace&#x60;). When it is the workspace of the calling session, &#x60;switchTo&#x60; names the workspace to switch to. Written to the audit log (&#x60;workspace.delete&#x60;) of the deleted workspace and of the one the session switches to.
2196
+ # @param workspace_id [String]
2197
+ # @param post_api_workspaces_by_workspace_id_actions_delete_request [PostApiWorkspacesByWorkspaceIdActionsDeleteRequest]
2198
+ # @param [Hash] opts the optional parameters
2199
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2200
+ # @return [Array<(PostApiWorkspacesByWorkspaceIdActionsDelete200Response, Integer, Hash)>] PostApiWorkspacesByWorkspaceIdActionsDelete200Response data, response status code and response headers
2201
+ def post_api_workspaces_by_workspace_id_actions_delete_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_actions_delete_request, opts = {})
2202
+ if @api_client.config.debugging
2203
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete ...'
2204
+ end
2205
+ # verify the required parameter 'workspace_id' is set
2206
+ if @api_client.config.client_side_validation && workspace_id.nil?
2207
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete"
2208
+ end
2209
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
2210
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete, the character length must be smaller than or equal to 128.'
2211
+ end
2212
+
2213
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
2214
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete, the character length must be great than or equal to 1.'
2215
+ end
2216
+
2217
+ # verify the required parameter 'post_api_workspaces_by_workspace_id_actions_delete_request' is set
2218
+ if @api_client.config.client_side_validation && post_api_workspaces_by_workspace_id_actions_delete_request.nil?
2219
+ fail ArgumentError, "Missing the required parameter 'post_api_workspaces_by_workspace_id_actions_delete_request' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete"
2220
+ end
2221
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
2222
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete, the character length must be smaller than or equal to 255.'
2223
+ end
2224
+
2225
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
2226
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete, the character length must be great than or equal to 1.'
2227
+ end
2228
+
2229
+ # resource path
2230
+ local_var_path = '/api/workspaces/{workspaceId}/actions/delete'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
2231
+
2232
+ # query parameters
2233
+ query_params = opts[:query_params] || {}
2234
+
2235
+ # header parameters
2236
+ header_params = opts[:header_params] || {}
2237
+ # HTTP header 'Accept' (if needed)
2238
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
2239
+ # HTTP header 'Content-Type'
2240
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
2241
+ if !content_type.nil?
2242
+ header_params['Content-Type'] = content_type
2243
+ end
2244
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2245
+
2246
+ # form parameters
2247
+ form_params = opts[:form_params] || {}
2248
+
2249
+ # http body (model)
2250
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_workspaces_by_workspace_id_actions_delete_request)
2251
+
2252
+ # return_type
2253
+ return_type = opts[:debug_return_type] || 'PostApiWorkspacesByWorkspaceIdActionsDelete200Response'
2254
+
2255
+ # auth_names
2256
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
2257
+
2258
+ new_options = opts.merge(
2259
+ :operation => :"WorkspaceApi.post_api_workspaces_by_workspace_id_actions_delete",
2260
+ :header_params => header_params,
2261
+ :query_params => query_params,
2262
+ :form_params => form_params,
2263
+ :body => post_body,
2264
+ :auth_names => auth_names,
2265
+ :return_type => return_type
2266
+ )
2267
+
2268
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2269
+ if @api_client.config.debugging
2270
+ @api_client.config.logger.debug "API called: WorkspaceApi#post_api_workspaces_by_workspace_id_actions_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2271
+ end
2272
+ return data, status_code, headers
2273
+ end
2274
+
1371
2275
  # Set my default workspace
1372
2276
  # Makes this workspace the default of the calling user (for a **workspace admin API key**: of the admin it is bound to): dashboard sign-in opens it, and `GET /workspaces` marks it `isDefault`. Any role may set a workspace it is a member of (404 otherwise); a deactivated workspace cannot be the default (409 `workspace_deactivated`). Idempotent; written to the audit log of that workspace (`workspace.set_default`). Other API keys: 403 `ERR_PARTNER_SCOPE`.
1373
2277
  # @param workspace_id [String]
@@ -1450,6 +2354,280 @@ module SeatsChart
1450
2354
  return data, status_code, headers
1451
2355
  end
1452
2356
 
2357
+ # Invite a person to a workspace you administer
2358
+ # Gives an organizer's team access to the SeatsChart dashboard of this workspace only (optional per organizer). Same invitation flow and e-mail as the dashboard: a pending invitation (7 days) and a one-time `inviteToken` for the accept link (`/accept-invite?token=…`), returned once so you may send your own e-mail. Accepting creates or joins the account and opens this workspace; the person sees only the workspaces they are a member of. 409 when already a member or invited. Audited (`team.invitation_created`).
2359
+ # @param workspace_id [String] Workspace id or its external id.
2360
+ # @param post_api_workspaces_by_workspace_id_invitations_request [PostApiWorkspacesByWorkspaceIdInvitationsRequest]
2361
+ # @param [Hash] opts the optional parameters
2362
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2363
+ # @return [PostApiWorkspacesByWorkspaceIdInvitations201Response]
2364
+ def post_api_workspaces_by_workspace_id_invitations(workspace_id, post_api_workspaces_by_workspace_id_invitations_request, opts = {})
2365
+ data, _status_code, _headers = post_api_workspaces_by_workspace_id_invitations_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_invitations_request, opts)
2366
+ data
2367
+ end
2368
+
2369
+ # Invite a person to a workspace you administer
2370
+ # Gives an organizer&#39;s team access to the SeatsChart dashboard of this workspace only (optional per organizer). Same invitation flow and e-mail as the dashboard: a pending invitation (7 days) and a one-time &#x60;inviteToken&#x60; for the accept link (&#x60;/accept-invite?token&#x3D;…&#x60;), returned once so you may send your own e-mail. Accepting creates or joins the account and opens this workspace; the person sees only the workspaces they are a member of. 409 when already a member or invited. Audited (&#x60;team.invitation_created&#x60;).
2371
+ # @param workspace_id [String] Workspace id or its external id.
2372
+ # @param post_api_workspaces_by_workspace_id_invitations_request [PostApiWorkspacesByWorkspaceIdInvitationsRequest]
2373
+ # @param [Hash] opts the optional parameters
2374
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2375
+ # @return [Array<(PostApiWorkspacesByWorkspaceIdInvitations201Response, Integer, Hash)>] PostApiWorkspacesByWorkspaceIdInvitations201Response data, response status code and response headers
2376
+ def post_api_workspaces_by_workspace_id_invitations_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_invitations_request, opts = {})
2377
+ if @api_client.config.debugging
2378
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspaces_by_workspace_id_invitations ...'
2379
+ end
2380
+ # verify the required parameter 'workspace_id' is set
2381
+ if @api_client.config.client_side_validation && workspace_id.nil?
2382
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations"
2383
+ end
2384
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
2385
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations, the character length must be smaller than or equal to 128.'
2386
+ end
2387
+
2388
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
2389
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations, the character length must be great than or equal to 1.'
2390
+ end
2391
+
2392
+ # verify the required parameter 'post_api_workspaces_by_workspace_id_invitations_request' is set
2393
+ if @api_client.config.client_side_validation && post_api_workspaces_by_workspace_id_invitations_request.nil?
2394
+ fail ArgumentError, "Missing the required parameter 'post_api_workspaces_by_workspace_id_invitations_request' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations"
2395
+ end
2396
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
2397
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations, the character length must be smaller than or equal to 255.'
2398
+ end
2399
+
2400
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
2401
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_invitations, the character length must be great than or equal to 1.'
2402
+ end
2403
+
2404
+ # resource path
2405
+ local_var_path = '/api/workspaces/{workspaceId}/invitations'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
2406
+
2407
+ # query parameters
2408
+ query_params = opts[:query_params] || {}
2409
+
2410
+ # header parameters
2411
+ header_params = opts[:header_params] || {}
2412
+ # HTTP header 'Accept' (if needed)
2413
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
2414
+ # HTTP header 'Content-Type'
2415
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
2416
+ if !content_type.nil?
2417
+ header_params['Content-Type'] = content_type
2418
+ end
2419
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2420
+
2421
+ # form parameters
2422
+ form_params = opts[:form_params] || {}
2423
+
2424
+ # http body (model)
2425
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_workspaces_by_workspace_id_invitations_request)
2426
+
2427
+ # return_type
2428
+ return_type = opts[:debug_return_type] || 'PostApiWorkspacesByWorkspaceIdInvitations201Response'
2429
+
2430
+ # auth_names
2431
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
2432
+
2433
+ new_options = opts.merge(
2434
+ :operation => :"WorkspaceApi.post_api_workspaces_by_workspace_id_invitations",
2435
+ :header_params => header_params,
2436
+ :query_params => query_params,
2437
+ :form_params => form_params,
2438
+ :body => post_body,
2439
+ :auth_names => auth_names,
2440
+ :return_type => return_type
2441
+ )
2442
+
2443
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2444
+ if @api_client.config.debugging
2445
+ @api_client.config.logger.debug "API called: WorkspaceApi#post_api_workspaces_by_workspace_id_invitations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2446
+ end
2447
+ return data, status_code, headers
2448
+ end
2449
+
2450
+ # Mint an API key in a workspace you administer
2451
+ # An ordinary `sk_live_` key of the workspace (full access by default, or the `scopes` given); the `secret` is returned once and stored as a SHA-256 hash only. Never a workspace admin key (those are minted in the dashboard). Audited in the workspace (`api_key.created`, `via: admin_key` for a workspace admin key). A sandbox answers 409 `sandbox_workspace`.
2452
+ # @param workspace_id [String] Workspace id or its external id.
2453
+ # @param post_api_workspaces_by_workspace_id_keys_request [PostApiWorkspacesByWorkspaceIdKeysRequest]
2454
+ # @param [Hash] opts the optional parameters
2455
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2456
+ # @return [PostApiWorkspacesByWorkspaceIdKeys201Response]
2457
+ def post_api_workspaces_by_workspace_id_keys(workspace_id, post_api_workspaces_by_workspace_id_keys_request, opts = {})
2458
+ data, _status_code, _headers = post_api_workspaces_by_workspace_id_keys_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_keys_request, opts)
2459
+ data
2460
+ end
2461
+
2462
+ # Mint an API key in a workspace you administer
2463
+ # An ordinary &#x60;sk_live_&#x60; key of the workspace (full access by default, or the &#x60;scopes&#x60; given); the &#x60;secret&#x60; is returned once and stored as a SHA-256 hash only. Never a workspace admin key (those are minted in the dashboard). Audited in the workspace (&#x60;api_key.created&#x60;, &#x60;via: admin_key&#x60; for a workspace admin key). A sandbox answers 409 &#x60;sandbox_workspace&#x60;.
2464
+ # @param workspace_id [String] Workspace id or its external id.
2465
+ # @param post_api_workspaces_by_workspace_id_keys_request [PostApiWorkspacesByWorkspaceIdKeysRequest]
2466
+ # @param [Hash] opts the optional parameters
2467
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2468
+ # @return [Array<(PostApiWorkspacesByWorkspaceIdKeys201Response, Integer, Hash)>] PostApiWorkspacesByWorkspaceIdKeys201Response data, response status code and response headers
2469
+ def post_api_workspaces_by_workspace_id_keys_with_http_info(workspace_id, post_api_workspaces_by_workspace_id_keys_request, opts = {})
2470
+ if @api_client.config.debugging
2471
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspaces_by_workspace_id_keys ...'
2472
+ end
2473
+ # verify the required parameter 'workspace_id' is set
2474
+ if @api_client.config.client_side_validation && workspace_id.nil?
2475
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys"
2476
+ end
2477
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
2478
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys, the character length must be smaller than or equal to 128.'
2479
+ end
2480
+
2481
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
2482
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys, the character length must be great than or equal to 1.'
2483
+ end
2484
+
2485
+ # verify the required parameter 'post_api_workspaces_by_workspace_id_keys_request' is set
2486
+ if @api_client.config.client_side_validation && post_api_workspaces_by_workspace_id_keys_request.nil?
2487
+ fail ArgumentError, "Missing the required parameter 'post_api_workspaces_by_workspace_id_keys_request' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys"
2488
+ end
2489
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
2490
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys, the character length must be smaller than or equal to 255.'
2491
+ end
2492
+
2493
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
2494
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys, the character length must be great than or equal to 1.'
2495
+ end
2496
+
2497
+ # resource path
2498
+ local_var_path = '/api/workspaces/{workspaceId}/keys'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s))
2499
+
2500
+ # query parameters
2501
+ query_params = opts[:query_params] || {}
2502
+
2503
+ # header parameters
2504
+ header_params = opts[:header_params] || {}
2505
+ # HTTP header 'Accept' (if needed)
2506
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
2507
+ # HTTP header 'Content-Type'
2508
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
2509
+ if !content_type.nil?
2510
+ header_params['Content-Type'] = content_type
2511
+ end
2512
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2513
+
2514
+ # form parameters
2515
+ form_params = opts[:form_params] || {}
2516
+
2517
+ # http body (model)
2518
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_workspaces_by_workspace_id_keys_request)
2519
+
2520
+ # return_type
2521
+ return_type = opts[:debug_return_type] || 'PostApiWorkspacesByWorkspaceIdKeys201Response'
2522
+
2523
+ # auth_names
2524
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
2525
+
2526
+ new_options = opts.merge(
2527
+ :operation => :"WorkspaceApi.post_api_workspaces_by_workspace_id_keys",
2528
+ :header_params => header_params,
2529
+ :query_params => query_params,
2530
+ :form_params => form_params,
2531
+ :body => post_body,
2532
+ :auth_names => auth_names,
2533
+ :return_type => return_type
2534
+ )
2535
+
2536
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2537
+ if @api_client.config.debugging
2538
+ @api_client.config.logger.debug "API called: WorkspaceApi#post_api_workspaces_by_workspace_id_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2539
+ end
2540
+ return data, status_code, headers
2541
+ end
2542
+
2543
+ # Rotate the secret of a key of a workspace you administer
2544
+ # Issues a new secret for the same key (same id, name and scopes) and returns it once; the old secret stops working at once on every API instance. Workspace admin keys answer 403 `ERR_ADMIN_KEY_DASHBOARD_ONLY`. Audited (`api_key.rotated`).
2545
+ # @param workspace_id [String] Workspace id or its external id.
2546
+ # @param key_id [String]
2547
+ # @param [Hash] opts the optional parameters
2548
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2549
+ # @return [PostApiWorkspacesByWorkspaceIdKeys201Response]
2550
+ def post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate(workspace_id, key_id, opts = {})
2551
+ data, _status_code, _headers = post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate_with_http_info(workspace_id, key_id, opts)
2552
+ data
2553
+ end
2554
+
2555
+ # Rotate the secret of a key of a workspace you administer
2556
+ # Issues a new secret for the same key (same id, name and scopes) and returns it once; the old secret stops working at once on every API instance. Workspace admin keys answer 403 &#x60;ERR_ADMIN_KEY_DASHBOARD_ONLY&#x60;. Audited (&#x60;api_key.rotated&#x60;).
2557
+ # @param workspace_id [String] Workspace id or its external id.
2558
+ # @param key_id [String]
2559
+ # @param [Hash] opts the optional parameters
2560
+ # @option opts [String] :idempotency_key Required on transactional routes. Reuse the same key for every retry of one logical operation; the API replays the stored outcome.
2561
+ # @return [Array<(PostApiWorkspacesByWorkspaceIdKeys201Response, Integer, Hash)>] PostApiWorkspacesByWorkspaceIdKeys201Response data, response status code and response headers
2562
+ def post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate_with_http_info(workspace_id, key_id, opts = {})
2563
+ if @api_client.config.debugging
2564
+ @api_client.config.logger.debug 'Calling API: WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate ...'
2565
+ end
2566
+ # verify the required parameter 'workspace_id' is set
2567
+ if @api_client.config.client_side_validation && workspace_id.nil?
2568
+ fail ArgumentError, "Missing the required parameter 'workspace_id' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate"
2569
+ end
2570
+ if @api_client.config.client_side_validation && workspace_id.to_s.length > 128
2571
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate, the character length must be smaller than or equal to 128.'
2572
+ end
2573
+
2574
+ if @api_client.config.client_side_validation && workspace_id.to_s.length < 1
2575
+ fail ArgumentError, 'invalid value for "workspace_id" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate, the character length must be great than or equal to 1.'
2576
+ end
2577
+
2578
+ # verify the required parameter 'key_id' is set
2579
+ if @api_client.config.client_side_validation && key_id.nil?
2580
+ fail ArgumentError, "Missing the required parameter 'key_id' when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate"
2581
+ end
2582
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
2583
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate, the character length must be smaller than or equal to 255.'
2584
+ end
2585
+
2586
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
2587
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate, the character length must be great than or equal to 1.'
2588
+ end
2589
+
2590
+ # resource path
2591
+ local_var_path = '/api/workspaces/{workspaceId}/keys/{keyId}/actions/rotate'.sub('{' + 'workspaceId' + '}', CGI.escape(workspace_id.to_s)).sub('{' + 'keyId' + '}', CGI.escape(key_id.to_s))
2592
+
2593
+ # query parameters
2594
+ query_params = opts[:query_params] || {}
2595
+
2596
+ # header parameters
2597
+ header_params = opts[:header_params] || {}
2598
+ # HTTP header 'Accept' (if needed)
2599
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
2600
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
2601
+
2602
+ # form parameters
2603
+ form_params = opts[:form_params] || {}
2604
+
2605
+ # http body (model)
2606
+ post_body = opts[:debug_body]
2607
+
2608
+ # return_type
2609
+ return_type = opts[:debug_return_type] || 'PostApiWorkspacesByWorkspaceIdKeys201Response'
2610
+
2611
+ # auth_names
2612
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
2613
+
2614
+ new_options = opts.merge(
2615
+ :operation => :"WorkspaceApi.post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate",
2616
+ :header_params => header_params,
2617
+ :query_params => query_params,
2618
+ :form_params => form_params,
2619
+ :body => post_body,
2620
+ :auth_names => auth_names,
2621
+ :return_type => return_type
2622
+ )
2623
+
2624
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2625
+ if @api_client.config.debugging
2626
+ @api_client.config.logger.debug "API called: WorkspaceApi#post_api_workspaces_by_workspace_id_keys_by_key_id_actions_rotate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2627
+ end
2628
+ return data, status_code, headers
2629
+ end
2630
+
1453
2631
  # Publish selected extraData keys to buyers (or stop)
1454
2632
  # Workspace admins only (dashboard session). Replaces the setting; takes effect within seconds on every API instance (tenant config cache invalidation) and on CDN copies of the public read (max-age 5 s). Audited (`workspace.buyer_extra_data.update`). Object `extraData` is private by default (server, Event Manager, reports). With `enabled` and a non-empty `keys` allow-list (at most 16 keys of letters, digits, `_`, `-`, `.` and `:`), only those keys, with scalar values (strings up to 256 characters, numbers, booleans, null), are published for this workspace's events by `GET /api/public/{publicKey}/events/{eventId}/extra-data` and read by the renderer (rules `match.extraData`, templates `{extraData.key}`, host objects). Never part of the compact state. `resalePriceCents` is never published. The key list is kept while disabled.
1455
2633
  # @param put_api_workspace_buyer_extra_data_request [PutApiWorkspaceBuyerExtraDataRequest]