cbox_billing 0.1.0 → 0.2.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cbox_billing/api/checkout_portal_api.rb +214 -0
  3. data/lib/cbox_billing/api/coupons_api.rb +55 -55
  4. data/lib/cbox_billing/api/experiments_api.rb +526 -0
  5. data/lib/cbox_billing/api/organizations_api.rb +554 -0
  6. data/lib/cbox_billing/api/pricing_tables_api.rb +519 -0
  7. data/lib/cbox_billing/api/retention_api.rb +884 -0
  8. data/lib/cbox_billing/api/sellers_api.rb +590 -0
  9. data/lib/cbox_billing/models/checkout_link.rb +283 -0
  10. data/lib/cbox_billing/models/conclude_experiment_request.rb +161 -0
  11. data/lib/cbox_billing/models/create_checkout_link_request.rb +178 -0
  12. data/lib/cbox_billing/models/customer_lifecycle_refusal.rb +238 -0
  13. data/lib/cbox_billing/models/customer_lifecycle_state.rb +268 -0
  14. data/lib/cbox_billing/models/delete_experiment200_response.rb +227 -0
  15. data/lib/cbox_billing/models/delete_organization200_response.rb +227 -0
  16. data/lib/cbox_billing/models/experiment.rb +387 -0
  17. data/lib/cbox_billing/models/experiment_input.rb +410 -0
  18. data/lib/cbox_billing/models/experiment_input_variants_inner.rb +233 -0
  19. data/lib/cbox_billing/models/experiment_variant.rb +266 -0
  20. data/lib/cbox_billing/models/list_checkout_links200_response.rb +179 -0
  21. data/lib/cbox_billing/models/list_checkout_links200_response_data_inner.rb +223 -0
  22. data/lib/cbox_billing/models/list_experiments200_response.rb +179 -0
  23. data/lib/cbox_billing/models/list_pricing_tables200_response.rb +179 -0
  24. data/lib/cbox_billing/models/list_retention_offers200_response.rb +179 -0
  25. data/lib/cbox_billing/models/list_retention_reasons200_response.rb +179 -0
  26. data/lib/cbox_billing/models/list_sellers200_response.rb +179 -0
  27. data/lib/cbox_billing/models/merge_organization_request.rb +221 -0
  28. data/lib/cbox_billing/models/merge_organization_request_fields.rb +279 -0
  29. data/lib/cbox_billing/models/preview_organization_merge200_response.rb +343 -0
  30. data/lib/cbox_billing/models/preview_organization_merge_request.rb +177 -0
  31. data/lib/cbox_billing/models/pricing_table.rb +426 -0
  32. data/lib/cbox_billing/models/pricing_table_column.rb +248 -0
  33. data/lib/cbox_billing/models/pricing_table_input.rb +388 -0
  34. data/lib/cbox_billing/models/retention_offer.rb +389 -0
  35. data/lib/cbox_billing/models/retention_offer_input.rb +447 -0
  36. data/lib/cbox_billing/models/retention_reason.rb +282 -0
  37. data/lib/cbox_billing/models/retention_reason_input.rb +195 -0
  38. data/lib/cbox_billing/models/revoke_checkout_link200_response.rb +227 -0
  39. data/lib/cbox_billing/models/seller.rb +551 -0
  40. data/lib/cbox_billing/models/seller_address.rb +201 -0
  41. data/lib/cbox_billing/models/seller_bank.rb +191 -0
  42. data/lib/cbox_billing/models/seller_input.rb +633 -0
  43. data/lib/cbox_billing/models/seller_input_registrations_inner.rb +188 -0
  44. data/lib/cbox_billing/models/seller_registrations_inner.rb +189 -0
  45. data/lib/cbox_billing/models/suspend_organization_request.rb +179 -0
  46. data/lib/cbox_billing/version.rb +1 -1
  47. data/lib/cbox_billing.rb +41 -0
  48. metadata +42 -1
@@ -0,0 +1,519 @@
1
+ =begin
2
+ #Cbox Billing API
3
+
4
+ #The HTTP API of Cbox Billing. Reference: https://github.com/cboxdk/cbox-billing/tree/main/docs/api
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.26.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module CboxBilling
16
+ class PricingTablesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Put a pricing table live
23
+ # Its public page and embed are served. Operator token only.
24
+ # @param id [String] The table's id, such as `pt_8Hk2mQ`.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is `409`.
27
+ # @return [PricingTable]
28
+ def activate_pricing_table(id, opts = {})
29
+ data, _status_code, _headers = activate_pricing_table_with_http_info(id, opts)
30
+ data
31
+ end
32
+
33
+ # Put a pricing table live
34
+ # Its public page and embed are served. Operator token only.
35
+ # @param id [String] The table's id, such as `pt_8Hk2mQ`.
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is `409`.
38
+ # @return [Array<(PricingTable, Integer, Hash)>] PricingTable data, response status code and response headers
39
+ def activate_pricing_table_with_http_info(id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.activate_pricing_table ...'
42
+ end
43
+ # verify the required parameter 'id' is set
44
+ if @api_client.config.client_side_validation && id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricingTablesApi.activate_pricing_table"
46
+ end
47
+ pattern = Regexp.new(/^pt_[A-Za-z0-9]+$/)
48
+ if @api_client.config.client_side_validation && id !~ pattern
49
+ fail ArgumentError, "invalid value for 'id' when calling PricingTablesApi.activate_pricing_table, must conform to the pattern #{pattern}."
50
+ end
51
+
52
+ # resource path
53
+ local_var_path = '/pricing-tables/{id}/activate'.sub('{id}', CGI.escape(id.to_s))
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+
58
+ # header parameters
59
+ header_params = opts[:header_params] || {}
60
+ # HTTP header 'Accept' (if needed)
61
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
62
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
63
+
64
+ # form parameters
65
+ form_params = opts[:form_params] || {}
66
+
67
+ # http body (model)
68
+ post_body = opts[:debug_body]
69
+
70
+ # return_type
71
+ return_type = opts[:debug_return_type] || 'PricingTable'
72
+
73
+ # auth_names
74
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
75
+
76
+ new_options = opts.merge(
77
+ :operation => :"PricingTablesApi.activate_pricing_table",
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: PricingTablesApi#activate_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # Create a pricing table
94
+ # A public pricing page and embed built from the catalog: the plan columns (a monthly plan with an optional yearly one), the features to compare, the currencies and the call-to-action link. The same fields and rules as Catalog → Pricing tables. A table shows the catalog and grants nothing, so it reaches no subscriber. A live table needs at least one plan. The key is unique (409). Operator token only.
95
+ # @param idempotency_key [String] An opaque, caller-generated key (at most 100 characters). Required: a missing key is &#x60;400 idempotency_key_required&#x60;. A retry with the same key replays the first response; reusing it with a different body is &#x60;409&#x60;.
96
+ # @param pricing_table_input [PricingTableInput]
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [PricingTable]
99
+ def create_pricing_table(idempotency_key, pricing_table_input, opts = {})
100
+ data, _status_code, _headers = create_pricing_table_with_http_info(idempotency_key, pricing_table_input, opts)
101
+ data
102
+ end
103
+
104
+ # Create a pricing table
105
+ # A public pricing page and embed built from the catalog: the plan columns (a monthly plan with an optional yearly one), the features to compare, the currencies and the call-to-action link. The same fields and rules as Catalog → Pricing tables. A table shows the catalog and grants nothing, so it reaches no subscriber. A live table needs at least one plan. The key is unique (409). Operator token only.
106
+ # @param idempotency_key [String] An opaque, caller-generated key (at most 100 characters). Required: a missing key is &#x60;400 idempotency_key_required&#x60;. A retry with the same key replays the first response; reusing it with a different body is &#x60;409&#x60;.
107
+ # @param pricing_table_input [PricingTableInput]
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [Array<(PricingTable, Integer, Hash)>] PricingTable data, response status code and response headers
110
+ def create_pricing_table_with_http_info(idempotency_key, pricing_table_input, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.create_pricing_table ...'
113
+ end
114
+ # verify the required parameter 'idempotency_key' is set
115
+ if @api_client.config.client_side_validation && idempotency_key.nil?
116
+ fail ArgumentError, "Missing the required parameter 'idempotency_key' when calling PricingTablesApi.create_pricing_table"
117
+ end
118
+ if @api_client.config.client_side_validation && idempotency_key.to_s.length > 100
119
+ fail ArgumentError, 'invalid value for "idempotency_key" when calling PricingTablesApi.create_pricing_table, the character length must be smaller than or equal to 100.'
120
+ end
121
+
122
+ # verify the required parameter 'pricing_table_input' is set
123
+ if @api_client.config.client_side_validation && pricing_table_input.nil?
124
+ fail ArgumentError, "Missing the required parameter 'pricing_table_input' when calling PricingTablesApi.create_pricing_table"
125
+ end
126
+ # resource path
127
+ local_var_path = '/pricing-tables'
128
+
129
+ # query parameters
130
+ query_params = opts[:query_params] || {}
131
+
132
+ # header parameters
133
+ header_params = opts[:header_params] || {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
136
+ # HTTP header 'Content-Type'
137
+ content_type = @api_client.select_header_content_type(['application/json'])
138
+ if !content_type.nil?
139
+ header_params['Content-Type'] = content_type
140
+ end
141
+ header_params[:'Idempotency-Key'] = idempotency_key
142
+
143
+ # form parameters
144
+ form_params = opts[:form_params] || {}
145
+
146
+ # http body (model)
147
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pricing_table_input)
148
+
149
+ # return_type
150
+ return_type = opts[:debug_return_type] || 'PricingTable'
151
+
152
+ # auth_names
153
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
154
+
155
+ new_options = opts.merge(
156
+ :operation => :"PricingTablesApi.create_pricing_table",
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type
163
+ )
164
+
165
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
166
+ if @api_client.config.debugging
167
+ @api_client.config.logger.debug "API called: PricingTablesApi#create_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
+ end
169
+ return data, status_code, headers
170
+ end
171
+
172
+ # Take a pricing table offline
173
+ # Its public page and embed stop being served; the table is kept. Operator token only.
174
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
175
+ # @param [Hash] opts the optional parameters
176
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
177
+ # @return [PricingTable]
178
+ def deactivate_pricing_table(id, opts = {})
179
+ data, _status_code, _headers = deactivate_pricing_table_with_http_info(id, opts)
180
+ data
181
+ end
182
+
183
+ # Take a pricing table offline
184
+ # Its public page and embed stop being served; the table is kept. Operator token only.
185
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
186
+ # @param [Hash] opts the optional parameters
187
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
188
+ # @return [Array<(PricingTable, Integer, Hash)>] PricingTable data, response status code and response headers
189
+ def deactivate_pricing_table_with_http_info(id, opts = {})
190
+ if @api_client.config.debugging
191
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.deactivate_pricing_table ...'
192
+ end
193
+ # verify the required parameter 'id' is set
194
+ if @api_client.config.client_side_validation && id.nil?
195
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricingTablesApi.deactivate_pricing_table"
196
+ end
197
+ pattern = Regexp.new(/^pt_[A-Za-z0-9]+$/)
198
+ if @api_client.config.client_side_validation && id !~ pattern
199
+ fail ArgumentError, "invalid value for 'id' when calling PricingTablesApi.deactivate_pricing_table, must conform to the pattern #{pattern}."
200
+ end
201
+
202
+ # resource path
203
+ local_var_path = '/pricing-tables/{id}/deactivate'.sub('{id}', CGI.escape(id.to_s))
204
+
205
+ # query parameters
206
+ query_params = opts[:query_params] || {}
207
+
208
+ # header parameters
209
+ header_params = opts[:header_params] || {}
210
+ # HTTP header 'Accept' (if needed)
211
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
212
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
213
+
214
+ # form parameters
215
+ form_params = opts[:form_params] || {}
216
+
217
+ # http body (model)
218
+ post_body = opts[:debug_body]
219
+
220
+ # return_type
221
+ return_type = opts[:debug_return_type] || 'PricingTable'
222
+
223
+ # auth_names
224
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
225
+
226
+ new_options = opts.merge(
227
+ :operation => :"PricingTablesApi.deactivate_pricing_table",
228
+ :header_params => header_params,
229
+ :query_params => query_params,
230
+ :form_params => form_params,
231
+ :body => post_body,
232
+ :auth_names => auth_names,
233
+ :return_type => return_type
234
+ )
235
+
236
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
237
+ if @api_client.config.debugging
238
+ @api_client.config.logger.debug "API called: PricingTablesApi#deactivate_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
239
+ end
240
+ return data, status_code, headers
241
+ end
242
+
243
+ # Delete a pricing table
244
+ # The public page and its embed stop working at once. To take a table offline and keep it, deactivate it instead. Operator token only.
245
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
246
+ # @param [Hash] opts the optional parameters
247
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
248
+ # @return [DeleteExperiment200Response]
249
+ def delete_pricing_table(id, opts = {})
250
+ data, _status_code, _headers = delete_pricing_table_with_http_info(id, opts)
251
+ data
252
+ end
253
+
254
+ # Delete a pricing table
255
+ # The public page and its embed stop working at once. To take a table offline and keep it, deactivate it instead. Operator token only.
256
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
257
+ # @param [Hash] opts the optional parameters
258
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
259
+ # @return [Array<(DeleteExperiment200Response, Integer, Hash)>] DeleteExperiment200Response data, response status code and response headers
260
+ def delete_pricing_table_with_http_info(id, opts = {})
261
+ if @api_client.config.debugging
262
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.delete_pricing_table ...'
263
+ end
264
+ # verify the required parameter 'id' is set
265
+ if @api_client.config.client_side_validation && id.nil?
266
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricingTablesApi.delete_pricing_table"
267
+ end
268
+ pattern = Regexp.new(/^pt_[A-Za-z0-9]+$/)
269
+ if @api_client.config.client_side_validation && id !~ pattern
270
+ fail ArgumentError, "invalid value for 'id' when calling PricingTablesApi.delete_pricing_table, must conform to the pattern #{pattern}."
271
+ end
272
+
273
+ # resource path
274
+ local_var_path = '/pricing-tables/{id}'.sub('{id}', CGI.escape(id.to_s))
275
+
276
+ # query parameters
277
+ query_params = opts[:query_params] || {}
278
+
279
+ # header parameters
280
+ header_params = opts[:header_params] || {}
281
+ # HTTP header 'Accept' (if needed)
282
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
283
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
284
+
285
+ # form parameters
286
+ form_params = opts[:form_params] || {}
287
+
288
+ # http body (model)
289
+ post_body = opts[:debug_body]
290
+
291
+ # return_type
292
+ return_type = opts[:debug_return_type] || 'DeleteExperiment200Response'
293
+
294
+ # auth_names
295
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
296
+
297
+ new_options = opts.merge(
298
+ :operation => :"PricingTablesApi.delete_pricing_table",
299
+ :header_params => header_params,
300
+ :query_params => query_params,
301
+ :form_params => form_params,
302
+ :body => post_body,
303
+ :auth_names => auth_names,
304
+ :return_type => return_type
305
+ )
306
+
307
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug "API called: PricingTablesApi#delete_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
310
+ end
311
+ return data, status_code, headers
312
+ end
313
+
314
+ # Read a pricing table
315
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
316
+ # @param [Hash] opts the optional parameters
317
+ # @return [PricingTable]
318
+ def get_pricing_table(id, opts = {})
319
+ data, _status_code, _headers = get_pricing_table_with_http_info(id, opts)
320
+ data
321
+ end
322
+
323
+ # Read a pricing table
324
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
325
+ # @param [Hash] opts the optional parameters
326
+ # @return [Array<(PricingTable, Integer, Hash)>] PricingTable data, response status code and response headers
327
+ def get_pricing_table_with_http_info(id, opts = {})
328
+ if @api_client.config.debugging
329
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.get_pricing_table ...'
330
+ end
331
+ # verify the required parameter 'id' is set
332
+ if @api_client.config.client_side_validation && id.nil?
333
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricingTablesApi.get_pricing_table"
334
+ end
335
+ pattern = Regexp.new(/^pt_[A-Za-z0-9]+$/)
336
+ if @api_client.config.client_side_validation && id !~ pattern
337
+ fail ArgumentError, "invalid value for 'id' when calling PricingTablesApi.get_pricing_table, must conform to the pattern #{pattern}."
338
+ end
339
+
340
+ # resource path
341
+ local_var_path = '/pricing-tables/{id}'.sub('{id}', CGI.escape(id.to_s))
342
+
343
+ # query parameters
344
+ query_params = opts[:query_params] || {}
345
+
346
+ # header parameters
347
+ header_params = opts[:header_params] || {}
348
+ # HTTP header 'Accept' (if needed)
349
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
350
+
351
+ # form parameters
352
+ form_params = opts[:form_params] || {}
353
+
354
+ # http body (model)
355
+ post_body = opts[:debug_body]
356
+
357
+ # return_type
358
+ return_type = opts[:debug_return_type] || 'PricingTable'
359
+
360
+ # auth_names
361
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
362
+
363
+ new_options = opts.merge(
364
+ :operation => :"PricingTablesApi.get_pricing_table",
365
+ :header_params => header_params,
366
+ :query_params => query_params,
367
+ :form_params => form_params,
368
+ :body => post_body,
369
+ :auth_names => auth_names,
370
+ :return_type => return_type
371
+ )
372
+
373
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
374
+ if @api_client.config.debugging
375
+ @api_client.config.logger.debug "API called: PricingTablesApi#get_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
376
+ end
377
+ return data, status_code, headers
378
+ end
379
+
380
+ # List the pricing tables
381
+ # Every embeddable pricing table of the environment, by name, live or not. Operator token only.
382
+ # @param [Hash] opts the optional parameters
383
+ # @return [ListPricingTables200Response]
384
+ def list_pricing_tables(opts = {})
385
+ data, _status_code, _headers = list_pricing_tables_with_http_info(opts)
386
+ data
387
+ end
388
+
389
+ # List the pricing tables
390
+ # Every embeddable pricing table of the environment, by name, live or not. Operator token only.
391
+ # @param [Hash] opts the optional parameters
392
+ # @return [Array<(ListPricingTables200Response, Integer, Hash)>] ListPricingTables200Response data, response status code and response headers
393
+ def list_pricing_tables_with_http_info(opts = {})
394
+ if @api_client.config.debugging
395
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.list_pricing_tables ...'
396
+ end
397
+ # resource path
398
+ local_var_path = '/pricing-tables'
399
+
400
+ # query parameters
401
+ query_params = opts[:query_params] || {}
402
+
403
+ # header parameters
404
+ header_params = opts[:header_params] || {}
405
+ # HTTP header 'Accept' (if needed)
406
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
407
+
408
+ # form parameters
409
+ form_params = opts[:form_params] || {}
410
+
411
+ # http body (model)
412
+ post_body = opts[:debug_body]
413
+
414
+ # return_type
415
+ return_type = opts[:debug_return_type] || 'ListPricingTables200Response'
416
+
417
+ # auth_names
418
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
419
+
420
+ new_options = opts.merge(
421
+ :operation => :"PricingTablesApi.list_pricing_tables",
422
+ :header_params => header_params,
423
+ :query_params => query_params,
424
+ :form_params => form_params,
425
+ :body => post_body,
426
+ :auth_names => auth_names,
427
+ :return_type => return_type
428
+ )
429
+
430
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
431
+ if @api_client.config.debugging
432
+ @api_client.config.logger.debug "API called: PricingTablesApi#list_pricing_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
433
+ end
434
+ return data, status_code, headers
435
+ end
436
+
437
+ # Change a pricing table
438
+ # The whole table, as the console's form sends it: columns and features are replaced, and a field left out is cleared. Operator token only.
439
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
440
+ # @param pricing_table_input [PricingTableInput]
441
+ # @param [Hash] opts the optional parameters
442
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
443
+ # @return [PricingTable]
444
+ def update_pricing_table(id, pricing_table_input, opts = {})
445
+ data, _status_code, _headers = update_pricing_table_with_http_info(id, pricing_table_input, opts)
446
+ data
447
+ end
448
+
449
+ # Change a pricing table
450
+ # The whole table, as the console&#39;s form sends it: columns and features are replaced, and a field left out is cleared. Operator token only.
451
+ # @param id [String] The table&#39;s id, such as &#x60;pt_8Hk2mQ&#x60;.
452
+ # @param pricing_table_input [PricingTableInput]
453
+ # @param [Hash] opts the optional parameters
454
+ # @option opts [String] :idempotency_key An opaque, caller-generated key giving this write exactly-once semantics. A retry with the same key replays the first response instead of re-running the effect; reusing it with a different body is &#x60;409&#x60;.
455
+ # @return [Array<(PricingTable, Integer, Hash)>] PricingTable data, response status code and response headers
456
+ def update_pricing_table_with_http_info(id, pricing_table_input, opts = {})
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug 'Calling API: PricingTablesApi.update_pricing_table ...'
459
+ end
460
+ # verify the required parameter 'id' is set
461
+ if @api_client.config.client_side_validation && id.nil?
462
+ fail ArgumentError, "Missing the required parameter 'id' when calling PricingTablesApi.update_pricing_table"
463
+ end
464
+ pattern = Regexp.new(/^pt_[A-Za-z0-9]+$/)
465
+ if @api_client.config.client_side_validation && id !~ pattern
466
+ fail ArgumentError, "invalid value for 'id' when calling PricingTablesApi.update_pricing_table, must conform to the pattern #{pattern}."
467
+ end
468
+
469
+ # verify the required parameter 'pricing_table_input' is set
470
+ if @api_client.config.client_side_validation && pricing_table_input.nil?
471
+ fail ArgumentError, "Missing the required parameter 'pricing_table_input' when calling PricingTablesApi.update_pricing_table"
472
+ end
473
+ # resource path
474
+ local_var_path = '/pricing-tables/{id}'.sub('{id}', CGI.escape(id.to_s))
475
+
476
+ # query parameters
477
+ query_params = opts[:query_params] || {}
478
+
479
+ # header parameters
480
+ header_params = opts[:header_params] || {}
481
+ # HTTP header 'Accept' (if needed)
482
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
483
+ # HTTP header 'Content-Type'
484
+ content_type = @api_client.select_header_content_type(['application/json'])
485
+ if !content_type.nil?
486
+ header_params['Content-Type'] = content_type
487
+ end
488
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
489
+
490
+ # form parameters
491
+ form_params = opts[:form_params] || {}
492
+
493
+ # http body (model)
494
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(pricing_table_input)
495
+
496
+ # return_type
497
+ return_type = opts[:debug_return_type] || 'PricingTable'
498
+
499
+ # auth_names
500
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
501
+
502
+ new_options = opts.merge(
503
+ :operation => :"PricingTablesApi.update_pricing_table",
504
+ :header_params => header_params,
505
+ :query_params => query_params,
506
+ :form_params => form_params,
507
+ :body => post_body,
508
+ :auth_names => auth_names,
509
+ :return_type => return_type
510
+ )
511
+
512
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
513
+ if @api_client.config.debugging
514
+ @api_client.config.logger.debug "API called: PricingTablesApi#update_pricing_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
515
+ end
516
+ return data, status_code, headers
517
+ end
518
+ end
519
+ end