seatschart 0.2.0 → 0.4.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 (117) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +199 -19
  3. data/lib/seatschart/api/audit_api.rb +2 -2
  4. data/lib/seatschart/api/auth_api.rb +81 -4
  5. data/lib/seatschart/api/billing_api.rb +4 -0
  6. data/lib/seatschart/api/charts_api.rb +810 -77
  7. data/lib/seatschart/api/embed_api.rb +5 -5
  8. data/lib/seatschart/api/embed_origins_api.rb +63 -2
  9. data/lib/seatschart/api/event_log_api.rb +2 -2
  10. data/lib/seatschart/api/events_api.rb +1491 -175
  11. data/lib/seatschart/api/health_api.rb +244 -0
  12. data/lib/seatschart/api/map_designer_api.rb +11 -9
  13. data/lib/seatschart/api/public_api.rb +356 -6
  14. data/lib/seatschart/api/sandboxes_api.rb +672 -0
  15. data/lib/seatschart/api/seasons_api.rb +344 -36
  16. data/lib/seatschart/api/seats_api.rb +10 -10
  17. data/lib/seatschart/api/usage_api.rb +18 -15
  18. data/lib/seatschart/api/webhooks_api.rb +2 -2
  19. data/lib/seatschart/api/workspace_api.rb +1815 -363
  20. data/lib/seatschart/models/api_error.rb +4 -4
  21. data/lib/seatschart/models/delete_api_sandboxes_by_sandbox_id200_response.rb +255 -0
  22. data/lib/seatschart/models/delete_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +237 -0
  23. data/lib/seatschart/models/get_api_monitoring_requests200_response.rb +62 -4
  24. data/lib/seatschart/models/get_api_monitoring_requests200_response_points_inner.rb +21 -4
  25. data/lib/seatschart/models/get_api_sandboxes200_response.rb +239 -0
  26. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner.rb +431 -0
  27. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_rate_limits.rb +270 -0
  28. data/lib/seatschart/models/get_api_sandboxes200_response_items_inner_usage.rb +287 -0
  29. data/lib/seatschart/models/get_api_status200_response.rb +387 -0
  30. data/lib/seatschart/models/get_api_status200_response_components_inner.rb +330 -0
  31. data/lib/seatschart/models/get_api_status200_response_components_inner_days_inner.rb +301 -0
  32. data/lib/seatschart/models/get_api_status200_response_incidents_inner.rb +374 -0
  33. data/lib/seatschart/models/get_api_status200_response_maintenance_inner.rb +350 -0
  34. data/lib/seatschart/models/get_api_status503_response.rb +271 -0
  35. data/lib/seatschart/models/get_api_workspace_buyer_extra_data200_response.rb +241 -0
  36. data/lib/seatschart/models/get_api_workspace_defaults200_response.rb +254 -0
  37. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer.rb +246 -0
  38. data/lib/seatschart/models/get_api_workspace_defaults200_response_renderer_built_in.rb +270 -0
  39. data/lib/seatschart/models/get_api_workspaces200_response_items_inner.rb +80 -5
  40. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response.rb +239 -0
  41. data/lib/seatschart/models/get_api_workspaces_by_workspace_id_keys200_response_api_keys_inner.rb +321 -0
  42. data/lib/seatschart/models/get_api_workspaces_created_by_api_parameter.rb +103 -0
  43. data/lib/seatschart/models/get_api_workspaces_overview_created_by_api_parameter.rb +103 -0
  44. data/lib/seatschart/models/patch_api_events_by_event_id_request.rb +12 -2
  45. data/lib/seatschart/models/patch_api_seasons_by_season_id_request.rb +15 -5
  46. data/lib/seatschart/models/patch_api_workspace_chart_validation_request_severities.rb +25 -4
  47. data/lib/seatschart/models/patch_api_workspace_defaults_request.rb +224 -0
  48. data/lib/seatschart/models/patch_api_workspace_defaults_request_renderer.rb +249 -0
  49. data/lib/seatschart/models/patch_api_workspace_settings_request.rb +6 -6
  50. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id200_response.rb +221 -0
  51. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_keys_by_key_id_request.rb +292 -0
  52. data/lib/seatschart/models/patch_api_workspaces_by_workspace_id_request.rb +288 -0
  53. data/lib/seatschart/models/post_api_auth_new_workspace_request.rb +294 -0
  54. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_copy_to_workspace_request.rb +39 -1
  55. data/lib/seatschart/models/post_api_charts_by_chart_id_actions_validate_request.rb +1 -0
  56. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish422_response_issues_inner.rb +64 -6
  57. data/lib/seatschart/models/post_api_charts_by_chart_id_map_publish_request.rb +1 -1
  58. data/lib/seatschart/models/post_api_embed_tokens_request.rb +18 -15
  59. data/lib/seatschart/models/post_api_embed_tokens_request_safe_mode_options.rb +226 -0
  60. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request.rb +251 -0
  61. data/lib/seatschart/models/post_api_events_actions_edit_for_sale_config_request_events_inner.rb +322 -0
  62. data/lib/seatschart/models/post_api_events_bulk_request_events_inner.rb +42 -1
  63. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request.rb +277 -0
  64. data/lib/seatschart/models/post_api_events_by_event_id_actions_edit_for_sale_config_request_for_sale_inner.rb +319 -0
  65. data/lib/seatschart/models/post_api_events_by_event_id_map_publish_request.rb +215 -0
  66. data/lib/seatschart/models/post_api_events_request.rb +42 -1
  67. data/lib/seatschart/models/{patch_api_events_by_event_id_request_categories_inner.rb → post_api_events_request_categories_inner.rb} +3 -3
  68. data/lib/seatschart/models/post_api_extract_seats200_response.rb +459 -0
  69. data/lib/seatschart/models/post_api_extract_seats200_response_seats_inner.rb +323 -0
  70. data/lib/seatschart/models/post_api_extract_seats200_response_suggested_inner.rb +320 -0
  71. data/lib/seatschart/models/post_api_extract_seats_request.rb +124 -4
  72. data/lib/seatschart/models/post_api_extract_seats_request_examples.rb +105 -0
  73. data/lib/seatschart/models/post_api_extract_seats_request_examples_any_of_inner.rb +293 -0
  74. data/lib/seatschart/models/post_api_extract_seats_request_negatives.rb +105 -0
  75. data/lib/seatschart/models/post_api_extract_seats_request_region.rb +105 -0
  76. data/lib/seatschart/models/{put_api_charts_by_chart_id_map_draft_request.rb → post_api_extract_seats_request_region_any_of.rb} +111 -96
  77. data/lib/seatschart/models/post_api_sandboxes201_response.rb +245 -0
  78. data/lib/seatschart/models/post_api_sandboxes201_response_admin_key.rb +286 -0
  79. data/lib/seatschart/models/post_api_sandboxes201_response_copied.rb +313 -0
  80. data/lib/seatschart/models/post_api_sandboxes201_response_copied_charts_inner.rb +281 -0
  81. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_inner.rb +281 -0
  82. data/lib/seatschart/models/post_api_sandboxes201_response_copied_events_with_own_map_inner.rb +265 -0
  83. data/lib/seatschart/models/post_api_sandboxes201_response_copied_key_conflicts_inner.rb +287 -0
  84. data/lib/seatschart/models/post_api_sandboxes201_response_copied_seasons_inner.rb +312 -0
  85. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production200_response.rb +313 -0
  86. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.rb +255 -0
  87. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_join200_response.rb +271 -0
  88. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset200_response.rb +268 -0
  89. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_actions_reset_request.rb +225 -0
  90. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response.rb +253 -0
  91. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key201_response_api_key.rb +286 -0
  92. data/lib/seatschart/models/post_api_sandboxes_by_sandbox_id_admin_key_request.rb +252 -0
  93. data/lib/seatschart/models/post_api_sandboxes_request.rb +319 -0
  94. data/lib/seatschart/models/post_api_seasons_request.rb +14 -4
  95. data/lib/seatschart/models/post_api_seats_confirm_request.rb +5 -5
  96. data/lib/seatschart/models/post_api_seats_release_request.rb +5 -5
  97. data/lib/seatschart/models/post_api_seats_reserve_request.rb +5 -5
  98. data/lib/seatschart/models/post_api_workspaces200_response.rb +468 -0
  99. data/lib/seatschart/models/post_api_workspaces200_response_api_key.rb +332 -0
  100. data/lib/seatschart/models/post_api_workspaces200_response_template.rb +260 -0
  101. data/lib/seatschart/models/post_api_workspaces200_response_template_webhooks_inner.rb +284 -0
  102. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete200_response.rb +319 -0
  103. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_actions_delete_request.rb +281 -0
  104. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_invitations_request.rb +300 -0
  105. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response.rb +237 -0
  106. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys201_response_api_key.rb +338 -0
  107. data/lib/seatschart/models/post_api_workspaces_by_workspace_id_keys_request.rb +299 -0
  108. data/lib/seatschart/models/post_api_workspaces_request.rb +101 -5
  109. data/lib/seatschart/models/post_api_workspaces_request_issue_key.rb +294 -0
  110. data/lib/seatschart/models/put_api_workspace_buyer_extra_data_request.rb +260 -0
  111. data/lib/seatschart/models/put_internal_status_notices_request.rb +242 -0
  112. data/lib/seatschart/models/put_internal_status_notices_request_notices_inner.rb +445 -0
  113. data/lib/seatschart/retry.rb +106 -7
  114. data/lib/seatschart/version.rb +1 -1
  115. data/lib/seatschart.rb +73 -3
  116. metadata +75 -5
  117. data/lib/seatschart/api/default_api.rb +0 -763
@@ -0,0 +1,672 @@
1
+ =begin
2
+ #SeatsChart API
3
+
4
+ #Seat inventory and locking API for B2B2C integrations. Authenticate using `x-api-key` (partners) or `Authorization: Bearer` with an HS256 JWT.
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.11.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module SeatsChart
16
+ class SandboxesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Delete a sandbox
23
+ # Deletes the sandbox for good in one transaction: its data (as a reset) and its configuration (API keys, webhooks, members, invitations, embed domains). Its keys and sessions stop working at once; members whose default workspace it was default to this workspace. Unlike production workspaces (soft delete), a sandbox is hard-deleted. Irreversible. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
24
+ # @param sandbox_id [String]
25
+ # @param [Hash] opts the optional parameters
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.
27
+ # @return [DeleteApiSandboxesBySandboxId200Response]
28
+ def delete_api_sandboxes_by_sandbox_id(sandbox_id, opts = {})
29
+ data, _status_code, _headers = delete_api_sandboxes_by_sandbox_id_with_http_info(sandbox_id, opts)
30
+ data
31
+ end
32
+
33
+ # Delete a sandbox
34
+ # Deletes the sandbox for good in one transaction: its data (as a reset) and its configuration (API keys, webhooks, members, invitations, embed domains). Its keys and sessions stop working at once; members whose default workspace it was default to this workspace. Unlike production workspaces (soft delete), a sandbox is hard-deleted. Irreversible. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
35
+ # @param sandbox_id [String]
36
+ # @param [Hash] opts the optional parameters
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.
38
+ # @return [Array<(DeleteApiSandboxesBySandboxId200Response, Integer, Hash)>] DeleteApiSandboxesBySandboxId200Response data, response status code and response headers
39
+ def delete_api_sandboxes_by_sandbox_id_with_http_info(sandbox_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.delete_api_sandboxes_by_sandbox_id ...'
42
+ end
43
+ # verify the required parameter 'sandbox_id' is set
44
+ if @api_client.config.client_side_validation && sandbox_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.delete_api_sandboxes_by_sandbox_id"
46
+ end
47
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
48
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.delete_api_sandboxes_by_sandbox_id, the character length must be smaller than or equal to 128.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
52
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.delete_api_sandboxes_by_sandbox_id, the character length must be great than or equal to 1.'
53
+ end
54
+
55
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
56
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.delete_api_sandboxes_by_sandbox_id, the character length must be smaller than or equal to 255.'
57
+ end
58
+
59
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
60
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.delete_api_sandboxes_by_sandbox_id, the character length must be great than or equal to 1.'
61
+ end
62
+
63
+ # resource path
64
+ local_var_path = '/api/sandboxes/{sandboxId}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
73
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
74
+
75
+ # form parameters
76
+ form_params = opts[:form_params] || {}
77
+
78
+ # http body (model)
79
+ post_body = opts[:debug_body]
80
+
81
+ # return_type
82
+ return_type = opts[:debug_return_type] || 'DeleteApiSandboxesBySandboxId200Response'
83
+
84
+ # auth_names
85
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
86
+
87
+ new_options = opts.merge(
88
+ :operation => :"SandboxesApi.delete_api_sandboxes_by_sandbox_id",
89
+ :header_params => header_params,
90
+ :query_params => query_params,
91
+ :form_params => form_params,
92
+ :body => post_body,
93
+ :auth_names => auth_names,
94
+ :return_type => return_type
95
+ )
96
+
97
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
98
+ if @api_client.config.debugging
99
+ @api_client.config.logger.debug "API called: SandboxesApi#delete_api_sandboxes_by_sandbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
100
+ end
101
+ return data, status_code, headers
102
+ end
103
+
104
+ # List the sandboxes of this workspace
105
+ # Sandboxes of the calling production workspace (oldest first) with this month's usage (shown, never billed) and the rate limits they run at. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [GetApiSandboxes200Response]
108
+ def get_api_sandboxes(opts = {})
109
+ data, _status_code, _headers = get_api_sandboxes_with_http_info(opts)
110
+ data
111
+ end
112
+
113
+ # List the sandboxes of this workspace
114
+ # Sandboxes of the calling production workspace (oldest first) with this month&#39;s usage (shown, never billed) and the rate limits they run at. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
115
+ # @param [Hash] opts the optional parameters
116
+ # @return [Array<(GetApiSandboxes200Response, Integer, Hash)>] GetApiSandboxes200Response data, response status code and response headers
117
+ def get_api_sandboxes_with_http_info(opts = {})
118
+ if @api_client.config.debugging
119
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.get_api_sandboxes ...'
120
+ end
121
+ # resource path
122
+ local_var_path = '/api/sandboxes'
123
+
124
+ # query parameters
125
+ query_params = opts[:query_params] || {}
126
+
127
+ # header parameters
128
+ header_params = opts[:header_params] || {}
129
+ # HTTP header 'Accept' (if needed)
130
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:debug_body]
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'GetApiSandboxes200Response'
140
+
141
+ # auth_names
142
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
143
+
144
+ new_options = opts.merge(
145
+ :operation => :"SandboxesApi.get_api_sandboxes",
146
+ :header_params => header_params,
147
+ :query_params => query_params,
148
+ :form_params => form_params,
149
+ :body => post_body,
150
+ :auth_names => auth_names,
151
+ :return_type => return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: SandboxesApi#get_api_sandboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ return data, status_code, headers
159
+ end
160
+
161
+ # Get a sandbox
162
+ # One sandbox of this workspace (404 for any other id). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
163
+ # @param sandbox_id [String]
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [GetApiSandboxes200ResponseItemsInner]
166
+ def get_api_sandboxes_by_sandbox_id(sandbox_id, opts = {})
167
+ data, _status_code, _headers = get_api_sandboxes_by_sandbox_id_with_http_info(sandbox_id, opts)
168
+ data
169
+ end
170
+
171
+ # Get a sandbox
172
+ # One sandbox of this workspace (404 for any other id). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
173
+ # @param sandbox_id [String]
174
+ # @param [Hash] opts the optional parameters
175
+ # @return [Array<(GetApiSandboxes200ResponseItemsInner, Integer, Hash)>] GetApiSandboxes200ResponseItemsInner data, response status code and response headers
176
+ def get_api_sandboxes_by_sandbox_id_with_http_info(sandbox_id, opts = {})
177
+ if @api_client.config.debugging
178
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.get_api_sandboxes_by_sandbox_id ...'
179
+ end
180
+ # verify the required parameter 'sandbox_id' is set
181
+ if @api_client.config.client_side_validation && sandbox_id.nil?
182
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.get_api_sandboxes_by_sandbox_id"
183
+ end
184
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
185
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.get_api_sandboxes_by_sandbox_id, the character length must be smaller than or equal to 128.'
186
+ end
187
+
188
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
189
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.get_api_sandboxes_by_sandbox_id, the character length must be great than or equal to 1.'
190
+ end
191
+
192
+ # resource path
193
+ local_var_path = '/api/sandboxes/{sandboxId}'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
194
+
195
+ # query parameters
196
+ query_params = opts[:query_params] || {}
197
+
198
+ # header parameters
199
+ header_params = opts[:header_params] || {}
200
+ # HTTP header 'Accept' (if needed)
201
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
202
+
203
+ # form parameters
204
+ form_params = opts[:form_params] || {}
205
+
206
+ # http body (model)
207
+ post_body = opts[:debug_body]
208
+
209
+ # return_type
210
+ return_type = opts[:debug_return_type] || 'GetApiSandboxes200ResponseItemsInner'
211
+
212
+ # auth_names
213
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
214
+
215
+ new_options = opts.merge(
216
+ :operation => :"SandboxesApi.get_api_sandboxes_by_sandbox_id",
217
+ :header_params => header_params,
218
+ :query_params => query_params,
219
+ :form_params => form_params,
220
+ :body => post_body,
221
+ :auth_names => auth_names,
222
+ :return_type => return_type
223
+ )
224
+
225
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: SandboxesApi#get_api_sandboxes_by_sandbox_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+
232
+ # Create a sandbox
233
+ # Creates an isolated sandbox of this workspace: a workspace of its own (`kind: sandbox`) with its own charts, events, seasons, holds, orders, ticket buyer ids, webhooks and API keys (`sk_test_…`). It is never billed: its usage is shown but not counted against the plan, it has no chart or event caps, webhooks are marked sandbox, billing emails are suppressed and other emails are marked, and buyers see a small Sandbox ribbon. Every member of this workspace becomes a member with the same role, and the team keeps following: members who join later get access with their role, role changes apply and members removed from this workspace lose its sandboxes. At most 10 per workspace (409 `sandbox_limit_reached`). Optionally copies charts (and their events). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
234
+ # @param post_api_sandboxes_request [PostApiSandboxesRequest]
235
+ # @param [Hash] opts the optional parameters
236
+ # @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.
237
+ # @return [PostApiSandboxes201Response]
238
+ def post_api_sandboxes(post_api_sandboxes_request, opts = {})
239
+ data, _status_code, _headers = post_api_sandboxes_with_http_info(post_api_sandboxes_request, opts)
240
+ data
241
+ end
242
+
243
+ # Create a sandbox
244
+ # Creates an isolated sandbox of this workspace: a workspace of its own (&#x60;kind: sandbox&#x60;) with its own charts, events, seasons, holds, orders, ticket buyer ids, webhooks and API keys (&#x60;sk_test_…&#x60;). It is never billed: its usage is shown but not counted against the plan, it has no chart or event caps, webhooks are marked sandbox, billing emails are suppressed and other emails are marked, and buyers see a small Sandbox ribbon. Every member of this workspace becomes a member with the same role, and the team keeps following: members who join later get access with their role, role changes apply and members removed from this workspace lose its sandboxes. At most 10 per workspace (409 &#x60;sandbox_limit_reached&#x60;). Optionally copies charts (and their events). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
245
+ # @param post_api_sandboxes_request [PostApiSandboxesRequest]
246
+ # @param [Hash] opts the optional parameters
247
+ # @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.
248
+ # @return [Array<(PostApiSandboxes201Response, Integer, Hash)>] PostApiSandboxes201Response data, response status code and response headers
249
+ def post_api_sandboxes_with_http_info(post_api_sandboxes_request, opts = {})
250
+ if @api_client.config.debugging
251
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.post_api_sandboxes ...'
252
+ end
253
+ # verify the required parameter 'post_api_sandboxes_request' is set
254
+ if @api_client.config.client_side_validation && post_api_sandboxes_request.nil?
255
+ fail ArgumentError, "Missing the required parameter 'post_api_sandboxes_request' when calling SandboxesApi.post_api_sandboxes"
256
+ end
257
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
258
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes, the character length must be smaller than or equal to 255.'
259
+ end
260
+
261
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
262
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes, the character length must be great than or equal to 1.'
263
+ end
264
+
265
+ # resource path
266
+ local_var_path = '/api/sandboxes'
267
+
268
+ # query parameters
269
+ query_params = opts[:query_params] || {}
270
+
271
+ # header parameters
272
+ header_params = opts[:header_params] || {}
273
+ # HTTP header 'Accept' (if needed)
274
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
275
+ # HTTP header 'Content-Type'
276
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
277
+ if !content_type.nil?
278
+ header_params['Content-Type'] = content_type
279
+ end
280
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
281
+
282
+ # form parameters
283
+ form_params = opts[:form_params] || {}
284
+
285
+ # http body (model)
286
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_sandboxes_request)
287
+
288
+ # return_type
289
+ return_type = opts[:debug_return_type] || 'PostApiSandboxes201Response'
290
+
291
+ # auth_names
292
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
293
+
294
+ new_options = opts.merge(
295
+ :operation => :"SandboxesApi.post_api_sandboxes",
296
+ :header_params => header_params,
297
+ :query_params => query_params,
298
+ :form_params => form_params,
299
+ :body => post_body,
300
+ :auth_names => auth_names,
301
+ :return_type => return_type
302
+ )
303
+
304
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug "API called: SandboxesApi#post_api_sandboxes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
307
+ end
308
+ return data, status_code, headers
309
+ end
310
+
311
+ # Copy charts (and events) from production into a sandbox
312
+ # Copies charts of this workspace into the sandbox (the WP18 cross-workspace copy): a published chart becomes a published copy with fresh object ids, a draft-only chart a draft; tags travel with them. With `includeEvents`, the events of each published chart are copied too, with their for-sale configuration and every object available. Chart and event keys are kept when the sandbox does not use them yet (`keyConflicts` lists the others, copied without a key), so the same integration code runs against both workspaces. Sandbox copies never share ids or secrets with production. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
313
+ # @param sandbox_id [String]
314
+ # @param post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request [PostApiSandboxesBySandboxIdActionsCopyFromProductionRequest]
315
+ # @param [Hash] opts the optional parameters
316
+ # @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.
317
+ # @return [PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response]
318
+ def post_api_sandboxes_by_sandbox_id_actions_copy_from_production(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request, opts = {})
319
+ data, _status_code, _headers = post_api_sandboxes_by_sandbox_id_actions_copy_from_production_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request, opts)
320
+ data
321
+ end
322
+
323
+ # Copy charts (and events) from production into a sandbox
324
+ # Copies charts of this workspace into the sandbox (the WP18 cross-workspace copy): a published chart becomes a published copy with fresh object ids, a draft-only chart a draft; tags travel with them. With &#x60;includeEvents&#x60;, the events of each published chart are copied too, with their for-sale configuration and every object available. Chart and event keys are kept when the sandbox does not use them yet (&#x60;keyConflicts&#x60; lists the others, copied without a key), so the same integration code runs against both workspaces. Sandbox copies never share ids or secrets with production. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
325
+ # @param sandbox_id [String]
326
+ # @param post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request [PostApiSandboxesBySandboxIdActionsCopyFromProductionRequest]
327
+ # @param [Hash] opts the optional parameters
328
+ # @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.
329
+ # @return [Array<(PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response, Integer, Hash)>] PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response data, response status code and response headers
330
+ def post_api_sandboxes_by_sandbox_id_actions_copy_from_production_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request, opts = {})
331
+ if @api_client.config.debugging
332
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production ...'
333
+ end
334
+ # verify the required parameter 'sandbox_id' is set
335
+ if @api_client.config.client_side_validation && sandbox_id.nil?
336
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production"
337
+ end
338
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
339
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production, the character length must be smaller than or equal to 128.'
340
+ end
341
+
342
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
343
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production, the character length must be great than or equal to 1.'
344
+ end
345
+
346
+ # verify the required parameter 'post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request' is set
347
+ if @api_client.config.client_side_validation && post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request.nil?
348
+ fail ArgumentError, "Missing the required parameter 'post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production"
349
+ end
350
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
351
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production, the character length must be smaller than or equal to 255.'
352
+ end
353
+
354
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
355
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production, the character length must be great than or equal to 1.'
356
+ end
357
+
358
+ # resource path
359
+ local_var_path = '/api/sandboxes/{sandboxId}/actions/copy-from-production'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
360
+
361
+ # query parameters
362
+ query_params = opts[:query_params] || {}
363
+
364
+ # header parameters
365
+ header_params = opts[:header_params] || {}
366
+ # HTTP header 'Accept' (if needed)
367
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
368
+ # HTTP header 'Content-Type'
369
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
370
+ if !content_type.nil?
371
+ header_params['Content-Type'] = content_type
372
+ end
373
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
374
+
375
+ # form parameters
376
+ form_params = opts[:form_params] || {}
377
+
378
+ # http body (model)
379
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_sandboxes_by_sandbox_id_actions_copy_from_production_request)
380
+
381
+ # return_type
382
+ return_type = opts[:debug_return_type] || 'PostApiSandboxesBySandboxIdActionsCopyFromProduction200Response'
383
+
384
+ # auth_names
385
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
386
+
387
+ new_options = opts.merge(
388
+ :operation => :"SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_copy_from_production",
389
+ :header_params => header_params,
390
+ :query_params => query_params,
391
+ :form_params => form_params,
392
+ :body => post_body,
393
+ :auth_names => auth_names,
394
+ :return_type => return_type
395
+ )
396
+
397
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug "API called: SandboxesApi#post_api_sandboxes_by_sandbox_id_actions_copy_from_production\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
400
+ end
401
+ return data, status_code, headers
402
+ end
403
+
404
+ # Join a sandbox (dashboard)
405
+ # Adds the calling admin of the production workspace to one of its sandboxes (as admin; an existing membership is kept) so they can switch to it. Members are also added automatically (listing or reading sandboxes, and accepting an invitation), so this is rarely needed. Dashboard sessions only.
406
+ # @param sandbox_id [String]
407
+ # @param [Hash] opts the optional parameters
408
+ # @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.
409
+ # @return [PostApiSandboxesBySandboxIdActionsJoin200Response]
410
+ def post_api_sandboxes_by_sandbox_id_actions_join(sandbox_id, opts = {})
411
+ data, _status_code, _headers = post_api_sandboxes_by_sandbox_id_actions_join_with_http_info(sandbox_id, opts)
412
+ data
413
+ end
414
+
415
+ # Join a sandbox (dashboard)
416
+ # Adds the calling admin of the production workspace to one of its sandboxes (as admin; an existing membership is kept) so they can switch to it. Members are also added automatically (listing or reading sandboxes, and accepting an invitation), so this is rarely needed. Dashboard sessions only.
417
+ # @param sandbox_id [String]
418
+ # @param [Hash] opts the optional parameters
419
+ # @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.
420
+ # @return [Array<(PostApiSandboxesBySandboxIdActionsJoin200Response, Integer, Hash)>] PostApiSandboxesBySandboxIdActionsJoin200Response data, response status code and response headers
421
+ def post_api_sandboxes_by_sandbox_id_actions_join_with_http_info(sandbox_id, opts = {})
422
+ if @api_client.config.debugging
423
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join ...'
424
+ end
425
+ # verify the required parameter 'sandbox_id' is set
426
+ if @api_client.config.client_side_validation && sandbox_id.nil?
427
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join"
428
+ end
429
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
430
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join, the character length must be smaller than or equal to 128.'
431
+ end
432
+
433
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
434
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join, the character length must be great than or equal to 1.'
435
+ end
436
+
437
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
438
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join, the character length must be smaller than or equal to 255.'
439
+ end
440
+
441
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
442
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join, the character length must be great than or equal to 1.'
443
+ end
444
+
445
+ # resource path
446
+ local_var_path = '/api/sandboxes/{sandboxId}/actions/join'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
447
+
448
+ # query parameters
449
+ query_params = opts[:query_params] || {}
450
+
451
+ # header parameters
452
+ header_params = opts[:header_params] || {}
453
+ # HTTP header 'Accept' (if needed)
454
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
455
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
456
+
457
+ # form parameters
458
+ form_params = opts[:form_params] || {}
459
+
460
+ # http body (model)
461
+ post_body = opts[:debug_body]
462
+
463
+ # return_type
464
+ return_type = opts[:debug_return_type] || 'PostApiSandboxesBySandboxIdActionsJoin200Response'
465
+
466
+ # auth_names
467
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
468
+
469
+ new_options = opts.merge(
470
+ :operation => :"SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_join",
471
+ :header_params => header_params,
472
+ :query_params => query_params,
473
+ :form_params => form_params,
474
+ :body => post_body,
475
+ :auth_names => auth_names,
476
+ :return_type => return_type
477
+ )
478
+
479
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
480
+ if @api_client.config.debugging
481
+ @api_client.config.logger.debug "API called: SandboxesApi#post_api_sandboxes_by_sandbox_id_actions_join\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
482
+ end
483
+ return data, status_code, headers
484
+ end
485
+
486
+ # Reset a sandbox
487
+ # Deletes **all data** of the sandbox in one transaction (all or nothing): orders, bookings, holds, events with their inventory, seasons, charts, listings, ticket buyer ids, usage, webhook deliveries and its audit log; live holds are cleared from the cache. Members, settings, the public key, embed domains, API keys (unless `rotateKeys`) and webhook endpoints (unless `keepWebhooks: false`) stay. A concurrent confirmation either commits before the reset (and is deleted) or fails after it. Irreversible. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
488
+ # @param sandbox_id [String]
489
+ # @param post_api_sandboxes_by_sandbox_id_actions_reset_request [PostApiSandboxesBySandboxIdActionsResetRequest]
490
+ # @param [Hash] opts the optional parameters
491
+ # @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.
492
+ # @return [PostApiSandboxesBySandboxIdActionsReset200Response]
493
+ def post_api_sandboxes_by_sandbox_id_actions_reset(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_reset_request, opts = {})
494
+ data, _status_code, _headers = post_api_sandboxes_by_sandbox_id_actions_reset_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_reset_request, opts)
495
+ data
496
+ end
497
+
498
+ # Reset a sandbox
499
+ # Deletes **all data** of the sandbox in one transaction (all or nothing): orders, bookings, holds, events with their inventory, seasons, charts, listings, ticket buyer ids, usage, webhook deliveries and its audit log; live holds are cleared from the cache. Members, settings, the public key, embed domains, API keys (unless &#x60;rotateKeys&#x60;) and webhook endpoints (unless &#x60;keepWebhooks: false&#x60;) stay. A concurrent confirmation either commits before the reset (and is deleted) or fails after it. Irreversible. Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
500
+ # @param sandbox_id [String]
501
+ # @param post_api_sandboxes_by_sandbox_id_actions_reset_request [PostApiSandboxesBySandboxIdActionsResetRequest]
502
+ # @param [Hash] opts the optional parameters
503
+ # @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.
504
+ # @return [Array<(PostApiSandboxesBySandboxIdActionsReset200Response, Integer, Hash)>] PostApiSandboxesBySandboxIdActionsReset200Response data, response status code and response headers
505
+ def post_api_sandboxes_by_sandbox_id_actions_reset_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_actions_reset_request, opts = {})
506
+ if @api_client.config.debugging
507
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset ...'
508
+ end
509
+ # verify the required parameter 'sandbox_id' is set
510
+ if @api_client.config.client_side_validation && sandbox_id.nil?
511
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset"
512
+ end
513
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
514
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset, the character length must be smaller than or equal to 128.'
515
+ end
516
+
517
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
518
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset, the character length must be great than or equal to 1.'
519
+ end
520
+
521
+ # verify the required parameter 'post_api_sandboxes_by_sandbox_id_actions_reset_request' is set
522
+ if @api_client.config.client_side_validation && post_api_sandboxes_by_sandbox_id_actions_reset_request.nil?
523
+ fail ArgumentError, "Missing the required parameter 'post_api_sandboxes_by_sandbox_id_actions_reset_request' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset"
524
+ end
525
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
526
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset, the character length must be smaller than or equal to 255.'
527
+ end
528
+
529
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
530
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset, the character length must be great than or equal to 1.'
531
+ end
532
+
533
+ # resource path
534
+ local_var_path = '/api/sandboxes/{sandboxId}/actions/reset'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
535
+
536
+ # query parameters
537
+ query_params = opts[:query_params] || {}
538
+
539
+ # header parameters
540
+ header_params = opts[:header_params] || {}
541
+ # HTTP header 'Accept' (if needed)
542
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
543
+ # HTTP header 'Content-Type'
544
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
545
+ if !content_type.nil?
546
+ header_params['Content-Type'] = content_type
547
+ end
548
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
549
+
550
+ # form parameters
551
+ form_params = opts[:form_params] || {}
552
+
553
+ # http body (model)
554
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_sandboxes_by_sandbox_id_actions_reset_request)
555
+
556
+ # return_type
557
+ return_type = opts[:debug_return_type] || 'PostApiSandboxesBySandboxIdActionsReset200Response'
558
+
559
+ # auth_names
560
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
561
+
562
+ new_options = opts.merge(
563
+ :operation => :"SandboxesApi.post_api_sandboxes_by_sandbox_id_actions_reset",
564
+ :header_params => header_params,
565
+ :query_params => query_params,
566
+ :form_params => form_params,
567
+ :body => post_body,
568
+ :auth_names => auth_names,
569
+ :return_type => return_type
570
+ )
571
+
572
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
573
+ if @api_client.config.debugging
574
+ @api_client.config.logger.debug "API called: SandboxesApi#post_api_sandboxes_by_sandbox_id_actions_reset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
575
+ end
576
+ return data, status_code, headers
577
+ end
578
+
579
+ # Create or rotate the sandbox admin key
580
+ # Mints a full-access `sk_test_…` key of the sandbox (secret returned once). It works only inside the sandbox: it can never read or change this workspace, another sandbox, or manage workspaces. `revokeExisting: true` rotates (revokes the other keys at once). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (`read` reads; changes need a full-access key). Sandbox keys and sessions get 403 `ERR_SANDBOX_SCOPE`: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
581
+ # @param sandbox_id [String]
582
+ # @param post_api_sandboxes_by_sandbox_id_admin_key_request [PostApiSandboxesBySandboxIdAdminKeyRequest]
583
+ # @param [Hash] opts the optional parameters
584
+ # @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.
585
+ # @return [PostApiSandboxesBySandboxIdAdminKey201Response]
586
+ def post_api_sandboxes_by_sandbox_id_admin_key(sandbox_id, post_api_sandboxes_by_sandbox_id_admin_key_request, opts = {})
587
+ data, _status_code, _headers = post_api_sandboxes_by_sandbox_id_admin_key_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_admin_key_request, opts)
588
+ data
589
+ end
590
+
591
+ # Create or rotate the sandbox admin key
592
+ # Mints a full-access &#x60;sk_test_…&#x60; key of the sandbox (secret returned once). It works only inside the sandbox: it can never read or change this workspace, another sandbox, or manage workspaces. &#x60;revokeExisting: true&#x60; rotates (revokes the other keys at once). Callers: a dashboard session of the **production** workspace (any member reads; admins change) or an API key of it (&#x60;read&#x60; reads; changes need a full-access key). Sandbox keys and sessions get 403 &#x60;ERR_SANDBOX_SCOPE&#x60;: a sandbox can never act on its production workspace or on another sandbox, and production keys never work inside a sandbox (each workspace has its own keys).
593
+ # @param sandbox_id [String]
594
+ # @param post_api_sandboxes_by_sandbox_id_admin_key_request [PostApiSandboxesBySandboxIdAdminKeyRequest]
595
+ # @param [Hash] opts the optional parameters
596
+ # @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.
597
+ # @return [Array<(PostApiSandboxesBySandboxIdAdminKey201Response, Integer, Hash)>] PostApiSandboxesBySandboxIdAdminKey201Response data, response status code and response headers
598
+ def post_api_sandboxes_by_sandbox_id_admin_key_with_http_info(sandbox_id, post_api_sandboxes_by_sandbox_id_admin_key_request, opts = {})
599
+ if @api_client.config.debugging
600
+ @api_client.config.logger.debug 'Calling API: SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key ...'
601
+ end
602
+ # verify the required parameter 'sandbox_id' is set
603
+ if @api_client.config.client_side_validation && sandbox_id.nil?
604
+ fail ArgumentError, "Missing the required parameter 'sandbox_id' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key"
605
+ end
606
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length > 128
607
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key, the character length must be smaller than or equal to 128.'
608
+ end
609
+
610
+ if @api_client.config.client_side_validation && sandbox_id.to_s.length < 1
611
+ fail ArgumentError, 'invalid value for "sandbox_id" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key, the character length must be great than or equal to 1.'
612
+ end
613
+
614
+ # verify the required parameter 'post_api_sandboxes_by_sandbox_id_admin_key_request' is set
615
+ if @api_client.config.client_side_validation && post_api_sandboxes_by_sandbox_id_admin_key_request.nil?
616
+ fail ArgumentError, "Missing the required parameter 'post_api_sandboxes_by_sandbox_id_admin_key_request' when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key"
617
+ end
618
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length > 255
619
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key, the character length must be smaller than or equal to 255.'
620
+ end
621
+
622
+ if @api_client.config.client_side_validation && !opts[:'idempotency_key'].nil? && opts[:'idempotency_key'].to_s.length < 1
623
+ fail ArgumentError, 'invalid value for "opts[:"idempotency_key"]" when calling SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key, the character length must be great than or equal to 1.'
624
+ end
625
+
626
+ # resource path
627
+ local_var_path = '/api/sandboxes/{sandboxId}/admin-key'.sub('{' + 'sandboxId' + '}', CGI.escape(sandbox_id.to_s))
628
+
629
+ # query parameters
630
+ query_params = opts[:query_params] || {}
631
+
632
+ # header parameters
633
+ header_params = opts[:header_params] || {}
634
+ # HTTP header 'Accept' (if needed)
635
+ header_params['Accept'] = @api_client.select_header_accept(['application/json', 'multipart/form-data', 'text/plain']) unless header_params['Accept']
636
+ # HTTP header 'Content-Type'
637
+ content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data', 'text/plain'])
638
+ if !content_type.nil?
639
+ header_params['Content-Type'] = content_type
640
+ end
641
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
642
+
643
+ # form parameters
644
+ form_params = opts[:form_params] || {}
645
+
646
+ # http body (model)
647
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(post_api_sandboxes_by_sandbox_id_admin_key_request)
648
+
649
+ # return_type
650
+ return_type = opts[:debug_return_type] || 'PostApiSandboxesBySandboxIdAdminKey201Response'
651
+
652
+ # auth_names
653
+ auth_names = opts[:debug_auth_names] || ['ApiKeyAuth', 'BearerAuth']
654
+
655
+ new_options = opts.merge(
656
+ :operation => :"SandboxesApi.post_api_sandboxes_by_sandbox_id_admin_key",
657
+ :header_params => header_params,
658
+ :query_params => query_params,
659
+ :form_params => form_params,
660
+ :body => post_body,
661
+ :auth_names => auth_names,
662
+ :return_type => return_type
663
+ )
664
+
665
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
666
+ if @api_client.config.debugging
667
+ @api_client.config.logger.debug "API called: SandboxesApi#post_api_sandboxes_by_sandbox_id_admin_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
668
+ end
669
+ return data, status_code, headers
670
+ end
671
+ end
672
+ end