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