tradenity 0.1.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +7 -0
- data/README.md +89 -77
- data/lib/tradenity/api_client.rb +408 -0
- data/lib/tradenity/api_error.rb +36 -0
- data/lib/tradenity/configuration.rb +205 -0
- data/lib/tradenity/exceptions.rb +5 -0
- data/lib/tradenity/rails/railtie.rb +20 -20
- data/lib/tradenity/resources/address.rb +729 -0
- data/lib/tradenity/resources/braintree_gateway.rb +804 -0
- data/lib/tradenity/resources/brand.rb +732 -0
- data/lib/tradenity/resources/cancel_operation.rb +675 -0
- data/lib/tradenity/resources/cart_settings.rb +219 -0
- data/lib/tradenity/resources/cash_on_delivery_payment.rb +746 -0
- data/lib/tradenity/resources/category.rb +763 -0
- data/lib/tradenity/resources/collection.rb +734 -0
- data/lib/tradenity/resources/contact_info.rb +306 -0
- data/lib/tradenity/resources/countries_geo_zone.rb +739 -0
- data/lib/tradenity/resources/country.rb +803 -0
- data/lib/tradenity/resources/coupon.rb +454 -0
- data/lib/tradenity/resources/credit_card_payment.rb +803 -0
- data/lib/tradenity/resources/currency.rb +762 -0
- data/lib/tradenity/resources/customer.rb +816 -0
- data/lib/tradenity/resources/customer_group.rb +723 -0
- data/lib/tradenity/resources/dimensions.rb +263 -0
- data/lib/tradenity/resources/discount_coupon.rb +811 -0
- data/lib/tradenity/resources/discount_promotion.rb +784 -0
- data/lib/tradenity/resources/fixed_rate_shipping.rb +837 -0
- data/lib/tradenity/resources/free_item_coupon.rb +793 -0
- data/lib/tradenity/resources/free_shipping.rb +806 -0
- data/lib/tradenity/resources/free_shipping_coupon.rb +788 -0
- data/lib/tradenity/resources/free_shipping_promotion.rb +744 -0
- data/lib/tradenity/resources/gateway.rb +435 -0
- data/lib/tradenity/resources/general_settings.rb +206 -0
- data/lib/tradenity/resources/geo_zone.rb +406 -0
- data/lib/tradenity/resources/instance_meta.rb +182 -0
- data/lib/tradenity/resources/inventory_settings.rb +197 -0
- data/lib/tradenity/resources/items_selector.rb +270 -0
- data/lib/tradenity/resources/line_item.rb +347 -0
- data/lib/tradenity/resources/mail_server_settings.rb +221 -0
- data/lib/tradenity/resources/measurement_settings.rb +253 -0
- data/lib/tradenity/resources/option.rb +787 -0
- data/lib/tradenity/resources/option_set.rb +734 -0
- data/lib/tradenity/resources/option_value.rb +680 -0
- data/lib/tradenity/resources/order.rb +929 -0
- data/lib/tradenity/resources/order_line_item.rb +777 -0
- data/lib/tradenity/resources/paging.rb +38 -0
- data/lib/tradenity/resources/payment.rb +429 -0
- data/lib/tradenity/resources/payment_card.rb +847 -0
- data/lib/tradenity/resources/payment_settings.rb +201 -0
- data/lib/tradenity/resources/payment_source.rb +392 -0
- data/lib/tradenity/resources/payment_token.rb +723 -0
- data/lib/tradenity/resources/payment_transaction.rb +740 -0
- data/lib/tradenity/resources/photo.rb +341 -0
- data/lib/tradenity/resources/product.rb +1156 -0
- data/lib/tradenity/resources/promotion.rb +427 -0
- data/lib/tradenity/resources/refund_operation.rb +358 -0
- data/lib/tradenity/resources/refund_transaction.rb +730 -0
- data/lib/tradenity/resources/return_line_item.rb +781 -0
- data/lib/tradenity/resources/return_operation.rb +686 -0
- data/lib/tradenity/resources/return_settings.rb +255 -0
- data/lib/tradenity/resources/shipping_method.rb +530 -0
- data/lib/tradenity/resources/shopping_cart.rb +647 -0
- data/lib/tradenity/resources/state.rb +675 -0
- data/lib/tradenity/resources/states_geo_zone.rb +748 -0
- data/lib/tradenity/resources/store_credit.rb +686 -0
- data/lib/tradenity/resources/store_credit_payment.rb +764 -0
- data/lib/tradenity/resources/store_credit_transaction.rb +730 -0
- data/lib/tradenity/resources/store_profile.rb +532 -0
- data/lib/tradenity/resources/stripe_gateway.rb +804 -0
- data/lib/tradenity/resources/table_rate_rule.rb +712 -0
- data/lib/tradenity/resources/table_rate_shipping.rb +834 -0
- data/lib/tradenity/resources/tax_class.rb +723 -0
- data/lib/tradenity/resources/tax_rate.rb +845 -0
- data/lib/tradenity/resources/tax_settings.rb +231 -0
- data/lib/tradenity/resources/test_gateway.rb +804 -0
- data/lib/tradenity/resources/transaction.rb +523 -0
- data/lib/tradenity/resources/utils.rb +7 -0
- data/lib/tradenity/resources/variant.rb +877 -0
- data/lib/tradenity/resources/web_hooks.rb +262 -0
- data/lib/tradenity/resources/weight.rb +235 -0
- data/lib/tradenity/resources/wish_list.rb +686 -0
- data/lib/tradenity/resources/zip_codes_geo_zone.rb +755 -0
- data/lib/tradenity/token_holder.rb +22 -0
- data/lib/tradenity/version.rb +13 -3
- data/lib/tradenity.rb +117 -7
- data/tradenity.gemspec +35 -30
- metadata +200 -34
- data/lib/tradenity/api.rb +0 -17
- data/lib/tradenity/error/exceptions.rb +0 -52
- data/lib/tradenity/error/message.rb +0 -38
- data/lib/tradenity/http/client.rb +0 -130
- data/lib/tradenity/model/base.rb +0 -100
- data/lib/tradenity/model/entities.rb +0 -390
- data/lib/tradenity/model/paging.rb +0 -23
@@ -0,0 +1,530 @@
|
|
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 ShippingMethod
|
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
|
+
class EnumAttributeValidator
|
57
|
+
attr_reader :datatype
|
58
|
+
attr_reader :allowable_values
|
59
|
+
|
60
|
+
def initialize(datatype, allowable_values)
|
61
|
+
@allowable_values = allowable_values.map do |value|
|
62
|
+
case datatype.to_s
|
63
|
+
when /Integer/i
|
64
|
+
value.to_i
|
65
|
+
when /Float/i
|
66
|
+
value.to_f
|
67
|
+
else
|
68
|
+
value
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
def valid?(value)
|
74
|
+
!value || allowable_values.include?(value)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
79
|
+
def self.attribute_map
|
80
|
+
{
|
81
|
+
:'id' => :'id',
|
82
|
+
:'__meta' => :'__meta',
|
83
|
+
:'created_at' => :'createdAt',
|
84
|
+
:'updated_at' => :'updatedAt',
|
85
|
+
:'name' => :'name',
|
86
|
+
:'slug' => :'slug',
|
87
|
+
:'message' => :'message',
|
88
|
+
:'description' => :'description',
|
89
|
+
:'geo_zone' => :'geoZone',
|
90
|
+
:'customer_groups' => :'customerGroups',
|
91
|
+
:'status' => :'status',
|
92
|
+
:'use_discounted_subtotal' => :'useDiscountedSubtotal',
|
93
|
+
:'include_taxes' => :'includeTaxes'
|
94
|
+
}
|
95
|
+
end
|
96
|
+
|
97
|
+
# Attribute type mapping.
|
98
|
+
def self.swagger_types
|
99
|
+
{
|
100
|
+
:'id' => :'String',
|
101
|
+
:'__meta' => :'InstanceMeta',
|
102
|
+
:'created_at' => :'DateTime',
|
103
|
+
:'updated_at' => :'DateTime',
|
104
|
+
:'name' => :'String',
|
105
|
+
:'slug' => :'String',
|
106
|
+
:'message' => :'String',
|
107
|
+
:'description' => :'String',
|
108
|
+
:'geo_zone' => :'GeoZone',
|
109
|
+
:'customer_groups' => :'Array<CustomerGroup>',
|
110
|
+
:'status' => :'String',
|
111
|
+
:'use_discounted_subtotal' => :'BOOLEAN',
|
112
|
+
:'include_taxes' => :'BOOLEAN'
|
113
|
+
}
|
114
|
+
end
|
115
|
+
|
116
|
+
# Initializes the object
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
def initialize(attributes = {})
|
119
|
+
return unless attributes.is_a?(Hash)
|
120
|
+
|
121
|
+
# convert string to symbol for hash key
|
122
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
123
|
+
if attributes.has_key?(:'id')
|
124
|
+
self.id = attributes[:'id']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'__meta')
|
128
|
+
self.__meta = attributes[:'__meta']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'createdAt')
|
132
|
+
self.created_at = attributes[:'createdAt']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'created_at')
|
136
|
+
self.created_at = attributes[:'created_at']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'updatedAt')
|
140
|
+
self.updated_at = attributes[:'updatedAt']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.has_key?(:'updated_at')
|
144
|
+
self.updated_at = attributes[:'updated_at']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'name')
|
148
|
+
self.name = attributes[:'name']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'slug')
|
152
|
+
self.slug = attributes[:'slug']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'message')
|
156
|
+
self.message = attributes[:'message']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'description')
|
160
|
+
self.description = attributes[:'description']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'geoZone')
|
164
|
+
self.geo_zone = attributes[:'geoZone']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'geo_zone')
|
168
|
+
self.geo_zone = attributes[:'geo_zone']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'customerGroups')
|
172
|
+
if (value = attributes[:'customerGroups']).is_a?(Array)
|
173
|
+
self.customer_groups = value
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.has_key?(:'customer_groups')
|
178
|
+
if (value = attributes[:'customer_groups']).is_a?(Array)
|
179
|
+
self.customer_groups = value
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.has_key?(:'status')
|
184
|
+
self.status = attributes[:'status']
|
185
|
+
end
|
186
|
+
|
187
|
+
if attributes.has_key?(:'useDiscountedSubtotal')
|
188
|
+
self.use_discounted_subtotal = attributes[:'useDiscountedSubtotal']
|
189
|
+
end
|
190
|
+
|
191
|
+
if attributes.has_key?(:'use_discounted_subtotal')
|
192
|
+
self.use_discounted_subtotal = attributes[:'use_discounted_subtotal']
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.has_key?(:'includeTaxes')
|
196
|
+
self.include_taxes = attributes[:'includeTaxes']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.has_key?(:'include_taxes')
|
200
|
+
self.include_taxes = attributes[:'include_taxes']
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
205
|
+
# @return Array for valid properties with the reasons
|
206
|
+
def list_invalid_properties
|
207
|
+
invalid_properties = Array.new
|
208
|
+
if @name.nil?
|
209
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
210
|
+
end
|
211
|
+
|
212
|
+
if @slug.nil?
|
213
|
+
invalid_properties.push('invalid value for "slug", slug cannot be nil.')
|
214
|
+
end
|
215
|
+
|
216
|
+
if @geo_zone.nil?
|
217
|
+
invalid_properties.push('invalid value for "geo_zone", geo_zone cannot be nil.')
|
218
|
+
end
|
219
|
+
|
220
|
+
if @status.nil?
|
221
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
222
|
+
end
|
223
|
+
|
224
|
+
invalid_properties
|
225
|
+
end
|
226
|
+
|
227
|
+
# Check to see if the all the properties in the model are valid
|
228
|
+
# @return true if the model is valid
|
229
|
+
def valid?
|
230
|
+
return false if @name.nil?
|
231
|
+
return false if @slug.nil?
|
232
|
+
return false if @geo_zone.nil?
|
233
|
+
return false if @status.nil?
|
234
|
+
status_validator = EnumAttributeValidator.new('String', ['enabled', 'disabled'])
|
235
|
+
return false unless status_validator.valid?(@status)
|
236
|
+
true
|
237
|
+
end
|
238
|
+
|
239
|
+
# Custom attribute writer method checking allowed values (enum).
|
240
|
+
# @param [Object] status Object to be assigned
|
241
|
+
def status=(status)
|
242
|
+
validator = EnumAttributeValidator.new('String', ['enabled', 'disabled'])
|
243
|
+
unless validator.valid?(status)
|
244
|
+
fail ArgumentError, 'invalid value for "status", must be one of #{validator.allowable_values}.'
|
245
|
+
end
|
246
|
+
@status = status
|
247
|
+
end
|
248
|
+
|
249
|
+
# Checks equality by comparing each attribute.
|
250
|
+
# @param [Object] Object to be compared
|
251
|
+
def ==(o)
|
252
|
+
return true if self.equal?(o)
|
253
|
+
self.class == o.class &&
|
254
|
+
__meta == o.__meta &&
|
255
|
+
created_at == o.created_at &&
|
256
|
+
updated_at == o.updated_at &&
|
257
|
+
name == o.name &&
|
258
|
+
slug == o.slug &&
|
259
|
+
message == o.message &&
|
260
|
+
description == o.description &&
|
261
|
+
geo_zone == o.geo_zone &&
|
262
|
+
customer_groups == o.customer_groups &&
|
263
|
+
status == o.status &&
|
264
|
+
use_discounted_subtotal == o.use_discounted_subtotal &&
|
265
|
+
include_taxes == o.include_taxes
|
266
|
+
end
|
267
|
+
|
268
|
+
# @see the `==` method
|
269
|
+
# @param [Object] Object to be compared
|
270
|
+
def eql?(o)
|
271
|
+
self == o
|
272
|
+
end
|
273
|
+
|
274
|
+
# Calculates hash code according to all attributes.
|
275
|
+
# @return [Fixnum] Hash code
|
276
|
+
def hash
|
277
|
+
[__meta, created_at, updated_at, name, slug, message, description, geo_zone, customer_groups, status, use_discounted_subtotal, include_taxes].hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Builds the object from hash
|
281
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
282
|
+
# @return [Object] Returns the model itself
|
283
|
+
def build_from_hash(attributes)
|
284
|
+
return nil unless attributes.is_a?(Hash)
|
285
|
+
self.class.swagger_types.each_pair do |key, type|
|
286
|
+
if type =~ /\AArray<(.*)>/i
|
287
|
+
# check to ensure the input is an array given that the the attribute
|
288
|
+
# is documented as an array but the input is not
|
289
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
290
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
291
|
+
end
|
292
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
293
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
294
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
295
|
+
end
|
296
|
+
|
297
|
+
self
|
298
|
+
end
|
299
|
+
|
300
|
+
# Deserializes the data based on type
|
301
|
+
# @param string type Data type
|
302
|
+
# @param string value Value to be deserialized
|
303
|
+
# @return [Object] Deserialized data
|
304
|
+
def _deserialize(type, value)
|
305
|
+
case type.to_sym
|
306
|
+
when :DateTime
|
307
|
+
DateTime.parse(value)
|
308
|
+
when :Date
|
309
|
+
Date.parse(value)
|
310
|
+
when :String
|
311
|
+
value.to_s
|
312
|
+
when :Integer
|
313
|
+
value.to_i
|
314
|
+
when :Float
|
315
|
+
value.to_f
|
316
|
+
when :BOOLEAN
|
317
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
318
|
+
true
|
319
|
+
else
|
320
|
+
false
|
321
|
+
end
|
322
|
+
when :Object
|
323
|
+
# generic object (usually a Hash), return directly
|
324
|
+
value
|
325
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
326
|
+
inner_type = Regexp.last_match[:inner_type]
|
327
|
+
value.map { |v| _deserialize(inner_type, v) }
|
328
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
329
|
+
k_type = Regexp.last_match[:k_type]
|
330
|
+
v_type = Regexp.last_match[:v_type]
|
331
|
+
{}.tap do |hash|
|
332
|
+
value.each do |k, v|
|
333
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
334
|
+
end
|
335
|
+
end
|
336
|
+
else # model
|
337
|
+
temp_model = Tradenity.const_get(type).new
|
338
|
+
temp_model.build_from_hash(value)
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
# Returns the string representation of the object
|
343
|
+
# @return [String] String presentation of the object
|
344
|
+
def to_s
|
345
|
+
to_hash.to_s
|
346
|
+
end
|
347
|
+
|
348
|
+
# to_body is an alias to to_hash (backward compatibility)
|
349
|
+
# @return [Hash] Returns the object in the form of hash
|
350
|
+
def to_body
|
351
|
+
to_hash
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the object in the form of hash
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
356
|
+
def to_hash
|
357
|
+
hash = {}
|
358
|
+
self.class.attribute_map.each_pair do |attr, param|
|
359
|
+
value = self.send(attr)
|
360
|
+
next if value.nil?
|
361
|
+
hash[param] = _to_hash(value)
|
362
|
+
end
|
363
|
+
hash
|
364
|
+
end
|
365
|
+
|
366
|
+
# Outputs non-array value in the form of hash
|
367
|
+
# For object, use to_hash. Otherwise, just return the value
|
368
|
+
# @param [Object] value Any valid value
|
369
|
+
# @return [Hash] Returns the value in the form of hash
|
370
|
+
def _to_hash(value)
|
371
|
+
if value.is_a?(Array)
|
372
|
+
value.compact.map { |v| _to_hash(v) }
|
373
|
+
elsif value.is_a?(Hash)
|
374
|
+
{}.tap do |hash|
|
375
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
376
|
+
end
|
377
|
+
elsif value.respond_to? :to_hash
|
378
|
+
value.to_hash
|
379
|
+
else
|
380
|
+
value
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
|
385
|
+
def self.api_client
|
386
|
+
ApiClient.default
|
387
|
+
end
|
388
|
+
|
389
|
+
|
390
|
+
class << self
|
391
|
+
|
392
|
+
# List ShippingMethods
|
393
|
+
# Return a list of ShippingMethods
|
394
|
+
# @param [Hash] opts the optional parameters
|
395
|
+
# @return [Page<ShippingMethod>]
|
396
|
+
def find_all
|
397
|
+
list_all_shipping_methods
|
398
|
+
end
|
399
|
+
|
400
|
+
# Find List of ShippingMethod
|
401
|
+
# Return multiple instances of ShippingMethod by its attributes.
|
402
|
+
# @param [Hash] opts the search parameters
|
403
|
+
# @return [Page<Collection>]
|
404
|
+
def find_all_by(opts = {})
|
405
|
+
list_all_shipping_methods(opts)
|
406
|
+
end
|
407
|
+
|
408
|
+
# Find ShippingMethod by its parameters
|
409
|
+
# Return single instance of Collection by its attributes.
|
410
|
+
# @param [Hash] opts search parameters
|
411
|
+
# @return [ShippingMethod]
|
412
|
+
def find_one_by(opts = {})
|
413
|
+
list_all_shipping_methods(opts)[0]
|
414
|
+
end
|
415
|
+
|
416
|
+
|
417
|
+
# Find shipping methods for order.
|
418
|
+
# Find all shipping methods suitable for an order.
|
419
|
+
# @param order_id Order ID to get shipping methods for.
|
420
|
+
# @param [Hash] opts the optional parameters
|
421
|
+
# @return [Page<ShippingMethod>]
|
422
|
+
def find_all_for_order(order_id, opts = {})
|
423
|
+
data, _status_code, _headers = find_all_for_order_with_http_info(order_id, opts)
|
424
|
+
data
|
425
|
+
end
|
426
|
+
|
427
|
+
# Find shipping methods for order.
|
428
|
+
# Find all shipping methods suitable for an order.
|
429
|
+
# @param order_id Order ID to get shipping methods for.
|
430
|
+
# @param [Hash] opts the optional parameters
|
431
|
+
# @return [Array<(Page<ShippingMethod>, Fixnum, Hash)>] Page<ShippingMethod> data, response status code and response headers
|
432
|
+
def find_all_for_order_with_http_info(order_id, opts = {})
|
433
|
+
if api_client.config.debugging
|
434
|
+
api_client.config.logger.debug 'Calling API: ShippingMethod.find_all_for_order ...'
|
435
|
+
end
|
436
|
+
# verify the required parameter 'order_id' is set
|
437
|
+
if api_client.config.client_side_validation && order_id.nil?
|
438
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling ShippingMethod.find_all_for_order"
|
439
|
+
end
|
440
|
+
# resource path
|
441
|
+
local_var_path = '/shippingMethods/order/{orderId}'.sub('{' + 'orderId' + '}', order_id.to_s)
|
442
|
+
|
443
|
+
# query parameters
|
444
|
+
query_params = opts
|
445
|
+
|
446
|
+
# header parameters
|
447
|
+
header_params = {}
|
448
|
+
# HTTP header 'Accept' (if needed)
|
449
|
+
header_params['Accept'] = api_client.select_header_accept(['application/json'])
|
450
|
+
# HTTP header 'Content-Type'
|
451
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
|
452
|
+
|
453
|
+
# form parameters
|
454
|
+
form_params = {}
|
455
|
+
|
456
|
+
# http body (model)
|
457
|
+
post_body = nil
|
458
|
+
auth_names = []
|
459
|
+
data, status_code, headers = api_client.call_api(:GET, local_var_path,
|
460
|
+
:header_params => header_params,
|
461
|
+
:query_params => query_params,
|
462
|
+
:form_params => form_params,
|
463
|
+
:body => post_body,
|
464
|
+
:auth_names => auth_names,
|
465
|
+
:return_type => 'Page<ShippingMethod>')
|
466
|
+
if api_client.config.debugging
|
467
|
+
api_client.config.logger.debug "API called: ShippingMethod#find_all_for_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
468
|
+
end
|
469
|
+
return data, status_code, headers
|
470
|
+
end
|
471
|
+
# List ShippingMethods
|
472
|
+
# Return a list of ShippingMethods
|
473
|
+
# @param [Hash] opts the optional parameters
|
474
|
+
# @option opts [Integer] :page page number
|
475
|
+
# @option opts [Integer] :size page size
|
476
|
+
# @option opts [String] :sort page order
|
477
|
+
# @return [Page<ShippingMethod>]
|
478
|
+
def list_all_shipping_methods(opts = {})
|
479
|
+
data, _status_code, _headers = list_all_shipping_methods_with_http_info(opts)
|
480
|
+
data
|
481
|
+
end
|
482
|
+
|
483
|
+
# List ShippingMethods
|
484
|
+
# Return a list of ShippingMethods
|
485
|
+
# @param [Hash] opts the optional parameters
|
486
|
+
# @option opts [Integer] :page page number
|
487
|
+
# @option opts [Integer] :size page size
|
488
|
+
# @option opts [String] :sort page order
|
489
|
+
# @return [Array<(Page<ShippingMethod>, Fixnum, Hash)>] Page<ShippingMethod> data, response status code and response headers
|
490
|
+
def list_all_shipping_methods_with_http_info(opts = {})
|
491
|
+
if api_client.config.debugging
|
492
|
+
api_client.config.logger.debug 'Calling API: ShippingMethod.list_all_shipping_methods ...'
|
493
|
+
end
|
494
|
+
# resource path
|
495
|
+
local_var_path = '/shippingMethods'
|
496
|
+
|
497
|
+
# query parameters
|
498
|
+
query_params = opts
|
499
|
+
# query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
500
|
+
# query_params[:'size'] = opts[:'size'] if !opts[:'size'].nil?
|
501
|
+
# query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
502
|
+
|
503
|
+
# header parameters
|
504
|
+
header_params = {}
|
505
|
+
# HTTP header 'Accept' (if needed)
|
506
|
+
header_params['Accept'] = api_client.select_header_accept(['application/json'])
|
507
|
+
# HTTP header 'Content-Type'
|
508
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['application/json'])
|
509
|
+
|
510
|
+
# form parameters
|
511
|
+
form_params = {}
|
512
|
+
|
513
|
+
# http body (model)
|
514
|
+
post_body = nil
|
515
|
+
auth_names = []
|
516
|
+
data, status_code, headers = api_client.call_api(:GET, local_var_path,
|
517
|
+
:header_params => header_params,
|
518
|
+
:query_params => query_params,
|
519
|
+
:form_params => form_params,
|
520
|
+
:body => post_body,
|
521
|
+
:auth_names => auth_names,
|
522
|
+
:return_type => 'Page<ShippingMethod>')
|
523
|
+
if api_client.config.debugging
|
524
|
+
api_client.config.logger.debug "API called: ShippingMethod#list_all_shipping_methods\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
525
|
+
end
|
526
|
+
return data, status_code, headers
|
527
|
+
end
|
528
|
+
end
|
529
|
+
end
|
530
|
+
end
|