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