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