tradenity 0.1.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +89 -77
  4. data/lib/tradenity/api_client.rb +408 -0
  5. data/lib/tradenity/api_error.rb +36 -0
  6. data/lib/tradenity/configuration.rb +205 -0
  7. data/lib/tradenity/exceptions.rb +5 -0
  8. data/lib/tradenity/rails/railtie.rb +20 -20
  9. data/lib/tradenity/resources/address.rb +729 -0
  10. data/lib/tradenity/resources/braintree_gateway.rb +804 -0
  11. data/lib/tradenity/resources/brand.rb +732 -0
  12. data/lib/tradenity/resources/cancel_operation.rb +675 -0
  13. data/lib/tradenity/resources/cart_settings.rb +219 -0
  14. data/lib/tradenity/resources/cash_on_delivery_payment.rb +746 -0
  15. data/lib/tradenity/resources/category.rb +763 -0
  16. data/lib/tradenity/resources/collection.rb +734 -0
  17. data/lib/tradenity/resources/contact_info.rb +306 -0
  18. data/lib/tradenity/resources/countries_geo_zone.rb +739 -0
  19. data/lib/tradenity/resources/country.rb +803 -0
  20. data/lib/tradenity/resources/coupon.rb +454 -0
  21. data/lib/tradenity/resources/credit_card_payment.rb +803 -0
  22. data/lib/tradenity/resources/currency.rb +762 -0
  23. data/lib/tradenity/resources/customer.rb +816 -0
  24. data/lib/tradenity/resources/customer_group.rb +723 -0
  25. data/lib/tradenity/resources/dimensions.rb +263 -0
  26. data/lib/tradenity/resources/discount_coupon.rb +811 -0
  27. data/lib/tradenity/resources/discount_promotion.rb +784 -0
  28. data/lib/tradenity/resources/fixed_rate_shipping.rb +837 -0
  29. data/lib/tradenity/resources/free_item_coupon.rb +793 -0
  30. data/lib/tradenity/resources/free_shipping.rb +806 -0
  31. data/lib/tradenity/resources/free_shipping_coupon.rb +788 -0
  32. data/lib/tradenity/resources/free_shipping_promotion.rb +744 -0
  33. data/lib/tradenity/resources/gateway.rb +435 -0
  34. data/lib/tradenity/resources/general_settings.rb +206 -0
  35. data/lib/tradenity/resources/geo_zone.rb +406 -0
  36. data/lib/tradenity/resources/instance_meta.rb +182 -0
  37. data/lib/tradenity/resources/inventory_settings.rb +197 -0
  38. data/lib/tradenity/resources/items_selector.rb +270 -0
  39. data/lib/tradenity/resources/line_item.rb +347 -0
  40. data/lib/tradenity/resources/mail_server_settings.rb +221 -0
  41. data/lib/tradenity/resources/measurement_settings.rb +253 -0
  42. data/lib/tradenity/resources/option.rb +787 -0
  43. data/lib/tradenity/resources/option_set.rb +734 -0
  44. data/lib/tradenity/resources/option_value.rb +680 -0
  45. data/lib/tradenity/resources/order.rb +929 -0
  46. data/lib/tradenity/resources/order_line_item.rb +777 -0
  47. data/lib/tradenity/resources/paging.rb +38 -0
  48. data/lib/tradenity/resources/payment.rb +429 -0
  49. data/lib/tradenity/resources/payment_card.rb +847 -0
  50. data/lib/tradenity/resources/payment_settings.rb +201 -0
  51. data/lib/tradenity/resources/payment_source.rb +392 -0
  52. data/lib/tradenity/resources/payment_token.rb +723 -0
  53. data/lib/tradenity/resources/payment_transaction.rb +740 -0
  54. data/lib/tradenity/resources/photo.rb +341 -0
  55. data/lib/tradenity/resources/product.rb +1156 -0
  56. data/lib/tradenity/resources/promotion.rb +427 -0
  57. data/lib/tradenity/resources/refund_operation.rb +358 -0
  58. data/lib/tradenity/resources/refund_transaction.rb +730 -0
  59. data/lib/tradenity/resources/return_line_item.rb +781 -0
  60. data/lib/tradenity/resources/return_operation.rb +686 -0
  61. data/lib/tradenity/resources/return_settings.rb +255 -0
  62. data/lib/tradenity/resources/shipping_method.rb +530 -0
  63. data/lib/tradenity/resources/shopping_cart.rb +647 -0
  64. data/lib/tradenity/resources/state.rb +675 -0
  65. data/lib/tradenity/resources/states_geo_zone.rb +748 -0
  66. data/lib/tradenity/resources/store_credit.rb +686 -0
  67. data/lib/tradenity/resources/store_credit_payment.rb +764 -0
  68. data/lib/tradenity/resources/store_credit_transaction.rb +730 -0
  69. data/lib/tradenity/resources/store_profile.rb +532 -0
  70. data/lib/tradenity/resources/stripe_gateway.rb +804 -0
  71. data/lib/tradenity/resources/table_rate_rule.rb +712 -0
  72. data/lib/tradenity/resources/table_rate_shipping.rb +834 -0
  73. data/lib/tradenity/resources/tax_class.rb +723 -0
  74. data/lib/tradenity/resources/tax_rate.rb +845 -0
  75. data/lib/tradenity/resources/tax_settings.rb +231 -0
  76. data/lib/tradenity/resources/test_gateway.rb +804 -0
  77. data/lib/tradenity/resources/transaction.rb +523 -0
  78. data/lib/tradenity/resources/utils.rb +7 -0
  79. data/lib/tradenity/resources/variant.rb +877 -0
  80. data/lib/tradenity/resources/web_hooks.rb +262 -0
  81. data/lib/tradenity/resources/weight.rb +235 -0
  82. data/lib/tradenity/resources/wish_list.rb +686 -0
  83. data/lib/tradenity/resources/zip_codes_geo_zone.rb +755 -0
  84. data/lib/tradenity/token_holder.rb +22 -0
  85. data/lib/tradenity/version.rb +13 -3
  86. data/lib/tradenity.rb +117 -7
  87. data/tradenity.gemspec +35 -30
  88. metadata +200 -34
  89. data/lib/tradenity/api.rb +0 -17
  90. data/lib/tradenity/error/exceptions.rb +0 -52
  91. data/lib/tradenity/error/message.rb +0 -38
  92. data/lib/tradenity/http/client.rb +0 -130
  93. data/lib/tradenity/model/base.rb +0 -100
  94. data/lib/tradenity/model/entities.rb +0 -390
  95. data/lib/tradenity/model/paging.rb +0 -23
@@ -0,0 +1,764 @@
1
+ =begin
2
+ #Tradenity API
3
+
4
+ #Tradenity eCommerce Rest API
5
+
6
+ Contact: support@tradenity.com
7
+ Generated by: https://github.com/tradenity
8
+
9
+ =end
10
+
11
+ require 'uri'
12
+
13
+ module Tradenity
14
+ class StoreCreditPayment
15
+
16
+
17
+ def id=(id)
18
+ @id = id
19
+ end
20
+
21
+ def id
22
+ if instance_variable_defined?('@id') && @id != nil
23
+ @id
24
+ elsif __meta && __meta.href != nil
25
+ @id = __meta.href.split('/')[-1]
26
+ @id
27
+ else
28
+ nil
29
+ end
30
+ end
31
+
32
+ attr_accessor :__meta
33
+
34
+ attr_accessor :created_at
35
+
36
+ attr_accessor :updated_at
37
+
38
+ attr_accessor :amount
39
+
40
+ attr_accessor :order
41
+
42
+ attr_accessor :payment_source
43
+
44
+ attr_accessor :currency
45
+
46
+ attr_accessor :status
47
+
48
+ attr_accessor :store_credit
49
+
50
+ class EnumAttributeValidator
51
+ attr_reader :datatype
52
+ attr_reader :allowable_values
53
+
54
+ def initialize(datatype, allowable_values)
55
+ @allowable_values = allowable_values.map do |value|
56
+ case datatype.to_s
57
+ when /Integer/i
58
+ value.to_i
59
+ when /Float/i
60
+ value.to_f
61
+ else
62
+ value
63
+ end
64
+ end
65
+ end
66
+
67
+ def valid?(value)
68
+ !value || allowable_values.include?(value)
69
+ end
70
+ end
71
+
72
+ # Attribute mapping from ruby-style variable name to JSON key.
73
+ def self.attribute_map
74
+ {
75
+ :'id' => :'id',
76
+ :'__meta' => :'__meta',
77
+ :'created_at' => :'createdAt',
78
+ :'updated_at' => :'updatedAt',
79
+ :'amount' => :'amount',
80
+ :'order' => :'order',
81
+ :'payment_source' => :'paymentSource',
82
+ :'currency' => :'currency',
83
+ :'status' => :'status',
84
+ :'store_credit' => :'storeCredit'
85
+ }
86
+ end
87
+
88
+ # Attribute type mapping.
89
+ def self.swagger_types
90
+ {
91
+ :'id' => :'String',
92
+ :'__meta' => :'InstanceMeta',
93
+ :'created_at' => :'DateTime',
94
+ :'updated_at' => :'DateTime',
95
+ :'amount' => :'Integer',
96
+ :'order' => :'Order',
97
+ :'payment_source' => :'PaymentSource',
98
+ :'currency' => :'Currency',
99
+ :'status' => :'String',
100
+ :'store_credit' => :'StoreCredit'
101
+ }
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ return unless attributes.is_a?(Hash)
108
+
109
+ # convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
111
+ if attributes.has_key?(:'id')
112
+ self.id = attributes[:'id']
113
+ end
114
+
115
+ if attributes.has_key?(:'__meta')
116
+ self.__meta = attributes[:'__meta']
117
+ end
118
+
119
+ if attributes.has_key?(:'createdAt')
120
+ self.created_at = attributes[:'createdAt']
121
+ end
122
+
123
+ if attributes.has_key?(:'created_at')
124
+ self.created_at = attributes[:'created_at']
125
+ end
126
+
127
+ if attributes.has_key?(:'updatedAt')
128
+ self.updated_at = attributes[:'updatedAt']
129
+ end
130
+
131
+ if attributes.has_key?(:'updated_at')
132
+ self.updated_at = attributes[:'updated_at']
133
+ end
134
+
135
+ if attributes.has_key?(:'amount')
136
+ self.amount = attributes[:'amount']
137
+ end
138
+
139
+ if attributes.has_key?(:'order')
140
+ self.order = attributes[:'order']
141
+ end
142
+
143
+ if attributes.has_key?(:'paymentSource')
144
+ self.payment_source = attributes[:'paymentSource']
145
+ end
146
+
147
+ if attributes.has_key?(:'payment_source')
148
+ self.payment_source = attributes[:'payment_source']
149
+ end
150
+
151
+ if attributes.has_key?(:'currency')
152
+ self.currency = attributes[:'currency']
153
+ end
154
+
155
+ if attributes.has_key?(:'status')
156
+ self.status = attributes[:'status']
157
+ end
158
+
159
+ if attributes.has_key?(:'storeCredit')
160
+ self.store_credit = attributes[:'storeCredit']
161
+ end
162
+
163
+ if attributes.has_key?(:'store_credit')
164
+ self.store_credit = attributes[:'store_credit']
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ invalid_properties = Array.new
172
+ if @amount.nil?
173
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
174
+ end
175
+
176
+ if @order.nil?
177
+ invalid_properties.push('invalid value for "order", order cannot be nil.')
178
+ end
179
+
180
+ if @payment_source.nil?
181
+ invalid_properties.push('invalid value for "payment_source", payment_source cannot be nil.')
182
+ end
183
+
184
+ if @currency.nil?
185
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
186
+ end
187
+
188
+ if @status.nil?
189
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
190
+ end
191
+
192
+ if @store_credit.nil?
193
+ invalid_properties.push('invalid value for "store_credit", store_credit cannot be nil.')
194
+ end
195
+
196
+ invalid_properties
197
+ end
198
+
199
+ # Check to see if the all the properties in the model are valid
200
+ # @return true if the model is valid
201
+ def valid?
202
+ return false if @amount.nil?
203
+ return false if @order.nil?
204
+ return false if @payment_source.nil?
205
+ return false if @currency.nil?
206
+ return false if @status.nil?
207
+ status_validator = EnumAttributeValidator.new('String', ['pending', 'awaitingRetry', 'successful', 'failed'])
208
+ return false unless status_validator.valid?(@status)
209
+ return false if @store_credit.nil?
210
+ true
211
+ end
212
+
213
+ # Custom attribute writer method checking allowed values (enum).
214
+ # @param [Object] status Object to be assigned
215
+ def status=(status)
216
+ validator = EnumAttributeValidator.new('String', ['pending', 'awaitingRetry', 'successful', 'failed'])
217
+ unless validator.valid?(status)
218
+ fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
219
+ end
220
+ @status = status
221
+ end
222
+
223
+ # Checks equality by comparing each attribute.
224
+ # @param [Object] Object to be compared
225
+ def ==(o)
226
+ return true if self.equal?(o)
227
+ self.class == o.class &&
228
+ __meta == o.__meta &&
229
+ created_at == o.created_at &&
230
+ updated_at == o.updated_at &&
231
+ amount == o.amount &&
232
+ order == o.order &&
233
+ payment_source == o.payment_source &&
234
+ currency == o.currency &&
235
+ status == o.status &&
236
+ store_credit == o.store_credit
237
+ end
238
+
239
+ # @see the `==` method
240
+ # @param [Object] Object to be compared
241
+ def eql?(o)
242
+ self == o
243
+ end
244
+
245
+ # Calculates hash code according to all attributes.
246
+ # @return [Fixnum] Hash code
247
+ def hash
248
+ [__meta, created_at, updated_at, amount, order, payment_source, currency, status, store_credit].hash
249
+ end
250
+
251
+ # Builds the object from hash
252
+ # @param [Hash] attributes Model attributes in the form of hash
253
+ # @return [Object] Returns the model itself
254
+ def build_from_hash(attributes)
255
+ return nil unless attributes.is_a?(Hash)
256
+ self.class.swagger_types.each_pair do |key, type|
257
+ if type =~ /\AArray<(.*)>/i
258
+ # check to ensure the input is an array given that the the attribute
259
+ # is documented as an array but the input is not
260
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
261
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
262
+ end
263
+ elsif !attributes[self.class.attribute_map[key]].nil?
264
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
265
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
266
+ end
267
+
268
+ self
269
+ end
270
+
271
+ # Deserializes the data based on type
272
+ # @param string type Data type
273
+ # @param string value Value to be deserialized
274
+ # @return [Object] Deserialized data
275
+ def _deserialize(type, value)
276
+ case type.to_sym
277
+ when :DateTime
278
+ DateTime.parse(value)
279
+ when :Date
280
+ Date.parse(value)
281
+ when :String
282
+ value.to_s
283
+ when :Integer
284
+ value.to_i
285
+ when :Float
286
+ value.to_f
287
+ when :BOOLEAN
288
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
289
+ true
290
+ else
291
+ false
292
+ end
293
+ when :Object
294
+ # generic object (usually a Hash), return directly
295
+ value
296
+ when /\AArray<(?<inner_type>.+)>\z/
297
+ inner_type = Regexp.last_match[:inner_type]
298
+ value.map { |v| _deserialize(inner_type, v) }
299
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
300
+ k_type = Regexp.last_match[:k_type]
301
+ v_type = Regexp.last_match[:v_type]
302
+ {}.tap do |hash|
303
+ value.each do |k, v|
304
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
305
+ end
306
+ end
307
+ else # model
308
+ temp_model = Tradenity.const_get(type).new
309
+ temp_model.build_from_hash(value)
310
+ end
311
+ end
312
+
313
+ # Returns the string representation of the object
314
+ # @return [String] String presentation of the object
315
+ def to_s
316
+ to_hash.to_s
317
+ end
318
+
319
+ # to_body is an alias to to_hash (backward compatibility)
320
+ # @return [Hash] Returns the object in the form of hash
321
+ def to_body
322
+ to_hash
323
+ end
324
+
325
+ # Returns the object in the form of hash
326
+ # @return [Hash] Returns the object in the form of hash
327
+ def to_hash
328
+ hash = {}
329
+ self.class.attribute_map.each_pair do |attr, param|
330
+ value = self.send(attr)
331
+ next if value.nil?
332
+ hash[param] = _to_hash(value)
333
+ end
334
+ hash
335
+ end
336
+
337
+ # Outputs non-array value in the form of hash
338
+ # For object, use to_hash. Otherwise, just return the value
339
+ # @param [Object] value Any valid value
340
+ # @return [Hash] Returns the value in the form of hash
341
+ def _to_hash(value)
342
+ if value.is_a?(Array)
343
+ value.compact.map { |v| _to_hash(v) }
344
+ elsif value.is_a?(Hash)
345
+ {}.tap do |hash|
346
+ value.each { |k, v| hash[k] = _to_hash(v) }
347
+ end
348
+ elsif value.respond_to? :to_hash
349
+ value.to_hash
350
+ else
351
+ value
352
+ end
353
+ end
354
+
355
+
356
+ def self.api_client
357
+ ApiClient.default
358
+ end
359
+
360
+ # Create StoreCreditPayment
361
+ # Create a new StoreCreditPayment
362
+ def create
363
+ data = self.class.create_store_credit_payment(self)
364
+ self.id = data.id
365
+ data
366
+ end
367
+
368
+ # Update StoreCreditPayment
369
+ # Update attributes of StoreCreditPayment
370
+ # @return [StoreCreditPayment]
371
+ def update
372
+ self.class.update_store_credit_payment_by_id(self.id, self)
373
+ end
374
+
375
+ # Delete StoreCreditPayment
376
+ # Delete this instance of StoreCreditPayment.
377
+ # @return [nil]
378
+ def delete
379
+ self.class.delete_store_credit_payment_by_id(self.id)
380
+ end
381
+
382
+ class << self
383
+
384
+ # List StoreCreditPayments
385
+ # Return a list of StoreCreditPayments
386
+ # @param [Hash] opts the optional parameters
387
+ # @return [Page<StoreCreditPayment>]
388
+ def find_all
389
+ list_all_store_credit_payments
390
+ end
391
+
392
+ # Find List of StoreCreditPayment
393
+ # Return multiple instances of StoreCreditPayment by its attributes.
394
+ # @param [Hash] opts the search parameters
395
+ # @return [Page<Collection>]
396
+ def find_all_by(opts = {})
397
+ list_all_store_credit_payments(opts)
398
+ end
399
+
400
+ # Find StoreCreditPayment by its parameters
401
+ # Return single instance of Collection by its attributes.
402
+ # @param [Hash] opts search parameters
403
+ # @return [StoreCreditPayment]
404
+ def find_one_by(opts = {})
405
+ list_all_store_credit_payments(opts)[0]
406
+ end
407
+
408
+ # Find StoreCreditPayment
409
+ # Return single instance of StoreCreditPayment by its ID.
410
+ # @param id ID of StoreCreditPayment to return
411
+ # @return [StoreCreditPayment]
412
+ def find_by_id(id)
413
+ get_store_credit_payment_by_id(id)
414
+ end
415
+
416
+ # Delete StoreCreditPayment
417
+ # Delete an instance of StoreCreditPayment by its ID.
418
+ # @param id ID of StoreCreditPayment to delete.
419
+ # @return [nil]
420
+ def delete_by_id(id)
421
+ delete_store_credit_payment_by_id(id)
422
+ end
423
+
424
+ # Create StoreCreditPayment
425
+ # Create a new StoreCreditPayment
426
+ # @param store_credit_payment Attributes of storeCreditPayment to create
427
+ # @param [Hash] opts the optional parameters
428
+ # @return [StoreCreditPayment]
429
+ def create_store_credit_payment(store_credit_payment, opts = {})
430
+ data, _status_code, _headers = create_store_credit_payment_with_http_info(store_credit_payment, opts)
431
+ data
432
+ end
433
+
434
+ # Create StoreCreditPayment
435
+ # Create a new StoreCreditPayment
436
+ # @param store_credit_payment Attributes of storeCreditPayment to create
437
+ # @param [Hash] opts the optional parameters
438
+ # @return [Array<(StoreCreditPayment, Fixnum, Hash)>] StoreCreditPayment data, response status code and response headers
439
+ def create_store_credit_payment_with_http_info(store_credit_payment, opts = {})
440
+ if api_client.config.debugging
441
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.create_store_credit_payment ...'
442
+ end
443
+ # verify the required parameter 'store_credit_payment' is set
444
+ if api_client.config.client_side_validation && store_credit_payment.nil?
445
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment' when calling StoreCreditPayment.create_store_credit_payment"
446
+ end
447
+ # resource path
448
+ local_var_path = '/storeCreditPayments'
449
+
450
+ # query parameters
451
+ query_params = opts
452
+
453
+ # header parameters
454
+ header_params = {}
455
+ # HTTP header 'Accept' (if needed)
456
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
457
+ # HTTP header 'Content-Type'
458
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
459
+
460
+ # form parameters
461
+ form_params = {}
462
+
463
+ # http body (model)
464
+ post_body = api_client.object_to_http_body(store_credit_payment)
465
+ auth_names = []
466
+ data, status_code, headers = api_client.call_api(:POST, local_var_path,
467
+ :header_params => header_params,
468
+ :query_params => query_params,
469
+ :form_params => form_params,
470
+ :body => post_body,
471
+ :auth_names => auth_names,
472
+ :return_type => 'StoreCreditPayment')
473
+ if api_client.config.debugging
474
+ api_client.config.logger.debug "API called: StoreCreditPayment#create_store_credit_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
475
+ end
476
+ return data, status_code, headers
477
+ end
478
+ # Delete StoreCreditPayment
479
+ # Delete an instance of StoreCreditPayment by its ID.
480
+ # @param store_credit_payment_id ID of storeCreditPayment to delete.
481
+ # @param [Hash] opts the optional parameters
482
+ # @return [nil]
483
+ def delete_store_credit_payment_by_id(store_credit_payment_id, opts = {})
484
+ delete_store_credit_payment_by_id_with_http_info(store_credit_payment_id, opts)
485
+ nil
486
+ end
487
+
488
+ # Delete StoreCreditPayment
489
+ # Delete an instance of StoreCreditPayment by its ID.
490
+ # @param store_credit_payment_id ID of storeCreditPayment to delete.
491
+ # @param [Hash] opts the optional parameters
492
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
493
+ def delete_store_credit_payment_by_id_with_http_info(store_credit_payment_id, opts = {})
494
+ if api_client.config.debugging
495
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.delete_store_credit_payment_by_id ...'
496
+ end
497
+ # verify the required parameter 'store_credit_payment_id' is set
498
+ if api_client.config.client_side_validation && store_credit_payment_id.nil?
499
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment_id' when calling StoreCreditPayment.delete_store_credit_payment_by_id"
500
+ end
501
+ # resource path
502
+ local_var_path = '/storeCreditPayments/{storeCreditPaymentId}'.sub('{' + 'storeCreditPaymentId' + '}', store_credit_payment_id.to_s)
503
+
504
+ # query parameters
505
+ query_params = opts
506
+
507
+ # header parameters
508
+ header_params = {}
509
+ # HTTP header 'Accept' (if needed)
510
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
511
+ # HTTP header 'Content-Type'
512
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
513
+
514
+ # form parameters
515
+ form_params = {}
516
+
517
+ # http body (model)
518
+ post_body = nil
519
+ auth_names = []
520
+ data, status_code, headers = api_client.call_api(:DELETE, local_var_path,
521
+ :header_params => header_params,
522
+ :query_params => query_params,
523
+ :form_params => form_params,
524
+ :body => post_body,
525
+ :auth_names => auth_names)
526
+ if api_client.config.debugging
527
+ api_client.config.logger.debug "API called: StoreCreditPayment#delete_store_credit_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
528
+ end
529
+ return data, status_code, headers
530
+ end
531
+ # Find StoreCreditPayment
532
+ # Return single instance of StoreCreditPayment by its ID.
533
+ # @param store_credit_payment_id ID of storeCreditPayment to return
534
+ # @param [Hash] opts the optional parameters
535
+ # @return [StoreCreditPayment]
536
+ def get_store_credit_payment_by_id(store_credit_payment_id, opts = {})
537
+ data, _status_code, _headers = get_store_credit_payment_by_id_with_http_info(store_credit_payment_id, opts)
538
+ data
539
+ end
540
+
541
+ # Find StoreCreditPayment
542
+ # Return single instance of StoreCreditPayment by its ID.
543
+ # @param store_credit_payment_id ID of storeCreditPayment to return
544
+ # @param [Hash] opts the optional parameters
545
+ # @return [Array<(StoreCreditPayment, Fixnum, Hash)>] StoreCreditPayment data, response status code and response headers
546
+ def get_store_credit_payment_by_id_with_http_info(store_credit_payment_id, opts = {})
547
+ if api_client.config.debugging
548
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.get_store_credit_payment_by_id ...'
549
+ end
550
+ # verify the required parameter 'store_credit_payment_id' is set
551
+ if api_client.config.client_side_validation && store_credit_payment_id.nil?
552
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment_id' when calling StoreCreditPayment.get_store_credit_payment_by_id"
553
+ end
554
+ # resource path
555
+ local_var_path = '/storeCreditPayments/{storeCreditPaymentId}'.sub('{' + 'storeCreditPaymentId' + '}', store_credit_payment_id.to_s)
556
+
557
+ # query parameters
558
+ query_params = opts
559
+
560
+ # header parameters
561
+ header_params = {}
562
+ # HTTP header 'Accept' (if needed)
563
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
564
+ # HTTP header 'Content-Type'
565
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
566
+
567
+ # form parameters
568
+ form_params = {}
569
+
570
+ # http body (model)
571
+ post_body = nil
572
+ auth_names = []
573
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
574
+ :header_params => header_params,
575
+ :query_params => query_params,
576
+ :form_params => form_params,
577
+ :body => post_body,
578
+ :auth_names => auth_names,
579
+ :return_type => 'StoreCreditPayment')
580
+ if api_client.config.debugging
581
+ api_client.config.logger.debug "API called: StoreCreditPayment#get_store_credit_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
582
+ end
583
+ return data, status_code, headers
584
+ end
585
+ # List StoreCreditPayments
586
+ # Return a list of StoreCreditPayments
587
+ # @param [Hash] opts the optional parameters
588
+ # @option opts [Integer] :page page number
589
+ # @option opts [Integer] :size page size
590
+ # @option opts [String] :sort page order
591
+ # @return [Page<StoreCreditPayment>]
592
+ def list_all_store_credit_payments(opts = {})
593
+ data, _status_code, _headers = list_all_store_credit_payments_with_http_info(opts)
594
+ data
595
+ end
596
+
597
+ # List StoreCreditPayments
598
+ # Return a list of StoreCreditPayments
599
+ # @param [Hash] opts the optional parameters
600
+ # @option opts [Integer] :page page number
601
+ # @option opts [Integer] :size page size
602
+ # @option opts [String] :sort page order
603
+ # @return [Array<(Page<StoreCreditPayment>, Fixnum, Hash)>] Page<StoreCreditPayment> data, response status code and response headers
604
+ def list_all_store_credit_payments_with_http_info(opts = {})
605
+ if api_client.config.debugging
606
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.list_all_store_credit_payments ...'
607
+ end
608
+ # resource path
609
+ local_var_path = '/storeCreditPayments'
610
+
611
+ # query parameters
612
+ query_params = opts
613
+ # query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
614
+ # query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
615
+ # query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
616
+
617
+ # header parameters
618
+ header_params = {}
619
+ # HTTP header 'Accept' (if needed)
620
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
621
+ # HTTP header 'Content-Type'
622
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
623
+
624
+ # form parameters
625
+ form_params = {}
626
+
627
+ # http body (model)
628
+ post_body = nil
629
+ auth_names = []
630
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
631
+ :header_params => header_params,
632
+ :query_params => query_params,
633
+ :form_params => form_params,
634
+ :body => post_body,
635
+ :auth_names => auth_names,
636
+ :return_type => 'Page<StoreCreditPayment>')
637
+ if api_client.config.debugging
638
+ api_client.config.logger.debug "API called: StoreCreditPayment#list_all_store_credit_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
639
+ end
640
+ return data, status_code, headers
641
+ end
642
+ # Replace StoreCreditPayment
643
+ # Replace all attributes of StoreCreditPayment
644
+ # @param store_credit_payment_id ID of storeCreditPayment to replace
645
+ # @param store_credit_payment Attributes of storeCreditPayment to replace
646
+ # @param [Hash] opts the optional parameters
647
+ # @return [StoreCreditPayment]
648
+ def replace_store_credit_payment_by_id(store_credit_payment_id, store_credit_payment, opts = {})
649
+ data, _status_code, _headers = replace_store_credit_payment_by_id_with_http_info(store_credit_payment_id, store_credit_payment, opts)
650
+ data
651
+ end
652
+
653
+ # Replace StoreCreditPayment
654
+ # Replace all attributes of StoreCreditPayment
655
+ # @param store_credit_payment_id ID of storeCreditPayment to replace
656
+ # @param store_credit_payment Attributes of storeCreditPayment to replace
657
+ # @param [Hash] opts the optional parameters
658
+ # @return [Array<(StoreCreditPayment, Fixnum, Hash)>] StoreCreditPayment data, response status code and response headers
659
+ def replace_store_credit_payment_by_id_with_http_info(store_credit_payment_id, store_credit_payment, opts = {})
660
+ if api_client.config.debugging
661
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.replace_store_credit_payment_by_id ...'
662
+ end
663
+ # verify the required parameter 'store_credit_payment_id' is set
664
+ if api_client.config.client_side_validation && store_credit_payment_id.nil?
665
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment_id' when calling StoreCreditPayment.replace_store_credit_payment_by_id"
666
+ end
667
+ # verify the required parameter 'store_credit_payment' is set
668
+ if api_client.config.client_side_validation && store_credit_payment.nil?
669
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment' when calling StoreCreditPayment.replace_store_credit_payment_by_id"
670
+ end
671
+ # resource path
672
+ local_var_path = '/storeCreditPayments/{storeCreditPaymentId}'.sub('{' + 'storeCreditPaymentId' + '}', store_credit_payment_id.to_s)
673
+
674
+ # query parameters
675
+ query_params = opts
676
+
677
+ # header parameters
678
+ header_params = {}
679
+ # HTTP header 'Accept' (if needed)
680
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
681
+ # HTTP header 'Content-Type'
682
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
683
+
684
+ # form parameters
685
+ form_params = {}
686
+
687
+ # http body (model)
688
+ post_body = api_client.object_to_http_body(store_credit_payment)
689
+ auth_names = []
690
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
691
+ :header_params => header_params,
692
+ :query_params => query_params,
693
+ :form_params => form_params,
694
+ :body => post_body,
695
+ :auth_names => auth_names,
696
+ :return_type => 'StoreCreditPayment')
697
+ if api_client.config.debugging
698
+ api_client.config.logger.debug "API called: StoreCreditPayment#replace_store_credit_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
699
+ end
700
+ return data, status_code, headers
701
+ end
702
+ # Update StoreCreditPayment
703
+ # Update attributes of StoreCreditPayment
704
+ # @param store_credit_payment_id ID of storeCreditPayment to update.
705
+ # @param store_credit_payment Attributes of storeCreditPayment to update.
706
+ # @param [Hash] opts the optional parameters
707
+ # @return [StoreCreditPayment]
708
+ def update_store_credit_payment_by_id(store_credit_payment_id, store_credit_payment, opts = {})
709
+ data, _status_code, _headers = update_store_credit_payment_by_id_with_http_info(store_credit_payment_id, store_credit_payment, opts)
710
+ data
711
+ end
712
+
713
+ # Update StoreCreditPayment
714
+ # Update attributes of StoreCreditPayment
715
+ # @param store_credit_payment_id ID of storeCreditPayment to update.
716
+ # @param store_credit_payment Attributes of storeCreditPayment to update.
717
+ # @param [Hash] opts the optional parameters
718
+ # @return [Array<(StoreCreditPayment, Fixnum, Hash)>] StoreCreditPayment data, response status code and response headers
719
+ def update_store_credit_payment_by_id_with_http_info(store_credit_payment_id, store_credit_payment, opts = {})
720
+ if api_client.config.debugging
721
+ api_client.config.logger.debug 'Calling API: StoreCreditPayment.update_store_credit_payment_by_id ...'
722
+ end
723
+ # verify the required parameter 'store_credit_payment_id' is set
724
+ if api_client.config.client_side_validation && store_credit_payment_id.nil?
725
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment_id' when calling StoreCreditPayment.update_store_credit_payment_by_id"
726
+ end
727
+ # verify the required parameter 'store_credit_payment' is set
728
+ if api_client.config.client_side_validation && store_credit_payment.nil?
729
+ fail ArgumentError, "Missing the required parameter 'store_credit_payment' when calling StoreCreditPayment.update_store_credit_payment_by_id"
730
+ end
731
+ # resource path
732
+ local_var_path = '/storeCreditPayments/{storeCreditPaymentId}'.sub('{' + 'storeCreditPaymentId' + '}', store_credit_payment_id.to_s)
733
+
734
+ # query parameters
735
+ query_params = opts
736
+
737
+ # header parameters
738
+ header_params = {}
739
+ # HTTP header 'Accept' (if needed)
740
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
741
+ # HTTP header 'Content-Type'
742
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
743
+
744
+ # form parameters
745
+ form_params = {}
746
+
747
+ # http body (model)
748
+ post_body = api_client.object_to_http_body(store_credit_payment)
749
+ auth_names = []
750
+ data, status_code, headers = api_client.call_api(:PATCH, local_var_path,
751
+ :header_params => header_params,
752
+ :query_params => query_params,
753
+ :form_params => form_params,
754
+ :body => post_body,
755
+ :auth_names => auth_names,
756
+ :return_type => 'StoreCreditPayment')
757
+ if api_client.config.debugging
758
+ api_client.config.logger.debug "API called: StoreCreditPayment#update_store_credit_payment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
759
+ end
760
+ return data, status_code, headers
761
+ end
762
+ end
763
+ end
764
+ end