Skip to content

Commit

Permalink
Add 2.9.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
shilpa-khanal committed Nov 3, 2020
1 parent d4ed2e7 commit ad57ae4
Show file tree
Hide file tree
Showing 18 changed files with 1,267 additions and 204 deletions.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
154 changes: 154 additions & 0 deletions lib/avatax/client/advancedrules.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ class Client
module AdvancedRules


# Copy an existing advanced rule to a new environment
#
#
# @param ruleId [String]
# @param model [Object]
# @return [Object]
def copy_advanced_rule(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/copy"
put(path, model) end

# Create an advanced rule
#
#
# @param model [Object] The advanced rule you wish to create
# @return [Object]
def create_advanced_rule(model) path = "/api/v2/advancedrules/rules"
post(path, model) end

# Create a lookup file for a company
#
#
Expand All @@ -13,6 +30,24 @@ module AdvancedRules
def create_company_lookup_file(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
post(path, model) end

# Create a rule execution for a company
#
#
# @param accountId [Integer] The ID of the account for the company
# @param companyId [Integer] The ID of the company for which the rule execution is to be created
# @param model [Object] The rule execution you wish to create
# @return [Object]
def create_company_rule_execution(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions"
post(path, model) end

# Delete an advanced rule that is not in use by a company
#
#
# @param ruleId [String] The ID of the advanced rule to be deleted
# @return [ErrorDetail[]]
def delete_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}"
delete(path) end

# Delete a lookup file
#
#
Expand All @@ -22,6 +57,51 @@ def create_company_lookup_file(accountId, companyId, model) path = "/api/
def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
delete(path) end

# Delete a rule execution
#
#
# @param accountId [Integer] The ID of the account for the company the rule execution is for
# @param ruleExecutionId [String] The unique ID/GUID for the rule execution to be deleted
# @return [ErrorDetail[]]
def delete_rule_execution(accountId, ruleExecutionId) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
delete(path) end

# Get an advanced rule by rule ID
#
#
# @param ruleId [String] The ID of the rule to retrieve
# @return [Object]
def get_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}"
get(path) end

# Get an advanced rule by name
#
#
# @param name [String] The name of the rule to retrieve
# @return [Object]
def get_advanced_rule_by_name(name) path = "/api/v2/advancedrules/rules/name/#{name}"
get(path) end

# Retrieve an advanced rule's customer data schema for a company
#
#
# @param ruleId [String] The ID of the advance rule for which the schema is requested
# @param accountId [Integer] The ID of the account of the requesting user
# @param companyId [Integer] The ID of the company of the requesting user
# @return [Object]
def get_advanced_rule_customer_data_schema(ruleId, accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/rules/#{ruleId}/schema"
get(path) end

# List all advanced rules
#
#
# @param fullDetails [Boolean] Retrieve detailed advanced rule properties (limited to tech support level)
# @param includeTest [Boolean] Include test rules
# @param includeSystemRules [Boolean] Include rules used to retrieve enumerated values
# @return [FetchResult]
def get_advanced_rules(options={}) path = "/api/v2/advancedrules/rules"
get(path, options) end

# Get audit records by account id and date range.
#
#
Expand All @@ -32,6 +112,14 @@ def delete_lookup_file(accountId, id) path = "/api/v2/advancedrules/accou
def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advancedrules/audits/accounts/#{accountId}/from/#{fromDate}/to/#{toDate}"
get(path) end

# Retrieve companies that have an advanced rule configured in its rule execution configuration
#
#
# @param ruleId [String] he ID of the advance rule for which companies are requested
# @return [FetchResult]
def get_companies_using_advanced_rule(ruleId) path = "/api/v2/advancedrules/rules/#{ruleId}/companies"
get(path) end

# Get the lookup files for a company
#
#
Expand All @@ -41,6 +129,16 @@ def get_audit_records(accountId, fromDate, toDate) path = "/api/v2/advanc
def get_company_lookup_files(accountId, companyId) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/lookupFiles"
get(path) end

# Get the rule executions for a company
#
#
# @param accountId [Integer] The account ID for the company
# @param companyId [Integer] The ID of the company for which to retrieve rule executions
# @param effectiveDate [DateTime] Optional date which the rule executions should be effective
# @return [FetchResult]
def get_company_rule_executions(accountId, companyId, options={}) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions"
get(path, options) end

# Get a lookup file for an accountId and companyLookupFileId
#
#
Expand All @@ -50,6 +148,52 @@ def get_company_lookup_files(accountId, companyId) path = "/api/v2/advanc
def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
get(path) end

# Get a rule execution for an accountId and ruleExecutionId
#
#
# @param accountId [Integer] The ID of the account for the rule execution
# @param ruleExecutionId [String] The unique ID/GUID of the rule execution to return
# @return [Object]
def get_rule_execution(accountId, ruleExecutionId) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
get(path) end

# Update an advanced rule
#
# Creates a new version of the advanced rule
# @param ruleId [String] The ID of the advanced rule to be updated
# @param model [Object] The new values for the advanced rule
# @return [Object]
def update_advanced_rule(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}"
put(path, model) end

# Set rule approved or unapproved
#
#
# @param ruleId [String] The ID of the advanced rule to change the approved state
# @param model [Object] The value to set approved state
# @return [Object]
def update_advanced_rule_approval(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/approve"
post(path, model) end

# Set rule visible or not visible for an account
#
#
# @param ruleId [String]
# @param model [Object]
# @return [Object]
def update_advanced_rule_visibility(ruleId, model) path = "/api/v2/advancedrules/rules/#{ruleId}/visible"
put(path, model) end

# Change the rule execution order for a company
#
#
# @param accountId [Integer] The ID of the account for the company the rule execution is for
# @param companyId [Integer] The ID of the company for which the rule execution order is being modified
# @param model [Object] A list of rule execution IDs for the company indicating the new execution order
# @return [FetchResult]
def update_company_rule_execution_order(accountId, companyId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/companies/#{companyId}/executions/order"
post(path, model) end

# Update a lookup file
#
#
Expand All @@ -59,6 +203,16 @@ def get_lookup_file(accountId, id) path = "/api/v2/advancedrules/accounts
# @return [Object]
def update_lookup_file(accountId, id, model) path = "/api/v2/advancedrules/accounts/#{accountId}/lookupFiles/#{id}"
put(path, model) end

# Update a rule execution
#
#
# @param accountId [Integer] The ID of the account for the company the rule execution is for
# @param ruleExecutionId [String] The unique ID/GUID of the rule execution to be updated
# @param model [Object] The new values to update the rule execution
# @return [Object]
def update_rule_execution(accountId, ruleExecutionId, model) path = "/api/v2/advancedrules/accounts/#{accountId}/executions/#{ruleExecutionId}"
put(path, model) end
end
end
end
105 changes: 105 additions & 0 deletions lib/avatax/client/companies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,29 @@ def company_initialize(model) path = "/api/v2/companies/initialize"
def create_companies(model) path = "/api/v2/companies"
post(path, model) end

# Add parameters to a company.
#
# Add parameters to a company.
#
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
#
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
#
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
#
# To see available parameters for this company, call `/api/v2/definitions/parameters?$filter=attributeType eq Company`
#
# Some parameters are only available for use if you have subscribed to specific AvaTax services. To see which parameters you are able to use, add the query parameter "$showSubscribed=true" to the parameter definition call above.
#
# ### Security Policies
#
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
# @param companyId [Integer] The ID of the company that owns this company parameter.
# @param model [CompanyParameterDetailModel[]] The company parameters you wish to create.
# @return [CompanyParameterDetailModel[]]
def create_company_parameters(companyId, model) path = "/api/v2/companies/#{companyId}/parameters"
post(path, model) end

# Request managed returns funding setup for a company
#
# This API is available by invitation only.
Expand Down Expand Up @@ -136,6 +159,24 @@ def create_funding_request(id, model) path = "/api/v2/companies/#{id}/fun
def delete_company(id) path = "/api/v2/companies/#{id}"
delete(path) end

# Delete a single company parameter
#
# Delete a parameter of a company.
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
#
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
#
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
#
# ### Security Policies
#
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, SSTAdmin, TechnicalSupportAdmin.
# @param companyId [Integer] The company id
# @param id [Integer] The parameter id
# @return [ErrorDetail[]]
def delete_company_parameter(companyId, id) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
delete(path) end

# Check the funding configuration of a company
#
# This API is available by invitation only.
Expand Down Expand Up @@ -217,6 +258,25 @@ def get_company(id, options={}) path = "/api/v2/companies/#{id}"
def get_company_configuration(id) path = "/api/v2/companies/#{id}/configuration"
get(path) end

# Retrieve a single company parameter
#
# Retrieves a single parameter of a company.
#
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
#
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
#
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
#
# ### Security Policies
#
# * 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, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
# @param companyId [Integer]
# @param id [Integer]
# @return [Object]
def get_company_parameter_detail(companyId, id) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
get(path) end

# Get this company's filing status
#
# Retrieve the current filing status of this company.
Expand All @@ -241,6 +301,31 @@ def get_company_configuration(id) path = "/api/v2/companies/#{id}/configu
def get_filing_status(id) path = "/api/v2/companies/#{id}/filingstatus"
get(path) end

# Retrieve parameters for a company
#
# Retrieve all parameters of a company.
#
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
#
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
#
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
#
# Search for specific objects using the criteria in the `$filter` parameter; full documentation is available on [Filtering in REST](http://developer.avalara.com/avatax/filtering-in-rest/) .
# Paginate your results using the `$top`, `$skip`, and `$orderby` parameters.
#
# ### Security Policies
#
# * 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, TechnicalSupportAdmin, TechnicalSupportUser, TreasuryAdmin, TreasuryUser.
# @param companyId [Integer] The company id
# @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:* name, unit
# @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.
# @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
# @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
# @return [FetchResult]
def list_company_parameter_details(companyId, options={}) path = "/api/v2/companies/#{companyId}/parameters"
get(path, options) end

# Check managed returns funding status for a company
#
# This API is available by invitation only.
Expand Down Expand Up @@ -348,6 +433,26 @@ def set_company_configuration(id, model) path = "/api/v2/companies/#{id}/
# @return [Object]
def update_company(id, model) path = "/api/v2/companies/#{id}"
put(path, model) end

# Update a company parameter
#
# Update a parameter of a company.
#
# Some companies can be taxed and reported differently depending on the properties of the company, such as IsPrimaryAddress. In AvaTax, these tax-affecting properties are called "parameters".
#
# A parameter added to a company will be used by default in tax calculation but will not show on the transaction line referencing the company.
#
# A company location parameter specified on a transaction line will override a company parameter if they share the same parameter name.
#
# ### Security Policies
#
# * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, FirmAdmin, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
# @param companyId [Integer] The company id.
# @param id [Integer] The company parameter id
# @param model [Object] The company parameter object you wish to update.
# @return [Object]
def update_company_parameter_detail(companyId, id, model) path = "/api/v2/companies/#{companyId}/parameters/#{id}"
put(path, model) end
end
end
end
Loading

0 comments on commit ad57ae4

Please sign in to comment.