ultracart_api 4.1.110 → 4.1.112

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -407,6 +407,122 @@ module UltracartClient
407
407
  return data, status_code, headers
408
408
  end
409
409
 
410
+ # Retrieve the Anrok tax provider
411
+ # Retrieves the Anrok tax provider.
412
+ # @param [Hash] opts the optional parameters
413
+ # @return [TaxProviderAnrok]
414
+ def get_tax_provider_anrok(opts = {})
415
+ data, _status_code, _headers = get_tax_provider_anrok_with_http_info(opts)
416
+ data
417
+ end
418
+
419
+ # Retrieve the Anrok tax provider
420
+ # Retrieves the Anrok tax provider.
421
+ # @param [Hash] opts the optional parameters
422
+ # @return [Array<(TaxProviderAnrok, Integer, Hash)>] TaxProviderAnrok data, response status code and response headers
423
+ def get_tax_provider_anrok_with_http_info(opts = {})
424
+ if @api_client.config.debugging
425
+ @api_client.config.logger.debug 'Calling API: TaxApi.get_tax_provider_anrok ...'
426
+ end
427
+ # resource path
428
+ local_var_path = '/tax/providers/anrok'
429
+
430
+ # query parameters
431
+ query_params = opts[:query_params] || {}
432
+
433
+ # header parameters
434
+ header_params = opts[:header_params] || {}
435
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
436
+ # HTTP header 'Accept' (if needed)
437
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
438
+
439
+ # form parameters
440
+ form_params = opts[:form_params] || {}
441
+
442
+ # http body (model)
443
+ post_body = opts[:debug_body]
444
+
445
+ # return_type
446
+ return_type = opts[:debug_return_type] || 'TaxProviderAnrok'
447
+
448
+ # auth_names
449
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
450
+
451
+ new_options = opts.merge(
452
+ :operation => :"TaxApi.get_tax_provider_anrok",
453
+ :header_params => header_params,
454
+ :query_params => query_params,
455
+ :form_params => form_params,
456
+ :body => post_body,
457
+ :auth_names => auth_names,
458
+ :return_type => return_type
459
+ )
460
+
461
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
462
+ if @api_client.config.debugging
463
+ @api_client.config.logger.debug "API called: TaxApi#get_tax_provider_anrok\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
464
+ end
465
+ return data, status_code, headers
466
+ end
467
+
468
+ # Attempts to connect to Anrok and returns back the response
469
+ # Attempts to connect to Anrok and returns back the response.
470
+ # @param [Hash] opts the optional parameters
471
+ # @return [TaxProviderTestResult]
472
+ def get_tax_provider_anrok_test(opts = {})
473
+ data, _status_code, _headers = get_tax_provider_anrok_test_with_http_info(opts)
474
+ data
475
+ end
476
+
477
+ # Attempts to connect to Anrok and returns back the response
478
+ # Attempts to connect to Anrok and returns back the response.
479
+ # @param [Hash] opts the optional parameters
480
+ # @return [Array<(TaxProviderTestResult, Integer, Hash)>] TaxProviderTestResult data, response status code and response headers
481
+ def get_tax_provider_anrok_test_with_http_info(opts = {})
482
+ if @api_client.config.debugging
483
+ @api_client.config.logger.debug 'Calling API: TaxApi.get_tax_provider_anrok_test ...'
484
+ end
485
+ # resource path
486
+ local_var_path = '/tax/providers/anrok/test'
487
+
488
+ # query parameters
489
+ query_params = opts[:query_params] || {}
490
+
491
+ # header parameters
492
+ header_params = opts[:header_params] || {}
493
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
494
+ # HTTP header 'Accept' (if needed)
495
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
496
+
497
+ # form parameters
498
+ form_params = opts[:form_params] || {}
499
+
500
+ # http body (model)
501
+ post_body = opts[:debug_body]
502
+
503
+ # return_type
504
+ return_type = opts[:debug_return_type] || 'TaxProviderTestResult'
505
+
506
+ # auth_names
507
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
508
+
509
+ new_options = opts.merge(
510
+ :operation => :"TaxApi.get_tax_provider_anrok_test",
511
+ :header_params => header_params,
512
+ :query_params => query_params,
513
+ :form_params => form_params,
514
+ :body => post_body,
515
+ :auth_names => auth_names,
516
+ :return_type => return_type
517
+ )
518
+
519
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
520
+ if @api_client.config.debugging
521
+ @api_client.config.logger.debug "API called: TaxApi#get_tax_provider_anrok_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
522
+ end
523
+ return data, status_code, headers
524
+ end
525
+
410
526
  # Retrieve the Avalara tax provider
411
527
  # Retrieves the Avalara tax provider.
412
528
  # @param [Hash] opts the optional parameters
@@ -1193,6 +1309,75 @@ module UltracartClient
1193
1309
  return data, status_code, headers
1194
1310
  end
1195
1311
 
1312
+ # Update the Anrok tax provider
1313
+ # Update the Anrok tax provider.
1314
+ # @param tax_provider_anrok [TaxProviderAnrok] TaxProviderAnrok object
1315
+ # @param [Hash] opts the optional parameters
1316
+ # @return [TaxProviderAnrok]
1317
+ def update_tax_provider_anrok(tax_provider_anrok, opts = {})
1318
+ data, _status_code, _headers = update_tax_provider_anrok_with_http_info(tax_provider_anrok, opts)
1319
+ data
1320
+ end
1321
+
1322
+ # Update the Anrok tax provider
1323
+ # Update the Anrok tax provider.
1324
+ # @param tax_provider_anrok [TaxProviderAnrok] TaxProviderAnrok object
1325
+ # @param [Hash] opts the optional parameters
1326
+ # @return [Array<(TaxProviderAnrok, Integer, Hash)>] TaxProviderAnrok data, response status code and response headers
1327
+ def update_tax_provider_anrok_with_http_info(tax_provider_anrok, opts = {})
1328
+ if @api_client.config.debugging
1329
+ @api_client.config.logger.debug 'Calling API: TaxApi.update_tax_provider_anrok ...'
1330
+ end
1331
+ # verify the required parameter 'tax_provider_anrok' is set
1332
+ if @api_client.config.client_side_validation && tax_provider_anrok.nil?
1333
+ fail ArgumentError, "Missing the required parameter 'tax_provider_anrok' when calling TaxApi.update_tax_provider_anrok"
1334
+ end
1335
+ # resource path
1336
+ local_var_path = '/tax/providers/anrok'
1337
+
1338
+ # query parameters
1339
+ query_params = opts[:query_params] || {}
1340
+
1341
+ # header parameters
1342
+ header_params = opts[:header_params] || {}
1343
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1344
+ # HTTP header 'Accept' (if needed)
1345
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1346
+ # HTTP header 'Content-Type'
1347
+ content_type = @api_client.select_header_content_type(['application/json'])
1348
+ if !content_type.nil?
1349
+ header_params['Content-Type'] = content_type
1350
+ end
1351
+
1352
+ # form parameters
1353
+ form_params = opts[:form_params] || {}
1354
+
1355
+ # http body (model)
1356
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(tax_provider_anrok)
1357
+
1358
+ # return_type
1359
+ return_type = opts[:debug_return_type] || 'TaxProviderAnrok'
1360
+
1361
+ # auth_names
1362
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1363
+
1364
+ new_options = opts.merge(
1365
+ :operation => :"TaxApi.update_tax_provider_anrok",
1366
+ :header_params => header_params,
1367
+ :query_params => query_params,
1368
+ :form_params => form_params,
1369
+ :body => post_body,
1370
+ :auth_names => auth_names,
1371
+ :return_type => return_type
1372
+ )
1373
+
1374
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1375
+ if @api_client.config.debugging
1376
+ @api_client.config.logger.debug "API called: TaxApi#update_tax_provider_anrok\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1377
+ end
1378
+ return data, status_code, headers
1379
+ end
1380
+
1196
1381
  # Update the Avalara tax provider
1197
1382
  # Update the Avalara tax provider.
1198
1383
  # @param tax_provider_avalara [TaxProviderAvalara] TaxProviderAvalara object
@@ -0,0 +1,250 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class AnrokConfig
18
+ # Anrok API key
19
+ attr_accessor :api_key
20
+
21
+ # True if this Anrok configuration is to estimate taxes only and not report placed orders to Anrok
22
+ attr_accessor :estimate_only
23
+
24
+ # Date/time of the connection test to Anrok
25
+ attr_accessor :last_test_dts
26
+
27
+ # Test results of the last connection test to Anrok
28
+ attr_accessor :test_results
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'api_key' => :'api_key',
34
+ :'estimate_only' => :'estimate_only',
35
+ :'last_test_dts' => :'last_test_dts',
36
+ :'test_results' => :'test_results'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'api_key' => :'String',
49
+ :'estimate_only' => :'Boolean',
50
+ :'last_test_dts' => :'String',
51
+ :'test_results' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::AnrokConfig` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::AnrokConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'api_key')
77
+ self.api_key = attributes[:'api_key']
78
+ end
79
+
80
+ if attributes.key?(:'estimate_only')
81
+ self.estimate_only = attributes[:'estimate_only']
82
+ end
83
+
84
+ if attributes.key?(:'last_test_dts')
85
+ self.last_test_dts = attributes[:'last_test_dts']
86
+ end
87
+
88
+ if attributes.key?(:'test_results')
89
+ self.test_results = attributes[:'test_results']
90
+ end
91
+ end
92
+
93
+ # Show invalid properties with the reasons. Usually used together with valid?
94
+ # @return Array for valid properties with the reasons
95
+ def list_invalid_properties
96
+ invalid_properties = Array.new
97
+ invalid_properties
98
+ end
99
+
100
+ # Check to see if the all the properties in the model are valid
101
+ # @return true if the model is valid
102
+ def valid?
103
+ true
104
+ end
105
+
106
+ # Checks equality by comparing each attribute.
107
+ # @param [Object] Object to be compared
108
+ def ==(o)
109
+ return true if self.equal?(o)
110
+ self.class == o.class &&
111
+ api_key == o.api_key &&
112
+ estimate_only == o.estimate_only &&
113
+ last_test_dts == o.last_test_dts &&
114
+ test_results == o.test_results
115
+ end
116
+
117
+ # @see the `==` method
118
+ # @param [Object] Object to be compared
119
+ def eql?(o)
120
+ self == o
121
+ end
122
+
123
+ # Calculates hash code according to all attributes.
124
+ # @return [Integer] Hash code
125
+ def hash
126
+ [api_key, estimate_only, last_test_dts, test_results].hash
127
+ end
128
+
129
+ # Builds the object from hash
130
+ # @param [Hash] attributes Model attributes in the form of hash
131
+ # @return [Object] Returns the model itself
132
+ def self.build_from_hash(attributes)
133
+ new.build_from_hash(attributes)
134
+ end
135
+
136
+ # Builds the object from hash
137
+ # @param [Hash] attributes Model attributes in the form of hash
138
+ # @return [Object] Returns the model itself
139
+ def build_from_hash(attributes)
140
+ return nil unless attributes.is_a?(Hash)
141
+ attributes = attributes.transform_keys(&:to_sym)
142
+ self.class.openapi_types.each_pair do |key, type|
143
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
144
+ self.send("#{key}=", nil)
145
+ elsif type =~ /\AArray<(.*)>/i
146
+ # check to ensure the input is an array given that the attribute
147
+ # is documented as an array but the input is not
148
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
149
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
150
+ end
151
+ elsif !attributes[self.class.attribute_map[key]].nil?
152
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
153
+ end
154
+ end
155
+
156
+ self
157
+ end
158
+
159
+ # Deserializes the data based on type
160
+ # @param string type Data type
161
+ # @param string value Value to be deserialized
162
+ # @return [Object] Deserialized data
163
+ def _deserialize(type, value)
164
+ case type.to_sym
165
+ when :Time
166
+ Time.parse(value)
167
+ when :Date
168
+ Date.parse(value)
169
+ when :String
170
+ value.to_s
171
+ when :Integer
172
+ value.to_i
173
+ when :Float
174
+ value.to_f
175
+ when :Boolean
176
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
177
+ true
178
+ else
179
+ false
180
+ end
181
+ when :Object
182
+ # generic object (usually a Hash), return directly
183
+ value
184
+ when /\AArray<(?<inner_type>.+)>\z/
185
+ inner_type = Regexp.last_match[:inner_type]
186
+ value.map { |v| _deserialize(inner_type, v) }
187
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
188
+ k_type = Regexp.last_match[:k_type]
189
+ v_type = Regexp.last_match[:v_type]
190
+ {}.tap do |hash|
191
+ value.each do |k, v|
192
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
193
+ end
194
+ end
195
+ else # model
196
+ # models (e.g. Pet) or oneOf
197
+ klass = UltracartClient.const_get(type)
198
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
199
+ end
200
+ end
201
+
202
+ # Returns the string representation of the object
203
+ # @return [String] String presentation of the object
204
+ def to_s
205
+ to_hash.to_s
206
+ end
207
+
208
+ # to_body is an alias to to_hash (backward compatibility)
209
+ # @return [Hash] Returns the object in the form of hash
210
+ def to_body
211
+ to_hash
212
+ end
213
+
214
+ # Returns the object in the form of hash
215
+ # @return [Hash] Returns the object in the form of hash
216
+ def to_hash
217
+ hash = {}
218
+ self.class.attribute_map.each_pair do |attr, param|
219
+ value = self.send(attr)
220
+ if value.nil?
221
+ is_nullable = self.class.openapi_nullable.include?(attr)
222
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
223
+ end
224
+
225
+ hash[param] = _to_hash(value)
226
+ end
227
+ hash
228
+ end
229
+
230
+ # Outputs non-array value in the form of hash
231
+ # For object, use to_hash. Otherwise, just return the value
232
+ # @param [Object] value Any valid value
233
+ # @return [Hash] Returns the value in the form of hash
234
+ def _to_hash(value)
235
+ if value.is_a?(Array)
236
+ value.compact.map { |v| _to_hash(v) }
237
+ elsif value.is_a?(Hash)
238
+ {}.tap do |hash|
239
+ value.each { |k, v| hash[k] = _to_hash(v) }
240
+ end
241
+ elsif value.respond_to? :to_hash
242
+ value.to_hash
243
+ else
244
+ value
245
+ end
246
+ end
247
+
248
+ end
249
+
250
+ end