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