avalara_sdk 2.4.5.6
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.
- checksums.yaml +7 -0
- data/Avalara.SDK.gemspec +38 -0
- data/Gemfile +9 -0
- data/README.md +129 -0
- data/Rakefile +10 -0
- data/TAGS +441 -0
- data/avalara_sdk.gemspec +36 -0
- data/docs/AgeVerificationApi.md +87 -0
- data/docs/AgeVerifyFailureCode.md +15 -0
- data/docs/AgeVerifyRequest.md +24 -0
- data/docs/AgeVerifyRequestAddress.md +26 -0
- data/docs/AgeVerifyResult.md +20 -0
- data/docs/ErrorDetails.md +18 -0
- data/docs/ErrorDetailsError.md +22 -0
- data/docs/ErrorDetailsErrorDetails.md +30 -0
- data/docs/ShippingVerificationApi.md +327 -0
- data/docs/ShippingVerifyResult.md +30 -0
- data/docs/ShippingVerifyResultLines.md +28 -0
- data/example/test.rb +25 -0
- data/git_push.sh +57 -0
- data/lib/avalara_sdk/api/age_verification_api.rb +95 -0
- data/lib/avalara_sdk/api/shipping_verification_api.rb +322 -0
- data/lib/avalara_sdk/api_client.rb +411 -0
- data/lib/avalara_sdk/api_error.rb +57 -0
- data/lib/avalara_sdk/configuration.rb +231 -0
- data/lib/avalara_sdk/models/age_verify_failure_code.rb +39 -0
- data/lib/avalara_sdk/models/age_verify_request.rb +245 -0
- data/lib/avalara_sdk/models/age_verify_request_address.rb +288 -0
- data/lib/avalara_sdk/models/age_verify_result.rb +230 -0
- data/lib/avalara_sdk/models/error_details.rb +217 -0
- data/lib/avalara_sdk/models/error_details_error.rb +271 -0
- data/lib/avalara_sdk/models/error_details_error_details.rb +324 -0
- data/lib/avalara_sdk/models/shipping_verify_result.rb +306 -0
- data/lib/avalara_sdk/models/shipping_verify_result_lines.rb +303 -0
- data/lib/avalara_sdk/version.rb +13 -0
- data/lib/avalara_sdk.rb +48 -0
- data/spec/api/age_verification_api_spec.rb +48 -0
- data/spec/api/shipping_verification_api_spec.rb +88 -0
- data/spec/api_client_spec.rb +224 -0
- data/spec/configuration_spec.rb +40 -0
- data/spec/models/age_verify_failure_code_spec.rb +28 -0
- data/spec/models/age_verify_request_address_spec.rb +62 -0
- data/spec/models/age_verify_request_spec.rb +52 -0
- data/spec/models/age_verify_result_spec.rb +40 -0
- data/spec/models/error_details_error_details_spec.rb +78 -0
- data/spec/models/error_details_error_spec.rb +50 -0
- data/spec/models/error_details_spec.rb +34 -0
- data/spec/models/shipping_verify_result_lines_spec.rb +72 -0
- data/spec/models/shipping_verify_result_spec.rb +78 -0
- data/spec/spec_helper.rb +108 -0
- metadata +147 -0
data/git_push.sh
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=$(git remote)
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
@@ -0,0 +1,95 @@
|
|
1
|
+
=begin
|
2
|
+
#Avalara Shipping Verification only
|
3
|
+
|
4
|
+
#API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta.
|
5
|
+
|
6
|
+
SDK Version : 2.4.5.6
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'cgi'
|
12
|
+
|
13
|
+
module AvalaraSdk
|
14
|
+
class AgeVerificationApi
|
15
|
+
attr_accessor :api_client
|
16
|
+
|
17
|
+
def initialize(api_client)
|
18
|
+
if (api_client.nil?)
|
19
|
+
fail ArgumentError,'api_client is nil'
|
20
|
+
end
|
21
|
+
api_client.set_sdk_version("2.4.5.6")
|
22
|
+
@api_client = api_client
|
23
|
+
end
|
24
|
+
# Determines whether an individual meets or exceeds the minimum legal drinking age.
|
25
|
+
# The request must meet the following criteria in order to be evaluated: * *firstName*, *lastName*, and *address* are required fields. * One of the following sets of attributes are required for the *address*: * *line1, city, region* * *line1, postalCode* Optionally, the transaction and its lines may use the following parameters: * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21). * Beyond the required *address* fields above, a *country* field is permitted * The valid values for this attribute are [*US, USA*] **Security Policies** This API depends on the active subscription *AgeVerification*
|
26
|
+
# @param age_verify_request [AgeVerifyRequest] Information about the individual whose age is being verified.
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @option opts [AgeVerifyFailureCode] :simulated_failure_code (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.
|
29
|
+
# @return [AgeVerifyResult]
|
30
|
+
def verify_age(age_verify_request, opts = {})
|
31
|
+
data, _status_code, _headers = verify_age_with_http_info(age_verify_request, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Determines whether an individual meets or exceeds the minimum legal drinking age.
|
36
|
+
# The request must meet the following criteria in order to be evaluated: * *firstName*, *lastName*, and *address* are required fields. * One of the following sets of attributes are required for the *address*: * *line1, city, region* * *line1, postalCode* Optionally, the transaction and its lines may use the following parameters: * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21). * Beyond the required *address* fields above, a *country* field is permitted * The valid values for this attribute are [*US, USA*] **Security Policies** This API depends on the active subscription *AgeVerification*
|
37
|
+
# @param age_verify_request [AgeVerifyRequest] Information about the individual whose age is being verified.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [AgeVerifyFailureCode] :simulated_failure_code (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.
|
40
|
+
# @return [Array<(AgeVerifyResult, Integer, Hash)>] AgeVerifyResult data, response status code and response headers
|
41
|
+
def verify_age_with_http_info(age_verify_request, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: AgeVerificationApi.verify_age ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'age_verify_request' is set
|
46
|
+
if @api_client.config.client_side_validation && age_verify_request.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'age_verify_request' when calling AgeVerificationApi.verify_age"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/api/v2/ageverification/verify'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
query_params[:'simulatedFailureCode'] = opts[:'simulated_failure_code'] if !opts[:'simulated_failure_code'].nil?
|
55
|
+
|
56
|
+
# header parameters
|
57
|
+
header_params = opts[:header_params] || {}
|
58
|
+
# HTTP header 'Accept' (if needed)
|
59
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
60
|
+
# HTTP header 'Content-Type'
|
61
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
62
|
+
if !content_type.nil?
|
63
|
+
header_params['Content-Type'] = content_type
|
64
|
+
end
|
65
|
+
|
66
|
+
# form parameters
|
67
|
+
form_params = opts[:form_params] || {}
|
68
|
+
|
69
|
+
# http body (model)
|
70
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(age_verify_request)
|
71
|
+
|
72
|
+
# return_type
|
73
|
+
return_type = opts[:debug_return_type] || 'AgeVerifyResult'
|
74
|
+
|
75
|
+
# auth_names
|
76
|
+
auth_names = opts[:debug_auth_names] || ['BasicAuth', 'Bearer']
|
77
|
+
|
78
|
+
new_options = opts.merge(
|
79
|
+
:operation => :"AgeVerificationApi.verify_age",
|
80
|
+
:header_params => header_params,
|
81
|
+
:query_params => query_params,
|
82
|
+
:form_params => form_params,
|
83
|
+
:body => post_body,
|
84
|
+
:auth_names => auth_names,
|
85
|
+
:return_type => return_type
|
86
|
+
)
|
87
|
+
|
88
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
89
|
+
if @api_client.config.debugging
|
90
|
+
@api_client.config.logger.debug "API called: AgeVerificationApi#verify_age\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
91
|
+
end
|
92
|
+
return data, status_code, headers
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,322 @@
|
|
1
|
+
=begin
|
2
|
+
#Avalara Shipping Verification only
|
3
|
+
|
4
|
+
#API for evaluating transactions against direct-to-consumer Beverage Alcohol shipping regulations. This API is currently in beta.
|
5
|
+
|
6
|
+
SDK Version : 2.4.5.6
|
7
|
+
|
8
|
+
|
9
|
+
=end
|
10
|
+
|
11
|
+
require 'cgi'
|
12
|
+
|
13
|
+
module AvalaraSdk
|
14
|
+
class ShippingVerificationApi
|
15
|
+
attr_accessor :api_client
|
16
|
+
|
17
|
+
def initialize(api_client)
|
18
|
+
if (api_client.nil?)
|
19
|
+
fail ArgumentError,'api_client is nil'
|
20
|
+
end
|
21
|
+
api_client.set_sdk_version("2.4.5.6")
|
22
|
+
@api_client = api_client
|
23
|
+
end
|
24
|
+
# Removes the transaction from consideration when evaluating regulations that span multiple transactions.
|
25
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
26
|
+
# @param transaction_code [String] The transaction code to retrieve
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
29
|
+
# @return [nil]
|
30
|
+
def deregister_shipment(company_code, transaction_code, opts = {})
|
31
|
+
deregister_shipment_with_http_info(company_code, transaction_code, opts)
|
32
|
+
nil
|
33
|
+
end
|
34
|
+
|
35
|
+
# Removes the transaction from consideration when evaluating regulations that span multiple transactions.
|
36
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
37
|
+
# @param transaction_code [String] The transaction code to retrieve
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
40
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
41
|
+
def deregister_shipment_with_http_info(company_code, transaction_code, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: ShippingVerificationApi.deregister_shipment ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'company_code' is set
|
46
|
+
if @api_client.config.client_side_validation && company_code.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'company_code' when calling ShippingVerificationApi.deregister_shipment"
|
48
|
+
end
|
49
|
+
# verify the required parameter 'transaction_code' is set
|
50
|
+
if @api_client.config.client_side_validation && transaction_code.nil?
|
51
|
+
fail ArgumentError, "Missing the required parameter 'transaction_code' when calling ShippingVerificationApi.deregister_shipment"
|
52
|
+
end
|
53
|
+
allowable_values = ["SalesInvoice", "ReturnInvoice"]
|
54
|
+
if @api_client.config.client_side_validation && opts[:'document_type'] && !allowable_values.include?(opts[:'document_type'])
|
55
|
+
fail ArgumentError, "invalid value for \"document_type\", must be one of #{allowable_values}"
|
56
|
+
end
|
57
|
+
# resource path
|
58
|
+
local_var_path = '/api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registration'.sub('{' + 'companyCode' + '}', CGI.escape(company_code.to_s)).sub('{' + 'transactionCode' + '}', CGI.escape(transaction_code.to_s))
|
59
|
+
|
60
|
+
# query parameters
|
61
|
+
query_params = opts[:query_params] || {}
|
62
|
+
query_params[:'documentType'] = opts[:'document_type'] if !opts[:'document_type'].nil?
|
63
|
+
|
64
|
+
# header parameters
|
65
|
+
header_params = opts[:header_params] || {}
|
66
|
+
# HTTP header 'Accept' (if needed)
|
67
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
68
|
+
|
69
|
+
# form parameters
|
70
|
+
form_params = opts[:form_params] || {}
|
71
|
+
|
72
|
+
# http body (model)
|
73
|
+
post_body = opts[:debug_body]
|
74
|
+
|
75
|
+
# return_type
|
76
|
+
return_type = opts[:debug_return_type]
|
77
|
+
|
78
|
+
# auth_names
|
79
|
+
auth_names = opts[:debug_auth_names] || ['BasicAuth', 'Bearer']
|
80
|
+
|
81
|
+
new_options = opts.merge(
|
82
|
+
:operation => :"ShippingVerificationApi.deregister_shipment",
|
83
|
+
:header_params => header_params,
|
84
|
+
:query_params => query_params,
|
85
|
+
:form_params => form_params,
|
86
|
+
:body => post_body,
|
87
|
+
:auth_names => auth_names,
|
88
|
+
:return_type => return_type
|
89
|
+
)
|
90
|
+
|
91
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
92
|
+
if @api_client.config.debugging
|
93
|
+
@api_client.config.logger.debug "API called: ShippingVerificationApi#deregister_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
94
|
+
end
|
95
|
+
return data, status_code, headers
|
96
|
+
end
|
97
|
+
|
98
|
+
# Registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
99
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
100
|
+
# @param transaction_code [String] The transaction code to retrieve
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
103
|
+
# @return [nil]
|
104
|
+
def register_shipment(company_code, transaction_code, opts = {})
|
105
|
+
register_shipment_with_http_info(company_code, transaction_code, opts)
|
106
|
+
nil
|
107
|
+
end
|
108
|
+
|
109
|
+
# Registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
110
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
111
|
+
# @param transaction_code [String] The transaction code to retrieve
|
112
|
+
# @param [Hash] opts the optional parameters
|
113
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
114
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
115
|
+
def register_shipment_with_http_info(company_code, transaction_code, opts = {})
|
116
|
+
if @api_client.config.debugging
|
117
|
+
@api_client.config.logger.debug 'Calling API: ShippingVerificationApi.register_shipment ...'
|
118
|
+
end
|
119
|
+
# verify the required parameter 'company_code' is set
|
120
|
+
if @api_client.config.client_side_validation && company_code.nil?
|
121
|
+
fail ArgumentError, "Missing the required parameter 'company_code' when calling ShippingVerificationApi.register_shipment"
|
122
|
+
end
|
123
|
+
# verify the required parameter 'transaction_code' is set
|
124
|
+
if @api_client.config.client_side_validation && transaction_code.nil?
|
125
|
+
fail ArgumentError, "Missing the required parameter 'transaction_code' when calling ShippingVerificationApi.register_shipment"
|
126
|
+
end
|
127
|
+
allowable_values = ["SalesInvoice", "ReturnInvoice"]
|
128
|
+
if @api_client.config.client_side_validation && opts[:'document_type'] && !allowable_values.include?(opts[:'document_type'])
|
129
|
+
fail ArgumentError, "invalid value for \"document_type\", must be one of #{allowable_values}"
|
130
|
+
end
|
131
|
+
# resource path
|
132
|
+
local_var_path = '/api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registration'.sub('{' + 'companyCode' + '}', CGI.escape(company_code.to_s)).sub('{' + 'transactionCode' + '}', CGI.escape(transaction_code.to_s))
|
133
|
+
|
134
|
+
# query parameters
|
135
|
+
query_params = opts[:query_params] || {}
|
136
|
+
query_params[:'documentType'] = opts[:'document_type'] if !opts[:'document_type'].nil?
|
137
|
+
|
138
|
+
# header parameters
|
139
|
+
header_params = opts[:header_params] || {}
|
140
|
+
# HTTP header 'Accept' (if needed)
|
141
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
142
|
+
|
143
|
+
# form parameters
|
144
|
+
form_params = opts[:form_params] || {}
|
145
|
+
|
146
|
+
# http body (model)
|
147
|
+
post_body = opts[:debug_body]
|
148
|
+
|
149
|
+
# return_type
|
150
|
+
return_type = opts[:debug_return_type]
|
151
|
+
|
152
|
+
# auth_names
|
153
|
+
auth_names = opts[:debug_auth_names] || ['BasicAuth', 'Bearer']
|
154
|
+
|
155
|
+
new_options = opts.merge(
|
156
|
+
:operation => :"ShippingVerificationApi.register_shipment",
|
157
|
+
:header_params => header_params,
|
158
|
+
:query_params => query_params,
|
159
|
+
:form_params => form_params,
|
160
|
+
:body => post_body,
|
161
|
+
:auth_names => auth_names,
|
162
|
+
:return_type => return_type
|
163
|
+
)
|
164
|
+
|
165
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
166
|
+
if @api_client.config.debugging
|
167
|
+
@api_client.config.logger.debug "API called: ShippingVerificationApi#register_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
168
|
+
end
|
169
|
+
return data, status_code, headers
|
170
|
+
end
|
171
|
+
|
172
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
173
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
174
|
+
# @param transaction_code [String] The transaction code to retrieve
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
177
|
+
# @return [ShippingVerifyResult]
|
178
|
+
def register_shipment_if_compliant(company_code, transaction_code, opts = {})
|
179
|
+
data, _status_code, _headers = register_shipment_if_compliant_with_http_info(company_code, transaction_code, opts)
|
180
|
+
data
|
181
|
+
end
|
182
|
+
|
183
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations and, if compliant, registers the transaction so that it may be included when evaluating regulations that span multiple transactions.
|
184
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
185
|
+
# @param transaction_code [String] The transaction code to retrieve
|
186
|
+
# @param [Hash] opts the optional parameters
|
187
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
188
|
+
# @return [Array<(ShippingVerifyResult, Integer, Hash)>] ShippingVerifyResult data, response status code and response headers
|
189
|
+
def register_shipment_if_compliant_with_http_info(company_code, transaction_code, opts = {})
|
190
|
+
if @api_client.config.debugging
|
191
|
+
@api_client.config.logger.debug 'Calling API: ShippingVerificationApi.register_shipment_if_compliant ...'
|
192
|
+
end
|
193
|
+
# verify the required parameter 'company_code' is set
|
194
|
+
if @api_client.config.client_side_validation && company_code.nil?
|
195
|
+
fail ArgumentError, "Missing the required parameter 'company_code' when calling ShippingVerificationApi.register_shipment_if_compliant"
|
196
|
+
end
|
197
|
+
# verify the required parameter 'transaction_code' is set
|
198
|
+
if @api_client.config.client_side_validation && transaction_code.nil?
|
199
|
+
fail ArgumentError, "Missing the required parameter 'transaction_code' when calling ShippingVerificationApi.register_shipment_if_compliant"
|
200
|
+
end
|
201
|
+
allowable_values = ["SalesInvoice", "ReturnInvoice"]
|
202
|
+
if @api_client.config.client_side_validation && opts[:'document_type'] && !allowable_values.include?(opts[:'document_type'])
|
203
|
+
fail ArgumentError, "invalid value for \"document_type\", must be one of #{allowable_values}"
|
204
|
+
end
|
205
|
+
# resource path
|
206
|
+
local_var_path = '/api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/registerIfCompliant'.sub('{' + 'companyCode' + '}', CGI.escape(company_code.to_s)).sub('{' + 'transactionCode' + '}', CGI.escape(transaction_code.to_s))
|
207
|
+
|
208
|
+
# query parameters
|
209
|
+
query_params = opts[:query_params] || {}
|
210
|
+
query_params[:'documentType'] = opts[:'document_type'] if !opts[:'document_type'].nil?
|
211
|
+
|
212
|
+
# header parameters
|
213
|
+
header_params = opts[:header_params] || {}
|
214
|
+
# HTTP header 'Accept' (if needed)
|
215
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
216
|
+
|
217
|
+
# form parameters
|
218
|
+
form_params = opts[:form_params] || {}
|
219
|
+
|
220
|
+
# http body (model)
|
221
|
+
post_body = opts[:debug_body]
|
222
|
+
|
223
|
+
# return_type
|
224
|
+
return_type = opts[:debug_return_type] || 'ShippingVerifyResult'
|
225
|
+
|
226
|
+
# auth_names
|
227
|
+
auth_names = opts[:debug_auth_names] || ['BasicAuth', 'Bearer']
|
228
|
+
|
229
|
+
new_options = opts.merge(
|
230
|
+
:operation => :"ShippingVerificationApi.register_shipment_if_compliant",
|
231
|
+
:header_params => header_params,
|
232
|
+
:query_params => query_params,
|
233
|
+
:form_params => form_params,
|
234
|
+
:body => post_body,
|
235
|
+
:auth_names => auth_names,
|
236
|
+
:return_type => return_type
|
237
|
+
)
|
238
|
+
|
239
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
240
|
+
if @api_client.config.debugging
|
241
|
+
@api_client.config.logger.debug "API called: ShippingVerificationApi#register_shipment_if_compliant\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
242
|
+
end
|
243
|
+
return data, status_code, headers
|
244
|
+
end
|
245
|
+
|
246
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations.
|
247
|
+
# The transaction and its lines must meet the following criteria in order to be evaluated: * The transaction must be recorded. Using a type of *SalesInvoice* is recommended. * A parameter with the name *AlcoholRouteType* must be specified and the value must be one of the following: '*DTC*', '*Retailer DTC*' * A parameter with the name *RecipientName* must be specified and the value must be the name of the recipient. * Each alcohol line must include a *ContainerSize* parameter that describes the volume of a single container. Use the *unit* field to specify one of the following units: '*Litre*', '*Millilitre*', '*gallon (US fluid)*', '*quart (US fluid)*', '*ounce (fluid US customary)*' * Each alcohol line must include a *PackSize* parameter that describes the number of containers in a pack. Specify *Count* in the *unit* field. Optionally, the transaction and its lines may use the following parameters: * The *ShipDate* parameter may be used if the date of shipment is different than the date of the transaction. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *RecipientDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *PurchaserDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *SalesLocation* parameter may be used to describe whether the sale was made *OnSite* or *OffSite*. *OffSite* is the default value. * The *AlcoholContent* parameter may be used to describe the alcohol percentage by volume of the item. Specify *Percentage* in the *unit* field. **Security Policies** This API depends on all of the following active subscriptions: *AvaAlcohol, AutoAddress, AvaTaxPro*
|
248
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
249
|
+
# @param transaction_code [String] The transaction code to retrieve
|
250
|
+
# @param [Hash] opts the optional parameters
|
251
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
252
|
+
# @return [ShippingVerifyResult]
|
253
|
+
def verify_shipment(company_code, transaction_code, opts = {})
|
254
|
+
data, _status_code, _headers = verify_shipment_with_http_info(company_code, transaction_code, opts)
|
255
|
+
data
|
256
|
+
end
|
257
|
+
|
258
|
+
# Evaluates a transaction against a set of direct-to-consumer shipping regulations.
|
259
|
+
# The transaction and its lines must meet the following criteria in order to be evaluated: * The transaction must be recorded. Using a type of *SalesInvoice* is recommended. * A parameter with the name *AlcoholRouteType* must be specified and the value must be one of the following: '*DTC*', '*Retailer DTC*' * A parameter with the name *RecipientName* must be specified and the value must be the name of the recipient. * Each alcohol line must include a *ContainerSize* parameter that describes the volume of a single container. Use the *unit* field to specify one of the following units: '*Litre*', '*Millilitre*', '*gallon (US fluid)*', '*quart (US fluid)*', '*ounce (fluid US customary)*' * Each alcohol line must include a *PackSize* parameter that describes the number of containers in a pack. Specify *Count* in the *unit* field. Optionally, the transaction and its lines may use the following parameters: * The *ShipDate* parameter may be used if the date of shipment is different than the date of the transaction. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *RecipientDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *PurchaserDOB* parameter may be used to evaluate age restrictions. The value should be ISO-8601 compliant (e.g. 2020-07-21). * The *SalesLocation* parameter may be used to describe whether the sale was made *OnSite* or *OffSite*. *OffSite* is the default value. * The *AlcoholContent* parameter may be used to describe the alcohol percentage by volume of the item. Specify *Percentage* in the *unit* field. **Security Policies** This API depends on all of the following active subscriptions: *AvaAlcohol, AutoAddress, AvaTaxPro*
|
260
|
+
# @param company_code [String] The company code of the company that recorded the transaction
|
261
|
+
# @param transaction_code [String] The transaction code to retrieve
|
262
|
+
# @param [Hash] opts the optional parameters
|
263
|
+
# @option opts [String] :document_type (Optional): The document type of the transaction to operate on. If omitted, defaults to \"SalesInvoice\"
|
264
|
+
# @return [Array<(ShippingVerifyResult, Integer, Hash)>] ShippingVerifyResult data, response status code and response headers
|
265
|
+
def verify_shipment_with_http_info(company_code, transaction_code, opts = {})
|
266
|
+
if @api_client.config.debugging
|
267
|
+
@api_client.config.logger.debug 'Calling API: ShippingVerificationApi.verify_shipment ...'
|
268
|
+
end
|
269
|
+
# verify the required parameter 'company_code' is set
|
270
|
+
if @api_client.config.client_side_validation && company_code.nil?
|
271
|
+
fail ArgumentError, "Missing the required parameter 'company_code' when calling ShippingVerificationApi.verify_shipment"
|
272
|
+
end
|
273
|
+
# verify the required parameter 'transaction_code' is set
|
274
|
+
if @api_client.config.client_side_validation && transaction_code.nil?
|
275
|
+
fail ArgumentError, "Missing the required parameter 'transaction_code' when calling ShippingVerificationApi.verify_shipment"
|
276
|
+
end
|
277
|
+
allowable_values = ["SalesInvoice", "ReturnInvoice"]
|
278
|
+
if @api_client.config.client_side_validation && opts[:'document_type'] && !allowable_values.include?(opts[:'document_type'])
|
279
|
+
fail ArgumentError, "invalid value for \"document_type\", must be one of #{allowable_values}"
|
280
|
+
end
|
281
|
+
# resource path
|
282
|
+
local_var_path = '/api/v2/companies/{companyCode}/transactions/{transactionCode}/shipment/verify'.sub('{' + 'companyCode' + '}', CGI.escape(company_code.to_s)).sub('{' + 'transactionCode' + '}', CGI.escape(transaction_code.to_s))
|
283
|
+
|
284
|
+
# query parameters
|
285
|
+
query_params = opts[:query_params] || {}
|
286
|
+
query_params[:'documentType'] = opts[:'document_type'] if !opts[:'document_type'].nil?
|
287
|
+
|
288
|
+
# header parameters
|
289
|
+
header_params = opts[:header_params] || {}
|
290
|
+
# HTTP header 'Accept' (if needed)
|
291
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
292
|
+
|
293
|
+
# form parameters
|
294
|
+
form_params = opts[:form_params] || {}
|
295
|
+
|
296
|
+
# http body (model)
|
297
|
+
post_body = opts[:debug_body]
|
298
|
+
|
299
|
+
# return_type
|
300
|
+
return_type = opts[:debug_return_type] || 'ShippingVerifyResult'
|
301
|
+
|
302
|
+
# auth_names
|
303
|
+
auth_names = opts[:debug_auth_names] || ['BasicAuth', 'Bearer']
|
304
|
+
|
305
|
+
new_options = opts.merge(
|
306
|
+
:operation => :"ShippingVerificationApi.verify_shipment",
|
307
|
+
:header_params => header_params,
|
308
|
+
:query_params => query_params,
|
309
|
+
:form_params => form_params,
|
310
|
+
:body => post_body,
|
311
|
+
:auth_names => auth_names,
|
312
|
+
:return_type => return_type
|
313
|
+
)
|
314
|
+
|
315
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
316
|
+
if @api_client.config.debugging
|
317
|
+
@api_client.config.logger.debug "API called: ShippingVerificationApi#verify_shipment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
318
|
+
end
|
319
|
+
return data, status_code, headers
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|