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