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,781 @@
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 ReturnLineItem
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 :unit_price
39
+
40
+ attr_accessor :quantity
41
+
42
+ attr_accessor :product
43
+
44
+ attr_accessor :taxes
45
+
46
+ attr_accessor :promotions
47
+
48
+ attr_accessor :subtotal
49
+
50
+ attr_accessor :total
51
+
52
+ attr_accessor :shipping_amount
53
+
54
+ attr_accessor :tax_amount
55
+
56
+ attr_accessor :discount_amount
57
+
58
+ attr_accessor :return_operation
59
+
60
+ # Attribute mapping from ruby-style variable name to JSON key.
61
+ def self.attribute_map
62
+ {
63
+ :'id' => :'id',
64
+ :'__meta' => :'__meta',
65
+ :'created_at' => :'createdAt',
66
+ :'updated_at' => :'updatedAt',
67
+ :'unit_price' => :'unitPrice',
68
+ :'quantity' => :'quantity',
69
+ :'product' => :'product',
70
+ :'taxes' => :'taxes',
71
+ :'promotions' => :'promotions',
72
+ :'subtotal' => :'subtotal',
73
+ :'total' => :'total',
74
+ :'shipping_amount' => :'shippingAmount',
75
+ :'tax_amount' => :'taxAmount',
76
+ :'discount_amount' => :'discountAmount',
77
+ :'return_operation' => :'returnOperation'
78
+ }
79
+ end
80
+
81
+ # Attribute type mapping.
82
+ def self.swagger_types
83
+ {
84
+ :'id' => :'String',
85
+ :'__meta' => :'InstanceMeta',
86
+ :'created_at' => :'DateTime',
87
+ :'updated_at' => :'DateTime',
88
+ :'unit_price' => :'Integer',
89
+ :'quantity' => :'Integer',
90
+ :'product' => :'Product',
91
+ :'taxes' => :'Array<TaxRate>',
92
+ :'promotions' => :'Array<Promotion>',
93
+ :'subtotal' => :'Integer',
94
+ :'total' => :'Integer',
95
+ :'shipping_amount' => :'Integer',
96
+ :'tax_amount' => :'Integer',
97
+ :'discount_amount' => :'Integer',
98
+ :'return_operation' => :'ReturnOperation'
99
+ }
100
+ end
101
+
102
+ # Initializes the object
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ def initialize(attributes = {})
105
+ return unless attributes.is_a?(Hash)
106
+
107
+ # convert string to symbol for hash key
108
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
109
+ if attributes.has_key?(:'id')
110
+ self.id = attributes[:'id']
111
+ end
112
+
113
+ if attributes.has_key?(:'__meta')
114
+ self.__meta = attributes[:'__meta']
115
+ end
116
+
117
+ if attributes.has_key?(:'createdAt')
118
+ self.created_at = attributes[:'createdAt']
119
+ end
120
+
121
+ if attributes.has_key?(:'created_at')
122
+ self.created_at = attributes[:'created_at']
123
+ end
124
+
125
+ if attributes.has_key?(:'updatedAt')
126
+ self.updated_at = attributes[:'updatedAt']
127
+ end
128
+
129
+ if attributes.has_key?(:'updated_at')
130
+ self.updated_at = attributes[:'updated_at']
131
+ end
132
+
133
+ if attributes.has_key?(:'unitPrice')
134
+ self.unit_price = attributes[:'unitPrice']
135
+ end
136
+
137
+ if attributes.has_key?(:'unit_price')
138
+ self.unit_price = attributes[:'unit_price']
139
+ end
140
+
141
+ if attributes.has_key?(:'quantity')
142
+ self.quantity = attributes[:'quantity']
143
+ end
144
+
145
+ if attributes.has_key?(:'product')
146
+ self.product = attributes[:'product']
147
+ end
148
+
149
+ if attributes.has_key?(:'taxes')
150
+ if (value = attributes[:'taxes']).is_a?(Array)
151
+ self.taxes = value
152
+ end
153
+ end
154
+
155
+ if attributes.has_key?(:'promotions')
156
+ if (value = attributes[:'promotions']).is_a?(Array)
157
+ self.promotions = value
158
+ end
159
+ end
160
+
161
+ if attributes.has_key?(:'subtotal')
162
+ self.subtotal = attributes[:'subtotal']
163
+ end
164
+
165
+ if attributes.has_key?(:'total')
166
+ self.total = attributes[:'total']
167
+ end
168
+
169
+ if attributes.has_key?(:'shippingAmount')
170
+ self.shipping_amount = attributes[:'shippingAmount']
171
+ end
172
+
173
+ if attributes.has_key?(:'shipping_amount')
174
+ self.shipping_amount = attributes[:'shipping_amount']
175
+ end
176
+
177
+ if attributes.has_key?(:'taxAmount')
178
+ self.tax_amount = attributes[:'taxAmount']
179
+ end
180
+
181
+ if attributes.has_key?(:'tax_amount')
182
+ self.tax_amount = attributes[:'tax_amount']
183
+ end
184
+
185
+ if attributes.has_key?(:'discountAmount')
186
+ self.discount_amount = attributes[:'discountAmount']
187
+ end
188
+
189
+ if attributes.has_key?(:'discount_amount')
190
+ self.discount_amount = attributes[:'discount_amount']
191
+ end
192
+
193
+ if attributes.has_key?(:'returnOperation')
194
+ self.return_operation = attributes[:'returnOperation']
195
+ end
196
+
197
+ if attributes.has_key?(:'return_operation')
198
+ self.return_operation = attributes[:'return_operation']
199
+ end
200
+ end
201
+
202
+ # Show invalid properties with the reasons. Usually used together with valid?
203
+ # @return Array for valid properties with the reasons
204
+ def list_invalid_properties
205
+ invalid_properties = Array.new
206
+ if @unit_price.nil?
207
+ invalid_properties.push('invalid value for "unit_price", unit_price cannot be nil.')
208
+ end
209
+
210
+ if @quantity.nil?
211
+ invalid_properties.push('invalid value for "quantity", quantity cannot be nil.')
212
+ end
213
+
214
+ if @product.nil?
215
+ invalid_properties.push('invalid value for "product", product cannot be nil.')
216
+ end
217
+
218
+ if @return_operation.nil?
219
+ invalid_properties.push('invalid value for "return_operation", return_operation cannot be nil.')
220
+ end
221
+
222
+ invalid_properties
223
+ end
224
+
225
+ # Check to see if the all the properties in the model are valid
226
+ # @return true if the model is valid
227
+ def valid?
228
+ return false if @unit_price.nil?
229
+ return false if @quantity.nil?
230
+ return false if @product.nil?
231
+ return false if @return_operation.nil?
232
+ true
233
+ end
234
+
235
+ # Checks equality by comparing each attribute.
236
+ # @param [Object] Object to be compared
237
+ def ==(o)
238
+ return true if self.equal?(o)
239
+ self.class == o.class &&
240
+ __meta == o.__meta &&
241
+ created_at == o.created_at &&
242
+ updated_at == o.updated_at &&
243
+ unit_price == o.unit_price &&
244
+ quantity == o.quantity &&
245
+ product == o.product &&
246
+ taxes == o.taxes &&
247
+ promotions == o.promotions &&
248
+ subtotal == o.subtotal &&
249
+ total == o.total &&
250
+ shipping_amount == o.shipping_amount &&
251
+ tax_amount == o.tax_amount &&
252
+ discount_amount == o.discount_amount &&
253
+ return_operation == o.return_operation
254
+ end
255
+
256
+ # @see the `==` method
257
+ # @param [Object] Object to be compared
258
+ def eql?(o)
259
+ self == o
260
+ end
261
+
262
+ # Calculates hash code according to all attributes.
263
+ # @return [Fixnum] Hash code
264
+ def hash
265
+ [__meta, created_at, updated_at, unit_price, quantity, product, taxes, promotions, subtotal, total, shipping_amount, tax_amount, discount_amount, return_operation].hash
266
+ end
267
+
268
+ # Builds the object from hash
269
+ # @param [Hash] attributes Model attributes in the form of hash
270
+ # @return [Object] Returns the model itself
271
+ def build_from_hash(attributes)
272
+ return nil unless attributes.is_a?(Hash)
273
+ self.class.swagger_types.each_pair do |key, type|
274
+ if type =~ /\AArray<(.*)>/i
275
+ # check to ensure the input is an array given that the the attribute
276
+ # is documented as an array but the input is not
277
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
278
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
279
+ end
280
+ elsif !attributes[self.class.attribute_map[key]].nil?
281
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
282
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
283
+ end
284
+
285
+ self
286
+ end
287
+
288
+ # Deserializes the data based on type
289
+ # @param string type Data type
290
+ # @param string value Value to be deserialized
291
+ # @return [Object] Deserialized data
292
+ def _deserialize(type, value)
293
+ case type.to_sym
294
+ when :DateTime
295
+ DateTime.parse(value)
296
+ when :Date
297
+ Date.parse(value)
298
+ when :String
299
+ value.to_s
300
+ when :Integer
301
+ value.to_i
302
+ when :Float
303
+ value.to_f
304
+ when :BOOLEAN
305
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
306
+ true
307
+ else
308
+ false
309
+ end
310
+ when :Object
311
+ # generic object (usually a Hash), return directly
312
+ value
313
+ when /\AArray<(?<inner_type>.+)>\z/
314
+ inner_type = Regexp.last_match[:inner_type]
315
+ value.map { |v| _deserialize(inner_type, v) }
316
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
317
+ k_type = Regexp.last_match[:k_type]
318
+ v_type = Regexp.last_match[:v_type]
319
+ {}.tap do |hash|
320
+ value.each do |k, v|
321
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
322
+ end
323
+ end
324
+ else # model
325
+ temp_model = Tradenity.const_get(type).new
326
+ temp_model.build_from_hash(value)
327
+ end
328
+ end
329
+
330
+ # Returns the string representation of the object
331
+ # @return [String] String presentation of the object
332
+ def to_s
333
+ to_hash.to_s
334
+ end
335
+
336
+ # to_body is an alias to to_hash (backward compatibility)
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_body
339
+ to_hash
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ next if value.nil?
349
+ hash[param] = _to_hash(value)
350
+ end
351
+ hash
352
+ end
353
+
354
+ # Outputs non-array value in the form of hash
355
+ # For object, use to_hash. Otherwise, just return the value
356
+ # @param [Object] value Any valid value
357
+ # @return [Hash] Returns the value in the form of hash
358
+ def _to_hash(value)
359
+ if value.is_a?(Array)
360
+ value.compact.map { |v| _to_hash(v) }
361
+ elsif value.is_a?(Hash)
362
+ {}.tap do |hash|
363
+ value.each { |k, v| hash[k] = _to_hash(v) }
364
+ end
365
+ elsif value.respond_to? :to_hash
366
+ value.to_hash
367
+ else
368
+ value
369
+ end
370
+ end
371
+
372
+
373
+ def self.api_client
374
+ ApiClient.default
375
+ end
376
+
377
+ # Create ReturnLineItem
378
+ # Create a new ReturnLineItem
379
+ def create
380
+ data = self.class.create_return_line_item(self)
381
+ self.id = data.id
382
+ data
383
+ end
384
+
385
+ # Update ReturnLineItem
386
+ # Update attributes of ReturnLineItem
387
+ # @return [ReturnLineItem]
388
+ def update
389
+ self.class.update_return_line_item_by_id(self.id, self)
390
+ end
391
+
392
+ # Delete ReturnLineItem
393
+ # Delete this instance of ReturnLineItem.
394
+ # @return [nil]
395
+ def delete
396
+ self.class.delete_return_line_item_by_id(self.id)
397
+ end
398
+
399
+ class << self
400
+
401
+ # List ReturnLineItems
402
+ # Return a list of ReturnLineItems
403
+ # @param [Hash] opts the optional parameters
404
+ # @return [Page<ReturnLineItem>]
405
+ def find_all
406
+ list_all_return_line_items
407
+ end
408
+
409
+ # Find List of ReturnLineItem
410
+ # Return multiple instances of ReturnLineItem by its attributes.
411
+ # @param [Hash] opts the search parameters
412
+ # @return [Page<Collection>]
413
+ def find_all_by(opts = {})
414
+ list_all_return_line_items(opts)
415
+ end
416
+
417
+ # Find ReturnLineItem by its parameters
418
+ # Return single instance of Collection by its attributes.
419
+ # @param [Hash] opts search parameters
420
+ # @return [ReturnLineItem]
421
+ def find_one_by(opts = {})
422
+ list_all_return_line_items(opts)[0]
423
+ end
424
+
425
+ # Find ReturnLineItem
426
+ # Return single instance of ReturnLineItem by its ID.
427
+ # @param id ID of ReturnLineItem to return
428
+ # @return [ReturnLineItem]
429
+ def find_by_id(id)
430
+ get_return_line_item_by_id(id)
431
+ end
432
+
433
+ # Delete ReturnLineItem
434
+ # Delete an instance of ReturnLineItem by its ID.
435
+ # @param id ID of ReturnLineItem to delete.
436
+ # @return [nil]
437
+ def delete_by_id(id)
438
+ delete_return_line_item_by_id(id)
439
+ end
440
+
441
+ # Create ReturnLineItem
442
+ # Create a new ReturnLineItem
443
+ # @param return_line_item Attributes of returnLineItem to create
444
+ # @param [Hash] opts the optional parameters
445
+ # @return [ReturnLineItem]
446
+ def create_return_line_item(return_line_item, opts = {})
447
+ data, _status_code, _headers = create_return_line_item_with_http_info(return_line_item, opts)
448
+ data
449
+ end
450
+
451
+ # Create ReturnLineItem
452
+ # Create a new ReturnLineItem
453
+ # @param return_line_item Attributes of returnLineItem to create
454
+ # @param [Hash] opts the optional parameters
455
+ # @return [Array<(ReturnLineItem, Fixnum, Hash)>] ReturnLineItem data, response status code and response headers
456
+ def create_return_line_item_with_http_info(return_line_item, opts = {})
457
+ if api_client.config.debugging
458
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.create_return_line_item ...'
459
+ end
460
+ # verify the required parameter 'return_line_item' is set
461
+ if api_client.config.client_side_validation && return_line_item.nil?
462
+ fail ArgumentError, "Missing the required parameter 'return_line_item' when calling ReturnLineItem.create_return_line_item"
463
+ end
464
+ # resource path
465
+ local_var_path = '/returnLineItems'
466
+
467
+ # query parameters
468
+ query_params = opts
469
+
470
+ # header parameters
471
+ header_params = {}
472
+ # HTTP header 'Accept' (if needed)
473
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
474
+ # HTTP header 'Content-Type'
475
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
476
+
477
+ # form parameters
478
+ form_params = {}
479
+
480
+ # http body (model)
481
+ post_body = api_client.object_to_http_body(return_line_item)
482
+ auth_names = []
483
+ data, status_code, headers = api_client.call_api(:POST, local_var_path,
484
+ :header_params => header_params,
485
+ :query_params => query_params,
486
+ :form_params => form_params,
487
+ :body => post_body,
488
+ :auth_names => auth_names,
489
+ :return_type => 'ReturnLineItem')
490
+ if api_client.config.debugging
491
+ api_client.config.logger.debug "API called: ReturnLineItem#create_return_line_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
492
+ end
493
+ return data, status_code, headers
494
+ end
495
+ # Delete ReturnLineItem
496
+ # Delete an instance of ReturnLineItem by its ID.
497
+ # @param return_line_item_id ID of returnLineItem to delete.
498
+ # @param [Hash] opts the optional parameters
499
+ # @return [nil]
500
+ def delete_return_line_item_by_id(return_line_item_id, opts = {})
501
+ delete_return_line_item_by_id_with_http_info(return_line_item_id, opts)
502
+ nil
503
+ end
504
+
505
+ # Delete ReturnLineItem
506
+ # Delete an instance of ReturnLineItem by its ID.
507
+ # @param return_line_item_id ID of returnLineItem to delete.
508
+ # @param [Hash] opts the optional parameters
509
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
510
+ def delete_return_line_item_by_id_with_http_info(return_line_item_id, opts = {})
511
+ if api_client.config.debugging
512
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.delete_return_line_item_by_id ...'
513
+ end
514
+ # verify the required parameter 'return_line_item_id' is set
515
+ if api_client.config.client_side_validation && return_line_item_id.nil?
516
+ fail ArgumentError, "Missing the required parameter 'return_line_item_id' when calling ReturnLineItem.delete_return_line_item_by_id"
517
+ end
518
+ # resource path
519
+ local_var_path = '/returnLineItems/{returnLineItemId}'.sub('{' + 'returnLineItemId' + '}', return_line_item_id.to_s)
520
+
521
+ # query parameters
522
+ query_params = opts
523
+
524
+ # header parameters
525
+ header_params = {}
526
+ # HTTP header 'Accept' (if needed)
527
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
528
+ # HTTP header 'Content-Type'
529
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
530
+
531
+ # form parameters
532
+ form_params = {}
533
+
534
+ # http body (model)
535
+ post_body = nil
536
+ auth_names = []
537
+ data, status_code, headers = api_client.call_api(:DELETE, local_var_path,
538
+ :header_params => header_params,
539
+ :query_params => query_params,
540
+ :form_params => form_params,
541
+ :body => post_body,
542
+ :auth_names => auth_names)
543
+ if api_client.config.debugging
544
+ api_client.config.logger.debug "API called: ReturnLineItem#delete_return_line_item_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
545
+ end
546
+ return data, status_code, headers
547
+ end
548
+ # Find ReturnLineItem
549
+ # Return single instance of ReturnLineItem by its ID.
550
+ # @param return_line_item_id ID of returnLineItem to return
551
+ # @param [Hash] opts the optional parameters
552
+ # @return [ReturnLineItem]
553
+ def get_return_line_item_by_id(return_line_item_id, opts = {})
554
+ data, _status_code, _headers = get_return_line_item_by_id_with_http_info(return_line_item_id, opts)
555
+ data
556
+ end
557
+
558
+ # Find ReturnLineItem
559
+ # Return single instance of ReturnLineItem by its ID.
560
+ # @param return_line_item_id ID of returnLineItem to return
561
+ # @param [Hash] opts the optional parameters
562
+ # @return [Array<(ReturnLineItem, Fixnum, Hash)>] ReturnLineItem data, response status code and response headers
563
+ def get_return_line_item_by_id_with_http_info(return_line_item_id, opts = {})
564
+ if api_client.config.debugging
565
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.get_return_line_item_by_id ...'
566
+ end
567
+ # verify the required parameter 'return_line_item_id' is set
568
+ if api_client.config.client_side_validation && return_line_item_id.nil?
569
+ fail ArgumentError, "Missing the required parameter 'return_line_item_id' when calling ReturnLineItem.get_return_line_item_by_id"
570
+ end
571
+ # resource path
572
+ local_var_path = '/returnLineItems/{returnLineItemId}'.sub('{' + 'returnLineItemId' + '}', return_line_item_id.to_s)
573
+
574
+ # query parameters
575
+ query_params = opts
576
+
577
+ # header parameters
578
+ header_params = {}
579
+ # HTTP header 'Accept' (if needed)
580
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
581
+ # HTTP header 'Content-Type'
582
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
583
+
584
+ # form parameters
585
+ form_params = {}
586
+
587
+ # http body (model)
588
+ post_body = nil
589
+ auth_names = []
590
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
591
+ :header_params => header_params,
592
+ :query_params => query_params,
593
+ :form_params => form_params,
594
+ :body => post_body,
595
+ :auth_names => auth_names,
596
+ :return_type => 'ReturnLineItem')
597
+ if api_client.config.debugging
598
+ api_client.config.logger.debug "API called: ReturnLineItem#get_return_line_item_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
599
+ end
600
+ return data, status_code, headers
601
+ end
602
+ # List ReturnLineItems
603
+ # Return a list of ReturnLineItems
604
+ # @param [Hash] opts the optional parameters
605
+ # @option opts [Integer] :page page number
606
+ # @option opts [Integer] :size page size
607
+ # @option opts [String] :sort page order
608
+ # @return [Page<ReturnLineItem>]
609
+ def list_all_return_line_items(opts = {})
610
+ data, _status_code, _headers = list_all_return_line_items_with_http_info(opts)
611
+ data
612
+ end
613
+
614
+ # List ReturnLineItems
615
+ # Return a list of ReturnLineItems
616
+ # @param [Hash] opts the optional parameters
617
+ # @option opts [Integer] :page page number
618
+ # @option opts [Integer] :size page size
619
+ # @option opts [String] :sort page order
620
+ # @return [Array<(Page<ReturnLineItem>, Fixnum, Hash)>] Page<ReturnLineItem> data, response status code and response headers
621
+ def list_all_return_line_items_with_http_info(opts = {})
622
+ if api_client.config.debugging
623
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.list_all_return_line_items ...'
624
+ end
625
+ # resource path
626
+ local_var_path = '/returnLineItems'
627
+
628
+ # query parameters
629
+ query_params = opts
630
+ # query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
631
+ # query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
632
+ # query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
633
+
634
+ # header parameters
635
+ header_params = {}
636
+ # HTTP header 'Accept' (if needed)
637
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
638
+ # HTTP header 'Content-Type'
639
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
640
+
641
+ # form parameters
642
+ form_params = {}
643
+
644
+ # http body (model)
645
+ post_body = nil
646
+ auth_names = []
647
+ data, status_code, headers = api_client.call_api(:GET, local_var_path,
648
+ :header_params => header_params,
649
+ :query_params => query_params,
650
+ :form_params => form_params,
651
+ :body => post_body,
652
+ :auth_names => auth_names,
653
+ :return_type => 'Page<ReturnLineItem>')
654
+ if api_client.config.debugging
655
+ api_client.config.logger.debug "API called: ReturnLineItem#list_all_return_line_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
656
+ end
657
+ return data, status_code, headers
658
+ end
659
+ # Replace ReturnLineItem
660
+ # Replace all attributes of ReturnLineItem
661
+ # @param return_line_item_id ID of returnLineItem to replace
662
+ # @param return_line_item Attributes of returnLineItem to replace
663
+ # @param [Hash] opts the optional parameters
664
+ # @return [ReturnLineItem]
665
+ def replace_return_line_item_by_id(return_line_item_id, return_line_item, opts = {})
666
+ data, _status_code, _headers = replace_return_line_item_by_id_with_http_info(return_line_item_id, return_line_item, opts)
667
+ data
668
+ end
669
+
670
+ # Replace ReturnLineItem
671
+ # Replace all attributes of ReturnLineItem
672
+ # @param return_line_item_id ID of returnLineItem to replace
673
+ # @param return_line_item Attributes of returnLineItem to replace
674
+ # @param [Hash] opts the optional parameters
675
+ # @return [Array<(ReturnLineItem, Fixnum, Hash)>] ReturnLineItem data, response status code and response headers
676
+ def replace_return_line_item_by_id_with_http_info(return_line_item_id, return_line_item, opts = {})
677
+ if api_client.config.debugging
678
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.replace_return_line_item_by_id ...'
679
+ end
680
+ # verify the required parameter 'return_line_item_id' is set
681
+ if api_client.config.client_side_validation && return_line_item_id.nil?
682
+ fail ArgumentError, "Missing the required parameter 'return_line_item_id' when calling ReturnLineItem.replace_return_line_item_by_id"
683
+ end
684
+ # verify the required parameter 'return_line_item' is set
685
+ if api_client.config.client_side_validation && return_line_item.nil?
686
+ fail ArgumentError, "Missing the required parameter 'return_line_item' when calling ReturnLineItem.replace_return_line_item_by_id"
687
+ end
688
+ # resource path
689
+ local_var_path = '/returnLineItems/{returnLineItemId}'.sub('{' + 'returnLineItemId' + '}', return_line_item_id.to_s)
690
+
691
+ # query parameters
692
+ query_params = opts
693
+
694
+ # header parameters
695
+ header_params = {}
696
+ # HTTP header 'Accept' (if needed)
697
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
698
+ # HTTP header 'Content-Type'
699
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
700
+
701
+ # form parameters
702
+ form_params = {}
703
+
704
+ # http body (model)
705
+ post_body = api_client.object_to_http_body(return_line_item)
706
+ auth_names = []
707
+ data, status_code, headers = api_client.call_api(:PUT, local_var_path,
708
+ :header_params => header_params,
709
+ :query_params => query_params,
710
+ :form_params => form_params,
711
+ :body => post_body,
712
+ :auth_names => auth_names,
713
+ :return_type => 'ReturnLineItem')
714
+ if api_client.config.debugging
715
+ api_client.config.logger.debug "API called: ReturnLineItem#replace_return_line_item_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
716
+ end
717
+ return data, status_code, headers
718
+ end
719
+ # Update ReturnLineItem
720
+ # Update attributes of ReturnLineItem
721
+ # @param return_line_item_id ID of returnLineItem to update.
722
+ # @param return_line_item Attributes of returnLineItem to update.
723
+ # @param [Hash] opts the optional parameters
724
+ # @return [ReturnLineItem]
725
+ def update_return_line_item_by_id(return_line_item_id, return_line_item, opts = {})
726
+ data, _status_code, _headers = update_return_line_item_by_id_with_http_info(return_line_item_id, return_line_item, opts)
727
+ data
728
+ end
729
+
730
+ # Update ReturnLineItem
731
+ # Update attributes of ReturnLineItem
732
+ # @param return_line_item_id ID of returnLineItem to update.
733
+ # @param return_line_item Attributes of returnLineItem to update.
734
+ # @param [Hash] opts the optional parameters
735
+ # @return [Array<(ReturnLineItem, Fixnum, Hash)>] ReturnLineItem data, response status code and response headers
736
+ def update_return_line_item_by_id_with_http_info(return_line_item_id, return_line_item, opts = {})
737
+ if api_client.config.debugging
738
+ api_client.config.logger.debug 'Calling API: ReturnLineItem.update_return_line_item_by_id ...'
739
+ end
740
+ # verify the required parameter 'return_line_item_id' is set
741
+ if api_client.config.client_side_validation && return_line_item_id.nil?
742
+ fail ArgumentError, "Missing the required parameter 'return_line_item_id' when calling ReturnLineItem.update_return_line_item_by_id"
743
+ end
744
+ # verify the required parameter 'return_line_item' is set
745
+ if api_client.config.client_side_validation && return_line_item.nil?
746
+ fail ArgumentError, "Missing the required parameter 'return_line_item' when calling ReturnLineItem.update_return_line_item_by_id"
747
+ end
748
+ # resource path
749
+ local_var_path = '/returnLineItems/{returnLineItemId}'.sub('{' + 'returnLineItemId' + '}', return_line_item_id.to_s)
750
+
751
+ # query parameters
752
+ query_params = opts
753
+
754
+ # header parameters
755
+ header_params = {}
756
+ # HTTP header 'Accept' (if needed)
757
+ header_params['Accept'] = api_client.select_header_accept(['application/json'])
758
+ # HTTP header 'Content-Type'
759
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
760
+
761
+ # form parameters
762
+ form_params = {}
763
+
764
+ # http body (model)
765
+ post_body = api_client.object_to_http_body(return_line_item)
766
+ auth_names = []
767
+ data, status_code, headers = api_client.call_api(:PATCH, local_var_path,
768
+ :header_params => header_params,
769
+ :query_params => query_params,
770
+ :form_params => form_params,
771
+ :body => post_body,
772
+ :auth_names => auth_names,
773
+ :return_type => 'ReturnLineItem')
774
+ if api_client.config.debugging
775
+ api_client.config.logger.debug "API called: ReturnLineItem#update_return_line_item_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
776
+ end
777
+ return data, status_code, headers
778
+ end
779
+ end
780
+ end
781
+ end