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