Skip to content

Commit

Permalink
Merge pull request #44 from contygm/master
Browse files Browse the repository at this point in the history
API 18.12: Generate Ruby SDK
  • Loading branch information
marcus authored Jan 15, 2019
2 parents 46c7865 + b5edaed commit a10edec
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 31 deletions.
5 changes: 2 additions & 3 deletions lib/avatax/client/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,11 @@ def account_reset_license_key(id, model)
# If you have not read or accepted the terms and conditions, this API call will return the
# unchanged account model.
# @param id [Integer] The ID of the account to activate
# @param include [String] Elements to include when fetching the account
# @param model [Object] The activation request
# @return [Object]
def activate_account(id, model, options={})
def activate_account(id, model)
path = "/api/v2/accounts/#{id}/activate"
post(path, model, options)
post(path, model)
end


Expand Down
2 changes: 1 addition & 1 deletion lib/avatax/client/avafileforms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def delete_ava_file_form(id)
# Retrieve a single AvaFileForm
#
# Get the AvaFileForm object identified by this URL.
# @param id [String] The primary key of this AvaFileForm
# @param id [Integer] The primary key of this AvaFileForm
# @return [Object]
def get_ava_file_form(id)
path = "/api/v2/avafileforms/#{id}"
Expand Down
5 changes: 3 additions & 2 deletions lib/avatax/client/certificates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ module Certificates
# certificate related APIs. To check if this company is set up, call `GetCertificateSetup`. To request setup of the auditable document
# storage for this company, call `RequestCertificateSetup`.
# @param companyId [Integer] The ID number of the company recording this certificate
# @param preValidatedExemptionReason [Boolean] If set to true, the certificate will bypass the human verification process.
# @param model [CertificateModel[]] Certificates to be created
# @return [CertificateModel[]]
def create_certificates(companyId, model)
def create_certificates(companyId, model, options={})
path = "/api/v2/companies/#{companyId}/certificates"
post(path, model)
post(path, model, options)
end


Expand Down
22 changes: 11 additions & 11 deletions lib/avatax/client/companies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ def get_company(id, options={})
# Retrieve a list of all configuration settings tied to this company.
#
# Configuration settings provide you with the ability to control features of your account and of your
# tax software. The category names `AvaCertServiceConfig` is reserved for
# Avalara internal software configuration values; to store your own account-level settings, please
# tax software. The category name `AvaCertServiceConfig` is reserved for
# Avalara internal software configuration values; to store your own company-level settings, please
# create a new category name that begins with `X-`, for example, `X-MyCustomCategory`.
#
# Company settings are permanent settings that cannot be deleted. You can set the value of a
# company setting to null if desired.
# company setting to null if desired and if the particular setting supports it.
#
# Avalara-based account settings for `AvaCertServiceConfig` affect your account's exemption certificate
# processing, and should only be changed with care.
# Avalara-based company settings for `AvaCertServiceConfig` affect your company's exemption certificate
# processing, and should be changed with care.
# @param id [Integer]
# @return [CompanyConfigurationModel[]]
def get_company_configuration(id)
Expand Down Expand Up @@ -247,20 +247,20 @@ def query_companies(options={})
end


# Change configuration settings for this account
# Change configuration settings for this company
#
# Update configuration settings tied to this account.
# Update configuration settings tied to this company.
#
# Configuration settings provide you with the ability to control features of your account and of your
# tax software. The category names `AvaCertServiceConfig` is reserved for
# Avalara internal software configuration values; to store your own account-level settings, please
# Avalara internal software configuration values; to store your own company-level settings, please
# create a new category name that begins with `X-`, for example, `X-MyCustomCategory`.
#
# Company settings are permanent settings that cannot be deleted. You can set the value of a
# company setting to null if desired.
# company setting to null if desired and if the particular setting supports it.
#
# Avalara-based account settings for `AvaCertServiceConfig` affect your account's exemption certificate
# processing, and should only be changed with care.
# Avalara-based company settings for `AvaCertServiceConfig` affect your company's exemption certificate
# processing, and should be changed with care.
# @param id [Integer]
# @param model [CompanyConfigurationModel[]]
# @return [CompanyConfigurationModel[]]
Expand Down
55 changes: 53 additions & 2 deletions lib/avatax/client/definitions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def get_cross_border_code(country, hsCode)
# Test whether a form supports online login verification
#
# This API is intended to be useful to identify whether the user should be allowed
# to automatically verify their login and password.
# @param form [String] The name of the form you would like to verify. This can be the tax form code or the legacy return name
# to automatically verify their login and password. This API will provide a result only if the form supports automatic online login verification.
# @param form [String] The name of the form you would like to verify. This is the tax form code
# @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/) .
# @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.
Expand Down Expand Up @@ -640,6 +640,22 @@ def list_parameters(options={})
end


# Retrieve the parameters by companyCode and itemCode.
#
# Returns the list of parameters based on the company country and state jurisdiction and the item code.
# @param companyCode [String] Company code.
# @param itemCode [String] Item code.
# @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/) .
# @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_parameters_by_item(companyCode, itemCode, options={})
path = "/api/v2/definitions/parameters/byitem/#{companyCode}/#{itemCode}"
get(path, options)
end


# Retrieve the full list of Avalara-supported permissions
#
# Returns the full list of Avalara-supported permission types.
Expand Down Expand Up @@ -689,6 +705,41 @@ def list_preferred_programs(options={})
end


# List all available product classification systems.
#
# List all available product classification systems.
#
# Tax authorities use product classification systems as a way to identify products and associate them with a tax rate.
# More than one tax authority might use the same product classification system, but they might charge different tax rates for products.
# @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/) .
# @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_product_classification_systems(options={})
path = "/api/v2/definitions/productclassificationsystems"
get(path, options)
end


# List all product classification systems available to a company based on its nexus.
#
# Lists all product classification systems available to a company based on its nexus.
#
# Tax authorities use product classification systems as a way to identify products and associate them with a tax rate.
# More than one tax authority might use the same product classification system, but they might charge different tax rates for products.
# @param companyCode [String] The company code.
# @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/) .
# @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_product_classification_systems_by_company(companyCode, options={})
path = "/api/v2/definitions/productclassificationsystems/bycompany/#{companyCode}"
get(path, options)
end


# Retrieve the full list of rate types for each country
#
# Returns the full list of Avalara-supported rate type file types
Expand Down
2 changes: 1 addition & 1 deletion lib/avatax/client/filings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_filing_attachments_trace_file(companyId, year, month)
# @param companyId [Integer] The ID of the company that owns the filings.
# @param id [Integer] The id of the filing return your retrieving
# @param details [Boolean] Indicates if you would like the credit details returned
# @return [FetchResult]
# @return [Object]
def get_filing_return(companyId, id, options={})
path = "/api/v2/companies/#{companyId}/filings/returns/#{id}"
get(path, options)
Expand Down
Loading

0 comments on commit a10edec

Please sign in to comment.