Skip to content

Commit d4ed2e7

Browse files
authored
Merge pull request #79 from avadev/20-7-update
Update for 20-7-update
2 parents fc91942 + 59c2b9b commit d4ed2e7

38 files changed

+609
-1521
lines changed

lib/avatax/client/accounts.rb

Lines changed: 22 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ module Accounts
2626
# @param id [Integer] The ID of the account you wish to update.
2727
# @param model [Object] A request confirming that you wish to reset the license key of this account.
2828
# @return [Object]
29-
def account_reset_license_key(id, model)
30-
path = "/api/v2/accounts/#{id}/resetlicensekey"
31-
post(path, model)
32-
end
33-
29+
def account_reset_license_key(id, model) path = "/api/v2/accounts/#{id}/resetlicensekey"
30+
post(path, model) end
3431

3532
# Activate an account by accepting terms and conditions
3633
#
@@ -51,11 +48,8 @@ def account_reset_license_key(id, model)
5148
# @param id [Integer] The ID of the account to activate
5249
# @param model [Object] The activation request
5350
# @return [Object]
54-
def activate_account(id, model)
55-
path = "/api/v2/accounts/#{id}/activate"
56-
post(path, model)
57-
end
58-
51+
def activate_account(id, model) path = "/api/v2/accounts/#{id}/activate"
52+
post(path, model) end
5953

6054
# Retrieve audit history for an account.
6155
#
@@ -83,11 +77,8 @@ def activate_account(id, model)
8377
# @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.
8478
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
8579
# @return [FetchResult]
86-
def audit_account(id, options={})
87-
path = "/api/v2/accounts/#{id}/audit"
88-
get(path, options)
89-
end
90-
80+
def audit_account(id, options={}) path = "/api/v2/accounts/#{id}/audit"
81+
get(path, options) end
9182

9283
# Create license key for this account
9384
#
@@ -108,11 +99,8 @@ def audit_account(id, options={})
10899
# @param id [Integer] The ID of the account you wish to update.
109100
# @param model [Object]
110101
# @return [Object]
111-
def create_license_key(id, model)
112-
path = "/api/v2/accounts/#{id}/licensekey"
113-
post(path, model)
114-
end
115-
102+
def create_license_key(id, model) path = "/api/v2/accounts/#{id}/licensekey"
103+
post(path, model) end
116104

117105
# Delete license key for this account by license key name
118106
#
@@ -128,11 +116,8 @@ def create_license_key(id, model)
128116
# @param id [Integer] The ID of the account you wish to update.
129117
# @param licensekeyname [String] The license key name you wish to update.
130118
# @return [ErrorDetail[]]
131-
def delete_license_key(id, licensekeyname)
132-
path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
133-
delete(path)
134-
end
135-
119+
def delete_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
120+
delete(path) end
136121

137122
# Retrieve a single account
138123
#
@@ -148,11 +133,8 @@ def delete_license_key(id, licensekeyname)
148133
# @param id [Integer] The ID of the account to retrieve
149134
# @param include [String] A comma separated list of special fetch options
150135
# @return [Object]
151-
def get_account(id, options={})
152-
path = "/api/v2/accounts/#{id}"
153-
get(path, options)
154-
end
155-
136+
def get_account(id, options={}) path = "/api/v2/accounts/#{id}"
137+
get(path, options) end
156138

157139
# Get configuration settings for this account
158140
#
@@ -174,11 +156,8 @@ def get_account(id, options={})
174156
# * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
175157
# @param id [Integer]
176158
# @return [AccountConfigurationModel[]]
177-
def get_account_configuration(id)
178-
path = "/api/v2/accounts/#{id}/configuration"
179-
get(path)
180-
end
181-
159+
def get_account_configuration(id) path = "/api/v2/accounts/#{id}/configuration"
160+
get(path) end
182161

183162
# Retrieve license key by license key name
184163
#
@@ -188,11 +167,8 @@ def get_account_configuration(id)
188167
# @param id [Integer] The ID of the account to retrieve
189168
# @param licensekeyname [String] The ID of the account to retrieve
190169
# @return [Object]
191-
def get_license_key(id, licensekeyname)
192-
path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
193-
get(path)
194-
end
195-
170+
def get_license_key(id, licensekeyname) path = "/api/v2/accounts/#{id}/licensekey/#{licensekeyname}"
171+
get(path) end
196172

197173
# Retrieve all license keys for this account
198174
#
@@ -203,11 +179,8 @@ def get_license_key(id, licensekeyname)
203179
# * 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.
204180
# @param id [Integer] The ID of the account to retrieve
205181
# @return [AccountLicenseKeyModel[]]
206-
def get_license_keys(id)
207-
path = "/api/v2/accounts/#{id}/licensekeys"
208-
get(path)
209-
end
210-
182+
def get_license_keys(id) path = "/api/v2/accounts/#{id}/licensekeys"
183+
get(path) end
211184

212185
# Retrieve all accounts
213186
#
@@ -233,11 +206,8 @@ def get_license_keys(id)
233206
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
234207
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
235208
# @return [FetchResult]
236-
def query_accounts(options={})
237-
path = "/api/v2/accounts"
238-
get(path, options)
239-
end
240-
209+
def query_accounts(options={}) path = "/api/v2/accounts"
210+
get(path, options) end
241211

242212
# Change configuration settings for this account
243213
#
@@ -260,11 +230,8 @@ def query_accounts(options={})
260230
# @param id [Integer]
261231
# @param model [AccountConfigurationModel[]]
262232
# @return [AccountConfigurationModel[]]
263-
def set_account_configuration(id, model)
264-
path = "/api/v2/accounts/#{id}/configuration"
265-
post(path, model)
266-
end
267-
233+
def set_account_configuration(id, model) path = "/api/v2/accounts/#{id}/configuration"
234+
post(path, model) end
268235
end
269236
end
270237
end

lib/avatax/client/addresses.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,8 @@ module Addresses
3030
# @param country [String] Two character ISO 3166 Country Code (see /api/v2/definitions/countries for a full list)
3131
# @param textCase [String] selectable text case for address validation (See TextCase::* for a list of allowable values)
3232
# @return [Object]
33-
def resolve_address(options={})
34-
path = "/api/v2/addresses/resolve"
35-
get(path, options)
36-
end
37-
33+
def resolve_address(options={}) path = "/api/v2/addresses/resolve"
34+
get(path, options) end
3835

3936
# Retrieve geolocation information for a specified address
4037
#
@@ -51,11 +48,8 @@ def resolve_address(options={})
5148
# * This API depends on the following active services<br />*Required* (all): AutoAddress.
5249
# @param model [Object] The address to resolve
5350
# @return [Object]
54-
def resolve_address_post(model)
55-
path = "/api/v2/addresses/resolve"
56-
post(path, model)
57-
end
58-
51+
def resolve_address_post(model) path = "/api/v2/addresses/resolve"
52+
post(path, model) end
5953
end
6054
end
6155
end

lib/avatax/client/advancedrules.rb

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,17 @@ module AdvancedRules
1010
# @param companyId [Integer] The ID of the company for which the lookup file is to be created
1111
# @param model [Object] The lookup file you wish to create
1212
# @return [Object]
13-
def create_company_lookup_file(accountId, companyId, model)
14-
path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
15-
post(path, model)
16-
end
17-
13+
def create_company_lookup_file(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
14+
post(path, model) end
1815

1916
# Delete a lookup file
2017
#
2118
#
2219
# @param accountId [Integer] The ID of the account for the company the lookup file is for
2320
# @param id [String] The unique ID/GUID for the company lookup file to be deleted
2421
# @return [ErrorDetail[]]
25-
def delete_lookup_file(accountId, id)
26-
path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
27-
delete(path)
28-
end
29-
22+
def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
23+
delete(path) end
3024

3125
# Get audit records by account id and date range.
3226
#
@@ -35,35 +29,26 @@ def delete_lookup_file(accountId, id)
3529
# @param fromDate [String] Date
3630
# @param toDate [String] Date
3731
# @return [Object]
38-
def get_audit_records(accountId, fromDate, toDate)
39-
path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
40-
get(path)
41-
end
42-
32+
def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
33+
get(path) end
4334

4435
# Get the lookup files for a company
4536
#
4637
#
4738
# @param accountId [Integer] The account ID for the company
4839
# @param companyId [Integer] The ID of the company for which to retrieve lookup files
4940
# @return [FetchResult]
50-
def get_company_lookup_files(accountId, companyId)
51-
path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
52-
get(path)
53-
end
54-
41+
def get_company_lookup_files(accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
42+
get(path) end
5543

5644
# Get a lookup file for an accountId and companyLookupFileId
5745
#
5846
#
5947
# @param accountId [Integer] The ID of the account for the lookup file
6048
# @param id [String] The unique ID/GUID of the company lookup file to return
6149
# @return [Object]
62-
def get_lookup_file(accountId, id)
63-
path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
64-
get(path)
65-
end
66-
50+
def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
51+
get(path) end
6752

6853
# Update a lookup file
6954
#
@@ -72,11 +57,8 @@ def get_lookup_file(accountId, id)
7257
# @param id [String] The unique ID/GUID of the company lookup file to be updated
7358
# @param model [Object] The new values to update the lookup file
7459
# @return [Object]
75-
def update_lookup_file(accountId, id, model)
76-
path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
77-
put(path, model)
78-
end
79-
60+
def update_lookup_file(accountId, id, model) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
61+
put(path, model) end
8062
end
8163
end
8264
end

lib/avatax/client/avafileforms.rb

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ module AvaFileForms
1414
# * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
1515
# @param model [AvaFileFormModel[]] The AvaFileForm you wish to create.
1616
# @return [AvaFileFormModel[]]
17-
def create_ava_file_forms(model)
18-
path = "/api/v2/avafileforms"
19-
post(path, model)
20-
end
21-
17+
def create_ava_file_forms(model) path = "/api/v2/avafileforms"
18+
post(path, model) end
2219

2320
# Delete a single AvaFileForm
2421
#
@@ -30,11 +27,8 @@ def create_ava_file_forms(model)
3027
# * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
3128
# @param id [Integer] The ID of the AvaFileForm you wish to delete.
3229
# @return [ErrorDetail[]]
33-
def delete_ava_file_form(id)
34-
path = "/api/v2/avafileforms/#{id}"
35-
delete(path)
36-
end
37-
30+
def delete_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
31+
delete(path) end
3832

3933
# Retrieve a single AvaFileForm
4034
#
@@ -46,11 +40,8 @@ def delete_ava_file_form(id)
4640
# * This API depends on the following active services<br />*Returns* (at least one of): Mrs, MRSComplianceManager, AvaTaxCsp.<br />*Firm Managed* (for accounts managed by a firm): ARA, ARAManaged.
4741
# @param id [Integer] The primary key of this AvaFileForm
4842
# @return [Object]
49-
def get_ava_file_form(id)
50-
path = "/api/v2/avafileforms/#{id}"
51-
get(path)
52-
end
53-
43+
def get_ava_file_form(id) path = "/api/v2/avafileforms/#{id}"
44+
get(path) end
5445

5546
# Retrieve all AvaFileForms
5647
#
@@ -66,11 +57,8 @@ def get_ava_file_form(id)
6657
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
6758
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
6859
# @return [FetchResult]
69-
def query_ava_file_forms(options={})
70-
path = "/api/v2/avafileforms"
71-
get(path, options)
72-
end
73-
60+
def query_ava_file_forms(options={}) path = "/api/v2/avafileforms"
61+
get(path, options) end
7462

7563
# Update a AvaFileForm
7664
#
@@ -84,11 +72,8 @@ def query_ava_file_forms(options={})
8472
# @param id [Integer] The ID of the AvaFileForm you wish to update
8573
# @param model [Object] The AvaFileForm model you wish to update.
8674
# @return [Object]
87-
def update_ava_file_form(id, model)
88-
path = "/api/v2/avafileforms/#{id}"
89-
put(path, model)
90-
end
91-
75+
def update_ava_file_form(id, model) path = "/api/v2/avafileforms/#{id}"
76+
put(path, model) end
9277
end
9378
end
9479
end

0 commit comments

Comments
 (0)