avatax 20.9.0 → 21.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.vs/slnx.sqlite +0 -0
  3. data/lib/avatax/client/accounts.rb +83 -83
  4. data/lib/avatax/client/addresses.rb +21 -21
  5. data/lib/avatax/client/advancedrules.rb +41 -51
  6. data/lib/avatax/client/avafileforms.rb +41 -41
  7. data/lib/avatax/client/batches.rb +62 -62
  8. data/lib/avatax/client/certexpressinvites.rb +39 -39
  9. data/lib/avatax/client/certificates.rb +163 -163
  10. data/lib/avatax/client/companies.rb +157 -156
  11. data/lib/avatax/client/contacts.rb +48 -48
  12. data/lib/avatax/client/customers.rb +145 -145
  13. data/lib/avatax/client/datasources.rb +48 -48
  14. data/lib/avatax/client/definitions.rb +591 -422
  15. data/lib/avatax/client/distancethresholds.rb +48 -48
  16. data/lib/avatax/client/ecms.rb +26 -31
  17. data/lib/avatax/client/ecommercetoken.rb +17 -17
  18. data/lib/avatax/client/errortransactions.rb +27 -15
  19. data/lib/avatax/client/filingcalendars.rb +48 -12
  20. data/lib/avatax/client/filings.rb +23 -21
  21. data/lib/avatax/client/firmclientlinkages.rb +69 -69
  22. data/lib/avatax/client/free.rb +13 -86
  23. data/lib/avatax/client/fundingrequests.rb +20 -20
  24. data/lib/avatax/client/items.rb +255 -137
  25. data/lib/avatax/client/jurisdictionoverrides.rb +48 -48
  26. data/lib/avatax/client/locations.rb +92 -92
  27. data/lib/avatax/client/multidocument.rb +78 -78
  28. data/lib/avatax/client/nexus.rb +133 -105
  29. data/lib/avatax/client/notices.rb +43 -504
  30. data/lib/avatax/client/notifications.rb +27 -27
  31. data/lib/avatax/client/provisioning.rb +20 -20
  32. data/lib/avatax/client/registrar.rb +85 -75
  33. data/lib/avatax/client/reports.rb +44 -35
  34. data/lib/avatax/client/settings.rb +55 -50
  35. data/lib/avatax/client/subscriptions.rb +27 -27
  36. data/lib/avatax/client/taxcodes.rb +48 -48
  37. data/lib/avatax/client/taxcontent.rb +90 -27
  38. data/lib/avatax/client/taxprofiles.rb +14 -10
  39. data/lib/avatax/client/taxrules.rb +50 -50
  40. data/lib/avatax/client/transactions.rb +155 -155
  41. data/lib/avatax/client/upcs.rb +48 -48
  42. data/lib/avatax/client/users.rb +64 -64
  43. data/lib/avatax/client/utilities.rb +27 -27
  44. data/lib/avatax/configuration.rb +1 -1
  45. data/lib/avatax/request.rb +11 -5
  46. data/lib/avatax/version.rb +1 -1
  47. data/spec/avatax/request_spec.rb +25 -0
  48. metadata +12 -4
@@ -1,54 +1,54 @@
1
- module AvaTax
2
- class Client
3
- module Upcs
4
-
5
-
6
- # Create a new UPC
7
- #
1
+ module AvaTax
2
+ class Client
3
+ module Upcs
4
+
5
+
6
+ # Create a new UPC
7
+ #
8
8
  # Create one or more new UPC objects attached to this company.
9
9
  # A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.
10
10
  #
11
11
  # ### Security Policies
12
12
  #
13
13
  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
14
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
14
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
15
15
  # @param companyId [Integer] The ID of the company that owns this UPC.
16
16
  # @param model [UPCModel[]] The UPC you wish to create.
17
- # @return [UPCModel[]]
18
- def create_u_p_cs(companyId, model) path = "/api/v2/companies/#{companyId}/upcs"
19
- post(path, model) end
20
-
21
- # Delete a single UPC
22
- #
17
+ # @return [UPCModel[]]
18
+ def create_u_p_cs(companyId, model) path = "/api/v2/companies/#{companyId}/upcs"
19
+ post(path, model) end
20
+
21
+ # Delete a single UPC
22
+ #
23
23
  # Marks the UPC object identified by this URL as deleted.
24
24
  #
25
25
  # ### Security Policies
26
26
  #
27
27
  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
28
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
28
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
29
29
  # @param companyId [Integer] The ID of the company that owns this UPC.
30
30
  # @param id [Integer] The ID of the UPC you wish to delete.
31
- # @return [ErrorDetail[]]
32
- def delete_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
33
- delete(path) end
34
-
35
- # Retrieve a single UPC
36
- #
31
+ # @return [ErrorDetail[]]
32
+ def delete_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
33
+ delete(path) end
34
+
35
+ # Retrieve a single UPC
36
+ #
37
37
  # Get the UPC object identified by this URL.
38
38
  # A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.
39
39
  #
40
40
  # ### Security Policies
41
41
  #
42
42
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
43
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
43
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
44
44
  # @param companyId [Integer] The ID of the company that owns this UPC
45
45
  # @param id [Integer] The primary key of this UPC
46
- # @return [Object]
47
- def get_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
48
- get(path) end
49
-
50
- # Retrieve UPCs for this company
51
- #
46
+ # @return [Object]
47
+ def get_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
48
+ get(path) end
49
+
50
+ # Retrieve UPCs for this company
51
+ #
52
52
  # List all UPC objects attached to this company.
53
53
  # A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.
54
54
  #
@@ -58,19 +58,19 @@ module AvaTax
58
58
  # ### Security Policies
59
59
  #
60
60
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
61
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
61
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
62
62
  # @param companyId [Integer] The ID of the company that owns these UPCs
63
63
  # @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/).
64
64
  # @param include [String] A comma separated list of additional data to retrieve.
65
65
  # @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.
66
66
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
67
67
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
68
- # @return [FetchResult]
69
- def list_u_p_cs_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/upcs"
70
- get(path, options) end
71
-
72
- # Retrieve all UPCs
73
- #
68
+ # @return [FetchResult]
69
+ def list_u_p_cs_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/upcs"
70
+ get(path, options) end
71
+
72
+ # Retrieve all UPCs
73
+ #
74
74
  # Get multiple UPC objects across all companies.
75
75
  # A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.
76
76
  #
@@ -80,18 +80,18 @@ module AvaTax
80
80
  # ### Security Policies
81
81
  #
82
82
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
83
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
83
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
84
84
  # @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/).
85
85
  # @param include [String] A comma separated list of additional data to retrieve.
86
86
  # @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.
87
87
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
88
88
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
89
- # @return [FetchResult]
90
- def query_u_p_cs(options={}) path = "/api/v2/upcs"
91
- get(path, options) end
92
-
93
- # Update a single UPC
94
- #
89
+ # @return [FetchResult]
90
+ def query_u_p_cs(options={}) path = "/api/v2/upcs"
91
+ get(path, options) end
92
+
93
+ # Update a single UPC
94
+ #
95
95
  # Replace the existing UPC object at this URL with an updated object.
96
96
  # A UPC represents a single UPC code in your catalog and matches this product to the tax code identified by this UPC.
97
97
  # All data from the existing object will be replaced with data in the object you PUT.
@@ -100,13 +100,13 @@ module AvaTax
100
100
  # ### Security Policies
101
101
  #
102
102
  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
103
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
103
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
104
104
  # @param companyId [Integer] The ID of the company that this UPC belongs to.
105
105
  # @param id [Integer] The ID of the UPC you wish to update
106
106
  # @param model [Object] The UPC you wish to update.
107
- # @return [Object]
108
- def update_u_p_c(companyId, id, model) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
109
- put(path, model) end
110
- end
111
- end
107
+ # @return [Object]
108
+ def update_u_p_c(companyId, id, model) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
109
+ put(path, model) end
110
+ end
111
+ end
112
112
  end
@@ -1,10 +1,10 @@
1
- module AvaTax
2
- class Client
3
- module Users
4
-
5
-
6
- # Change Password
7
- #
1
+ module AvaTax
2
+ class Client
3
+ module Users
4
+
5
+
6
+ # Change Password
7
+ #
8
8
  # Allows a user to change their password via an API call.
9
9
  #
10
10
  # This API allows an authenticated user to change their password via an API call. This feature is only available
@@ -15,14 +15,14 @@ module AvaTax
15
15
  #
16
16
  # ### Security Policies
17
17
  #
18
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
18
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
19
19
  # @param model [Object] An object containing your current password and the new password.
20
- # @return [String]
21
- def change_password(model) path = "/api/v2/passwords"
22
- put(path, model) end
23
-
24
- # Create new users
25
- #
20
+ # @return [String]
21
+ def change_password(model) path = "/api/v2/passwords"
22
+ put(path, model) end
23
+
24
+ # Create new users
25
+ #
26
26
  # Create one or more new user objects attached to this account.
27
27
  #
28
28
  # A user represents one person with access privileges to make API calls and work with a specific account.
@@ -35,15 +35,15 @@ module AvaTax
35
35
  #
36
36
  # ### Security Policies
37
37
  #
38
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
38
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
39
39
  # @param accountId [Integer] The unique ID number of the account where these users will be created.
40
40
  # @param model [UserModel[]] The user or array of users you wish to create.
41
- # @return [UserModel[]]
42
- def create_users(accountId, model) path = "/api/v2/accounts/#{accountId}/users"
43
- post(path, model) end
44
-
45
- # Delete a single user
46
- #
41
+ # @return [UserModel[]]
42
+ def create_users(accountId, model) path = "/api/v2/accounts/#{accountId}/users"
43
+ post(path, model) end
44
+
45
+ # Delete a single user
46
+ #
47
47
  # Mark the user object identified by this URL as deleted.
48
48
  #
49
49
  # This API is available for use by account and company administrators only.
@@ -53,15 +53,15 @@ module AvaTax
53
53
  #
54
54
  # ### Security Policies
55
55
  #
56
- # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, CSPTester, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TreasuryAdmin.
56
+ # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, Compliance Root User, CSPTester, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TreasuryAdmin.
57
57
  # @param id [Integer] The ID of the user you wish to delete.
58
58
  # @param accountId [Integer] The accountID of the user you wish to delete.
59
- # @return [ErrorDetail[]]
60
- def delete_user(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}"
61
- delete(path) end
62
-
63
- # Retrieve a single user
64
- #
59
+ # @return [ErrorDetail[]]
60
+ def delete_user(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}"
61
+ delete(path) end
62
+
63
+ # Retrieve a single user
64
+ #
65
65
  # Get the user object identified by this URL.
66
66
  # A user represents one person with access privileges to make API calls and work with a specific account.
67
67
  #
@@ -71,16 +71,16 @@ module AvaTax
71
71
  #
72
72
  # ### Security Policies
73
73
  #
74
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
74
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
75
75
  # @param id [Integer] The ID of the user to retrieve.
76
76
  # @param accountId [Integer] The accountID of the user you wish to get.
77
77
  # @param include [String] Optional fetch commands.
78
- # @return [Object]
79
- def get_user(id, accountId, options={}) path = "/api/v2/accounts/#{accountId}/users/#{id}"
80
- get(path, options) end
81
-
82
- # Retrieve all entitlements for a single user
83
- #
78
+ # @return [Object]
79
+ def get_user(id, accountId, options={}) path = "/api/v2/accounts/#{accountId}/users/#{id}"
80
+ get(path, options) end
81
+
82
+ # Retrieve all entitlements for a single user
83
+ #
84
84
  # Return a list of all entitlements to which this user has rights to access.
85
85
  # Entitlements are a list of specified API calls the user is permitted to make, a list of identifier numbers for companies the user is
86
86
  # allowed to use, and an access level identifier that indicates what types of access roles the user is allowed to use.
@@ -99,15 +99,15 @@ module AvaTax
99
99
  #
100
100
  # ### Security Policies
101
101
  #
102
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
102
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
103
103
  # @param id [Integer] The ID of the user to retrieve.
104
104
  # @param accountId [Integer] The accountID of the user you wish to get.
105
- # @return [Object]
106
- def get_user_entitlements(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}/entitlements"
107
- get(path) end
108
-
109
- # Retrieve users for this account
110
- #
105
+ # @return [Object]
106
+ def get_user_entitlements(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}/entitlements"
107
+ get(path) end
108
+
109
+ # Retrieve users for this account
110
+ #
111
111
  # List all user objects attached to this account.
112
112
  # A user represents one person with access privileges to make API calls and work with a specific account.
113
113
  #
@@ -123,19 +123,19 @@ module AvaTax
123
123
  #
124
124
  # ### Security Policies
125
125
  #
126
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
126
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
127
127
  # @param accountId [Integer] The accountID of the user you wish to list.
128
128
  # @param include [String] Optional fetch commands.
129
- # @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/).
129
+ # @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:* SuppressNewUserEmail
130
130
  # @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.
131
131
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
132
132
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
133
- # @return [FetchResult]
134
- def list_users_by_account(accountId, options={}) path = "/api/v2/accounts/#{accountId}/users"
135
- get(path, options) end
136
-
137
- # Retrieve all users
138
- #
133
+ # @return [FetchResult]
134
+ def list_users_by_account(accountId, options={}) path = "/api/v2/accounts/#{accountId}/users"
135
+ get(path, options) end
136
+
137
+ # Retrieve all users
138
+ #
139
139
  # Get multiple user objects across all accounts.
140
140
  #
141
141
  # A user represents one person or set of credentials with access privileges to make API calls and work with a specific account. A user can be authenticated
@@ -153,18 +153,18 @@ module AvaTax
153
153
  #
154
154
  # ### Security Policies
155
155
  #
156
- # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
156
+ # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPAdmin, CSPTester, FirmAdmin, FirmUser, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, SystemOperator, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
157
157
  # @param include [String] Optional fetch commands.
158
- # @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/).
158
+ # @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:* SuppressNewUserEmail
159
159
  # @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.
160
160
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
161
161
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
162
- # @return [FetchResult]
163
- def query_users(options={}) path = "/api/v2/users"
164
- get(path, options) end
165
-
166
- # Update a single user
167
- #
162
+ # @return [FetchResult]
163
+ def query_users(options={}) path = "/api/v2/users"
164
+ get(path, options) end
165
+
166
+ # Update a single user
167
+ #
168
168
  # Replace the existing user object at this URL with an updated object.
169
169
  # A user represents one person with access privileges to make API calls and work with a specific account.
170
170
  # All data from the existing object will be replaced with data in the object you PUT.
@@ -172,13 +172,13 @@ module AvaTax
172
172
  #
173
173
  # ### Security Policies
174
174
  #
175
- # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
175
+ # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, Compliance Root User, ComplianceAdmin, ComplianceUser, CSPTester, FirmAdmin, FirmUser, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
176
176
  # @param id [Integer] The ID of the user you wish to update.
177
177
  # @param accountId [Integer] The accountID of the user you wish to update.
178
178
  # @param model [Object] The user object you wish to update.
179
- # @return [Object]
180
- def update_user(id, accountId, model) path = "/api/v2/accounts/#{accountId}/users/#{id}"
181
- put(path, model) end
182
- end
183
- end
179
+ # @return [Object]
180
+ def update_user(id, accountId, model) path = "/api/v2/accounts/#{accountId}/users/#{id}"
181
+ put(path, model) end
182
+ end
183
+ end
184
184
  end
@@ -1,10 +1,10 @@
1
- module AvaTax
2
- class Client
3
- module Utilities
4
-
5
-
6
- # Checks if the current user is subscribed to a specific service
7
- #
1
+ module AvaTax
2
+ class Client
3
+ module Utilities
4
+
5
+
6
+ # Checks if the current user is subscribed to a specific service
7
+ #
8
8
  # Returns a subscription object for the current account, or 404 Not Found if this subscription is not enabled for this account.
9
9
  #
10
10
  # This API will return an error if it is called with invalid authentication credentials.
@@ -12,14 +12,14 @@ module AvaTax
12
12
  # This API is intended to help you determine whether you have the necessary subscription to use certain API calls
13
13
  # within AvaTax. You can examine the subscriptions returned from this API call to look for a particular product
14
14
  # or subscription to provide useful information to the current user as to whether they are entitled to use
15
- # specific features of AvaTax.
15
+ # specific features of AvaTax.
16
16
  # @param serviceTypeId [String] The service to check
17
- # @return [Object]
18
- def get_my_subscription(serviceTypeId) path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
19
- get(path) end
20
-
21
- # List all services to which the current user is subscribed
22
- #
17
+ # @return [Object]
18
+ def get_my_subscription(serviceTypeId) path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
19
+ get(path) end
20
+
21
+ # List all services to which the current user is subscribed
22
+ #
23
23
  # Returns the list of all subscriptions enabled for the currently logged in user.
24
24
  #
25
25
  # This API will return an error if it is called with invalid authentication credentials.
@@ -27,13 +27,13 @@ module AvaTax
27
27
  # This API is intended to help you determine whether you have the necessary subscription to use certain API calls
28
28
  # within AvaTax. You can examine the subscriptions returned from this API call to look for a particular product
29
29
  # or subscription to provide useful information to the current user as to whether they are entitled to use
30
- # specific features of AvaTax.
31
- # @return [FetchResult]
32
- def list_my_subscriptions() path = "/api/v2/utilities/subscriptions"
33
- get(path) end
34
-
35
- # Tests connectivity and version of the service
36
- #
30
+ # specific features of AvaTax.
31
+ # @return [FetchResult]
32
+ def list_my_subscriptions() path = "/api/v2/utilities/subscriptions"
33
+ get(path) end
34
+
35
+ # Tests connectivity and version of the service
36
+ #
37
37
  # Check connectivity to AvaTax and return information about the AvaTax API server.
38
38
  #
39
39
  # This API is intended to help you verify that your connection is working. This API will always succeed and will
@@ -53,10 +53,10 @@ module AvaTax
53
53
  #
54
54
  # ### Security Policies
55
55
  #
56
- # * This API may be called without providing authentication credentials.
57
- # @return [Object]
58
- def ping() path = "/api/v2/utilities/ping"
59
- get(path) end
60
- end
61
- end
56
+ # * This API may be called without providing authentication credentials.
57
+ # @return [Object]
58
+ def ping() path = "/api/v2/utilities/ping"
59
+ get(path) end
60
+ end
61
+ end
62
62
  end
@@ -29,7 +29,7 @@ module AvaTax
29
29
  DEFAULT_USER_AGENT = "AvaTax Ruby Gem #{AvaTax::VERSION}".freeze
30
30
  DEFAULT_USERNAME = nil
31
31
  DEFAULT_PASSWORD = nil
32
- DEFAULT_CONNECTION_OPTIONS = {}
32
+ DEFAULT_CONNECTION_OPTIONS = {request: {timeout: 1200}} # timeout in seconds
33
33
  DEFAULT_LOGGER = false
34
34
  DEFAULT_CUSTOM_LOGGER = nil
35
35
  DEFAULT_CUSTOM_LOGGER_OPTIONS = {}
@@ -1,5 +1,7 @@
1
1
  require 'faraday'
2
2
  require 'json'
3
+ require "erb"
4
+
3
5
 
4
6
  module AvaTax
5
7
  module Request
@@ -22,13 +24,11 @@ module AvaTax
22
24
 
23
25
  def request(method, path, model, options={})
24
26
  response = connection.send(method) do |request|
25
- # timeout in seconds
26
- request.options['timeout'] = 1200
27
27
  case method
28
28
  when :get, :delete
29
- request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
29
+ request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}")
30
30
  when :post, :put
31
- request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
31
+ request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}")
32
32
  request.headers['Content-Type'] = 'application/json'
33
33
  request.body = model.to_json unless model.empty?
34
34
  end
@@ -40,5 +40,11 @@ module AvaTax
40
40
  response.body
41
41
  end
42
42
  end
43
+
44
+ private
45
+
46
+ def encode_path(path)
47
+ path.split('/').map { |part| ERB::Util.url_encode(part) }.join('/')
48
+ end
43
49
  end
44
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module AvaTax
2
- VERSION = '20.9.0'.freeze unless defined?(::AvaTax::VERSION)
2
+ VERSION = '21.10.0'.freeze unless defined?(::AvaTax::VERSION)
3
3
  end
@@ -0,0 +1,25 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+
3
+ describe AvaTax::Request do
4
+
5
+ describe ".request" do
6
+ it "should default to a 1200 second timeout" do
7
+ @client.faraday_response = true
8
+ response = @client.request(:get, 'path', 'model')
9
+ expect(response.env.request['timeout']).to eq(1200)
10
+ end
11
+
12
+ it "should allow setting a custom timeout" do
13
+ @client.faraday_response = true
14
+ @client.connection_options = {
15
+ request: {
16
+ open_timeout: 5,
17
+ timeout: 10
18
+ }
19
+ }
20
+ response = @client.request(:get, 'path', 'model')
21
+ expect(response.env.request['open_timeout']).to eq(5)
22
+ expect(response.env.request['timeout']).to eq(10)
23
+ end
24
+ end
25
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatax
3
3
  version: !ruby/object:Gem::Version
4
- version: 20.9.0
4
+ version: 21.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcus Vorwaller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-14 00:00:00.000000000 Z
11
+ date: 2021-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -170,6 +170,7 @@ files:
170
170
  - lib/avatax/version.rb
171
171
  - spec/avatax/client/accounts_spec.rb
172
172
  - spec/avatax/client/transactions_spec.rb
173
+ - spec/avatax/request_spec.rb
173
174
  - spec/avatax_spec.rb
174
175
  - spec/credentials.yaml.example
175
176
  - spec/fixtures/accounts.json
@@ -205,8 +206,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
206
  - !ruby/object:Gem::Version
206
207
  version: 2.0.0
207
208
  requirements: []
208
- rubygems_version: 3.0.8
209
+ rubygems_version: 3.0.3
209
210
  signing_key:
210
211
  specification_version: 4
211
212
  summary: Ruby wrapper for the AvaTax API
212
- test_files: []
213
+ test_files:
214
+ - spec/avatax/client/accounts_spec.rb
215
+ - spec/avatax/client/transactions_spec.rb
216
+ - spec/avatax/request_spec.rb
217
+ - spec/avatax_spec.rb
218
+ - spec/credentials.yaml.example
219
+ - spec/fixtures/accounts.json
220
+ - spec/spec_helper.rb