ultracart_api 3.10.152 → 3.10.154
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -4
- data/docs/EmailSettings.md +4 -0
- data/docs/OrderApi.md +51 -0
- data/docs/OrderValidationRequest.md +9 -0
- data/docs/OrderValidationResponse.md +10 -0
- data/lib/ultracart_api/api/order_api.rb +55 -0
- data/lib/ultracart_api/models/email_settings.rb +41 -1
- data/lib/ultracart_api/models/order_validation_request.rb +196 -0
- data/lib/ultracart_api/models/order_validation_response.rb +209 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1a56abe6fda00ce5357098faa5696c58084af2d2072cb7b08dde77147f038ff
|
4
|
+
data.tar.gz: ea1592a7ce66666cf7f9976e6e49f29b18230f34d9fd1f83e2131a9d68acc984
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb158b4c64ab215f81481afafaeba292b027907ea13d94ea9b0e6dde4b398d9d8f8669476cdecfece79bd0de7b8bd4a7c11f437bfc50f0588b2f35d5caf3554c
|
7
|
+
data.tar.gz: ef227d180a367e6e11a850093af59585518eb9f4a85d1816adebe9f270cdce24719e229c4ffa79c11bd8261039e069b300ab20eab972de9c0b5db785fdb1aa2e
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
|
|
7
7
|
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 3.10.
|
10
|
+
- Package version: 3.10.154
|
11
11
|
- Build package: io.swagger.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
|
13
13
|
|
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./ultracart_api-3.10.
|
27
|
+
gem install ./ultracart_api-3.10.154.gem
|
28
28
|
```
|
29
|
-
(for development, run `gem install --dev ./ultracart_api-3.10.
|
29
|
+
(for development, run `gem install --dev ./ultracart_api-3.10.154.gem` to install the development dependencies)
|
30
30
|
|
31
31
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
32
32
|
|
33
33
|
Finally add this to the Gemfile:
|
34
34
|
|
35
|
-
gem 'ultracart_api', '~> 3.10.
|
35
|
+
gem 'ultracart_api', '~> 3.10.154'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -283,6 +283,7 @@ Class | Method | HTTP request | Description
|
|
283
283
|
*UltracartClient::OrderApi* | [**resend_shipment_confirmation**](docs/OrderApi.md#resend_shipment_confirmation) | **POST** /order/orders/{order_id}/resend_shipment_confirmation | Resend shipment confirmation
|
284
284
|
*UltracartClient::OrderApi* | [**update_accounts_receivable_retry_config**](docs/OrderApi.md#update_accounts_receivable_retry_config) | **POST** /order/accountsReceivableRetryConfig | Update A/R Retry Configuration
|
285
285
|
*UltracartClient::OrderApi* | [**update_order**](docs/OrderApi.md#update_order) | **PUT** /order/orders/{order_id} | Update an order
|
286
|
+
*UltracartClient::OrderApi* | [**validate_order**](docs/OrderApi.md#validate_order) | **POST** /order/validate | Validate
|
286
287
|
*UltracartClient::SsoApi* | [**get_sso_session_user**](docs/SsoApi.md#get_sso_session_user) | **GET** /sso/session/user | Get single sign on session user
|
287
288
|
*UltracartClient::SsoApi* | [**sso_authorize**](docs/SsoApi.md#sso_authorize) | **PUT** /sso/authorize | Authorize a single sign on session
|
288
289
|
*UltracartClient::SsoApi* | [**sso_session_revoke**](docs/SsoApi.md#sso_session_revoke) | **DELETE** /sso/session/revoke | Revoke single sign on session
|
@@ -1129,6 +1130,8 @@ Class | Method | HTTP request | Description
|
|
1129
1130
|
- [UltracartClient::OrderTrackingNumberDetails](docs/OrderTrackingNumberDetails.md)
|
1130
1131
|
- [UltracartClient::OrderTransactionalMerchantNote](docs/OrderTransactionalMerchantNote.md)
|
1131
1132
|
- [UltracartClient::OrderUtm](docs/OrderUtm.md)
|
1133
|
+
- [UltracartClient::OrderValidationRequest](docs/OrderValidationRequest.md)
|
1134
|
+
- [UltracartClient::OrderValidationResponse](docs/OrderValidationResponse.md)
|
1132
1135
|
- [UltracartClient::OrdersResponse](docs/OrdersResponse.md)
|
1133
1136
|
- [UltracartClient::Permission](docs/Permission.md)
|
1134
1137
|
- [UltracartClient::PointOfSaleLocation](docs/PointOfSaleLocation.md)
|
@@ -1357,6 +1360,8 @@ Not every change is committed to every SDK.
|
|
1357
1360
|
|
1358
1361
|
| Version | Date | Comments |
|
1359
1362
|
| --: | :-: | --- |
|
1363
|
+
| 3.10.154 | 08/14/2023 | esp - add require_order_within_last to the settings object |
|
1364
|
+
| 3.10.153 | 08/14/2023 | esp - expose rate limiter values in settings object |
|
1360
1365
|
| 3.10.152 | 07/27/2023 | dw bi - add settings to the report and page objects |
|
1361
1366
|
| 3.10.151 | 07/19/2023 | dw bi - add data_source_uuid to filter connection obj |
|
1362
1367
|
| 3.10.150 | 07/19/2023 | dw bi - add data_source_uuid to page visualization obj |
|
data/docs/EmailSettings.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
+
**emails_per_day** | **Integer** | Emails per day allowed | [optional]
|
7
|
+
**emails_per_hour** | **Integer** | Emails per hour allowed | [optional]
|
8
|
+
**emails_per_month** | **Integer** | Emails per month allowed | [optional]
|
6
9
|
**marketing_esp_domain_user** | **String** | | [optional]
|
7
10
|
**marketing_esp_domain_uuid** | **String** | | [optional]
|
8
11
|
**marketing_esp_friendly_name** | **String** | | [optional]
|
@@ -12,6 +15,7 @@ Name | Type | Description | Notes
|
|
12
15
|
**postcard_from_name** | **String** | | [optional]
|
13
16
|
**postcard_from_postal_code** | **String** | | [optional]
|
14
17
|
**postcard_from_state** | **String** | | [optional]
|
18
|
+
**require_order_within_last** | **Integer** | Require order within last | [optional]
|
15
19
|
**reviews_io_configured** | **BOOLEAN** | True if the Reviews.io integration is configured | [optional]
|
16
20
|
**sms_esp_twilio_uuid** | **String** | | [optional]
|
17
21
|
**sms_phone_number** | **String** | | [optional]
|
data/docs/OrderApi.md
CHANGED
@@ -30,6 +30,7 @@ Method | HTTP request | Description
|
|
30
30
|
[**resend_shipment_confirmation**](OrderApi.md#resend_shipment_confirmation) | **POST** /order/orders/{order_id}/resend_shipment_confirmation | Resend shipment confirmation
|
31
31
|
[**update_accounts_receivable_retry_config**](OrderApi.md#update_accounts_receivable_retry_config) | **POST** /order/accountsReceivableRetryConfig | Update A/R Retry Configuration
|
32
32
|
[**update_order**](OrderApi.md#update_order) | **PUT** /order/orders/{order_id} | Update an order
|
33
|
+
[**validate_order**](OrderApi.md#validate_order) | **POST** /order/validate | Validate
|
33
34
|
|
34
35
|
|
35
36
|
# **adjust_order_total**
|
@@ -1467,3 +1468,53 @@ Name | Type | Description | Notes
|
|
1467
1468
|
|
1468
1469
|
|
1469
1470
|
|
1471
|
+
# **validate_order**
|
1472
|
+
> OrderValidationResponse validate_order(validation_request)
|
1473
|
+
|
1474
|
+
Validate
|
1475
|
+
|
1476
|
+
Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
1477
|
+
|
1478
|
+
### Example
|
1479
|
+
```ruby
|
1480
|
+
# load the gem
|
1481
|
+
require 'ultracart_api'
|
1482
|
+
|
1483
|
+
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
|
1484
|
+
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
|
1485
|
+
api_instance = UltracartClient::OrderApi.new_using_api_key(simple_key, false, false)
|
1486
|
+
|
1487
|
+
|
1488
|
+
validation_request = UltracartClient::OrderValidationRequest.new # OrderValidationRequest | Validation request
|
1489
|
+
|
1490
|
+
|
1491
|
+
begin
|
1492
|
+
#Validate
|
1493
|
+
result = api_instance.validate_order(validation_request)
|
1494
|
+
p result
|
1495
|
+
rescue UltracartClient::ApiError => e
|
1496
|
+
puts "Exception when calling OrderApi->validate_order: #{e}"
|
1497
|
+
end
|
1498
|
+
```
|
1499
|
+
|
1500
|
+
### Parameters
|
1501
|
+
|
1502
|
+
Name | Type | Description | Notes
|
1503
|
+
------------- | ------------- | ------------- | -------------
|
1504
|
+
**validation_request** | [**OrderValidationRequest**](OrderValidationRequest.md)| Validation request |
|
1505
|
+
|
1506
|
+
### Return type
|
1507
|
+
|
1508
|
+
[**OrderValidationResponse**](OrderValidationResponse.md)
|
1509
|
+
|
1510
|
+
### Authorization
|
1511
|
+
|
1512
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
1513
|
+
|
1514
|
+
### HTTP request headers
|
1515
|
+
|
1516
|
+
- **Content-Type**: application/json
|
1517
|
+
- **Accept**: application/json
|
1518
|
+
|
1519
|
+
|
1520
|
+
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# UltracartClient::OrderValidationRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**checks** | **Array<String>** | Checks to perform | [optional]
|
7
|
+
**order** | [**Order**](Order.md) | | [optional]
|
8
|
+
|
9
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# UltracartClient::OrderValidationResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**errors** | **Array<String>** | Errors to display to the merchant if they failed any of the validations checked | [optional]
|
7
|
+
**messages** | **Array<String>** | Informational messages | [optional]
|
8
|
+
**order_was_updated** | **BOOLEAN** | If true, this order was updated during the validation call. This may happen during address standardization fixes. | [optional]
|
9
|
+
|
10
|
+
|
@@ -1641,5 +1641,60 @@ module UltracartClient
|
|
1641
1641
|
end
|
1642
1642
|
return data, status_code, headers
|
1643
1643
|
end
|
1644
|
+
# Validate
|
1645
|
+
# Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
1646
|
+
# @param validation_request Validation request
|
1647
|
+
# @param [Hash] opts the optional parameters
|
1648
|
+
# @return [OrderValidationResponse]
|
1649
|
+
def validate_order(validation_request, opts = {})
|
1650
|
+
data, _status_code, _headers = validate_order_with_http_info(validation_request, opts)
|
1651
|
+
data
|
1652
|
+
end
|
1653
|
+
|
1654
|
+
# Validate
|
1655
|
+
# Validate the order for errors. Specific checks can be passed to fine tune what is validated. Read and write permissions are required because the validate method may fix obvious address issues automatically which require update permission.This rest call makes use of the built-in translation of rest objects to UltraCart internal objects which also contains a multitude of validation checks that cannot be trapped. Therefore any time this call is made, you should also trap api exceptions and examine their content because it may contain validation issues. So check the response object and trap any exceptions.
|
1656
|
+
# @param validation_request Validation request
|
1657
|
+
# @param [Hash] opts the optional parameters
|
1658
|
+
# @return [Array<(OrderValidationResponse, Fixnum, Hash)>] OrderValidationResponse data, response status code and response headers
|
1659
|
+
def validate_order_with_http_info(validation_request, opts = {})
|
1660
|
+
if @api_client.config.debugging
|
1661
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.validate_order ...'
|
1662
|
+
end
|
1663
|
+
# verify the required parameter 'validation_request' is set
|
1664
|
+
if @api_client.config.client_side_validation && validation_request.nil?
|
1665
|
+
fail ArgumentError, "Missing the required parameter 'validation_request' when calling OrderApi.validate_order"
|
1666
|
+
end
|
1667
|
+
# resource path
|
1668
|
+
local_var_path = '/order/validate'
|
1669
|
+
|
1670
|
+
# query parameters
|
1671
|
+
query_params = {}
|
1672
|
+
|
1673
|
+
# header parameters
|
1674
|
+
header_params = {}
|
1675
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
1676
|
+
# HTTP header 'Accept' (if needed)
|
1677
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1678
|
+
# HTTP header 'Content-Type'
|
1679
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1680
|
+
|
1681
|
+
# form parameters
|
1682
|
+
form_params = {}
|
1683
|
+
|
1684
|
+
# http body (model)
|
1685
|
+
post_body = @api_client.object_to_http_body(validation_request)
|
1686
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
1687
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1688
|
+
:header_params => header_params,
|
1689
|
+
:query_params => query_params,
|
1690
|
+
:form_params => form_params,
|
1691
|
+
:body => post_body,
|
1692
|
+
:auth_names => auth_names,
|
1693
|
+
:return_type => 'OrderValidationResponse')
|
1694
|
+
if @api_client.config.debugging
|
1695
|
+
@api_client.config.logger.debug "API called: OrderApi#validate_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1696
|
+
end
|
1697
|
+
return data, status_code, headers
|
1698
|
+
end
|
1644
1699
|
end
|
1645
1700
|
end
|
@@ -14,6 +14,15 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class EmailSettings
|
17
|
+
# Emails per day allowed
|
18
|
+
attr_accessor :emails_per_day
|
19
|
+
|
20
|
+
# Emails per hour allowed
|
21
|
+
attr_accessor :emails_per_hour
|
22
|
+
|
23
|
+
# Emails per month allowed
|
24
|
+
attr_accessor :emails_per_month
|
25
|
+
|
17
26
|
attr_accessor :marketing_esp_domain_user
|
18
27
|
|
19
28
|
attr_accessor :marketing_esp_domain_uuid
|
@@ -32,6 +41,9 @@ module UltracartClient
|
|
32
41
|
|
33
42
|
attr_accessor :postcard_from_state
|
34
43
|
|
44
|
+
# Require order within last
|
45
|
+
attr_accessor :require_order_within_last
|
46
|
+
|
35
47
|
# True if the Reviews.io integration is configured
|
36
48
|
attr_accessor :reviews_io_configured
|
37
49
|
|
@@ -48,6 +60,9 @@ module UltracartClient
|
|
48
60
|
# Attribute mapping from ruby-style variable name to JSON key.
|
49
61
|
def self.attribute_map
|
50
62
|
{
|
63
|
+
:'emails_per_day' => :'emails_per_day',
|
64
|
+
:'emails_per_hour' => :'emails_per_hour',
|
65
|
+
:'emails_per_month' => :'emails_per_month',
|
51
66
|
:'marketing_esp_domain_user' => :'marketing_esp_domain_user',
|
52
67
|
:'marketing_esp_domain_uuid' => :'marketing_esp_domain_uuid',
|
53
68
|
:'marketing_esp_friendly_name' => :'marketing_esp_friendly_name',
|
@@ -57,6 +72,7 @@ module UltracartClient
|
|
57
72
|
:'postcard_from_name' => :'postcard_from_name',
|
58
73
|
:'postcard_from_postal_code' => :'postcard_from_postal_code',
|
59
74
|
:'postcard_from_state' => :'postcard_from_state',
|
75
|
+
:'require_order_within_last' => :'require_order_within_last',
|
60
76
|
:'reviews_io_configured' => :'reviews_io_configured',
|
61
77
|
:'sms_esp_twilio_uuid' => :'sms_esp_twilio_uuid',
|
62
78
|
:'sms_phone_number' => :'sms_phone_number',
|
@@ -69,6 +85,9 @@ module UltracartClient
|
|
69
85
|
# Attribute type mapping.
|
70
86
|
def self.swagger_types
|
71
87
|
{
|
88
|
+
:'emails_per_day' => :'Integer',
|
89
|
+
:'emails_per_hour' => :'Integer',
|
90
|
+
:'emails_per_month' => :'Integer',
|
72
91
|
:'marketing_esp_domain_user' => :'String',
|
73
92
|
:'marketing_esp_domain_uuid' => :'String',
|
74
93
|
:'marketing_esp_friendly_name' => :'String',
|
@@ -78,6 +97,7 @@ module UltracartClient
|
|
78
97
|
:'postcard_from_name' => :'String',
|
79
98
|
:'postcard_from_postal_code' => :'String',
|
80
99
|
:'postcard_from_state' => :'String',
|
100
|
+
:'require_order_within_last' => :'Integer',
|
81
101
|
:'reviews_io_configured' => :'BOOLEAN',
|
82
102
|
:'sms_esp_twilio_uuid' => :'String',
|
83
103
|
:'sms_phone_number' => :'String',
|
@@ -95,6 +115,18 @@ module UltracartClient
|
|
95
115
|
# convert string to symbol for hash key
|
96
116
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
97
117
|
|
118
|
+
if attributes.has_key?(:'emails_per_day')
|
119
|
+
self.emails_per_day = attributes[:'emails_per_day']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.has_key?(:'emails_per_hour')
|
123
|
+
self.emails_per_hour = attributes[:'emails_per_hour']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.has_key?(:'emails_per_month')
|
127
|
+
self.emails_per_month = attributes[:'emails_per_month']
|
128
|
+
end
|
129
|
+
|
98
130
|
if attributes.has_key?(:'marketing_esp_domain_user')
|
99
131
|
self.marketing_esp_domain_user = attributes[:'marketing_esp_domain_user']
|
100
132
|
end
|
@@ -131,6 +163,10 @@ module UltracartClient
|
|
131
163
|
self.postcard_from_state = attributes[:'postcard_from_state']
|
132
164
|
end
|
133
165
|
|
166
|
+
if attributes.has_key?(:'require_order_within_last')
|
167
|
+
self.require_order_within_last = attributes[:'require_order_within_last']
|
168
|
+
end
|
169
|
+
|
134
170
|
if attributes.has_key?(:'reviews_io_configured')
|
135
171
|
self.reviews_io_configured = attributes[:'reviews_io_configured']
|
136
172
|
end
|
@@ -174,6 +210,9 @@ module UltracartClient
|
|
174
210
|
def ==(o)
|
175
211
|
return true if self.equal?(o)
|
176
212
|
self.class == o.class &&
|
213
|
+
emails_per_day == o.emails_per_day &&
|
214
|
+
emails_per_hour == o.emails_per_hour &&
|
215
|
+
emails_per_month == o.emails_per_month &&
|
177
216
|
marketing_esp_domain_user == o.marketing_esp_domain_user &&
|
178
217
|
marketing_esp_domain_uuid == o.marketing_esp_domain_uuid &&
|
179
218
|
marketing_esp_friendly_name == o.marketing_esp_friendly_name &&
|
@@ -183,6 +222,7 @@ module UltracartClient
|
|
183
222
|
postcard_from_name == o.postcard_from_name &&
|
184
223
|
postcard_from_postal_code == o.postcard_from_postal_code &&
|
185
224
|
postcard_from_state == o.postcard_from_state &&
|
225
|
+
require_order_within_last == o.require_order_within_last &&
|
186
226
|
reviews_io_configured == o.reviews_io_configured &&
|
187
227
|
sms_esp_twilio_uuid == o.sms_esp_twilio_uuid &&
|
188
228
|
sms_phone_number == o.sms_phone_number &&
|
@@ -200,7 +240,7 @@ module UltracartClient
|
|
200
240
|
# Calculates hash code according to all attributes.
|
201
241
|
# @return [Fixnum] Hash code
|
202
242
|
def hash
|
203
|
-
[marketing_esp_domain_user, marketing_esp_domain_uuid, marketing_esp_friendly_name, postcard_from_address1, postcard_from_address2, postcard_from_city, postcard_from_name, postcard_from_postal_code, postcard_from_state, reviews_io_configured, sms_esp_twilio_uuid, sms_phone_number, transactional_esp_domain_user, transactional_esp_domain_uuid, transactional_esp_friendly_name].hash
|
243
|
+
[emails_per_day, emails_per_hour, emails_per_month, marketing_esp_domain_user, marketing_esp_domain_uuid, marketing_esp_friendly_name, postcard_from_address1, postcard_from_address2, postcard_from_city, postcard_from_name, postcard_from_postal_code, postcard_from_state, require_order_within_last, reviews_io_configured, sms_esp_twilio_uuid, sms_phone_number, transactional_esp_domain_user, transactional_esp_domain_uuid, transactional_esp_friendly_name].hash
|
204
244
|
end
|
205
245
|
|
206
246
|
# Builds the object from hash
|
@@ -0,0 +1,196 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class OrderValidationRequest
|
17
|
+
# Checks to perform
|
18
|
+
attr_accessor :checks
|
19
|
+
|
20
|
+
attr_accessor :order
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'checks' => :'checks',
|
26
|
+
:'order' => :'order'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Attribute type mapping.
|
31
|
+
def self.swagger_types
|
32
|
+
{
|
33
|
+
:'checks' => :'Array<String>',
|
34
|
+
:'order' => :'Order'
|
35
|
+
}
|
36
|
+
end
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
return unless attributes.is_a?(Hash)
|
42
|
+
|
43
|
+
# convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
45
|
+
|
46
|
+
if attributes.has_key?(:'checks')
|
47
|
+
if (value = attributes[:'checks']).is_a?(Array)
|
48
|
+
self.checks = value
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
if attributes.has_key?(:'order')
|
53
|
+
self.order = attributes[:'order']
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
58
|
+
# @return Array for valid properties with the reasons
|
59
|
+
def list_invalid_properties
|
60
|
+
invalid_properties = Array.new
|
61
|
+
invalid_properties
|
62
|
+
end
|
63
|
+
|
64
|
+
# Check to see if the all the properties in the model are valid
|
65
|
+
# @return true if the model is valid
|
66
|
+
def valid?
|
67
|
+
true
|
68
|
+
end
|
69
|
+
|
70
|
+
# Checks equality by comparing each attribute.
|
71
|
+
# @param [Object] Object to be compared
|
72
|
+
def ==(o)
|
73
|
+
return true if self.equal?(o)
|
74
|
+
self.class == o.class &&
|
75
|
+
checks == o.checks &&
|
76
|
+
order == o.order
|
77
|
+
end
|
78
|
+
|
79
|
+
# @see the `==` method
|
80
|
+
# @param [Object] Object to be compared
|
81
|
+
def eql?(o)
|
82
|
+
self == o
|
83
|
+
end
|
84
|
+
|
85
|
+
# Calculates hash code according to all attributes.
|
86
|
+
# @return [Fixnum] Hash code
|
87
|
+
def hash
|
88
|
+
[checks, order].hash
|
89
|
+
end
|
90
|
+
|
91
|
+
# Builds the object from hash
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
# @return [Object] Returns the model itself
|
94
|
+
def build_from_hash(attributes)
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
97
|
+
if type =~ /\AArray<(.*)>/i
|
98
|
+
# check to ensure the input is an array given that the attribute
|
99
|
+
# is documented as an array but the input is not
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
102
|
+
end
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
104
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
106
|
+
end
|
107
|
+
|
108
|
+
self
|
109
|
+
end
|
110
|
+
|
111
|
+
# Deserializes the data based on type
|
112
|
+
# @param string type Data type
|
113
|
+
# @param string value Value to be deserialized
|
114
|
+
# @return [Object] Deserialized data
|
115
|
+
def _deserialize(type, value)
|
116
|
+
case type.to_sym
|
117
|
+
when :DateTime
|
118
|
+
DateTime.parse(value)
|
119
|
+
when :Date
|
120
|
+
Date.parse(value)
|
121
|
+
when :String
|
122
|
+
value.to_s
|
123
|
+
when :Integer
|
124
|
+
value.to_i
|
125
|
+
when :Float
|
126
|
+
value.to_f
|
127
|
+
when :BOOLEAN
|
128
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
129
|
+
true
|
130
|
+
else
|
131
|
+
false
|
132
|
+
end
|
133
|
+
when :Object
|
134
|
+
# generic object (usually a Hash), return directly
|
135
|
+
value
|
136
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
137
|
+
inner_type = Regexp.last_match[:inner_type]
|
138
|
+
value.map { |v| _deserialize(inner_type, v) }
|
139
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
140
|
+
k_type = Regexp.last_match[:k_type]
|
141
|
+
v_type = Regexp.last_match[:v_type]
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each do |k, v|
|
144
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
else # model
|
148
|
+
temp_model = UltracartClient.const_get(type).new
|
149
|
+
temp_model.build_from_hash(value)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
# Returns the string representation of the object
|
154
|
+
# @return [String] String presentation of the object
|
155
|
+
def to_s
|
156
|
+
to_hash.to_s
|
157
|
+
end
|
158
|
+
|
159
|
+
# to_body is an alias to to_hash (backward compatibility)
|
160
|
+
# @return [Hash] Returns the object in the form of hash
|
161
|
+
def to_body
|
162
|
+
to_hash
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the object in the form of hash
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_hash
|
168
|
+
hash = {}
|
169
|
+
self.class.attribute_map.each_pair do |attr, param|
|
170
|
+
value = self.send(attr)
|
171
|
+
next if value.nil?
|
172
|
+
hash[param] = _to_hash(value)
|
173
|
+
end
|
174
|
+
hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Outputs non-array value in the form of hash
|
178
|
+
# For object, use to_hash. Otherwise, just return the value
|
179
|
+
# @param [Object] value Any valid value
|
180
|
+
# @return [Hash] Returns the value in the form of hash
|
181
|
+
def _to_hash(value)
|
182
|
+
if value.is_a?(Array)
|
183
|
+
value.compact.map { |v| _to_hash(v) }
|
184
|
+
elsif value.is_a?(Hash)
|
185
|
+
{}.tap do |hash|
|
186
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
187
|
+
end
|
188
|
+
elsif value.respond_to? :to_hash
|
189
|
+
value.to_hash
|
190
|
+
else
|
191
|
+
value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
196
|
+
end
|
@@ -0,0 +1,209 @@
|
|
1
|
+
=begin
|
2
|
+
#UltraCart Rest API V2
|
3
|
+
|
4
|
+
#UltraCart REST API Version 2
|
5
|
+
|
6
|
+
OpenAPI spec version: 2.0.0
|
7
|
+
Contact: support@ultracart.com
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.15-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module UltracartClient
|
16
|
+
class OrderValidationResponse
|
17
|
+
# Errors to display to the merchant if they failed any of the validations checked
|
18
|
+
attr_accessor :errors
|
19
|
+
|
20
|
+
# Informational messages
|
21
|
+
attr_accessor :messages
|
22
|
+
|
23
|
+
# If true, this order was updated during the validation call. This may happen during address standardization fixes.
|
24
|
+
attr_accessor :order_was_updated
|
25
|
+
|
26
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
27
|
+
def self.attribute_map
|
28
|
+
{
|
29
|
+
:'errors' => :'errors',
|
30
|
+
:'messages' => :'messages',
|
31
|
+
:'order_was_updated' => :'order_was_updated'
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.swagger_types
|
37
|
+
{
|
38
|
+
:'errors' => :'Array<String>',
|
39
|
+
:'messages' => :'Array<String>',
|
40
|
+
:'order_was_updated' => :'BOOLEAN'
|
41
|
+
}
|
42
|
+
end
|
43
|
+
|
44
|
+
# Initializes the object
|
45
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
46
|
+
def initialize(attributes = {})
|
47
|
+
return unless attributes.is_a?(Hash)
|
48
|
+
|
49
|
+
# convert string to symbol for hash key
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
51
|
+
|
52
|
+
if attributes.has_key?(:'errors')
|
53
|
+
if (value = attributes[:'errors']).is_a?(Array)
|
54
|
+
self.errors = value
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes.has_key?(:'messages')
|
59
|
+
if (value = attributes[:'messages']).is_a?(Array)
|
60
|
+
self.messages = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
if attributes.has_key?(:'order_was_updated')
|
65
|
+
self.order_was_updated = attributes[:'order_was_updated']
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properties with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
errors == o.errors &&
|
88
|
+
messages == o.messages &&
|
89
|
+
order_was_updated == o.order_was_updated
|
90
|
+
end
|
91
|
+
|
92
|
+
# @see the `==` method
|
93
|
+
# @param [Object] Object to be compared
|
94
|
+
def eql?(o)
|
95
|
+
self == o
|
96
|
+
end
|
97
|
+
|
98
|
+
# Calculates hash code according to all attributes.
|
99
|
+
# @return [Fixnum] Hash code
|
100
|
+
def hash
|
101
|
+
[errors, messages, order_was_updated].hash
|
102
|
+
end
|
103
|
+
|
104
|
+
# Builds the object from hash
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
106
|
+
# @return [Object] Returns the model itself
|
107
|
+
def build_from_hash(attributes)
|
108
|
+
return nil unless attributes.is_a?(Hash)
|
109
|
+
self.class.swagger_types.each_pair do |key, type|
|
110
|
+
if type =~ /\AArray<(.*)>/i
|
111
|
+
# check to ensure the input is an array given that the attribute
|
112
|
+
# is documented as an array but the input is not
|
113
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
114
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
115
|
+
end
|
116
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
117
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
118
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
119
|
+
end
|
120
|
+
|
121
|
+
self
|
122
|
+
end
|
123
|
+
|
124
|
+
# Deserializes the data based on type
|
125
|
+
# @param string type Data type
|
126
|
+
# @param string value Value to be deserialized
|
127
|
+
# @return [Object] Deserialized data
|
128
|
+
def _deserialize(type, value)
|
129
|
+
case type.to_sym
|
130
|
+
when :DateTime
|
131
|
+
DateTime.parse(value)
|
132
|
+
when :Date
|
133
|
+
Date.parse(value)
|
134
|
+
when :String
|
135
|
+
value.to_s
|
136
|
+
when :Integer
|
137
|
+
value.to_i
|
138
|
+
when :Float
|
139
|
+
value.to_f
|
140
|
+
when :BOOLEAN
|
141
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
142
|
+
true
|
143
|
+
else
|
144
|
+
false
|
145
|
+
end
|
146
|
+
when :Object
|
147
|
+
# generic object (usually a Hash), return directly
|
148
|
+
value
|
149
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
150
|
+
inner_type = Regexp.last_match[:inner_type]
|
151
|
+
value.map { |v| _deserialize(inner_type, v) }
|
152
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
153
|
+
k_type = Regexp.last_match[:k_type]
|
154
|
+
v_type = Regexp.last_match[:v_type]
|
155
|
+
{}.tap do |hash|
|
156
|
+
value.each do |k, v|
|
157
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
else # model
|
161
|
+
temp_model = UltracartClient.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
end
|
209
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -636,6 +636,8 @@ require 'ultracart_api/models/order_tracking_number_detail'
|
|
636
636
|
require 'ultracart_api/models/order_tracking_number_details'
|
637
637
|
require 'ultracart_api/models/order_transactional_merchant_note'
|
638
638
|
require 'ultracart_api/models/order_utm'
|
639
|
+
require 'ultracart_api/models/order_validation_request'
|
640
|
+
require 'ultracart_api/models/order_validation_response'
|
639
641
|
require 'ultracart_api/models/orders_response'
|
640
642
|
require 'ultracart_api/models/permission'
|
641
643
|
require 'ultracart_api/models/point_of_sale_location'
|
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: 3.10.
|
4
|
+
version: 3.10.154
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -855,6 +855,8 @@ files:
|
|
855
855
|
- docs/OrderTrackingNumberDetails.md
|
856
856
|
- docs/OrderTransactionalMerchantNote.md
|
857
857
|
- docs/OrderUtm.md
|
858
|
+
- docs/OrderValidationRequest.md
|
859
|
+
- docs/OrderValidationResponse.md
|
858
860
|
- docs/OrdersResponse.md
|
859
861
|
- docs/Permission.md
|
860
862
|
- docs/PointOfSaleLocation.md
|
@@ -1662,6 +1664,8 @@ files:
|
|
1662
1664
|
- lib/ultracart_api/models/order_tracking_number_details.rb
|
1663
1665
|
- lib/ultracart_api/models/order_transactional_merchant_note.rb
|
1664
1666
|
- lib/ultracart_api/models/order_utm.rb
|
1667
|
+
- lib/ultracart_api/models/order_validation_request.rb
|
1668
|
+
- lib/ultracart_api/models/order_validation_response.rb
|
1665
1669
|
- lib/ultracart_api/models/orders_response.rb
|
1666
1670
|
- lib/ultracart_api/models/permission.rb
|
1667
1671
|
- lib/ultracart_api/models/point_of_sale_location.rb
|