Skip to content

Commit 8938fd1

Browse files
Merge pull request #114 from avadev/21.12.0
Update for 21.12.0
2 parents 8b6ac97 + a7c3305 commit 8938fd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+879
-372
lines changed

lib/avatax/client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,7 @@ class Client < API
3131
include AvaTax::Client::Upcs
3232
include AvaTax::Client::Users
3333
include AvaTax::Client::Utilities
34+
include AvaTax::Client::ShippingVerification
35+
include AvaTax::Client::AgeVerification
3436
end
3537
end

lib/avatax/client/accounts.rb

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ module Accounts
2323
# ### Security Policies
2424
#
2525
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
26+
# Swagger Name: AvaTaxClient
2627
# @param id [Integer] The ID of the account you wish to update.
2728
# @param model [Object] A request confirming that you wish to reset the license key of this account.
2829
# @return [Object]
2930
def account_reset_license_key(id, model) path = "/api/v2/accounts/#{id}/resetlicensekey"
30-
post(path, model) end
31+
post(path, model, {}, "21.12.0") end
3132

3233
# Activate an account by accepting terms and conditions
3334
#
@@ -45,11 +46,12 @@ def account_reset_license_key(id, model) path = "/api/v2/accounts/#{id}/r
4546
# ### Security Policies
4647
#
4748
# * This API requires one of the following user roles: AccountAdmin, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
49+
# Swagger Name: AvaTaxClient
4850
# @param id [Integer] The ID of the account to activate
4951
# @param model [Object] The activation request
5052
# @return [Object]
5153
def activate_account(id, model) path = "/api/v2/accounts/#{id}/activate"
52-
post(path, model) end
54+
post(path, model, {}, "21.12.0") end
5355

5456
# Retrieve audit history for an account.
5557
#
@@ -71,14 +73,15 @@ def activate_account(id, model) path = "/api/v2/accounts/#{id}/activate"
7173
# ### Security Policies
7274
#
7375
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
76+
# Swagger Name: AvaTaxClient
7477
# @param id [Integer] The ID of the account you wish to audit.
7578
# @param start [DateTime] The start datetime of audit history you with to retrieve, e.g. "2018-06-08T17:00:00Z". Defaults to the past 15 minutes.
7679
# @param end [DateTime] The end datetime of audit history you with to retrieve, e.g. "2018-06-08T17:15:00Z. Defaults to the current time. Maximum of an hour after the start time.
7780
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
7881
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
7982
# @return [FetchResult]
8083
def audit_account(id, options={}) path = "/api/v2/accounts/#{id}/audit"
81-
get(path, options) end
84+
get(path, options, "21.12.0") end
8285

8386
# Create license key for this account
8487
#
@@ -96,11 +99,12 @@ def audit_account(id, options={}) path = "/api/v2/accounts/#{id}/audit"
9699
# ### Security Policies
97100
#
98101
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
102+
# Swagger Name: AvaTaxClient
99103
# @param id [Integer] The ID of the account you wish to update.
100104
# @param model [Object]
101105
# @return [Object]
102106
def create_license_key(id, model) path = "/api/v2/accounts/#{id}/licensekey"
103-
post(path, model) end
107+
post(path, model, {}, "21.12.0") end
104108

105109
# Delete license key for this account by license key name
106110
#
@@ -113,11 +117,12 @@ def create_license_key(id, model) path = "/api/v2/accounts/#{id}/licensek
113117
# ### Security Policies
114118
#
115119
# * This API requires one of the following user roles: AccountAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
120+
# Swagger Name: AvaTaxClient
116121
# @param id [Integer] The ID of the account you wish to update.
117122
# @param licensekeyname [String] The license key name you wish to update.
118123
# @return [ErrorDetail[]]
119124
def delete_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
120-
delete(path) end
125+
delete(path, {}, "21.12.0") end
121126

122127
# Retrieve a single account
123128
#
@@ -130,11 +135,12 @@ def delete_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}
130135
# ### Security Policies
131136
#
132137
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
138+
# Swagger Name: AvaTaxClient
133139
# @param id [Integer] The ID of the account to retrieve
134140
# @param include [String] A comma separated list of special fetch options
135141
# @return [Object]
136142
def get_account(id, options={}) path = "/api/v2/accounts/#{id}"
137-
get(path, options) end
143+
get(path, options, "21.12.0") end
138144

139145
# Get configuration settings for this account
140146
#
@@ -154,21 +160,23 @@ def get_account(id, options={}) path = "/api/v2/accounts/#{id}"
154160
# ### Security Policies
155161
#
156162
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
163+
# Swagger Name: AvaTaxClient
157164
# @param id [Integer]
158165
# @return [AccountConfigurationModel[]]
159166
def get_account_configuration(id) path = "/api/v2/accounts/#{id}/configuration"
160-
get(path) end
167+
get(path, {}, "21.12.0") end
161168

162169
# Retrieve license key by license key name
163170
#
164171
# ### Security Policies
165172
#
166173
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
174+
# Swagger Name: AvaTaxClient
167175
# @param id [Integer] The ID of the account to retrieve
168176
# @param licensekeyname [String] The ID of the account to retrieve
169177
# @return [Object]
170178
def get_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
171-
get(path) end
179+
get(path, {}, "21.12.0") end
172180

173181
# Retrieve all license keys for this account
174182
#
@@ -177,10 +185,11 @@ def get_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/li
177185
# ### Security Policies
178186
#
179187
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
188+
# Swagger Name: AvaTaxClient
180189
# @param id [Integer] The ID of the account to retrieve
181190
# @return [AccountLicenseKeyModel[]]
182191
def get_license_keys(id) path = "/api/v2/accounts/#{id}/licensekeys"
183-
get(path) end
192+
get(path, {}, "21.12.0") end
184193

185194
# Retrieve all accounts
186195
#
@@ -200,14 +209,15 @@ def get_license_keys(id) path = "/api/v2/accounts/#{id}/licensekeys"
200209
# ### Security Policies
201210
#
202211
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
212+
# Swagger Name: AvaTaxClient
203213
# @param include [String] A comma separated list of objects to fetch underneath this account. Any object with a URL path underneath this account can be fetched by specifying its name.
204214
# @param filter [String] A filter statement to identify specific records to retrieve. For more information on filtering, see [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/).<br />*Not filterable:* subscriptions, users
205215
# @param top [Integer] If nonzero, return no more than this number of results. Used with `$skip` to provide pagination for large datasets. Unless otherwise specified, the maximum number of records that can be returned from an API call is 1,000 records.
206216
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
207217
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
208218
# @return [FetchResult]
209219
def query_accounts(options={}) path = "/api/v2/accounts"
210-
get(path, options) end
220+
get(path, options, "21.12.0") end
211221

212222
# Change configuration settings for this account
213223
#
@@ -227,11 +237,12 @@ def query_accounts(options={}) path = "/api/v2/accounts"
227237
# ### Security Policies
228238
#
229239
# * This API requires one of the following user roles: AccountAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
240+
# Swagger Name: AvaTaxClient
230241
# @param id [Integer]
231242
# @param model [AccountConfigurationModel[]]
232243
# @return [AccountConfigurationModel[]]
233244
def set_account_configuration(id, model) path = "/api/v2/accounts/#{id}/configuration"
234-
post(path, model) end
245+
post(path, model, {}, "21.12.0") end
235246
end
236247
end
237248
end

lib/avatax/client/addresses.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Addresses
2121
#
2222
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
2323
# * This API depends on the following active services:*Required* (all): AutoAddress.
24+
# Swagger Name: AvaTaxClient
2425
# @param line1 [String] Line 1
2526
# @param line2 [String] Line 2
2627
# @param line3 [String] Line 3
@@ -31,7 +32,7 @@ module Addresses
3132
# @param textCase [String] selectable text case for address validation (See TextCase::* for a list of allowable values)
3233
# @return [Object]
3334
def resolve_address(options={}) path = "/api/v2/addresses/resolve"
34-
get(path, options) end
35+
get(path, options, "21.12.0") end
3536

3637
# Retrieve geolocation information for a specified address
3738
#
@@ -46,10 +47,11 @@ def resolve_address(options={}) path = "/api/v2/addresses/resolve"
4647
#
4748
# * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
4849
# * This API depends on the following active services:*Required* (all): AutoAddress.
50+
# Swagger Name: AvaTaxClient
4951
# @param model [Object] The address to resolve
5052
# @return [Object]
5153
def resolve_address_post(model) path = "/api/v2/addresses/resolve"
52-
post(path, model) end
54+
post(path, model, {}, "21.12.0") end
5355
end
5456
end
5557
end

lib/avatax/client/advancedrules.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,54 @@ module AdvancedRules
66
# Create a lookup file for a company
77
#
88
#
9+
# Swagger Name: AvaTaxClient
910
# @param accountId [Integer] The ID of the account for the company
1011
# @param companyId [Integer] The ID of the company for which the lookup file is to be created
1112
# @param model [Object] The lookup file you wish to create
1213
# @return [Object]
1314
def create_company_lookup_file(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
14-
post(path, model) end
15+
post(path, model, {}, "21.12.0") end
1516

1617
# Delete a lookup file
1718
#
1819
#
20+
# Swagger Name: AvaTaxClient
1921
# @param accountId [Integer] The ID of the account for the company the lookup file is for
2022
# @param id [String] The unique ID/GUID for the company lookup file to be deleted
2123
# @return [ErrorDetail[]]
2224
def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
23-
delete(path) end
25+
delete(path, {}, "21.12.0") end
2426

2527
# Get the lookup files for a company
2628
#
2729
#
30+
# Swagger Name: AvaTaxClient
2831
# @param accountId [Integer] The account ID for the company
2932
# @param companyId [Integer] The ID of the company for which to retrieve lookup files
3033
# @return [FetchResult]
3134
def get_company_lookup_files(accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
32-
get(path) end
35+
get(path, {}, "21.12.0") end
3336

3437
# Get a lookup file for an accountId and companyLookupFileId
3538
#
3639
#
40+
# Swagger Name: AvaTaxClient
3741
# @param accountId [Integer] The ID of the account for the lookup file
3842
# @param id [String] The unique ID/GUID of the company lookup file to return
3943
# @return [Object]
4044
def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
41-
get(path) end
45+
get(path, {}, "21.12.0") end
4246

4347
# Update a lookup file
4448
#
4549
#
50+
# Swagger Name: AvaTaxClient
4651
# @param accountId [Integer] The ID of the account for the company the lookup file is for
4752
# @param id [String] The unique ID/GUID of the company lookup file to be updated
4853
# @param model [Object] The new values to update the lookup file
4954
# @return [Object]
5055
def update_lookup_file(accountId, id, model) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
51-
put(path, model) end
56+
put(path, model, {}, "21.12.0") end
5257
end
5358
end
5459
end
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module AvaTax
2+
class Client
3+
module AgeVerification
4+
5+
6+
# Determines whether an individual meets or exceeds the minimum legal drinking age.
7+
#
8+
# The request must meet the following criteria in order to be evaluated:
9+
# * *firstName*, *lastName*, and *address* are required fields.
10+
# * One of the following sets of attributes are required for the *address*:
11+
# * *line1, city, region*
12+
# * *line1, postalCode*
13+
#
14+
# Optionally, the transaction and its lines may use the following parameters:
15+
# * A *DOB* (Date of Birth) field. The value should be ISO-8601 compliant (e.g. 2020-07-21).
16+
# * Beyond the required *address* fields above, a *country* field is permitted
17+
# * The valid values for this attribute are [*US, USA*]
18+
#
19+
# **Security Policies**
20+
# This API depends on the active subscription *AgeVerification*
21+
# Swagger Name: AvaTaxBeverageClient
22+
# @param simulatedFailureCode [String] (Optional) The failure code included in the simulated response of the endpoint. Note that this endpoint is only available in Sandbox for testing purposes.
23+
# @param model [Object] Information about the individual whose age is being verified.
24+
# @return [Object]
25+
def verify_age(model, options={}) path = "/api/v2/ageverification/verify"
26+
post(path, model, options, "") end
27+
end
28+
end
29+
end

0 commit comments

Comments
 (0)