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,518 +1,530 @@
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 CustomerShippingAddressApi
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 Shipping Address
24
- # @param customer_token_id The TokenId of a customer.
25
- # @param shipping_address_token_id The TokenId of an shipping address.
26
- # @param [Hash] opts the optional parameters
27
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
28
- # @return [nil]
29
- def delete_customer_shipping_address(customer_token_id, shipping_address_token_id, opts = {})
30
- data, status_code, headers = delete_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts)
31
- return data, status_code, headers
32
- end
33
-
34
- # Delete a Customer Shipping Address
35
- # @param customer_token_id The TokenId of a customer.
36
- # @param shipping_address_token_id The TokenId of an shipping address.
37
- # @param [Hash] opts the optional parameters
38
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
39
- # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
40
- def delete_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts = {})
41
-
42
- if @api_client.config.debugging
43
- begin
44
- raise
45
- @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.delete_customer_shipping_address ...'
46
- rescue
47
- puts 'Cannot write to log'
48
- end
49
- end
50
- # verify the required parameter 'customer_token_id' is set
51
- if @api_client.config.client_side_validation && customer_token_id.nil?
52
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.delete_customer_shipping_address"
53
- end
54
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
55
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 32.'
56
- end
57
-
58
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
59
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 1.'
60
- end
61
-
62
- # verify the required parameter 'shipping_address_token_id' is set
63
- if @api_client.config.client_side_validation && shipping_address_token_id.nil?
64
- fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.delete_customer_shipping_address"
65
- end
66
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
67
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 32.'
68
- end
69
-
70
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
71
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 1.'
72
- end
73
-
74
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
75
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 36.'
76
- end
77
-
78
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
79
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 36.'
80
- end
81
-
82
- # resource path
83
- local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
84
-
85
- # query parameters
86
- query_params = {}
87
-
88
- # header parameters
89
- header_params = {}
90
- # HTTP header 'Accept' (if needed)
91
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
92
- # HTTP header 'Content-Type'
93
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
94
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
95
-
96
- # form parameters
97
- form_params = {}
98
-
99
- # http body (model)
100
- post_body = nil
101
- auth_names = []
102
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
103
- :header_params => header_params,
104
- :query_params => query_params,
105
- :form_params => form_params,
106
- :body => post_body,
107
- :auth_names => auth_names)
108
- if @api_client.config.debugging
109
- begin
110
- raise
111
- @api_client.config.logger.debug "API called: CustomerShippingAddressApi#delete_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
112
- rescue
113
- puts 'Cannot write to log'
114
- end
115
- end
116
- return data, status_code, headers
117
- end
118
- # Retrieve a Customer Shipping Address
119
- # @param customer_token_id The TokenId of a customer.
120
- # @param shipping_address_token_id The TokenId of an shipping address.
121
- # @param [Hash] opts the optional parameters
122
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
123
- # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
124
- def get_customer_shipping_address(customer_token_id, shipping_address_token_id, opts = {})
125
- data, status_code, headers = get_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts)
126
- return data, status_code, headers
127
- end
128
-
129
- # Retrieve a Customer Shipping Address
130
- # @param customer_token_id The TokenId of a customer.
131
- # @param shipping_address_token_id The TokenId of an shipping address.
132
- # @param [Hash] opts the optional parameters
133
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
134
- # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
135
- def get_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts = {})
136
-
137
- if @api_client.config.debugging
138
- begin
139
- raise
140
- @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.get_customer_shipping_address ...'
141
- rescue
142
- puts 'Cannot write to log'
143
- end
144
- end
145
- # verify the required parameter 'customer_token_id' is set
146
- if @api_client.config.client_side_validation && customer_token_id.nil?
147
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_address"
148
- end
149
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
150
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 32.'
151
- end
152
-
153
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
154
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 1.'
155
- end
156
-
157
- # verify the required parameter 'shipping_address_token_id' is set
158
- if @api_client.config.client_side_validation && shipping_address_token_id.nil?
159
- fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_address"
160
- end
161
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
162
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 32.'
163
- end
164
-
165
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
166
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 1.'
167
- end
168
-
169
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
170
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 36.'
171
- end
172
-
173
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
174
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 36.'
175
- end
176
-
177
- # resource path
178
- local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
179
-
180
- # query parameters
181
- query_params = {}
182
-
183
- # header parameters
184
- header_params = {}
185
- # HTTP header 'Accept' (if needed)
186
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
187
- # HTTP header 'Content-Type'
188
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
189
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
190
-
191
- # form parameters
192
- form_params = {}
193
-
194
- # http body (model)
195
- post_body = nil
196
- auth_names = []
197
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
198
- :header_params => header_params,
199
- :query_params => query_params,
200
- :form_params => form_params,
201
- :body => post_body,
202
- :auth_names => auth_names,
203
- :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
204
- if @api_client.config.debugging
205
- begin
206
- raise
207
- @api_client.config.logger.debug "API called: CustomerShippingAddressApi#get_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
- rescue
209
- puts 'Cannot write to log'
210
- end
211
- end
212
- return data, status_code, headers
213
- end
214
- # List Shipping Addresses for a Customer
215
- # @param customer_token_id The TokenId of a customer.
216
- # @param [Hash] opts the optional parameters
217
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
218
- # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. (default to 0)
219
- # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (default to 20)
220
- # @return [ShippingAddressListForCustomer]
221
- def get_customer_shipping_addresses_list(customer_token_id, opts = {})
222
- data, status_code, headers = get_customer_shipping_addresses_list_with_http_info(customer_token_id, opts)
223
- return data, status_code, headers
224
- end
225
-
226
- # List Shipping Addresses for a Customer
227
- # @param customer_token_id The TokenId of a customer.
228
- # @param [Hash] opts the optional parameters
229
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
230
- # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
231
- # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
232
- # @return [Array<(ShippingAddressListForCustomer, Fixnum, Hash)>] ShippingAddressListForCustomer data, response status code and response headers
233
- def get_customer_shipping_addresses_list_with_http_info(customer_token_id, opts = {})
234
-
235
- if @api_client.config.debugging
236
- begin
237
- raise
238
- @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.get_customer_shipping_addresses_list ...'
239
- rescue
240
- puts 'Cannot write to log'
241
- end
242
- end
243
- # verify the required parameter 'customer_token_id' is set
244
- if @api_client.config.client_side_validation && customer_token_id.nil?
245
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list"
246
- end
247
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
248
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be smaller than or equal to 32.'
249
- end
250
-
251
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
252
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be great than or equal to 1.'
253
- end
254
-
255
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
256
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be smaller than or equal to 36.'
257
- end
258
-
259
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
260
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be great than or equal to 36.'
261
- end
262
-
263
- if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
264
- fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be greater than or equal to 0.'
265
- end
266
-
267
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
268
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be smaller than or equal to 100.'
269
- end
270
-
271
- if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
272
- fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be greater than or equal to 1.'
273
- end
274
-
275
- # resource path
276
- local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
277
-
278
- # query parameters
279
- query_params = {}
280
- query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
281
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
282
-
283
- # header parameters
284
- header_params = {}
285
- # HTTP header 'Accept' (if needed)
286
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
287
- # HTTP header 'Content-Type'
288
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
289
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
290
-
291
- # form parameters
292
- form_params = {}
293
-
294
- # http body (model)
295
- post_body = nil
296
- auth_names = []
297
- data, status_code, headers = @api_client.call_api(:GET, local_var_path,
298
- :header_params => header_params,
299
- :query_params => query_params,
300
- :form_params => form_params,
301
- :body => post_body,
302
- :auth_names => auth_names,
303
- :return_type => 'ShippingAddressListForCustomer')
304
- if @api_client.config.debugging
305
- begin
306
- raise
307
- @api_client.config.logger.debug "API called: CustomerShippingAddressApi#get_customer_shipping_addresses_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
- rescue
309
- puts 'Cannot write to log'
310
- end
311
- end
312
- return data, status_code, headers
313
- end
314
- # Update a Customer Shipping Address
315
- # @param customer_token_id The TokenId of a customer.
316
- # @param shipping_address_token_id The TokenId of an shipping address.
317
- # @param patch_customer_shipping_address_request
318
- # @param [Hash] opts the optional parameters
319
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
320
- # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
321
- # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
322
- def patch_customers_shipping_address(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts = {})
323
- data, status_code, headers = patch_customers_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts)
324
- return data, status_code, headers
325
- end
326
-
327
- # Update a Customer Shipping Address
328
- # @param customer_token_id The TokenId of a customer.
329
- # @param shipping_address_token_id The TokenId of an shipping address.
330
- # @param patch_customer_shipping_address_request
331
- # @param [Hash] opts the optional parameters
332
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
333
- # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
334
- # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
335
- def patch_customers_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts = {})
336
-
337
- if @api_client.config.debugging
338
- begin
339
- raise
340
- @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.patch_customers_shipping_address ...'
341
- rescue
342
- puts 'Cannot write to log'
343
- end
344
- end
345
- # verify the required parameter 'customer_token_id' is set
346
- if @api_client.config.client_side_validation && customer_token_id.nil?
347
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
348
- end
349
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
350
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
351
- end
352
-
353
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
354
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
355
- end
356
-
357
- # verify the required parameter 'shipping_address_token_id' is set
358
- if @api_client.config.client_side_validation && shipping_address_token_id.nil?
359
- fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
360
- end
361
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
362
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
363
- end
364
-
365
- if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
366
- fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
367
- end
368
-
369
- # verify the required parameter 'patch_customer_shipping_address_request' is set
370
- if @api_client.config.client_side_validation && patch_customer_shipping_address_request.nil?
371
- fail ArgumentError, "Missing the required parameter 'patch_customer_shipping_address_request' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
372
- end
373
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
374
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 36.'
375
- end
376
-
377
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
378
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 36.'
379
- end
380
-
381
- if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length > 32
382
- fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
383
- end
384
-
385
- if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length < 1
386
- fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
387
- end
388
-
389
- # resource path
390
- local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
391
-
392
- # query parameters
393
- query_params = {}
394
-
395
- # header parameters
396
- header_params = {}
397
- # HTTP header 'Accept' (if needed)
398
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
399
- # HTTP header 'Content-Type'
400
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
401
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
402
- header_params[:'if-match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
403
-
404
- # form parameters
405
- form_params = {}
406
-
407
- # http body (model)
408
- post_body = @api_client.object_to_http_body(patch_customer_shipping_address_request)
409
- auth_names = []
410
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
411
- :header_params => header_params,
412
- :query_params => query_params,
413
- :form_params => form_params,
414
- :body => post_body,
415
- :auth_names => auth_names,
416
- :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
417
- if @api_client.config.debugging
418
- begin
419
- raise
420
- @api_client.config.logger.debug "API called: CustomerShippingAddressApi#patch_customers_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
421
- rescue
422
- puts 'Cannot write to log'
423
- end
424
- end
425
- return data, status_code, headers
426
- end
427
- # Create a Customer Shipping Address
428
- # Include an existing TMS Customer token id in the request URI. * A Customer token can be created by calling: **POST */tms/v2/customers***
429
- # @param customer_token_id The TokenId of a customer.
430
- # @param post_customer_shipping_address_request
431
- # @param [Hash] opts the optional parameters
432
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
433
- # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
434
- def post_customer_shipping_address(customer_token_id, post_customer_shipping_address_request, opts = {})
435
- data, status_code, headers = post_customer_shipping_address_with_http_info(customer_token_id, post_customer_shipping_address_request, opts)
436
- return data, status_code, headers
437
- end
438
-
439
- # Create a Customer Shipping Address
440
- # Include an existing TMS Customer token id in the request URI. * A Customer token can be created by calling: **POST */tms/v2/customers***
441
- # @param customer_token_id The TokenId of a customer.
442
- # @param post_customer_shipping_address_request
443
- # @param [Hash] opts the optional parameters
444
- # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
445
- # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
446
- def post_customer_shipping_address_with_http_info(customer_token_id, post_customer_shipping_address_request, opts = {})
447
-
448
- if @api_client.config.debugging
449
- begin
450
- raise
451
- @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.post_customer_shipping_address ...'
452
- rescue
453
- puts 'Cannot write to log'
454
- end
455
- end
456
- # verify the required parameter 'customer_token_id' is set
457
- if @api_client.config.client_side_validation && customer_token_id.nil?
458
- fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.post_customer_shipping_address"
459
- end
460
- if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
461
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be smaller than or equal to 32.'
462
- end
463
-
464
- if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
465
- fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be great than or equal to 1.'
466
- end
467
-
468
- # verify the required parameter 'post_customer_shipping_address_request' is set
469
- if @api_client.config.client_side_validation && post_customer_shipping_address_request.nil?
470
- fail ArgumentError, "Missing the required parameter 'post_customer_shipping_address_request' when calling CustomerShippingAddressApi.post_customer_shipping_address"
471
- end
472
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
473
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be smaller than or equal to 36.'
474
- end
475
-
476
- if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
477
- fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be great than or equal to 36.'
478
- end
479
-
480
- # resource path
481
- local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
482
-
483
- # query parameters
484
- query_params = {}
485
-
486
- # header parameters
487
- header_params = {}
488
- # HTTP header 'Accept' (if needed)
489
- header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
490
- # HTTP header 'Content-Type'
491
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
492
- header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
493
-
494
- # form parameters
495
- form_params = {}
496
-
497
- # http body (model)
498
- post_body = @api_client.object_to_http_body(post_customer_shipping_address_request)
499
- auth_names = []
500
- data, status_code, headers = @api_client.call_api(:POST, local_var_path,
501
- :header_params => header_params,
502
- :query_params => query_params,
503
- :form_params => form_params,
504
- :body => post_body,
505
- :auth_names => auth_names,
506
- :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
507
- if @api_client.config.debugging
508
- begin
509
- raise
510
- @api_client.config.logger.debug "API called: CustomerShippingAddressApi#post_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
511
- rescue
512
- puts 'Cannot write to log'
513
- end
514
- end
515
- return data, status_code, headers
516
- end
517
- end
518
- 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 CustomerShippingAddressApi
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 Shipping Address
24
+ # @param customer_token_id The TokenId of a customer.
25
+ # @param shipping_address_token_id The TokenId of an shipping address.
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
28
+ # @return [nil]
29
+ def delete_customer_shipping_address(customer_token_id, shipping_address_token_id, opts = {})
30
+ data, status_code, headers = delete_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts)
31
+ return data, status_code, headers
32
+ end
33
+
34
+ # Delete a Customer Shipping Address
35
+ # @param customer_token_id The TokenId of a customer.
36
+ # @param shipping_address_token_id The TokenId of an shipping address.
37
+ # @param [Hash] opts the optional parameters
38
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
39
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
40
+ def delete_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts = {})
41
+
42
+ if @api_client.config.debugging
43
+ begin
44
+ raise
45
+ @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.delete_customer_shipping_address ...'
46
+ rescue
47
+ puts 'Cannot write to log'
48
+ end
49
+ end
50
+ # verify the required parameter 'customer_token_id' is set
51
+ if @api_client.config.client_side_validation && customer_token_id.nil?
52
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.delete_customer_shipping_address"
53
+ end
54
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
55
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 32.'
56
+ end
57
+
58
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
59
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 1.'
60
+ end
61
+
62
+ # verify the required parameter 'shipping_address_token_id' is set
63
+ if @api_client.config.client_side_validation && shipping_address_token_id.nil?
64
+ fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.delete_customer_shipping_address"
65
+ end
66
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
67
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 32.'
68
+ end
69
+
70
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
71
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 1.'
72
+ end
73
+
74
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
75
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be smaller than or equal to 36.'
76
+ end
77
+
78
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
79
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.delete_customer_shipping_address, the character length must be great than or equal to 36.'
80
+ end
81
+
82
+ # resource path
83
+ local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
84
+
85
+ # query parameters
86
+ query_params = {}
87
+
88
+ # header parameters
89
+ header_params = {}
90
+ # HTTP header 'Accept' (if needed)
91
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
92
+ # HTTP header 'Content-Type'
93
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
94
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
95
+
96
+ # form parameters
97
+ form_params = {}
98
+
99
+ # http body (model)
100
+ if 'DELETE' == 'POST'
101
+ post_body = '{}'
102
+ else
103
+ post_body = nil
104
+ end
105
+ auth_names = []
106
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
107
+ :header_params => header_params,
108
+ :query_params => query_params,
109
+ :form_params => form_params,
110
+ :body => post_body,
111
+ :auth_names => auth_names)
112
+ if @api_client.config.debugging
113
+ begin
114
+ raise
115
+ @api_client.config.logger.debug "API called: CustomerShippingAddressApi#delete_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
116
+ rescue
117
+ puts 'Cannot write to log'
118
+ end
119
+ end
120
+ return data, status_code, headers
121
+ end
122
+ # Retrieve a Customer Shipping Address
123
+ # @param customer_token_id The TokenId of a customer.
124
+ # @param shipping_address_token_id The TokenId of an shipping address.
125
+ # @param [Hash] opts the optional parameters
126
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
127
+ # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
128
+ def get_customer_shipping_address(customer_token_id, shipping_address_token_id, opts = {})
129
+ data, status_code, headers = get_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts)
130
+ return data, status_code, headers
131
+ end
132
+
133
+ # Retrieve a Customer Shipping Address
134
+ # @param customer_token_id The TokenId of a customer.
135
+ # @param shipping_address_token_id The TokenId of an shipping address.
136
+ # @param [Hash] opts the optional parameters
137
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
138
+ # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
139
+ def get_customer_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, opts = {})
140
+
141
+ if @api_client.config.debugging
142
+ begin
143
+ raise
144
+ @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.get_customer_shipping_address ...'
145
+ rescue
146
+ puts 'Cannot write to log'
147
+ end
148
+ end
149
+ # verify the required parameter 'customer_token_id' is set
150
+ if @api_client.config.client_side_validation && customer_token_id.nil?
151
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_address"
152
+ end
153
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
154
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 32.'
155
+ end
156
+
157
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
158
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 1.'
159
+ end
160
+
161
+ # verify the required parameter 'shipping_address_token_id' is set
162
+ if @api_client.config.client_side_validation && shipping_address_token_id.nil?
163
+ fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_address"
164
+ end
165
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
166
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 32.'
167
+ end
168
+
169
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
170
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 1.'
171
+ end
172
+
173
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
174
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be smaller than or equal to 36.'
175
+ end
176
+
177
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
178
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_address, the character length must be great than or equal to 36.'
179
+ end
180
+
181
+ # resource path
182
+ local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
183
+
184
+ # query parameters
185
+ query_params = {}
186
+
187
+ # header parameters
188
+ header_params = {}
189
+ # HTTP header 'Accept' (if needed)
190
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
191
+ # HTTP header 'Content-Type'
192
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
193
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
194
+
195
+ # form parameters
196
+ form_params = {}
197
+
198
+ # http body (model)
199
+ if 'GET' == 'POST'
200
+ post_body = '{}'
201
+ else
202
+ post_body = nil
203
+ end
204
+ auth_names = []
205
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
206
+ :header_params => header_params,
207
+ :query_params => query_params,
208
+ :form_params => form_params,
209
+ :body => post_body,
210
+ :auth_names => auth_names,
211
+ :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
212
+ if @api_client.config.debugging
213
+ begin
214
+ raise
215
+ @api_client.config.logger.debug "API called: CustomerShippingAddressApi#get_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
216
+ rescue
217
+ puts 'Cannot write to log'
218
+ end
219
+ end
220
+ return data, status_code, headers
221
+ end
222
+ # List Shipping Addresses for a Customer
223
+ # @param customer_token_id The TokenId of a customer.
224
+ # @param [Hash] opts the optional parameters
225
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
226
+ # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0. (default to 0)
227
+ # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100. (default to 20)
228
+ # @return [ShippingAddressListForCustomer]
229
+ def get_customer_shipping_addresses_list(customer_token_id, opts = {})
230
+ data, status_code, headers = get_customer_shipping_addresses_list_with_http_info(customer_token_id, opts)
231
+ return data, status_code, headers
232
+ end
233
+
234
+ # List Shipping Addresses for a Customer
235
+ # @param customer_token_id The TokenId of a customer.
236
+ # @param [Hash] opts the optional parameters
237
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
238
+ # @option opts [Integer] :offset Starting record in zero-based dataset that should be returned as the first object in the array. Default is 0.
239
+ # @option opts [Integer] :limit The maximum number that can be returned in the array starting from the offset record in zero-based dataset. Default is 20, maximum is 100.
240
+ # @return [Array<(ShippingAddressListForCustomer, Fixnum, Hash)>] ShippingAddressListForCustomer data, response status code and response headers
241
+ def get_customer_shipping_addresses_list_with_http_info(customer_token_id, opts = {})
242
+
243
+ if @api_client.config.debugging
244
+ begin
245
+ raise
246
+ @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.get_customer_shipping_addresses_list ...'
247
+ rescue
248
+ puts 'Cannot write to log'
249
+ end
250
+ end
251
+ # verify the required parameter 'customer_token_id' is set
252
+ if @api_client.config.client_side_validation && customer_token_id.nil?
253
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list"
254
+ end
255
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
256
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be smaller than or equal to 32.'
257
+ end
258
+
259
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
260
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be great than or equal to 1.'
261
+ end
262
+
263
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
264
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be smaller than or equal to 36.'
265
+ end
266
+
267
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
268
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, the character length must be great than or equal to 36.'
269
+ end
270
+
271
+ if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0
272
+ fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be greater than or equal to 0.'
273
+ end
274
+
275
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100
276
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be smaller than or equal to 100.'
277
+ end
278
+
279
+ if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1
280
+ fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling CustomerShippingAddressApi.get_customer_shipping_addresses_list, must be greater than or equal to 1.'
281
+ end
282
+
283
+ # resource path
284
+ local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
285
+
286
+ # query parameters
287
+ query_params = {}
288
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
289
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
290
+
291
+ # header parameters
292
+ header_params = {}
293
+ # HTTP header 'Accept' (if needed)
294
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
295
+ # HTTP header 'Content-Type'
296
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
297
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
298
+
299
+ # form parameters
300
+ form_params = {}
301
+
302
+ # http body (model)
303
+ if 'GET' == 'POST'
304
+ post_body = '{}'
305
+ else
306
+ post_body = nil
307
+ end
308
+ auth_names = []
309
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
310
+ :header_params => header_params,
311
+ :query_params => query_params,
312
+ :form_params => form_params,
313
+ :body => post_body,
314
+ :auth_names => auth_names,
315
+ :return_type => 'ShippingAddressListForCustomer')
316
+ if @api_client.config.debugging
317
+ begin
318
+ raise
319
+ @api_client.config.logger.debug "API called: CustomerShippingAddressApi#get_customer_shipping_addresses_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
320
+ rescue
321
+ puts 'Cannot write to log'
322
+ end
323
+ end
324
+ return data, status_code, headers
325
+ end
326
+ # Update a Customer Shipping Address
327
+ # @param customer_token_id The TokenId of a customer.
328
+ # @param shipping_address_token_id The TokenId of an shipping address.
329
+ # @param patch_customer_shipping_address_request
330
+ # @param [Hash] opts the optional parameters
331
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
332
+ # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
333
+ # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
334
+ def patch_customers_shipping_address(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts = {})
335
+ data, status_code, headers = patch_customers_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts)
336
+ return data, status_code, headers
337
+ end
338
+
339
+ # Update a Customer Shipping Address
340
+ # @param customer_token_id The TokenId of a customer.
341
+ # @param shipping_address_token_id The TokenId of an shipping address.
342
+ # @param patch_customer_shipping_address_request
343
+ # @param [Hash] opts the optional parameters
344
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
345
+ # @option opts [String] :if_match Contains an ETag value from a GET request to make the request conditional.
346
+ # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
347
+ def patch_customers_shipping_address_with_http_info(customer_token_id, shipping_address_token_id, patch_customer_shipping_address_request, opts = {})
348
+
349
+ if @api_client.config.debugging
350
+ begin
351
+ raise
352
+ @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.patch_customers_shipping_address ...'
353
+ rescue
354
+ puts 'Cannot write to log'
355
+ end
356
+ end
357
+ # verify the required parameter 'customer_token_id' is set
358
+ if @api_client.config.client_side_validation && customer_token_id.nil?
359
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
360
+ end
361
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
362
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
363
+ end
364
+
365
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
366
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
367
+ end
368
+
369
+ # verify the required parameter 'shipping_address_token_id' is set
370
+ if @api_client.config.client_side_validation && shipping_address_token_id.nil?
371
+ fail ArgumentError, "Missing the required parameter 'shipping_address_token_id' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
372
+ end
373
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length > 32
374
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
375
+ end
376
+
377
+ if @api_client.config.client_side_validation && shipping_address_token_id.to_s.length < 1
378
+ fail ArgumentError, 'invalid value for "shipping_address_token_id" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
379
+ end
380
+
381
+ # verify the required parameter 'patch_customer_shipping_address_request' is set
382
+ if @api_client.config.client_side_validation && patch_customer_shipping_address_request.nil?
383
+ fail ArgumentError, "Missing the required parameter 'patch_customer_shipping_address_request' when calling CustomerShippingAddressApi.patch_customers_shipping_address"
384
+ end
385
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
386
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 36.'
387
+ end
388
+
389
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
390
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 36.'
391
+ end
392
+
393
+ if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length > 32
394
+ fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be smaller than or equal to 32.'
395
+ end
396
+
397
+ if @api_client.config.client_side_validation && !opts[:'if_match'].nil? && opts[:'if_match'].to_s.length < 1
398
+ fail ArgumentError, 'invalid value for "opts[:"if_match"]" when calling CustomerShippingAddressApi.patch_customers_shipping_address, the character length must be great than or equal to 1.'
399
+ end
400
+
401
+ # resource path
402
+ local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses/{shippingAddressTokenId}'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s).sub('{' + 'shippingAddressTokenId' + '}', shipping_address_token_id.to_s)
403
+
404
+ # query parameters
405
+ query_params = {}
406
+
407
+ # header parameters
408
+ header_params = {}
409
+ # HTTP header 'Accept' (if needed)
410
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
411
+ # HTTP header 'Content-Type'
412
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
413
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
414
+ header_params[:'if-match'] = opts[:'if_match'] if !opts[:'if_match'].nil?
415
+
416
+ # form parameters
417
+ form_params = {}
418
+
419
+ # http body (model)
420
+ post_body = @api_client.object_to_http_body(patch_customer_shipping_address_request)
421
+ auth_names = []
422
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
423
+ :header_params => header_params,
424
+ :query_params => query_params,
425
+ :form_params => form_params,
426
+ :body => post_body,
427
+ :auth_names => auth_names,
428
+ :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
429
+ if @api_client.config.debugging
430
+ begin
431
+ raise
432
+ @api_client.config.logger.debug "API called: CustomerShippingAddressApi#patch_customers_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
433
+ rescue
434
+ puts 'Cannot write to log'
435
+ end
436
+ end
437
+ return data, status_code, headers
438
+ end
439
+ # Create a Customer Shipping Address
440
+ # Include an existing TMS Customer token id in the request URI. * A Customer token can be created by calling: **POST */tms/v2/customers***
441
+ # @param customer_token_id The TokenId of a customer.
442
+ # @param post_customer_shipping_address_request
443
+ # @param [Hash] opts the optional parameters
444
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
445
+ # @return [Tmsv2customersEmbeddedDefaultShippingAddress]
446
+ def post_customer_shipping_address(customer_token_id, post_customer_shipping_address_request, opts = {})
447
+ data, status_code, headers = post_customer_shipping_address_with_http_info(customer_token_id, post_customer_shipping_address_request, opts)
448
+ return data, status_code, headers
449
+ end
450
+
451
+ # Create a Customer Shipping Address
452
+ # Include an existing TMS Customer token id in the request URI. * A Customer token can be created by calling: **POST */tms/v2/customers***
453
+ # @param customer_token_id The TokenId of a customer.
454
+ # @param post_customer_shipping_address_request
455
+ # @param [Hash] opts the optional parameters
456
+ # @option opts [String] :profile_id The id of a profile containing user specific TMS configuration.
457
+ # @return [Array<(Tmsv2customersEmbeddedDefaultShippingAddress, Fixnum, Hash)>] Tmsv2customersEmbeddedDefaultShippingAddress data, response status code and response headers
458
+ def post_customer_shipping_address_with_http_info(customer_token_id, post_customer_shipping_address_request, opts = {})
459
+
460
+ if @api_client.config.debugging
461
+ begin
462
+ raise
463
+ @api_client.config.logger.debug 'Calling API: CustomerShippingAddressApi.post_customer_shipping_address ...'
464
+ rescue
465
+ puts 'Cannot write to log'
466
+ end
467
+ end
468
+ # verify the required parameter 'customer_token_id' is set
469
+ if @api_client.config.client_side_validation && customer_token_id.nil?
470
+ fail ArgumentError, "Missing the required parameter 'customer_token_id' when calling CustomerShippingAddressApi.post_customer_shipping_address"
471
+ end
472
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length > 32
473
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be smaller than or equal to 32.'
474
+ end
475
+
476
+ if @api_client.config.client_side_validation && customer_token_id.to_s.length < 1
477
+ fail ArgumentError, 'invalid value for "customer_token_id" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be great than or equal to 1.'
478
+ end
479
+
480
+ # verify the required parameter 'post_customer_shipping_address_request' is set
481
+ if @api_client.config.client_side_validation && post_customer_shipping_address_request.nil?
482
+ fail ArgumentError, "Missing the required parameter 'post_customer_shipping_address_request' when calling CustomerShippingAddressApi.post_customer_shipping_address"
483
+ end
484
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length > 36
485
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be smaller than or equal to 36.'
486
+ end
487
+
488
+ if @api_client.config.client_side_validation && !opts[:'profile_id'].nil? && opts[:'profile_id'].to_s.length < 36
489
+ fail ArgumentError, 'invalid value for "opts[:"profile_id"]" when calling CustomerShippingAddressApi.post_customer_shipping_address, the character length must be great than or equal to 36.'
490
+ end
491
+
492
+ # resource path
493
+ local_var_path = 'tms/v2/customers/{customerTokenId}/shipping-addresses'.sub('{' + 'customerTokenId' + '}', customer_token_id.to_s)
494
+
495
+ # query parameters
496
+ query_params = {}
497
+
498
+ # header parameters
499
+ header_params = {}
500
+ # HTTP header 'Accept' (if needed)
501
+ header_params['Accept'] = @api_client.select_header_accept(['application/json;charset=utf-8'])
502
+ # HTTP header 'Content-Type'
503
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
504
+ header_params[:'profile-id'] = opts[:'profile_id'] if !opts[:'profile_id'].nil?
505
+
506
+ # form parameters
507
+ form_params = {}
508
+
509
+ # http body (model)
510
+ post_body = @api_client.object_to_http_body(post_customer_shipping_address_request)
511
+ auth_names = []
512
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
513
+ :header_params => header_params,
514
+ :query_params => query_params,
515
+ :form_params => form_params,
516
+ :body => post_body,
517
+ :auth_names => auth_names,
518
+ :return_type => 'Tmsv2customersEmbeddedDefaultShippingAddress')
519
+ if @api_client.config.debugging
520
+ begin
521
+ raise
522
+ @api_client.config.logger.debug "API called: CustomerShippingAddressApi#post_customer_shipping_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
523
+ rescue
524
+ puts 'Cannot write to log'
525
+ end
526
+ end
527
+ return data, status_code, headers
528
+ end
529
+ end
530
+ end