ultracart_api 4.0.122.rc → 4.0.123.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/docs/OrderApi.md +72 -0
- data/docs/OrderInvoiceResponse.md +26 -0
- data/lib/ultracart_api/api/order_api.rb +64 -0
- data/lib/ultracart_api/models/order_invoice_response.rb +257 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a0cf7273bf5b90c4e089800e48cdd968b3f7acbdbb63bb99fc73a359b541479
|
4
|
+
data.tar.gz: 12cb66042827943dedbad3f90429c4212e8a0e84e325cb3591fd407749e99bbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b555fb6ddb95b6a3bdd9ee2a198c639c51cbd85c592cf8c1f9b9331a166b38e0d357994e2760d2f2646ed08c9a4deadbcbfef0c3d482a9789c090112bf742a1
|
7
|
+
data.tar.gz: 5b141644046019938468a9eb05292b96fc89fc19b5abb1416c97058f07c459cc7129ba786e12032495e42513e4af224a293063e13c241eddb30694b242e8d3ae
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
|
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 4.0.
|
10
|
+
- Package version: 4.0.123.rc
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
|
13
13
|
|
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./ultracart_api-4.0.
|
27
|
+
gem install ./ultracart_api-4.0.123.rc.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.0.
|
30
|
+
(for development, run `gem install --dev ./ultracart_api-4.0.123.rc.gem` to install the development dependencies)
|
31
31
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
33
|
|
34
34
|
Finally add this to the Gemfile:
|
35
35
|
|
36
|
-
gem 'ultracart_api', '~> 4.0.
|
36
|
+
gem 'ultracart_api', '~> 4.0.123.rc'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -248,6 +248,7 @@ Class | Method | HTTP request | Description
|
|
248
248
|
*UltracartClient::OrderApi* | [**delete_order**](docs/OrderApi.md#delete_order) | **DELETE** /order/orders/{order_id} | Delete an order
|
249
249
|
*UltracartClient::OrderApi* | [**duplicate_order**](docs/OrderApi.md#duplicate_order) | **POST** /order/orders/{order_id}/duplicate | Duplicate an order
|
250
250
|
*UltracartClient::OrderApi* | [**format**](docs/OrderApi.md#format) | **POST** /order/orders/{order_id}/format | Format order
|
251
|
+
*UltracartClient::OrderApi* | [**generate_invoice**](docs/OrderApi.md#generate_invoice) | **GET** /order/orders/{order_id}/invoice | Generate an invoice for this order.
|
251
252
|
*UltracartClient::OrderApi* | [**generate_order_token**](docs/OrderApi.md#generate_order_token) | **GET** /order/orders/token/{order_id} | Generate an order token for a given order id
|
252
253
|
*UltracartClient::OrderApi* | [**generate_packing_slip_all_dc**](docs/OrderApi.md#generate_packing_slip_all_dc) | **GET** /order/orders/{order_id}/packing_slip | Generate a packing slip for this order across all distribution centers.
|
253
254
|
*UltracartClient::OrderApi* | [**generate_packing_slip_specific_dc**](docs/OrderApi.md#generate_packing_slip_specific_dc) | **GET** /order/orders/{order_id}/packing_slip/{distribution_center_code} | Generate a packing slip for this order for the given distribution center.
|
@@ -1054,6 +1055,7 @@ Class | Method | HTTP request | Description
|
|
1054
1055
|
- [UltracartClient::OrderGift](docs/OrderGift.md)
|
1055
1056
|
- [UltracartClient::OrderGiftCertificate](docs/OrderGiftCertificate.md)
|
1056
1057
|
- [UltracartClient::OrderInternal](docs/OrderInternal.md)
|
1058
|
+
- [UltracartClient::OrderInvoiceResponse](docs/OrderInvoiceResponse.md)
|
1057
1059
|
- [UltracartClient::OrderItem](docs/OrderItem.md)
|
1058
1060
|
- [UltracartClient::OrderItemEdi](docs/OrderItemEdi.md)
|
1059
1061
|
- [UltracartClient::OrderItemEdiIdentification](docs/OrderItemEdiIdentification.md)
|
@@ -1298,6 +1300,7 @@ Not every change is committed to every SDK.
|
|
1298
1300
|
|
1299
1301
|
| Version | Date | Comments |
|
1300
1302
|
| --: | :-: | --- |
|
1303
|
+
| 4.0.123-RC | 01/25/2023 | order api method generateInvoice |
|
1301
1304
|
| 4.0.122-RC | 01/24/2023 | auto order - cancel minimum and change balance options |
|
1302
1305
|
| 4.0.121-RC | 01/23/2023 | conversation - method to fetch single engagement record |
|
1303
1306
|
| 4.0.120-RC | 01/19/2023 | added skip_on_rebill field to coupon object |
|
data/docs/OrderApi.md
CHANGED
@@ -9,6 +9,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
|
9
9
|
| [**delete_order**](OrderApi.md#delete_order) | **DELETE** /order/orders/{order_id} | Delete an order |
|
10
10
|
| [**duplicate_order**](OrderApi.md#duplicate_order) | **POST** /order/orders/{order_id}/duplicate | Duplicate an order |
|
11
11
|
| [**format**](OrderApi.md#format) | **POST** /order/orders/{order_id}/format | Format order |
|
12
|
+
| [**generate_invoice**](OrderApi.md#generate_invoice) | **GET** /order/orders/{order_id}/invoice | Generate an invoice for this order. |
|
12
13
|
| [**generate_order_token**](OrderApi.md#generate_order_token) | **GET** /order/orders/token/{order_id} | Generate an order token for a given order id |
|
13
14
|
| [**generate_packing_slip_all_dc**](OrderApi.md#generate_packing_slip_all_dc) | **GET** /order/orders/{order_id}/packing_slip | Generate a packing slip for this order across all distribution centers. |
|
14
15
|
| [**generate_packing_slip_specific_dc**](OrderApi.md#generate_packing_slip_specific_dc) | **GET** /order/orders/{order_id}/packing_slip/{distribution_center_code} | Generate a packing slip for this order for the given distribution center. |
|
@@ -392,6 +393,77 @@ end
|
|
392
393
|
- **Accept**: application/json
|
393
394
|
|
394
395
|
|
396
|
+
## generate_invoice
|
397
|
+
|
398
|
+
> <OrderInvoiceResponse> generate_invoice(order_id)
|
399
|
+
|
400
|
+
Generate an invoice for this order.
|
401
|
+
|
402
|
+
The invoice PDF that is returned is base 64 encoded
|
403
|
+
|
404
|
+
### Examples
|
405
|
+
|
406
|
+
```ruby
|
407
|
+
require 'time'
|
408
|
+
require 'ultracart_api'
|
409
|
+
require 'json'
|
410
|
+
require 'yaml'
|
411
|
+
require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
|
412
|
+
|
413
|
+
# This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
|
414
|
+
# As such, this might not be the best way to use this object.
|
415
|
+
# Please see https://github.com/UltraCart/sdk_samples for working examples.
|
416
|
+
|
417
|
+
api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
418
|
+
order_id = 'order_id_example' # String | Order ID
|
419
|
+
|
420
|
+
begin
|
421
|
+
# Generate an invoice for this order.
|
422
|
+
result = api_instance.generate_invoice(order_id)
|
423
|
+
p result
|
424
|
+
rescue UltracartClient::ApiError => e
|
425
|
+
puts "Error when calling OrderApi->generate_invoice: #{e}"
|
426
|
+
end
|
427
|
+
```
|
428
|
+
|
429
|
+
#### Using the generate_invoice_with_http_info variant
|
430
|
+
|
431
|
+
This returns an Array which contains the response data, status code and headers.
|
432
|
+
|
433
|
+
> <Array(<OrderInvoiceResponse>, Integer, Hash)> generate_invoice_with_http_info(order_id)
|
434
|
+
|
435
|
+
```ruby
|
436
|
+
begin
|
437
|
+
# Generate an invoice for this order.
|
438
|
+
data, status_code, headers = api_instance.generate_invoice_with_http_info(order_id)
|
439
|
+
p status_code # => 2xx
|
440
|
+
p headers # => { ... }
|
441
|
+
p data # => <OrderInvoiceResponse>
|
442
|
+
rescue UltracartClient::ApiError => e
|
443
|
+
puts "Error when calling OrderApi->generate_invoice_with_http_info: #{e}"
|
444
|
+
end
|
445
|
+
```
|
446
|
+
|
447
|
+
### Parameters
|
448
|
+
|
449
|
+
| Name | Type | Description | Notes |
|
450
|
+
| ---- | ---- | ----------- | ----- |
|
451
|
+
| **order_id** | **String** | Order ID | |
|
452
|
+
|
453
|
+
### Return type
|
454
|
+
|
455
|
+
[**OrderInvoiceResponse**](OrderInvoiceResponse.md)
|
456
|
+
|
457
|
+
### Authorization
|
458
|
+
|
459
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
460
|
+
|
461
|
+
### HTTP request headers
|
462
|
+
|
463
|
+
- **Content-Type**: Not defined
|
464
|
+
- **Accept**: application/json
|
465
|
+
|
466
|
+
|
395
467
|
## generate_order_token
|
396
468
|
|
397
469
|
> <OrderTokenResponse> generate_order_token(order_id)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# UltracartClient::OrderInvoiceResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **error** | [**Error**](Error.md) | | [optional] |
|
8
|
+
| **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
|
9
|
+
| **pdf_base64** | **String** | pdf_base64 | [optional] |
|
10
|
+
| **success** | **Boolean** | Indicates if API call was successful | [optional] |
|
11
|
+
| **warning** | [**Warning**](Warning.md) | | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'ultracart_api'
|
17
|
+
|
18
|
+
instance = UltracartClient::OrderInvoiceResponse.new(
|
19
|
+
error: null,
|
20
|
+
metadata: null,
|
21
|
+
pdf_base64: null,
|
22
|
+
success: null,
|
23
|
+
warning: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
@@ -372,6 +372,70 @@ module UltracartClient
|
|
372
372
|
return data, status_code, headers
|
373
373
|
end
|
374
374
|
|
375
|
+
# Generate an invoice for this order.
|
376
|
+
# The invoice PDF that is returned is base 64 encoded
|
377
|
+
# @param order_id [String] Order ID
|
378
|
+
# @param [Hash] opts the optional parameters
|
379
|
+
# @return [OrderInvoiceResponse]
|
380
|
+
def generate_invoice(order_id, opts = {})
|
381
|
+
data, _status_code, _headers = generate_invoice_with_http_info(order_id, opts)
|
382
|
+
data
|
383
|
+
end
|
384
|
+
|
385
|
+
# Generate an invoice for this order.
|
386
|
+
# The invoice PDF that is returned is base 64 encoded
|
387
|
+
# @param order_id [String] Order ID
|
388
|
+
# @param [Hash] opts the optional parameters
|
389
|
+
# @return [Array<(OrderInvoiceResponse, Integer, Hash)>] OrderInvoiceResponse data, response status code and response headers
|
390
|
+
def generate_invoice_with_http_info(order_id, opts = {})
|
391
|
+
if @api_client.config.debugging
|
392
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.generate_invoice ...'
|
393
|
+
end
|
394
|
+
# verify the required parameter 'order_id' is set
|
395
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
396
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.generate_invoice"
|
397
|
+
end
|
398
|
+
# resource path
|
399
|
+
local_var_path = '/order/orders/{order_id}/invoice'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
400
|
+
|
401
|
+
# query parameters
|
402
|
+
query_params = opts[:query_params] || {}
|
403
|
+
|
404
|
+
# header parameters
|
405
|
+
header_params = opts[:header_params] || {}
|
406
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
407
|
+
# HTTP header 'Accept' (if needed)
|
408
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
409
|
+
|
410
|
+
# form parameters
|
411
|
+
form_params = opts[:form_params] || {}
|
412
|
+
|
413
|
+
# http body (model)
|
414
|
+
post_body = opts[:debug_body]
|
415
|
+
|
416
|
+
# return_type
|
417
|
+
return_type = opts[:debug_return_type] || 'OrderInvoiceResponse'
|
418
|
+
|
419
|
+
# auth_names
|
420
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
421
|
+
|
422
|
+
new_options = opts.merge(
|
423
|
+
:operation => :"OrderApi.generate_invoice",
|
424
|
+
:header_params => header_params,
|
425
|
+
:query_params => query_params,
|
426
|
+
:form_params => form_params,
|
427
|
+
:body => post_body,
|
428
|
+
:auth_names => auth_names,
|
429
|
+
:return_type => return_type
|
430
|
+
)
|
431
|
+
|
432
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug "API called: OrderApi#generate_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
435
|
+
end
|
436
|
+
return data, status_code, headers
|
437
|
+
end
|
438
|
+
|
375
439
|
# Generate an order token for a given order id
|
376
440
|
# Retrieves a single order token for a given order id. The token can be used with the getOrderByToken API.
|
377
441
|
# @param order_id [String] The order id to generate a token for.
|
@@ -0,0 +1,257 @@
|
|
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 OrderInvoiceResponse
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
attr_accessor :metadata
|
21
|
+
|
22
|
+
# pdf_base64
|
23
|
+
attr_accessor :pdf_base64
|
24
|
+
|
25
|
+
# Indicates if API call was successful
|
26
|
+
attr_accessor :success
|
27
|
+
|
28
|
+
attr_accessor :warning
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'error' => :'error',
|
34
|
+
:'metadata' => :'metadata',
|
35
|
+
:'pdf_base64' => :'pdfBase64',
|
36
|
+
:'success' => :'success',
|
37
|
+
:'warning' => :'warning'
|
38
|
+
}
|
39
|
+
end
|
40
|
+
|
41
|
+
# Returns all the JSON keys this model knows about
|
42
|
+
def self.acceptable_attributes
|
43
|
+
attribute_map.values
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.openapi_types
|
48
|
+
{
|
49
|
+
:'error' => :'Error',
|
50
|
+
:'metadata' => :'ResponseMetadata',
|
51
|
+
:'pdf_base64' => :'String',
|
52
|
+
:'success' => :'Boolean',
|
53
|
+
:'warning' => :'Warning'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# List of attributes with nullable: true
|
58
|
+
def self.openapi_nullable
|
59
|
+
Set.new([
|
60
|
+
])
|
61
|
+
end
|
62
|
+
|
63
|
+
# Initializes the object
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
65
|
+
def initialize(attributes = {})
|
66
|
+
if (!attributes.is_a?(Hash))
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderInvoiceResponse` initialize method"
|
68
|
+
end
|
69
|
+
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
72
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderInvoiceResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
74
|
+
end
|
75
|
+
h[k.to_sym] = v
|
76
|
+
}
|
77
|
+
|
78
|
+
if attributes.key?(:'error')
|
79
|
+
self.error = attributes[:'error']
|
80
|
+
end
|
81
|
+
|
82
|
+
if attributes.key?(:'metadata')
|
83
|
+
self.metadata = attributes[:'metadata']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.key?(:'pdf_base64')
|
87
|
+
self.pdf_base64 = attributes[:'pdf_base64']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'success')
|
91
|
+
self.success = attributes[:'success']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.key?(:'warning')
|
95
|
+
self.warning = attributes[:'warning']
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
100
|
+
# @return Array for valid properties with the reasons
|
101
|
+
def list_invalid_properties
|
102
|
+
invalid_properties = Array.new
|
103
|
+
invalid_properties
|
104
|
+
end
|
105
|
+
|
106
|
+
# Check to see if the all the properties in the model are valid
|
107
|
+
# @return true if the model is valid
|
108
|
+
def valid?
|
109
|
+
true
|
110
|
+
end
|
111
|
+
|
112
|
+
# Checks equality by comparing each attribute.
|
113
|
+
# @param [Object] Object to be compared
|
114
|
+
def ==(o)
|
115
|
+
return true if self.equal?(o)
|
116
|
+
self.class == o.class &&
|
117
|
+
error == o.error &&
|
118
|
+
metadata == o.metadata &&
|
119
|
+
pdf_base64 == o.pdf_base64 &&
|
120
|
+
success == o.success &&
|
121
|
+
warning == o.warning
|
122
|
+
end
|
123
|
+
|
124
|
+
# @see the `==` method
|
125
|
+
# @param [Object] Object to be compared
|
126
|
+
def eql?(o)
|
127
|
+
self == o
|
128
|
+
end
|
129
|
+
|
130
|
+
# Calculates hash code according to all attributes.
|
131
|
+
# @return [Integer] Hash code
|
132
|
+
def hash
|
133
|
+
[error, metadata, pdf_base64, success, warning].hash
|
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 self.build_from_hash(attributes)
|
140
|
+
new.build_from_hash(attributes)
|
141
|
+
end
|
142
|
+
|
143
|
+
# Builds the object from hash
|
144
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
145
|
+
# @return [Object] Returns the model itself
|
146
|
+
def build_from_hash(attributes)
|
147
|
+
return nil unless attributes.is_a?(Hash)
|
148
|
+
attributes = attributes.transform_keys(&:to_sym)
|
149
|
+
self.class.openapi_types.each_pair do |key, type|
|
150
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
151
|
+
self.send("#{key}=", nil)
|
152
|
+
elsif type =~ /\AArray<(.*)>/i
|
153
|
+
# check to ensure the input is an array given that the attribute
|
154
|
+
# is documented as an array but the input is not
|
155
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
156
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
157
|
+
end
|
158
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
159
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
self
|
164
|
+
end
|
165
|
+
|
166
|
+
# Deserializes the data based on type
|
167
|
+
# @param string type Data type
|
168
|
+
# @param string value Value to be deserialized
|
169
|
+
# @return [Object] Deserialized data
|
170
|
+
def _deserialize(type, value)
|
171
|
+
case type.to_sym
|
172
|
+
when :Time
|
173
|
+
Time.parse(value)
|
174
|
+
when :Date
|
175
|
+
Date.parse(value)
|
176
|
+
when :String
|
177
|
+
value.to_s
|
178
|
+
when :Integer
|
179
|
+
value.to_i
|
180
|
+
when :Float
|
181
|
+
value.to_f
|
182
|
+
when :Boolean
|
183
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
184
|
+
true
|
185
|
+
else
|
186
|
+
false
|
187
|
+
end
|
188
|
+
when :Object
|
189
|
+
# generic object (usually a Hash), return directly
|
190
|
+
value
|
191
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
192
|
+
inner_type = Regexp.last_match[:inner_type]
|
193
|
+
value.map { |v| _deserialize(inner_type, v) }
|
194
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
195
|
+
k_type = Regexp.last_match[:k_type]
|
196
|
+
v_type = Regexp.last_match[:v_type]
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each do |k, v|
|
199
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
200
|
+
end
|
201
|
+
end
|
202
|
+
else # model
|
203
|
+
# models (e.g. Pet) or oneOf
|
204
|
+
klass = UltracartClient.const_get(type)
|
205
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
# Returns the string representation of the object
|
210
|
+
# @return [String] String presentation of the object
|
211
|
+
def to_s
|
212
|
+
to_hash.to_s
|
213
|
+
end
|
214
|
+
|
215
|
+
# to_body is an alias to to_hash (backward compatibility)
|
216
|
+
# @return [Hash] Returns the object in the form of hash
|
217
|
+
def to_body
|
218
|
+
to_hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Returns the object in the form of hash
|
222
|
+
# @return [Hash] Returns the object in the form of hash
|
223
|
+
def to_hash
|
224
|
+
hash = {}
|
225
|
+
self.class.attribute_map.each_pair do |attr, param|
|
226
|
+
value = self.send(attr)
|
227
|
+
if value.nil?
|
228
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
229
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
230
|
+
end
|
231
|
+
|
232
|
+
hash[param] = _to_hash(value)
|
233
|
+
end
|
234
|
+
hash
|
235
|
+
end
|
236
|
+
|
237
|
+
# Outputs non-array value in the form of hash
|
238
|
+
# For object, use to_hash. Otherwise, just return the value
|
239
|
+
# @param [Object] value Any valid value
|
240
|
+
# @return [Hash] Returns the value in the form of hash
|
241
|
+
def _to_hash(value)
|
242
|
+
if value.is_a?(Array)
|
243
|
+
value.compact.map { |v| _to_hash(v) }
|
244
|
+
elsif value.is_a?(Hash)
|
245
|
+
{}.tap do |hash|
|
246
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
247
|
+
end
|
248
|
+
elsif value.respond_to? :to_hash
|
249
|
+
value.to_hash
|
250
|
+
else
|
251
|
+
value
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
256
|
+
|
257
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -577,6 +577,7 @@ require 'ultracart_api/models/order_fraud_score'
|
|
577
577
|
require 'ultracart_api/models/order_gift'
|
578
578
|
require 'ultracart_api/models/order_gift_certificate'
|
579
579
|
require 'ultracart_api/models/order_internal'
|
580
|
+
require 'ultracart_api/models/order_invoice_response'
|
580
581
|
require 'ultracart_api/models/order_item'
|
581
582
|
require 'ultracart_api/models/order_item_edi'
|
582
583
|
require 'ultracart_api/models/order_item_edi_identification'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultracart_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.123.rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -635,6 +635,7 @@ files:
|
|
635
635
|
- docs/OrderGift.md
|
636
636
|
- docs/OrderGiftCertificate.md
|
637
637
|
- docs/OrderInternal.md
|
638
|
+
- docs/OrderInvoiceResponse.md
|
638
639
|
- docs/OrderItem.md
|
639
640
|
- docs/OrderItemEdi.md
|
640
641
|
- docs/OrderItemEdiIdentification.md
|
@@ -1395,6 +1396,7 @@ files:
|
|
1395
1396
|
- lib/ultracart_api/models/order_gift.rb
|
1396
1397
|
- lib/ultracart_api/models/order_gift_certificate.rb
|
1397
1398
|
- lib/ultracart_api/models/order_internal.rb
|
1399
|
+
- lib/ultracart_api/models/order_invoice_response.rb
|
1398
1400
|
- lib/ultracart_api/models/order_item.rb
|
1399
1401
|
- lib/ultracart_api/models/order_item_edi.rb
|
1400
1402
|
- lib/ultracart_api/models/order_item_edi_identification.rb
|