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.
- checksums.yaml +4 -4
- data/lib/cbox_billing/api/checkout_portal_api.rb +214 -0
- data/lib/cbox_billing/api/coupons_api.rb +55 -55
- data/lib/cbox_billing/api/experiments_api.rb +526 -0
- data/lib/cbox_billing/api/organizations_api.rb +554 -0
- data/lib/cbox_billing/api/pricing_tables_api.rb +519 -0
- data/lib/cbox_billing/api/retention_api.rb +884 -0
- data/lib/cbox_billing/api/sellers_api.rb +590 -0
- data/lib/cbox_billing/models/checkout_link.rb +283 -0
- data/lib/cbox_billing/models/conclude_experiment_request.rb +161 -0
- data/lib/cbox_billing/models/create_checkout_link_request.rb +178 -0
- data/lib/cbox_billing/models/customer_lifecycle_refusal.rb +238 -0
- data/lib/cbox_billing/models/customer_lifecycle_state.rb +268 -0
- data/lib/cbox_billing/models/delete_experiment200_response.rb +227 -0
- data/lib/cbox_billing/models/delete_organization200_response.rb +227 -0
- data/lib/cbox_billing/models/experiment.rb +387 -0
- data/lib/cbox_billing/models/experiment_input.rb +410 -0
- data/lib/cbox_billing/models/experiment_input_variants_inner.rb +233 -0
- data/lib/cbox_billing/models/experiment_variant.rb +266 -0
- data/lib/cbox_billing/models/list_checkout_links200_response.rb +179 -0
- data/lib/cbox_billing/models/list_checkout_links200_response_data_inner.rb +223 -0
- data/lib/cbox_billing/models/list_experiments200_response.rb +179 -0
- data/lib/cbox_billing/models/list_pricing_tables200_response.rb +179 -0
- data/lib/cbox_billing/models/list_retention_offers200_response.rb +179 -0
- data/lib/cbox_billing/models/list_retention_reasons200_response.rb +179 -0
- data/lib/cbox_billing/models/list_sellers200_response.rb +179 -0
- data/lib/cbox_billing/models/merge_organization_request.rb +221 -0
- data/lib/cbox_billing/models/merge_organization_request_fields.rb +279 -0
- data/lib/cbox_billing/models/preview_organization_merge200_response.rb +343 -0
- data/lib/cbox_billing/models/preview_organization_merge_request.rb +177 -0
- data/lib/cbox_billing/models/pricing_table.rb +426 -0
- data/lib/cbox_billing/models/pricing_table_column.rb +248 -0
- data/lib/cbox_billing/models/pricing_table_input.rb +388 -0
- data/lib/cbox_billing/models/retention_offer.rb +389 -0
- data/lib/cbox_billing/models/retention_offer_input.rb +447 -0
- data/lib/cbox_billing/models/retention_reason.rb +282 -0
- data/lib/cbox_billing/models/retention_reason_input.rb +195 -0
- data/lib/cbox_billing/models/revoke_checkout_link200_response.rb +227 -0
- data/lib/cbox_billing/models/seller.rb +551 -0
- data/lib/cbox_billing/models/seller_address.rb +201 -0
- data/lib/cbox_billing/models/seller_bank.rb +191 -0
- data/lib/cbox_billing/models/seller_input.rb +633 -0
- data/lib/cbox_billing/models/seller_input_registrations_inner.rb +188 -0
- data/lib/cbox_billing/models/seller_registrations_inner.rb +189 -0
- data/lib/cbox_billing/models/suspend_organization_request.rb +179 -0
- data/lib/cbox_billing/version.rb +1 -1
- data/lib/cbox_billing.rb +41 -0
- metadata +42 -1
|
@@ -0,0 +1,590 @@
|
|
|
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 SellersApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Archive a selling entity
|
|
23
|
+
# It issues nothing new; its documents stay. Operator token only.
|
|
24
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
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 [Seller]
|
|
28
|
+
def archive_seller(id, opts = {})
|
|
29
|
+
data, _status_code, _headers = archive_seller_with_http_info(id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Archive a selling entity
|
|
34
|
+
# It issues nothing new; its documents stay. Operator token only.
|
|
35
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
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<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
39
|
+
def archive_seller_with_http_info(id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.archive_seller ...'
|
|
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 SellersApi.archive_seller"
|
|
46
|
+
end
|
|
47
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
48
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
49
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.archive_seller, must conform to the pattern #{pattern}."
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# resource path
|
|
53
|
+
local_var_path = '/sellers/{id}/archive'.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] || 'Seller'
|
|
72
|
+
|
|
73
|
+
# auth_names
|
|
74
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
75
|
+
|
|
76
|
+
new_options = opts.merge(
|
|
77
|
+
:operation => :"SellersApi.archive_seller",
|
|
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: SellersApi#archive_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
89
|
+
end
|
|
90
|
+
return data, status_code, headers
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Create a selling entity
|
|
94
|
+
# The legal seller of record: name, registration number, establishment, currency, invoice prefix (unique in the environment), its tax registrations, the registered address documents print, the bank account and email branding. The same fields and rules as Settings → Sellers. Nothing is issued while the address is incomplete (`address_missing`). Operator token only.
|
|
95
|
+
# @param idempotency_key [String] An opaque, caller-generated key (at most 100 characters). Required: a missing key is `400 idempotency_key_required`. A retry with the same key replays the first response; reusing it with a different body is `409`.
|
|
96
|
+
# @param seller_input [SellerInput]
|
|
97
|
+
# @param [Hash] opts the optional parameters
|
|
98
|
+
# @return [Seller]
|
|
99
|
+
def create_seller(idempotency_key, seller_input, opts = {})
|
|
100
|
+
data, _status_code, _headers = create_seller_with_http_info(idempotency_key, seller_input, opts)
|
|
101
|
+
data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Create a selling entity
|
|
105
|
+
# The legal seller of record: name, registration number, establishment, currency, invoice prefix (unique in the environment), its tax registrations, the registered address documents print, the bank account and email branding. The same fields and rules as Settings → Sellers. Nothing is issued while the address is incomplete (`address_missing`). Operator token only.
|
|
106
|
+
# @param idempotency_key [String] An opaque, caller-generated key (at most 100 characters). Required: a missing key is `400 idempotency_key_required`. A retry with the same key replays the first response; reusing it with a different body is `409`.
|
|
107
|
+
# @param seller_input [SellerInput]
|
|
108
|
+
# @param [Hash] opts the optional parameters
|
|
109
|
+
# @return [Array<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
110
|
+
def create_seller_with_http_info(idempotency_key, seller_input, opts = {})
|
|
111
|
+
if @api_client.config.debugging
|
|
112
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.create_seller ...'
|
|
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 SellersApi.create_seller"
|
|
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 SellersApi.create_seller, the character length must be smaller than or equal to 100.'
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# verify the required parameter 'seller_input' is set
|
|
123
|
+
if @api_client.config.client_side_validation && seller_input.nil?
|
|
124
|
+
fail ArgumentError, "Missing the required parameter 'seller_input' when calling SellersApi.create_seller"
|
|
125
|
+
end
|
|
126
|
+
# resource path
|
|
127
|
+
local_var_path = '/sellers'
|
|
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(seller_input)
|
|
148
|
+
|
|
149
|
+
# return_type
|
|
150
|
+
return_type = opts[:debug_return_type] || 'Seller'
|
|
151
|
+
|
|
152
|
+
# auth_names
|
|
153
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
154
|
+
|
|
155
|
+
new_options = opts.merge(
|
|
156
|
+
:operation => :"SellersApi.create_seller",
|
|
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: SellersApi#create_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
168
|
+
end
|
|
169
|
+
return data, status_code, headers
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Delete a selling entity
|
|
173
|
+
# Refused (409) for the default seller, and for one whose prefix numbered invoices: archive that one instead. Operator token only.
|
|
174
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
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 `409`.
|
|
177
|
+
# @return [DeleteExperiment200Response]
|
|
178
|
+
def delete_seller(id, opts = {})
|
|
179
|
+
data, _status_code, _headers = delete_seller_with_http_info(id, opts)
|
|
180
|
+
data
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Delete a selling entity
|
|
184
|
+
# Refused (409) for the default seller, and for one whose prefix numbered invoices: archive that one instead. Operator token only.
|
|
185
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
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 `409`.
|
|
188
|
+
# @return [Array<(DeleteExperiment200Response, Integer, Hash)>] DeleteExperiment200Response data, response status code and response headers
|
|
189
|
+
def delete_seller_with_http_info(id, opts = {})
|
|
190
|
+
if @api_client.config.debugging
|
|
191
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.delete_seller ...'
|
|
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 SellersApi.delete_seller"
|
|
196
|
+
end
|
|
197
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
198
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
199
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.delete_seller, must conform to the pattern #{pattern}."
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# resource path
|
|
203
|
+
local_var_path = '/sellers/{id}'.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] || 'DeleteExperiment200Response'
|
|
222
|
+
|
|
223
|
+
# auth_names
|
|
224
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
225
|
+
|
|
226
|
+
new_options = opts.merge(
|
|
227
|
+
:operation => :"SellersApi.delete_seller",
|
|
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(:DELETE, local_var_path, new_options)
|
|
237
|
+
if @api_client.config.debugging
|
|
238
|
+
@api_client.config.logger.debug "API called: SellersApi#delete_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
239
|
+
end
|
|
240
|
+
return data, status_code, headers
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Read a selling entity
|
|
244
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
245
|
+
# @param [Hash] opts the optional parameters
|
|
246
|
+
# @return [Seller]
|
|
247
|
+
def get_seller(id, opts = {})
|
|
248
|
+
data, _status_code, _headers = get_seller_with_http_info(id, opts)
|
|
249
|
+
data
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
# Read a selling entity
|
|
253
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
254
|
+
# @param [Hash] opts the optional parameters
|
|
255
|
+
# @return [Array<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
256
|
+
def get_seller_with_http_info(id, opts = {})
|
|
257
|
+
if @api_client.config.debugging
|
|
258
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.get_seller ...'
|
|
259
|
+
end
|
|
260
|
+
# verify the required parameter 'id' is set
|
|
261
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
262
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellersApi.get_seller"
|
|
263
|
+
end
|
|
264
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
265
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
266
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.get_seller, must conform to the pattern #{pattern}."
|
|
267
|
+
end
|
|
268
|
+
|
|
269
|
+
# resource path
|
|
270
|
+
local_var_path = '/sellers/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
271
|
+
|
|
272
|
+
# query parameters
|
|
273
|
+
query_params = opts[:query_params] || {}
|
|
274
|
+
|
|
275
|
+
# header parameters
|
|
276
|
+
header_params = opts[:header_params] || {}
|
|
277
|
+
# HTTP header 'Accept' (if needed)
|
|
278
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
279
|
+
|
|
280
|
+
# form parameters
|
|
281
|
+
form_params = opts[:form_params] || {}
|
|
282
|
+
|
|
283
|
+
# http body (model)
|
|
284
|
+
post_body = opts[:debug_body]
|
|
285
|
+
|
|
286
|
+
# return_type
|
|
287
|
+
return_type = opts[:debug_return_type] || 'Seller'
|
|
288
|
+
|
|
289
|
+
# auth_names
|
|
290
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
291
|
+
|
|
292
|
+
new_options = opts.merge(
|
|
293
|
+
:operation => :"SellersApi.get_seller",
|
|
294
|
+
:header_params => header_params,
|
|
295
|
+
:query_params => query_params,
|
|
296
|
+
:form_params => form_params,
|
|
297
|
+
:body => post_body,
|
|
298
|
+
:auth_names => auth_names,
|
|
299
|
+
:return_type => return_type
|
|
300
|
+
)
|
|
301
|
+
|
|
302
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
303
|
+
if @api_client.config.debugging
|
|
304
|
+
@api_client.config.logger.debug "API called: SellersApi#get_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
305
|
+
end
|
|
306
|
+
return data, status_code, headers
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# List the selling entities
|
|
310
|
+
# Every selling entity of the environment, the default first. Operator token only.
|
|
311
|
+
# @param [Hash] opts the optional parameters
|
|
312
|
+
# @return [ListSellers200Response]
|
|
313
|
+
def list_sellers(opts = {})
|
|
314
|
+
data, _status_code, _headers = list_sellers_with_http_info(opts)
|
|
315
|
+
data
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
# List the selling entities
|
|
319
|
+
# Every selling entity of the environment, the default first. Operator token only.
|
|
320
|
+
# @param [Hash] opts the optional parameters
|
|
321
|
+
# @return [Array<(ListSellers200Response, Integer, Hash)>] ListSellers200Response data, response status code and response headers
|
|
322
|
+
def list_sellers_with_http_info(opts = {})
|
|
323
|
+
if @api_client.config.debugging
|
|
324
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.list_sellers ...'
|
|
325
|
+
end
|
|
326
|
+
# resource path
|
|
327
|
+
local_var_path = '/sellers'
|
|
328
|
+
|
|
329
|
+
# query parameters
|
|
330
|
+
query_params = opts[:query_params] || {}
|
|
331
|
+
|
|
332
|
+
# header parameters
|
|
333
|
+
header_params = opts[:header_params] || {}
|
|
334
|
+
# HTTP header 'Accept' (if needed)
|
|
335
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
336
|
+
|
|
337
|
+
# form parameters
|
|
338
|
+
form_params = opts[:form_params] || {}
|
|
339
|
+
|
|
340
|
+
# http body (model)
|
|
341
|
+
post_body = opts[:debug_body]
|
|
342
|
+
|
|
343
|
+
# return_type
|
|
344
|
+
return_type = opts[:debug_return_type] || 'ListSellers200Response'
|
|
345
|
+
|
|
346
|
+
# auth_names
|
|
347
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
348
|
+
|
|
349
|
+
new_options = opts.merge(
|
|
350
|
+
:operation => :"SellersApi.list_sellers",
|
|
351
|
+
:header_params => header_params,
|
|
352
|
+
:query_params => query_params,
|
|
353
|
+
:form_params => form_params,
|
|
354
|
+
:body => post_body,
|
|
355
|
+
:auth_names => auth_names,
|
|
356
|
+
:return_type => return_type
|
|
357
|
+
)
|
|
358
|
+
|
|
359
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
360
|
+
if @api_client.config.debugging
|
|
361
|
+
@api_client.config.logger.debug "API called: SellersApi#list_sellers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
362
|
+
end
|
|
363
|
+
return data, status_code, headers
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
# Make a selling entity the default
|
|
367
|
+
# New documents are issued by it unless a product or customer names another. Reinstates it if it was archived. Operator token only.
|
|
368
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
369
|
+
# @param [Hash] opts the optional parameters
|
|
370
|
+
# @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`.
|
|
371
|
+
# @return [Seller]
|
|
372
|
+
def set_default_seller(id, opts = {})
|
|
373
|
+
data, _status_code, _headers = set_default_seller_with_http_info(id, opts)
|
|
374
|
+
data
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Make a selling entity the default
|
|
378
|
+
# New documents are issued by it unless a product or customer names another. Reinstates it if it was archived. Operator token only.
|
|
379
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
380
|
+
# @param [Hash] opts the optional parameters
|
|
381
|
+
# @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`.
|
|
382
|
+
# @return [Array<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
383
|
+
def set_default_seller_with_http_info(id, opts = {})
|
|
384
|
+
if @api_client.config.debugging
|
|
385
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.set_default_seller ...'
|
|
386
|
+
end
|
|
387
|
+
# verify the required parameter 'id' is set
|
|
388
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
389
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellersApi.set_default_seller"
|
|
390
|
+
end
|
|
391
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
392
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
393
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.set_default_seller, must conform to the pattern #{pattern}."
|
|
394
|
+
end
|
|
395
|
+
|
|
396
|
+
# resource path
|
|
397
|
+
local_var_path = '/sellers/{id}/default'.sub('{id}', CGI.escape(id.to_s))
|
|
398
|
+
|
|
399
|
+
# query parameters
|
|
400
|
+
query_params = opts[:query_params] || {}
|
|
401
|
+
|
|
402
|
+
# header parameters
|
|
403
|
+
header_params = opts[:header_params] || {}
|
|
404
|
+
# HTTP header 'Accept' (if needed)
|
|
405
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
406
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
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] || 'Seller'
|
|
416
|
+
|
|
417
|
+
# auth_names
|
|
418
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
419
|
+
|
|
420
|
+
new_options = opts.merge(
|
|
421
|
+
:operation => :"SellersApi.set_default_seller",
|
|
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(:POST, local_var_path, new_options)
|
|
431
|
+
if @api_client.config.debugging
|
|
432
|
+
@api_client.config.logger.debug "API called: SellersApi#set_default_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
433
|
+
end
|
|
434
|
+
return data, status_code, headers
|
|
435
|
+
end
|
|
436
|
+
|
|
437
|
+
# Reinstate an archived selling entity
|
|
438
|
+
# Operator token only.
|
|
439
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
440
|
+
# @param [Hash] opts the optional parameters
|
|
441
|
+
# @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`.
|
|
442
|
+
# @return [Seller]
|
|
443
|
+
def unarchive_seller(id, opts = {})
|
|
444
|
+
data, _status_code, _headers = unarchive_seller_with_http_info(id, opts)
|
|
445
|
+
data
|
|
446
|
+
end
|
|
447
|
+
|
|
448
|
+
# Reinstate an archived selling entity
|
|
449
|
+
# Operator token only.
|
|
450
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
451
|
+
# @param [Hash] opts the optional parameters
|
|
452
|
+
# @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`.
|
|
453
|
+
# @return [Array<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
454
|
+
def unarchive_seller_with_http_info(id, opts = {})
|
|
455
|
+
if @api_client.config.debugging
|
|
456
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.unarchive_seller ...'
|
|
457
|
+
end
|
|
458
|
+
# verify the required parameter 'id' is set
|
|
459
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
460
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellersApi.unarchive_seller"
|
|
461
|
+
end
|
|
462
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
463
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
464
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.unarchive_seller, must conform to the pattern #{pattern}."
|
|
465
|
+
end
|
|
466
|
+
|
|
467
|
+
# resource path
|
|
468
|
+
local_var_path = '/sellers/{id}/unarchive'.sub('{id}', CGI.escape(id.to_s))
|
|
469
|
+
|
|
470
|
+
# query parameters
|
|
471
|
+
query_params = opts[:query_params] || {}
|
|
472
|
+
|
|
473
|
+
# header parameters
|
|
474
|
+
header_params = opts[:header_params] || {}
|
|
475
|
+
# HTTP header 'Accept' (if needed)
|
|
476
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
477
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
478
|
+
|
|
479
|
+
# form parameters
|
|
480
|
+
form_params = opts[:form_params] || {}
|
|
481
|
+
|
|
482
|
+
# http body (model)
|
|
483
|
+
post_body = opts[:debug_body]
|
|
484
|
+
|
|
485
|
+
# return_type
|
|
486
|
+
return_type = opts[:debug_return_type] || 'Seller'
|
|
487
|
+
|
|
488
|
+
# auth_names
|
|
489
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
490
|
+
|
|
491
|
+
new_options = opts.merge(
|
|
492
|
+
:operation => :"SellersApi.unarchive_seller",
|
|
493
|
+
:header_params => header_params,
|
|
494
|
+
:query_params => query_params,
|
|
495
|
+
:form_params => form_params,
|
|
496
|
+
:body => post_body,
|
|
497
|
+
:auth_names => auth_names,
|
|
498
|
+
:return_type => return_type
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
502
|
+
if @api_client.config.debugging
|
|
503
|
+
@api_client.config.logger.debug "API called: SellersApi#unarchive_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
504
|
+
end
|
|
505
|
+
return data, status_code, headers
|
|
506
|
+
end
|
|
507
|
+
|
|
508
|
+
# Change a selling entity
|
|
509
|
+
# The whole seller, as the console's form sends it: a field left out is cleared. Operator token only.
|
|
510
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
511
|
+
# @param seller_input [SellerInput]
|
|
512
|
+
# @param [Hash] opts the optional parameters
|
|
513
|
+
# @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`.
|
|
514
|
+
# @return [Seller]
|
|
515
|
+
def update_seller(id, seller_input, opts = {})
|
|
516
|
+
data, _status_code, _headers = update_seller_with_http_info(id, seller_input, opts)
|
|
517
|
+
data
|
|
518
|
+
end
|
|
519
|
+
|
|
520
|
+
# Change a selling entity
|
|
521
|
+
# The whole seller, as the console's form sends it: a field left out is cleared. Operator token only.
|
|
522
|
+
# @param id [String] The seller's id, such as `cbox-dk`.
|
|
523
|
+
# @param seller_input [SellerInput]
|
|
524
|
+
# @param [Hash] opts the optional parameters
|
|
525
|
+
# @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`.
|
|
526
|
+
# @return [Array<(Seller, Integer, Hash)>] Seller data, response status code and response headers
|
|
527
|
+
def update_seller_with_http_info(id, seller_input, opts = {})
|
|
528
|
+
if @api_client.config.debugging
|
|
529
|
+
@api_client.config.logger.debug 'Calling API: SellersApi.update_seller ...'
|
|
530
|
+
end
|
|
531
|
+
# verify the required parameter 'id' is set
|
|
532
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
533
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SellersApi.update_seller"
|
|
534
|
+
end
|
|
535
|
+
pattern = Regexp.new(/^[a-z0-9._-]+$/)
|
|
536
|
+
if @api_client.config.client_side_validation && id !~ pattern
|
|
537
|
+
fail ArgumentError, "invalid value for 'id' when calling SellersApi.update_seller, must conform to the pattern #{pattern}."
|
|
538
|
+
end
|
|
539
|
+
|
|
540
|
+
# verify the required parameter 'seller_input' is set
|
|
541
|
+
if @api_client.config.client_side_validation && seller_input.nil?
|
|
542
|
+
fail ArgumentError, "Missing the required parameter 'seller_input' when calling SellersApi.update_seller"
|
|
543
|
+
end
|
|
544
|
+
# resource path
|
|
545
|
+
local_var_path = '/sellers/{id}'.sub('{id}', CGI.escape(id.to_s))
|
|
546
|
+
|
|
547
|
+
# query parameters
|
|
548
|
+
query_params = opts[:query_params] || {}
|
|
549
|
+
|
|
550
|
+
# header parameters
|
|
551
|
+
header_params = opts[:header_params] || {}
|
|
552
|
+
# HTTP header 'Accept' (if needed)
|
|
553
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
554
|
+
# HTTP header 'Content-Type'
|
|
555
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
556
|
+
if !content_type.nil?
|
|
557
|
+
header_params['Content-Type'] = content_type
|
|
558
|
+
end
|
|
559
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
|
560
|
+
|
|
561
|
+
# form parameters
|
|
562
|
+
form_params = opts[:form_params] || {}
|
|
563
|
+
|
|
564
|
+
# http body (model)
|
|
565
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(seller_input)
|
|
566
|
+
|
|
567
|
+
# return_type
|
|
568
|
+
return_type = opts[:debug_return_type] || 'Seller'
|
|
569
|
+
|
|
570
|
+
# auth_names
|
|
571
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
572
|
+
|
|
573
|
+
new_options = opts.merge(
|
|
574
|
+
:operation => :"SellersApi.update_seller",
|
|
575
|
+
:header_params => header_params,
|
|
576
|
+
:query_params => query_params,
|
|
577
|
+
:form_params => form_params,
|
|
578
|
+
:body => post_body,
|
|
579
|
+
:auth_names => auth_names,
|
|
580
|
+
:return_type => return_type
|
|
581
|
+
)
|
|
582
|
+
|
|
583
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
|
584
|
+
if @api_client.config.debugging
|
|
585
|
+
@api_client.config.logger.debug "API called: SellersApi#update_seller\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
586
|
+
end
|
|
587
|
+
return data, status_code, headers
|
|
588
|
+
end
|
|
589
|
+
end
|
|
590
|
+
end
|