cybersource_rest_client 0.0.40 → 0.0.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/lib/AuthenticationSDK/logging/sensitive_logging.rb +7 -4
  3. data/lib/cybersource_rest_client/api/asymmetric_key_management_api.rb +223 -219
  4. data/lib/cybersource_rest_client/api/chargeback_details_api.rb +116 -112
  5. data/lib/cybersource_rest_client/api/chargeback_summaries_api.rb +116 -112
  6. data/lib/cybersource_rest_client/api/conversion_details_api.rb +5 -1
  7. data/lib/cybersource_rest_client/api/customer_api.rb +368 -360
  8. data/lib/cybersource_rest_client/api/customer_payment_instrument_api.rb +530 -518
  9. data/lib/cybersource_rest_client/api/customer_shipping_address_api.rb +530 -518
  10. data/lib/cybersource_rest_client/api/download_dtd_api.rb +92 -88
  11. data/lib/cybersource_rest_client/api/download_xsd_api.rb +92 -88
  12. data/lib/cybersource_rest_client/api/instrument_identifier_api.rb +15 -3
  13. data/lib/cybersource_rest_client/api/interchange_clearing_level_details_api.rb +116 -112
  14. data/lib/cybersource_rest_client/api/invoice_settings_api.rb +152 -148
  15. data/lib/cybersource_rest_client/api/invoices_api.rb +447 -431
  16. data/lib/cybersource_rest_client/api/net_fundings_api.rb +5 -1
  17. data/lib/cybersource_rest_client/api/notification_of_changes_api.rb +5 -1
  18. data/lib/cybersource_rest_client/api/payer_authentication_api.rb +219 -219
  19. data/lib/cybersource_rest_client/api/payment_batch_summaries_api.rb +133 -129
  20. data/lib/cybersource_rest_client/api/payment_instrument_api.rb +10 -2
  21. data/lib/cybersource_rest_client/api/purchase_and_refund_details_api.rb +5 -1
  22. data/lib/cybersource_rest_client/api/report_definitions_api.rb +10 -2
  23. data/lib/cybersource_rest_client/api/report_downloads_api.rb +5 -1
  24. data/lib/cybersource_rest_client/api/report_subscriptions_api.rb +15 -3
  25. data/lib/cybersource_rest_client/api/reports_api.rb +10 -2
  26. data/lib/cybersource_rest_client/api/retrieval_details_api.rb +116 -112
  27. data/lib/cybersource_rest_client/api/retrieval_summaries_api.rb +116 -112
  28. data/lib/cybersource_rest_client/api/search_transactions_api.rb +5 -1
  29. data/lib/cybersource_rest_client/api/secure_file_share_api.rb +206 -198
  30. data/lib/cybersource_rest_client/api/symmetric_key_management_api.rb +5 -1
  31. data/lib/cybersource_rest_client/api/taxes_api.rb +160 -160
  32. data/lib/cybersource_rest_client/api/tokenization_api.rb +89 -89
  33. data/lib/cybersource_rest_client/api/transaction_batches_api.rb +15 -3
  34. data/lib/cybersource_rest_client/api/transaction_details_api.rb +5 -1
  35. data/lib/cybersource_rest_client/api/user_management_api.rb +5 -1
  36. data/lib/cybersource_rest_client/api/user_management_search_api.rb +89 -89
  37. data/lib/cybersource_rest_client/api/verification_api.rb +154 -154
  38. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_payment_account_information_card.rb +20 -4
  39. data/lib/cybersource_rest_client/models/pts_v2_payments_post201_response_processor_information_merchant_advice.rb +20 -4
  40. data/lib/cybersource_rest_client/models/ptsv2payments_merchant_information_merchant_descriptor.rb +20 -4
  41. data/lib/cybersource_rest_client/models/ptsv2payments_order_information.rb +11 -1
  42. data/lib/cybersource_rest_client/models/ptsv2payments_order_information_invoice_details.rb +20 -4
  43. data/lib/cybersource_rest_client/models/ptsv2payments_payment_information_tokenized_card.rb +1 -1
  44. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information.rb +20 -4
  45. data/lib/cybersource_rest_client/models/ptsv2payments_point_of_sale_information_emv.rb +21 -7
  46. data/lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options.rb +17 -1
  47. data/lib/cybersource_rest_client/models/ptsv2payments_processor_information.rb +13 -4
  48. data/lib/cybersource_rest_client/models/ptsv2payments_processor_information_authorization_options.rb +190 -0
  49. data/lib/cybersource_rest_client/models/ptsv2paymentsidcaptures_point_of_sale_information_emv.rb +0 -2
  50. data/lib/cybersource_rest_client/models/ptsv2paymentsidvoids_order_information.rb +183 -0
  51. data/lib/cybersource_rest_client/models/ptsv2payouts_order_information.rb +14 -4
  52. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information.rb +13 -4
  53. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_funding_options.rb +183 -0
  54. data/lib/cybersource_rest_client/models/ptsv2payouts_processing_information_funding_options_initiator.rb +190 -0
  55. data/lib/cybersource_rest_client/models/ptsv2payouts_sender_information.rb +52 -4
  56. data/lib/cybersource_rest_client/models/riskv1authenticationresults_payment_information_tokenized_card.rb +1 -1
  57. data/lib/cybersource_rest_client/models/riskv1authentications_payment_information_tokenized_card.rb +1 -1
  58. data/lib/cybersource_rest_client/models/riskv1authenticationsetups_payment_information_tokenized_card.rb +1 -1
  59. data/lib/cybersource_rest_client/models/riskv1decisions_payment_information_tokenized_card.rb +1 -1
  60. data/lib/cybersource_rest_client/models/tss_v2_transactions_get200_response_order_information_amount_details.rb +1 -1
  61. data/lib/cybersource_rest_client/models/void_capture_request.rb +13 -4
  62. data/lib/cybersource_rest_client/models/void_credit_request.rb +13 -4
  63. data/lib/cybersource_rest_client/models/void_payment_request.rb +13 -4
  64. data/lib/cybersource_rest_client/models/void_refund_request.rb +13 -4
  65. data/lib/cybersource_rest_client.rb +4 -0
  66. metadata +7 -3
@@ -1,360 +1,368 @@
1
- =begin
2
- #CyberSource Merged Spec
3
-
4
- #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
-
6
- OpenAPI spec version: 0.0.1
7
-
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 2.2.3
10
-
11
- =end
12
-
13
- require 'uri'
14
-
15
- module CyberSource
16
- class CustomerApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default, config)
20
- @api_client = api_client
21
- @api_client.set_configuration(config)
22
- end
23
- # Delete a Customer
24
- # @param customer_token_id The TokenId of a customer.
25
- # @param [Hash] opts the optional parameters
26
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
27
- # @return [nil]
28
- def delete_customer(customer_token_id, opts = {})
29
- data, status_code, headers = delete_customer_with_http_info(customer_token_id, opts)
30
- return data, status_code, headers
31
- end
32
-
33
- # Delete a Customer
34
- # @param customer_token_id The TokenId of a customer.
35
- # @param [Hash] opts the optional parameters
36
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
37
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
38
- def delete_customer_with_http_info(customer_token_id, opts = {})
39
-
40
- if @api_client.config.debugging
41
- begin
42
- raise
43
- @api_client.config.logger.debug 'Calling API: CustomerApi.delete_customer ...'
44
- rescue
45
- puts 'Cannot write to log'
46
- end
47
- end
48
- # verify the required parameter 'customer_token_id' is set
49
- if @api_client.config.client_side_validation && customer_token_id.nil?
50
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.delete_customer"
51
- end
52
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
53
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.delete_customer, the character length must be smaller than or equal to 32.'
54
- end
55
-
56
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
57
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.delete_customer, the character length must be great than or equal to 1.'
58
- end
59
-
60
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
61
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.delete_customer, the character length must be smaller than or equal to 36.'
62
- end
63
-
64
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
65
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.delete_customer, the character length must be great than or equal to 36.'
66
- end
67
-
68
- # resource path
69
- local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
70
-
71
- # query parameters
72
- query_params = {}
73
-
74
- # header parameters
75
- header_params = {}
76
- # HTTP header 'Accept' (if needed)
77
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
78
- # HTTP header 'Content-Type'
79
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
80
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
81
-
82
- # form parameters
83
- form_params = {}
84
-
85
- # http body (model)
86
- post_body = nil
87
- auth_names = []
88
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
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
- if @api_client.config.debugging
95
- begin
96
- raise
97
- @api_client.config.logger.debug "API called: CustomerApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
- rescue
99
- puts 'Cannot write to log'
100
- end
101
- end
102
- return data, status_code, headers
103
- end
104
- # Retrieve a Customer
105
- # @param customer_token_id The TokenId of a customer.
106
- # @param [Hash] opts the optional parameters
107
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
108
- # @return [TmsV2CustomersResponse]
109
- def get_customer(customer_token_id, opts = {})
110
- data, status_code, headers = get_customer_with_http_info(customer_token_id, opts)
111
- return data, status_code, headers
112
- end
113
-
114
- # Retrieve a Customer
115
- # @param customer_token_id The TokenId of a customer.
116
- # @param [Hash] opts the optional parameters
117
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
118
- # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
119
- def get_customer_with_http_info(customer_token_id, opts = {})
120
-
121
- if @api_client.config.debugging
122
- begin
123
- raise
124
- @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...'
125
- rescue
126
- puts 'Cannot write to log'
127
- end
128
- end
129
- # verify the required parameter 'customer_token_id' is set
130
- if @api_client.config.client_side_validation && customer_token_id.nil?
131
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.get_customer"
132
- end
133
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
134
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.get_customer, the character length must be smaller than or equal to 32.'
135
- end
136
-
137
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
138
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.get_customer, the character length must be great than or equal to 1.'
139
- end
140
-
141
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
142
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.get_customer, the character length must be smaller than or equal to 36.'
143
- end
144
-
145
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
146
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.get_customer, the character length must be great than or equal to 36.'
147
- end
148
-
149
- # resource path
150
- local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
151
-
152
- # query parameters
153
- query_params = {}
154
-
155
- # header parameters
156
- header_params = {}
157
- # HTTP header 'Accept' (if needed)
158
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
159
- # HTTP header 'Content-Type'
160
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
161
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
162
-
163
- # form parameters
164
- form_params = {}
165
-
166
- # http body (model)
167
- post_body = nil
168
- auth_names = []
169
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
170
- :header_params => header_params,
171
- :query_params => query_params,
172
- :form_params => form_params,
173
- :body => post_body,
174
- :auth_names => auth_names,
175
- :return_type => 'TmsV2CustomersResponse')
176
- if @api_client.config.debugging
177
- begin
178
- raise
179
- @api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
180
- rescue
181
- puts 'Cannot write to log'
182
- end
183
- end
184
- return data, status_code, headers
185
- end
186
- # Update a Customer
187
- # @param customer_token_id The TokenId of a customer.
188
- # @param patch_customer_request
189
- # @param [Hash] opts the optional parameters
190
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
191
- # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
192
- # @return [TmsV2CustomersResponse]
193
- def patch_customer(customer_token_id, patch_customer_request, opts = {})
194
- data, status_code, headers = patch_customer_with_http_info(customer_token_id, patch_customer_request, opts)
195
- return data, status_code, headers
196
- end
197
-
198
- # Update a Customer
199
- # @param customer_token_id The TokenId of a customer.
200
- # @param patch_customer_request
201
- # @param [Hash] opts the optional parameters
202
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
203
- # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
204
- # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
205
- def patch_customer_with_http_info(customer_token_id, patch_customer_request, opts = {})
206
-
207
- if @api_client.config.debugging
208
- begin
209
- raise
210
- @api_client.config.logger.debug 'Calling API: CustomerApi.patch_customer ...'
211
- rescue
212
- puts 'Cannot write to log'
213
- end
214
- end
215
- # verify the required parameter 'customer_token_id' is set
216
- if @api_client.config.client_side_validation && customer_token_id.nil?
217
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.patch_customer"
218
- end
219
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
220
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 32.'
221
- end
222
-
223
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
224
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.patch_customer, the character length must be great than or equal to 1.'
225
- end
226
-
227
- # verify the required parameter 'patch_customer_request' is set
228
- if @api_client.config.client_side_validation && patch_customer_request.nil?
229
- fail ArgumentError, "Missing the required parameter 'patch_customer_request' when calling CustomerApi.patch_customer"
230
- end
231
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
232
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 36.'
233
- end
234
-
235
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
236
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.patch_customer, the character length must be great than or equal to 36.'
237
- end
238
-
239
- if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length > 32
240
- fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 32.'
241
- end
242
-
243
- if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length < 1
244
- fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerApi.patch_customer, the character length must be great than or equal to 1.'
245
- end
246
-
247
- # resource path
248
- local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
249
-
250
- # query parameters
251
- query_params = {}
252
-
253
- # header parameters
254
- header_params = {}
255
- # HTTP header 'Accept' (if needed)
256
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
257
- # HTTP header 'Content-Type'
258
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
259
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
260
- header_params[:'if-match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
261
-
262
- # form parameters
263
- form_params = {}
264
-
265
- # http body (model)
266
- post_body = @api_client.object_to_http_body(patch_customer_request)
267
- auth_names = []
268
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
269
- :header_params => header_params,
270
- :query_params => query_params,
271
- :form_params => form_params,
272
- :body => post_body,
273
- :auth_names => auth_names,
274
- :return_type => 'TmsV2CustomersResponse')
275
- if @api_client.config.debugging
276
- begin
277
- raise
278
- @api_client.config.logger.debug "API called: CustomerApi#patch_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
279
- rescue
280
- puts 'Cannot write to log'
281
- end
282
- end
283
- return data, status_code, headers
284
- end
285
- # Create a Customer
286
- # @param post_customer_request
287
- # @param [Hash] opts the optional parameters
288
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
289
- # @return [TmsV2CustomersResponse]
290
- def post_customer(post_customer_request, opts = {})
291
- data, status_code, headers = post_customer_with_http_info(post_customer_request, opts)
292
- return data, status_code, headers
293
- end
294
-
295
- # Create a Customer
296
- # @param post_customer_request
297
- # @param [Hash] opts the optional parameters
298
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
299
- # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
300
- def post_customer_with_http_info(post_customer_request, opts = {})
301
-
302
- if @api_client.config.debugging
303
- begin
304
- raise
305
- @api_client.config.logger.debug 'Calling API: CustomerApi.post_customer ...'
306
- rescue
307
- puts 'Cannot write to log'
308
- end
309
- end
310
- # verify the required parameter 'post_customer_request' is set
311
- if @api_client.config.client_side_validation && post_customer_request.nil?
312
- fail ArgumentError, "Missing the required parameter 'post_customer_request' when calling CustomerApi.post_customer"
313
- end
314
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
315
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.post_customer, the character length must be smaller than or equal to 36.'
316
- end
317
-
318
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
319
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.post_customer, the character length must be great than or equal to 36.'
320
- end
321
-
322
- # resource path
323
- local_var_path = 'tms/v2/customers'
324
-
325
- # query parameters
326
- query_params = {}
327
-
328
- # header parameters
329
- header_params = {}
330
- # HTTP header 'Accept' (if needed)
331
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
332
- # HTTP header 'Content-Type'
333
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
334
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
335
-
336
- # form parameters
337
- form_params = {}
338
-
339
- # http body (model)
340
- post_body = @api_client.object_to_http_body(post_customer_request)
341
- auth_names = []
342
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
343
- :header_params => header_params,
344
- :query_params => query_params,
345
- :form_params => form_params,
346
- :body => post_body,
347
- :auth_names => auth_names,
348
- :return_type => 'TmsV2CustomersResponse')
349
- if @api_client.config.debugging
350
- begin
351
- raise
352
- @api_client.config.logger.debug "API called: CustomerApi#post_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
353
- rescue
354
- puts 'Cannot write to log'
355
- end
356
- end
357
- return data, status_code, headers
358
- end
359
- end
360
- end
1
+ =begin
2
+ #CyberSource Merged Spec
3
+
4
+ #All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
5
+
6
+ OpenAPI spec version: 0.0.1
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.2.3
10
+
11
+ =end
12
+
13
+ require 'uri'
14
+
15
+ module CyberSource
16
+ class CustomerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default, config)
20
+ @api_client = api_client
21
+ @api_client.set_configuration(config)
22
+ end
23
+ # Delete a Customer
24
+ # @param customer_token_id The TokenId of a customer.
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
27
+ # @return [nil]
28
+ def delete_customer(customer_token_id, opts = {})
29
+ data, status_code, headers = delete_customer_with_http_info(customer_token_id, opts)
30
+ return data, status_code, headers
31
+ end
32
+
33
+ # Delete a Customer
34
+ # @param customer_token_id The TokenId of a customer.
35
+ # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
37
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
38
+ def delete_customer_with_http_info(customer_token_id, opts = {})
39
+
40
+ if @api_client.config.debugging
41
+ begin
42
+ raise
43
+ @api_client.config.logger.debug 'Calling API: CustomerApi.delete_customer ...'
44
+ rescue
45
+ puts 'Cannot write to log'
46
+ end
47
+ end
48
+ # verify the required parameter 'customer_token_id' is set
49
+ if @api_client.config.client_side_validation && customer_token_id.nil?
50
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.delete_customer"
51
+ end
52
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
53
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.delete_customer, the character length must be smaller than or equal to 32.'
54
+ end
55
+
56
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
57
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.delete_customer, the character length must be great than or equal to 1.'
58
+ end
59
+
60
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
61
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.delete_customer, the character length must be smaller than or equal to 36.'
62
+ end
63
+
64
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
65
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.delete_customer, the character length must be great than or equal to 36.'
66
+ end
67
+
68
+ # resource path
69
+ local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
70
+
71
+ # query parameters
72
+ query_params = {}
73
+
74
+ # header parameters
75
+ header_params = {}
76
+ # HTTP header 'Accept' (if needed)
77
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
78
+ # HTTP header 'Content-Type'
79
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
80
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
81
+
82
+ # form parameters
83
+ form_params = {}
84
+
85
+ # http body (model)
86
+ if 'DELETE' == 'POST'
87
+ post_body = '{}'
88
+ else
89
+ post_body = nil
90
+ end
91
+ auth_names = []
92
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
93
+ :header_params => header_params,
94
+ :query_params => query_params,
95
+ :form_params => form_params,
96
+ :body => post_body,
97
+ :auth_names => auth_names)
98
+ if @api_client.config.debugging
99
+ begin
100
+ raise
101
+ @api_client.config.logger.debug "API called: CustomerApi#delete_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ rescue
103
+ puts 'Cannot write to log'
104
+ end
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+ # Retrieve a Customer
109
+ # @param customer_token_id The TokenId of a customer.
110
+ # @param [Hash] opts the optional parameters
111
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
112
+ # @return [TmsV2CustomersResponse]
113
+ def get_customer(customer_token_id, opts = {})
114
+ data, status_code, headers = get_customer_with_http_info(customer_token_id, opts)
115
+ return data, status_code, headers
116
+ end
117
+
118
+ # Retrieve a Customer
119
+ # @param customer_token_id The TokenId of a customer.
120
+ # @param [Hash] opts the optional parameters
121
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
122
+ # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
123
+ def get_customer_with_http_info(customer_token_id, opts = {})
124
+
125
+ if @api_client.config.debugging
126
+ begin
127
+ raise
128
+ @api_client.config.logger.debug 'Calling API: CustomerApi.get_customer ...'
129
+ rescue
130
+ puts 'Cannot write to log'
131
+ end
132
+ end
133
+ # verify the required parameter 'customer_token_id' is set
134
+ if @api_client.config.client_side_validation && customer_token_id.nil?
135
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.get_customer"
136
+ end
137
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
138
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.get_customer, the character length must be smaller than or equal to 32.'
139
+ end
140
+
141
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
142
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.get_customer, the character length must be great than or equal to 1.'
143
+ end
144
+
145
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
146
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.get_customer, the character length must be smaller than or equal to 36.'
147
+ end
148
+
149
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
150
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.get_customer, the character length must be great than or equal to 36.'
151
+ end
152
+
153
+ # resource path
154
+ local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
155
+
156
+ # query parameters
157
+ query_params = {}
158
+
159
+ # header parameters
160
+ header_params = {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
163
+ # HTTP header 'Content-Type'
164
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
165
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
166
+
167
+ # form parameters
168
+ form_params = {}
169
+
170
+ # http body (model)
171
+ if 'GET' == 'POST'
172
+ post_body = '{}'
173
+ else
174
+ post_body = nil
175
+ end
176
+ auth_names = []
177
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
178
+ :header_params => header_params,
179
+ :query_params => query_params,
180
+ :form_params => form_params,
181
+ :body => post_body,
182
+ :auth_names => auth_names,
183
+ :return_type => 'TmsV2CustomersResponse')
184
+ if @api_client.config.debugging
185
+ begin
186
+ raise
187
+ @api_client.config.logger.debug "API called: CustomerApi#get_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
188
+ rescue
189
+ puts 'Cannot write to log'
190
+ end
191
+ end
192
+ return data, status_code, headers
193
+ end
194
+ # Update a Customer
195
+ # @param customer_token_id The TokenId of a customer.
196
+ # @param patch_customer_request
197
+ # @param [Hash] opts the optional parameters
198
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
199
+ # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
200
+ # @return [TmsV2CustomersResponse]
201
+ def patch_customer(customer_token_id, patch_customer_request, opts = {})
202
+ data, status_code, headers = patch_customer_with_http_info(customer_token_id, patch_customer_request, opts)
203
+ return data, status_code, headers
204
+ end
205
+
206
+ # Update a Customer
207
+ # @param customer_token_id The TokenId of a customer.
208
+ # @param patch_customer_request
209
+ # @param [Hash] opts the optional parameters
210
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
211
+ # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
212
+ # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
213
+ def patch_customer_with_http_info(customer_token_id, patch_customer_request, opts = {})
214
+
215
+ if @api_client.config.debugging
216
+ begin
217
+ raise
218
+ @api_client.config.logger.debug 'Calling API: CustomerApi.patch_customer ...'
219
+ rescue
220
+ puts 'Cannot write to log'
221
+ end
222
+ end
223
+ # verify the required parameter 'customer_token_id' is set
224
+ if @api_client.config.client_side_validation && customer_token_id.nil?
225
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerApi.patch_customer"
226
+ end
227
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
228
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 32.'
229
+ end
230
+
231
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
232
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerApi.patch_customer, the character length must be great than or equal to 1.'
233
+ end
234
+
235
+ # verify the required parameter 'patch_customer_request' is set
236
+ if @api_client.config.client_side_validation && patch_customer_request.nil?
237
+ fail ArgumentError, "Missing the required parameter 'patch_customer_request' when calling CustomerApi.patch_customer"
238
+ end
239
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
240
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 36.'
241
+ end
242
+
243
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
244
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.patch_customer, the character length must be great than or equal to 36.'
245
+ end
246
+
247
+ if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length > 32
248
+ fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerApi.patch_customer, the character length must be smaller than or equal to 32.'
249
+ end
250
+
251
+ if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length < 1
252
+ fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerApi.patch_customer, the character length must be great than or equal to 1.'
253
+ end
254
+
255
+ # resource path
256
+ local_var_path = 'tms/v2/customers/{customerTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
257
+
258
+ # query parameters
259
+ query_params = {}
260
+
261
+ # header parameters
262
+ header_params = {}
263
+ # HTTP header 'Accept' (if needed)
264
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
265
+ # HTTP header 'Content-Type'
266
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
267
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
268
+ header_params[:'if-match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
269
+
270
+ # form parameters
271
+ form_params = {}
272
+
273
+ # http body (model)
274
+ post_body = @api_client.object_to_http_body(patch_customer_request)
275
+ auth_names = []
276
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
277
+ :header_params => header_params,
278
+ :query_params => query_params,
279
+ :form_params => form_params,
280
+ :body => post_body,
281
+ :auth_names => auth_names,
282
+ :return_type => 'TmsV2CustomersResponse')
283
+ if @api_client.config.debugging
284
+ begin
285
+ raise
286
+ @api_client.config.logger.debug "API called: CustomerApi#patch_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
287
+ rescue
288
+ puts 'Cannot write to log'
289
+ end
290
+ end
291
+ return data, status_code, headers
292
+ end
293
+ # Create a Customer
294
+ # @param post_customer_request
295
+ # @param [Hash] opts the optional parameters
296
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
297
+ # @return [TmsV2CustomersResponse]
298
+ def post_customer(post_customer_request, opts = {})
299
+ data, status_code, headers = post_customer_with_http_info(post_customer_request, opts)
300
+ return data, status_code, headers
301
+ end
302
+
303
+ # Create a Customer
304
+ # @param post_customer_request
305
+ # @param [Hash] opts the optional parameters
306
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
307
+ # @return [Array<(TmsV2CustomersResponse, Fixnum, Hash)>] TmsV2CustomersResponse data, response status code and response headers
308
+ def post_customer_with_http_info(post_customer_request, opts = {})
309
+
310
+ if @api_client.config.debugging
311
+ begin
312
+ raise
313
+ @api_client.config.logger.debug 'Calling API: CustomerApi.post_customer ...'
314
+ rescue
315
+ puts 'Cannot write to log'
316
+ end
317
+ end
318
+ # verify the required parameter 'post_customer_request' is set
319
+ if @api_client.config.client_side_validation && post_customer_request.nil?
320
+ fail ArgumentError, "Missing the required parameter 'post_customer_request' when calling CustomerApi.post_customer"
321
+ end
322
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
323
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.post_customer, the character length must be smaller than or equal to 36.'
324
+ end
325
+
326
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
327
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerApi.post_customer, the character length must be great than or equal to 36.'
328
+ end
329
+
330
+ # resource path
331
+ local_var_path = 'tms/v2/customers'
332
+
333
+ # query parameters
334
+ query_params = {}
335
+
336
+ # header parameters
337
+ header_params = {}
338
+ # HTTP header 'Accept' (if needed)
339
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
340
+ # HTTP header 'Content-Type'
341
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
342
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
343
+
344
+ # form parameters
345
+ form_params = {}
346
+
347
+ # http body (model)
348
+ post_body = @api_client.object_to_http_body(post_customer_request)
349
+ auth_names = []
350
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
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 => 'TmsV2CustomersResponse')
357
+ if @api_client.config.debugging
358
+ begin
359
+ raise
360
+ @api_client.config.logger.debug "API called: CustomerApi#post_customer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
361
+ rescue
362
+ puts 'Cannot write to log'
363
+ end
364
+ end
365
+ return data, status_code, headers
366
+ end
367
+ end
368
+ end