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