avatax 21.6.0 → 21.10.0

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/lib/avatax/client/accounts.rb +83 -83
  3. data/lib/avatax/client/addresses.rb +20 -20
  4. data/lib/avatax/client/advancedrules.rb +41 -41
  5. data/lib/avatax/client/avafileforms.rb +41 -41
  6. data/lib/avatax/client/batches.rb +62 -62
  7. data/lib/avatax/client/certexpressinvites.rb +27 -27
  8. data/lib/avatax/client/certificates.rb +111 -111
  9. data/lib/avatax/client/companies.rb +153 -153
  10. data/lib/avatax/client/contacts.rb +48 -48
  11. data/lib/avatax/client/customers.rb +97 -97
  12. data/lib/avatax/client/datasources.rb +48 -48
  13. data/lib/avatax/client/definitions.rb +558 -443
  14. data/lib/avatax/client/distancethresholds.rb +48 -48
  15. data/lib/avatax/client/ecommercetoken.rb +16 -16
  16. data/lib/avatax/client/filingcalendars.rb +41 -20
  17. data/lib/avatax/client/filings.rb +22 -20
  18. data/lib/avatax/client/firmclientlinkages.rb +69 -69
  19. data/lib/avatax/client/free.rb +13 -13
  20. data/lib/avatax/client/fundingrequests.rb +20 -20
  21. data/lib/avatax/client/items.rb +185 -181
  22. data/lib/avatax/client/jurisdictionoverrides.rb +48 -48
  23. data/lib/avatax/client/locations.rb +90 -90
  24. data/lib/avatax/client/multidocument.rb +76 -76
  25. data/lib/avatax/client/nexus.rb +133 -105
  26. data/lib/avatax/client/notices.rb +22 -22
  27. data/lib/avatax/client/notifications.rb +27 -27
  28. data/lib/avatax/client/provisioning.rb +20 -20
  29. data/lib/avatax/client/registrar.rb +85 -75
  30. data/lib/avatax/client/reports.rb +34 -34
  31. data/lib/avatax/client/settings.rb +48 -48
  32. data/lib/avatax/client/subscriptions.rb +27 -27
  33. data/lib/avatax/client/taxcodes.rb +48 -48
  34. data/lib/avatax/client/taxcontent.rb +41 -41
  35. data/lib/avatax/client/taxrules.rb +50 -50
  36. data/lib/avatax/client/transactions.rb +153 -153
  37. data/lib/avatax/client/upcs.rb +48 -48
  38. data/lib/avatax/client/users.rb +62 -62
  39. data/lib/avatax/client/utilities.rb +27 -27
  40. data/lib/avatax/request.rb +11 -3
  41. data/lib/avatax/version.rb +1 -1
  42. metadata +11 -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:*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:*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:*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:*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:*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:*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
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
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
@@ -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
@@ -24,9 +26,9 @@ module AvaTax
24
26
  response = connection.send(method) do |request|
25
27
  case method
26
28
  when :get, :delete
27
- request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
29
+ request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}")
28
30
  when :post, :put
29
- request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
31
+ request.url("#{encode_path(path)}?#{URI.encode_www_form(options)}")
30
32
  request.headers['Content-Type'] = 'application/json'
31
33
  request.body = model.to_json unless model.empty?
32
34
  end
@@ -38,5 +40,11 @@ module AvaTax
38
40
  response.body
39
41
  end
40
42
  end
43
+
44
+ private
45
+
46
+ def encode_path(path)
47
+ path.split('/').map { |part| ERB::Util.url_encode(part) }.join('/')
48
+ end
41
49
  end
42
- end
50
+ end
@@ -1,3 +1,3 @@
1
1
  module AvaTax
2
- VERSION = '21.6.0'.freeze unless defined?(::AvaTax::VERSION)
2
+ VERSION = '21.10.0'.freeze unless defined?(::AvaTax::VERSION)
3
3
  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: 21.6.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: 2021-06-11 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
@@ -206,8 +206,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  - !ruby/object:Gem::Version
207
207
  version: 2.0.0
208
208
  requirements: []
209
- rubygems_version: 3.0.8
209
+ rubygems_version: 3.0.3
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: Ruby wrapper for the AvaTax API
213
- 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