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