avatax 20.7.0 → 21.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.vs/slnx.sqlite +0 -0
  3. data/lib/avatax/client/accounts.rb +22 -55
  4. data/lib/avatax/client/addresses.rb +7 -13
  5. data/lib/avatax/client/advancedrules.rb +10 -38
  6. data/lib/avatax/client/avafileforms.rb +15 -30
  7. data/lib/avatax/client/batches.rb +16 -40
  8. data/lib/avatax/client/certexpressinvites.rb +21 -30
  9. data/lib/avatax/client/certificates.rb +97 -142
  10. data/lib/avatax/client/companies.rb +137 -80
  11. data/lib/avatax/client/compliance.rb +2 -5
  12. data/lib/avatax/client/contacts.rb +12 -30
  13. data/lib/avatax/client/customers.rb +87 -126
  14. data/lib/avatax/client/datasources.rb +18 -36
  15. data/lib/avatax/client/definitions.rb +126 -303
  16. data/lib/avatax/client/distancethresholds.rb +12 -30
  17. data/lib/avatax/client/ecms.rb +26 -31
  18. data/lib/avatax/client/ecommercetoken.rb +37 -0
  19. data/lib/avatax/client/errortransactions.rb +27 -15
  20. data/lib/avatax/client/filingcalendars.rb +17 -5
  21. data/lib/avatax/client/filings.rb +15 -7
  22. data/lib/avatax/client/firmclientlinkages.rb +18 -45
  23. data/lib/avatax/client/free.rb +2 -84
  24. data/lib/avatax/client/fundingrequests.rb +6 -12
  25. data/lib/avatax/client/items.rb +38 -95
  26. data/lib/avatax/client/jurisdictionoverrides.rb +12 -30
  27. data/lib/avatax/client/locations.rb +128 -38
  28. data/lib/avatax/client/multidocument.rb +32 -62
  29. data/lib/avatax/client/nexus.rb +138 -37
  30. data/lib/avatax/client/notices.rb +47 -139
  31. data/lib/avatax/client/notifications.rb +6 -15
  32. data/lib/avatax/client/provisioning.rb +4 -10
  33. data/lib/avatax/client/registrar.rb +20 -50
  34. data/lib/avatax/client/reports.rb +17 -20
  35. data/lib/avatax/client/settings.rb +12 -30
  36. data/lib/avatax/client/subscriptions.rb +6 -15
  37. data/lib/avatax/client/taxcodes.rb +12 -30
  38. data/lib/avatax/client/taxcontent.rb +70 -16
  39. data/lib/avatax/client/taxprofiles.rb +14 -10
  40. data/lib/avatax/client/taxrules.rb +12 -30
  41. data/lib/avatax/client/transactions.rb +63 -126
  42. data/lib/avatax/client/upcs.rb +18 -36
  43. data/lib/avatax/client/users.rb +16 -40
  44. data/lib/avatax/client/utilities.rb +6 -15
  45. data/lib/avatax/configuration.rb +1 -1
  46. data/lib/avatax/request.rb +0 -2
  47. data/lib/avatax/version.rb +1 -1
  48. data/spec/avatax/request_spec.rb +25 -0
  49. metadata +4 -2
@@ -11,15 +11,12 @@ module AvaTax
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
17
  # @return [UPCModel[]]
18
- def create_u_p_cs(companyId, model)
19
- path = "/api/v2/companies/#{companyId}/upcs"
20
- post(path, model)
21
- end
22
-
18
+ def create_u_p_cs(companyId, model) path = "/api/v2/companies/#{companyId}/upcs"
19
+ post(path, model) end
23
20
 
24
21
  # Delete a single UPC
25
22
  #
@@ -28,15 +25,12 @@ module AvaTax
28
25
  # ### Security Policies
29
26
  #
30
27
  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
31
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
28
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
32
29
  # @param companyId [Integer] The ID of the company that owns this UPC.
33
30
  # @param id [Integer] The ID of the UPC you wish to delete.
34
31
  # @return [ErrorDetail[]]
35
- def delete_u_p_c(companyId, id)
36
- path = "/api/v2/companies/#{companyId}/upcs/#{id}"
37
- delete(path)
38
- end
39
-
32
+ def delete_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
33
+ delete(path) end
40
34
 
41
35
  # Retrieve a single UPC
42
36
  #
@@ -46,15 +40,12 @@ module AvaTax
46
40
  # ### Security Policies
47
41
  #
48
42
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
49
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
43
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
50
44
  # @param companyId [Integer] The ID of the company that owns this UPC
51
45
  # @param id [Integer] The primary key of this UPC
52
46
  # @return [Object]
53
- def get_u_p_c(companyId, id)
54
- path = "/api/v2/companies/#{companyId}/upcs/#{id}"
55
- get(path)
56
- end
57
-
47
+ def get_u_p_c(companyId, id) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
48
+ get(path) end
58
49
 
59
50
  # Retrieve UPCs for this company
60
51
  #
@@ -67,7 +58,7 @@ module AvaTax
67
58
  # ### Security Policies
68
59
  #
69
60
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
70
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
61
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
71
62
  # @param companyId [Integer] The ID of the company that owns these UPCs
72
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/).
73
64
  # @param include [String] A comma separated list of additional data to retrieve.
@@ -75,11 +66,8 @@ module AvaTax
75
66
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
76
67
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
77
68
  # @return [FetchResult]
78
- def list_u_p_cs_by_company(companyId, options={})
79
- path = "/api/v2/companies/#{companyId}/upcs"
80
- get(path, options)
81
- end
82
-
69
+ def list_u_p_cs_by_company(companyId, options={}) path = "/api/v2/companies/#{companyId}/upcs"
70
+ get(path, options) end
83
71
 
84
72
  # Retrieve all UPCs
85
73
  #
@@ -92,18 +80,15 @@ module AvaTax
92
80
  # ### Security Policies
93
81
  #
94
82
  # * This API requires one of the following user roles: AccountAdmin, AccountUser, CompanyAdmin, CompanyUser, CSPAdmin, CSPTester, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
95
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
83
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
96
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/).
97
85
  # @param include [String] A comma separated list of additional data to retrieve.
98
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.
99
87
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
100
88
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
101
89
  # @return [FetchResult]
102
- def query_u_p_cs(options={})
103
- path = "/api/v2/upcs"
104
- get(path, options)
105
- end
106
-
90
+ def query_u_p_cs(options={}) path = "/api/v2/upcs"
91
+ get(path, options) end
107
92
 
108
93
  # Update a single UPC
109
94
  #
@@ -115,16 +100,13 @@ module AvaTax
115
100
  # ### Security Policies
116
101
  #
117
102
  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, SSTAdmin, TechnicalSupportAdmin.
118
- # * This API depends on the following active services<br />*Required* (all): AvaUpc.
103
+ # * This API depends on the following active services:*Required* (all): AvaUpc.
119
104
  # @param companyId [Integer] The ID of the company that this UPC belongs to.
120
105
  # @param id [Integer] The ID of the UPC you wish to update
121
106
  # @param model [Object] The UPC you wish to update.
122
107
  # @return [Object]
123
- def update_u_p_c(companyId, id, model)
124
- path = "/api/v2/companies/#{companyId}/upcs/#{id}"
125
- put(path, model)
126
- end
127
-
108
+ def update_u_p_c(companyId, id, model) path = "/api/v2/companies/#{companyId}/upcs/#{id}"
109
+ put(path, model) end
128
110
  end
129
111
  end
130
112
  end
@@ -18,11 +18,8 @@ module AvaTax
18
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
20
  # @return [String]
21
- def change_password(model)
22
- path = "/api/v2/passwords"
23
- put(path, model)
24
- end
25
-
21
+ def change_password(model) path = "/api/v2/passwords"
22
+ put(path, model) end
26
23
 
27
24
  # Create new users
28
25
  #
@@ -42,11 +39,8 @@ module AvaTax
42
39
  # @param accountId [Integer] The unique ID number of the account where these users will be created.
43
40
  # @param model [UserModel[]] The user or array of users you wish to create.
44
41
  # @return [UserModel[]]
45
- def create_users(accountId, model)
46
- path = "/api/v2/accounts/#{accountId}/users"
47
- post(path, model)
48
- end
49
-
42
+ def create_users(accountId, model) path = "/api/v2/accounts/#{accountId}/users"
43
+ post(path, model) end
50
44
 
51
45
  # Delete a single user
52
46
  #
@@ -63,11 +57,8 @@ module AvaTax
63
57
  # @param id [Integer] The ID of the user you wish to delete.
64
58
  # @param accountId [Integer] The accountID of the user you wish to delete.
65
59
  # @return [ErrorDetail[]]
66
- def delete_user(id, accountId)
67
- path = "/api/v2/accounts/#{accountId}/users/#{id}"
68
- delete(path)
69
- end
70
-
60
+ def delete_user(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}"
61
+ delete(path) end
71
62
 
72
63
  # Retrieve a single user
73
64
  #
@@ -85,11 +76,8 @@ module AvaTax
85
76
  # @param accountId [Integer] The accountID of the user you wish to get.
86
77
  # @param include [String] Optional fetch commands.
87
78
  # @return [Object]
88
- def get_user(id, accountId, options={})
89
- path = "/api/v2/accounts/#{accountId}/users/#{id}"
90
- get(path, options)
91
- end
92
-
79
+ def get_user(id, accountId, options={}) path = "/api/v2/accounts/#{accountId}/users/#{id}"
80
+ get(path, options) end
93
81
 
94
82
  # Retrieve all entitlements for a single user
95
83
  #
@@ -115,11 +103,8 @@ module AvaTax
115
103
  # @param id [Integer] The ID of the user to retrieve.
116
104
  # @param accountId [Integer] The accountID of the user you wish to get.
117
105
  # @return [Object]
118
- def get_user_entitlements(id, accountId)
119
- path = "/api/v2/accounts/#{accountId}/users/#{id}/entitlements"
120
- get(path)
121
- end
122
-
106
+ def get_user_entitlements(id, accountId) path = "/api/v2/accounts/#{accountId}/users/#{id}/entitlements"
107
+ get(path) end
123
108
 
124
109
  # Retrieve users for this account
125
110
  #
@@ -146,11 +131,8 @@ module AvaTax
146
131
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
147
132
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
148
133
  # @return [FetchResult]
149
- def list_users_by_account(accountId, options={})
150
- path = "/api/v2/accounts/#{accountId}/users"
151
- get(path, options)
152
- end
153
-
134
+ def list_users_by_account(accountId, options={}) path = "/api/v2/accounts/#{accountId}/users"
135
+ get(path, options) end
154
136
 
155
137
  # Retrieve all users
156
138
  #
@@ -178,11 +160,8 @@ module AvaTax
178
160
  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
179
161
  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
180
162
  # @return [FetchResult]
181
- def query_users(options={})
182
- path = "/api/v2/users"
183
- get(path, options)
184
- end
185
-
163
+ def query_users(options={}) path = "/api/v2/users"
164
+ get(path, options) end
186
165
 
187
166
  # Update a single user
188
167
  #
@@ -198,11 +177,8 @@ module AvaTax
198
177
  # @param accountId [Integer] The accountID of the user you wish to update.
199
178
  # @param model [Object] The user object you wish to update.
200
179
  # @return [Object]
201
- def update_user(id, accountId, model)
202
- path = "/api/v2/accounts/#{accountId}/users/#{id}"
203
- put(path, model)
204
- end
205
-
180
+ def update_user(id, accountId, model) path = "/api/v2/accounts/#{accountId}/users/#{id}"
181
+ put(path, model) end
206
182
  end
207
183
  end
208
184
  end
@@ -15,11 +15,8 @@ module AvaTax
15
15
  # specific features of AvaTax.
16
16
  # @param serviceTypeId [String] The service to check
17
17
  # @return [Object]
18
- def get_my_subscription(serviceTypeId)
19
- path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
20
- get(path)
21
- end
22
-
18
+ def get_my_subscription(serviceTypeId) path = "/api/v2/utilities/subscriptions/#{serviceTypeId}"
19
+ get(path) end
23
20
 
24
21
  # List all services to which the current user is subscribed
25
22
  #
@@ -32,11 +29,8 @@ module AvaTax
32
29
  # or subscription to provide useful information to the current user as to whether they are entitled to use
33
30
  # specific features of AvaTax.
34
31
  # @return [FetchResult]
35
- def list_my_subscriptions()
36
- path = "/api/v2/utilities/subscriptions"
37
- get(path)
38
- end
39
-
32
+ def list_my_subscriptions() path = "/api/v2/utilities/subscriptions"
33
+ get(path) end
40
34
 
41
35
  # Tests connectivity and version of the service
42
36
  #
@@ -61,11 +55,8 @@ module AvaTax
61
55
  #
62
56
  # * This API may be called without providing authentication credentials.
63
57
  # @return [Object]
64
- def ping()
65
- path = "/api/v2/utilities/ping"
66
- get(path)
67
- end
68
-
58
+ def ping() path = "/api/v2/utilities/ping"
59
+ get(path) end
69
60
  end
70
61
  end
71
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 = {}
@@ -22,8 +22,6 @@ module AvaTax
22
22
 
23
23
  def request(method, path, model, options={})
24
24
  response = connection.send(method) do |request|
25
- # timeout in seconds
26
- request.options['timeout'] = 1200
27
25
  case method
28
26
  when :get, :delete
29
27
  request.url("#{URI.encode(path)}?#{URI.encode_www_form(options)}")
@@ -1,3 +1,3 @@
1
1
  module AvaTax
2
- VERSION = '20.7.0'.freeze unless defined?(::AvaTax::VERSION)
2
+ VERSION = '21.3.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.7.0
4
+ version: 21.3.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-07-16 00:00:00.000000000 Z
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -133,6 +133,7 @@ files:
133
133
  - lib/avatax/client/definitions.rb
134
134
  - lib/avatax/client/distancethresholds.rb
135
135
  - lib/avatax/client/ecms.rb
136
+ - lib/avatax/client/ecommercetoken.rb
136
137
  - lib/avatax/client/errortransactions.rb
137
138
  - lib/avatax/client/filingcalendars.rb
138
139
  - lib/avatax/client/filings.rb
@@ -169,6 +170,7 @@ files:
169
170
  - lib/avatax/version.rb
170
171
  - spec/avatax/client/accounts_spec.rb
171
172
  - spec/avatax/client/transactions_spec.rb
173
+ - spec/avatax/request_spec.rb
172
174
  - spec/avatax_spec.rb
173
175
  - spec/credentials.yaml.example
174
176
  - spec/fixtures/accounts.json