avatax 21.8.0 → 22.2.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.
- checksums.yaml +4 -4
- data/.gitignore +55 -55
- data/.rspec +1 -1
- data/.travis.yml +18 -18
- data/.vs/VSWorkspaceState.json +5 -5
- data/.yardopts +4 -4
- data/Gemfile +2 -2
- data/LICENSE +201 -201
- data/README.md +98 -98
- data/Rakefile +9 -9
- data/avatax.gemspec +38 -38
- data/example/avatax.rb +47 -47
- data/example/credentials.example.yaml +5 -5
- data/lib/avatax/api.rb +27 -27
- data/lib/avatax/client/accounts.rb +94 -83
- data/lib/avatax/client/addresses.rb +22 -20
- data/lib/avatax/client/advancedrules.rb +46 -41
- data/lib/avatax/client/ageverification.rb +29 -0
- data/lib/avatax/client/avafileforms.rb +46 -41
- data/lib/avatax/client/batches.rb +70 -62
- data/lib/avatax/client/certexpressinvites.rb +30 -27
- data/lib/avatax/client/certificates.rb +126 -111
- data/lib/avatax/client/companies.rb +192 -152
- data/lib/avatax/client/compliance.rb +25 -14
- data/lib/avatax/client/contacts.rb +54 -48
- data/lib/avatax/client/customers.rb +110 -97
- data/lib/avatax/client/datasources.rb +54 -48
- data/lib/avatax/client/definitions.rb +620 -446
- data/lib/avatax/client/distancethresholds.rb +54 -48
- data/lib/avatax/client/ecms.rb +73 -73
- data/lib/avatax/client/ecommercetoken.rb +20 -18
- data/lib/avatax/client/errortransactions.rb +61 -61
- data/lib/avatax/client/filingcalendars.rb +44 -20
- data/lib/avatax/client/filings.rb +24 -20
- data/lib/avatax/client/firmclientlinkages.rb +78 -69
- data/lib/avatax/client/free.rb +14 -13
- data/lib/avatax/client/fundingrequests.rb +22 -20
- data/lib/avatax/client/items.rb +206 -181
- data/lib/avatax/client/jurisdictionoverrides.rb +54 -48
- data/lib/avatax/client/locations.rb +102 -90
- data/lib/avatax/client/multidocument.rb +86 -76
- data/lib/avatax/client/nexus.rb +146 -103
- data/lib/avatax/client/notices.rb +30 -26
- data/lib/avatax/client/notifications.rb +30 -27
- data/lib/avatax/client/onboarding.rb +55 -55
- data/lib/avatax/client/pointofsale.rb +21 -21
- data/lib/avatax/client/provisioning.rb +22 -20
- data/lib/avatax/client/registrar.rb +94 -83
- data/lib/avatax/client/reports.rb +38 -34
- data/lib/avatax/client/settings.rb +54 -48
- data/lib/avatax/client/shippingverification.rb +66 -0
- data/lib/avatax/client/subscriptions.rb +30 -27
- data/lib/avatax/client/taxcodes.rb +54 -48
- data/lib/avatax/client/taxcontent.rb +46 -41
- data/lib/avatax/client/taxprofiles.rb +42 -42
- data/lib/avatax/client/taxrules.rb +56 -50
- data/lib/avatax/client/transactions.rb +174 -153
- data/lib/avatax/client/upcs.rb +54 -48
- data/lib/avatax/client/userdefinedfields.rb +52 -0
- data/lib/avatax/client/users.rb +70 -62
- data/lib/avatax/client/utilities.rb +30 -27
- data/lib/avatax/client.rb +37 -35
- data/lib/avatax/configuration.rb +76 -76
- data/lib/avatax/connection.rb +49 -49
- data/lib/avatax/request.rb +51 -42
- data/lib/avatax/version.rb +3 -3
- data/lib/avatax.rb +26 -26
- data/spec/avatax/client/accounts_spec.rb +13 -13
- data/spec/avatax/client/transactions_spec.rb +80 -80
- data/spec/avatax/request_spec.rb +25 -25
- data/spec/avatax_spec.rb +45 -45
- data/spec/credentials.yaml.example +4 -4
- data/spec/fixtures/accounts.json +15 -15
- data/spec/spec_helper.rb +27 -27
- metadata +9 -13
| @@ -1,10 +1,10 @@ | |
| 1 | 
            -
            module AvaTax
         | 
| 2 | 
            -
              class Client
         | 
| 3 | 
            -
                module Certificates 
         | 
| 4 | 
            -
             | 
| 5 | 
            -
             | 
| 6 | 
            -
                  # Create certificates for this company
         | 
| 7 | 
            -
                  #
         | 
| 1 | 
            +
            module AvaTax
         | 
| 2 | 
            +
              class Client
         | 
| 3 | 
            +
                module Certificates 
         | 
| 4 | 
            +
             | 
| 5 | 
            +
             | 
| 6 | 
            +
                  # Create certificates for this company
         | 
| 7 | 
            +
                  #
         | 
| 8 8 | 
             
                  # Record one or more certificates document for this company.
         | 
| 9 9 | 
             
                  #
         | 
| 10 10 | 
             
                  # A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
         | 
| @@ -30,16 +30,17 @@ module AvaTax | |
| 30 30 | 
             
                  # ### Security Policies
         | 
| 31 31 | 
             
                  #
         | 
| 32 32 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, CompanyAdmin, CSPTester, ProStoresOperator, Registrar, SiteAdmin, SSTAdmin, SystemAdmin, TechnicalSupportAdmin.
         | 
| 33 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 33 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 34 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 34 35 | 
             
                  # @param companyId [Integer] The ID number of the company recording this certificate
         | 
| 35 36 | 
             
                  # @param preValidatedExemptionReason [Boolean] If set to true, the certificate will bypass the human verification process.
         | 
| 36 37 | 
             
                  # @param model [CertificateModel[]] Certificates to be created
         | 
| 37 | 
            -
                  # @return [CertificateModel[]]
         | 
| 38 | 
            -
                  def create_certificates(companyId, model, options={})        path = "/api/v2/companies/#{companyId}/certificates"
         | 
| 39 | 
            -
                    post(path, model, options)      end
         | 
| 40 | 
            -
             | 
| 41 | 
            -
                  # Revoke and delete a certificate
         | 
| 42 | 
            -
                  #
         | 
| 38 | 
            +
                  # @return [CertificateModel[]]
         | 
| 39 | 
            +
                  def create_certificates(companyId, model, options={})        path = "/api/v2/companies/#{companyId}/certificates"
         | 
| 40 | 
            +
                    post(path, model, options, "22.2.0")      end
         | 
| 41 | 
            +
             | 
| 42 | 
            +
                  # Revoke and delete a certificate
         | 
| 43 | 
            +
                  #
         | 
| 43 44 | 
             
                  # Revoke the certificate identified by this URL, then delete it.
         | 
| 44 45 | 
             
                  #
         | 
| 45 46 | 
             
                  # A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
         | 
| @@ -57,15 +58,16 @@ module AvaTax | |
| 57 58 | 
             
                  # ### Security Policies
         | 
| 58 59 | 
             
                  #
         | 
| 59 60 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 60 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 61 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 62 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 61 63 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 62 64 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 63 | 
            -
                  # @return [ErrorDetail[]]
         | 
| 64 | 
            -
                  def delete_certificate(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 65 | 
            -
                    delete(path)      end
         | 
| 66 | 
            -
             | 
| 67 | 
            -
                  # Download an image for this certificate
         | 
| 68 | 
            -
                  #
         | 
| 65 | 
            +
                  # @return [ErrorDetail[]]
         | 
| 66 | 
            +
                  def delete_certificate(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 67 | 
            +
                    delete(path, {}, "22.2.0")      end
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                  # Download an image for this certificate
         | 
| 70 | 
            +
                  #
         | 
| 69 71 | 
             
                  # Download an image or PDF file for this certificate.
         | 
| 70 72 | 
             
                  #
         | 
| 71 73 | 
             
                  # This API can be used to download either a single-page preview of the certificate or a full PDF document.
         | 
| @@ -84,17 +86,18 @@ module AvaTax | |
| 84 86 | 
             
                  # ### Security Policies
         | 
| 85 87 | 
             
                  #
         | 
| 86 88 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 87 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 89 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 90 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 88 91 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 89 92 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 90 93 | 
             
                  # @param page [Integer] If you choose `$type`=`Jpeg`, you must specify which page number to retrieve.
         | 
| 91 94 | 
             
                  # @param type [String] The data format in which to retrieve the certificate image (See CertificatePreviewType::* for a list of allowable values)
         | 
| 92 | 
            -
                  # @return [Object]
         | 
| 93 | 
            -
                  def download_certificate_image(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
         | 
| 94 | 
            -
                    get(path, options)      end
         | 
| 95 | 
            -
             | 
| 96 | 
            -
                  # Retrieve a single certificate
         | 
| 97 | 
            -
                  #
         | 
| 95 | 
            +
                  # @return [Object]
         | 
| 96 | 
            +
                  def download_certificate_image(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
         | 
| 97 | 
            +
                    get(path, options, "22.2.0")      end
         | 
| 98 | 
            +
             | 
| 99 | 
            +
                  # Retrieve a single certificate
         | 
| 100 | 
            +
                  #
         | 
| 98 101 | 
             
                  # Get the current certificate identified by this URL.
         | 
| 99 102 | 
             
                  #
         | 
| 100 103 | 
             
                  # A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
         | 
| @@ -116,16 +119,17 @@ module AvaTax | |
| 116 119 | 
             
                  # ### Security Policies
         | 
| 117 120 | 
             
                  #
         | 
| 118 121 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 119 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 122 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 123 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 120 124 | 
             
                  # @param companyId [Integer] The ID number of the company that recorded this certificate
         | 
| 121 125 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 122 126 | 
             
                  # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following:      * customers - Retrieves the list of customers linked to the certificate.   * po_numbers - Retrieves all PO numbers tied to the certificate.   * attributes - Retrieves all attributes applied to the certificate.
         | 
| 123 | 
            -
                  # @return [Object]
         | 
| 124 | 
            -
                  def get_certificate(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 125 | 
            -
                    get(path, options)      end
         | 
| 126 | 
            -
             | 
| 127 | 
            -
                  # Check a company's exemption certificate status.
         | 
| 128 | 
            -
                  #
         | 
| 127 | 
            +
                  # @return [Object]
         | 
| 128 | 
            +
                  def get_certificate(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 129 | 
            +
                    get(path, options, "22.2.0")      end
         | 
| 130 | 
            +
             | 
| 131 | 
            +
                  # Check a company's exemption certificate status.
         | 
| 132 | 
            +
                  #
         | 
| 129 133 | 
             
                  # Checks whether this company is configured to use exemption certificates in AvaTax.
         | 
| 130 134 | 
             
                  #
         | 
| 131 135 | 
             
                  # Exemption certificates are tracked through a different auditable data store than the one that
         | 
| @@ -137,14 +141,15 @@ module AvaTax | |
| 137 141 | 
             
                  # ### Security Policies
         | 
| 138 142 | 
             
                  #
         | 
| 139 143 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 140 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 144 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 145 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 141 146 | 
             
                  # @param companyId [Integer] The company ID to check
         | 
| 142 | 
            -
                  # @return [Object]
         | 
| 143 | 
            -
                  def get_certificate_setup(companyId)        path = "/api/v2/companies/#{companyId}/certificates/setup"
         | 
| 144 | 
            -
                    get(path)      end
         | 
| 145 | 
            -
             | 
| 146 | 
            -
                  # Link attributes to a certificate
         | 
| 147 | 
            -
                  #
         | 
| 147 | 
            +
                  # @return [Object]
         | 
| 148 | 
            +
                  def get_certificate_setup(companyId)        path = "/api/v2/companies/#{companyId}/certificates/setup"
         | 
| 149 | 
            +
                    get(path, {}, "22.2.0")      end
         | 
| 150 | 
            +
             | 
| 151 | 
            +
                  # Link attributes to a certificate
         | 
| 152 | 
            +
                  #
         | 
| 148 153 | 
             
                  # Link one or many attributes to a certificate.
         | 
| 149 154 | 
             
                  #
         | 
| 150 155 | 
             
                  # A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
         | 
| @@ -163,16 +168,17 @@ module AvaTax | |
| 163 168 | 
             
                  # ### Security Policies
         | 
| 164 169 | 
             
                  #
         | 
| 165 170 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 166 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 171 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 172 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 167 173 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 168 174 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 169 175 | 
             
                  # @param model [CertificateAttributeModel[]] The list of attributes to link to this certificate.
         | 
| 170 | 
            -
                  # @return [FetchResult]
         | 
| 171 | 
            -
                  def link_attributes_to_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/link"
         | 
| 172 | 
            -
                    post(path, model)      end
         | 
| 173 | 
            -
             | 
| 174 | 
            -
                  # Link customers to a certificate
         | 
| 175 | 
            -
                  #
         | 
| 176 | 
            +
                  # @return [FetchResult]
         | 
| 177 | 
            +
                  def link_attributes_to_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/link"
         | 
| 178 | 
            +
                    post(path, model, {}, "22.2.0")      end
         | 
| 179 | 
            +
             | 
| 180 | 
            +
                  # Link customers to a certificate
         | 
| 181 | 
            +
                  #
         | 
| 176 182 | 
             
                  # Link one or more customers to an existing certificate.
         | 
| 177 183 | 
             
                  #
         | 
| 178 184 | 
             
                  # Customers and certificates must be linked before a customer can make use of a certificate to obtain
         | 
| @@ -192,16 +198,17 @@ module AvaTax | |
| 192 198 | 
             
                  # ### Security Policies
         | 
| 193 199 | 
             
                  #
         | 
| 194 200 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 195 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 201 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 202 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 196 203 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 197 204 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 198 205 | 
             
                  # @param model [Object] The list of customers needed be added to the Certificate for exemption
         | 
| 199 | 
            -
                  # @return [FetchResult]
         | 
| 200 | 
            -
                  def link_customers_to_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/link"
         | 
| 201 | 
            -
                    post(path, model)      end
         | 
| 202 | 
            -
             | 
| 203 | 
            -
                  # List all attributes applied to this certificate
         | 
| 204 | 
            -
                  #
         | 
| 206 | 
            +
                  # @return [FetchResult]
         | 
| 207 | 
            +
                  def link_customers_to_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/link"
         | 
| 208 | 
            +
                    post(path, model, {}, "22.2.0")      end
         | 
| 209 | 
            +
             | 
| 210 | 
            +
                  # List all attributes applied to this certificate
         | 
| 211 | 
            +
                  #
         | 
| 205 212 | 
             
                  # Retrieve the list of attributes that are linked to this certificate.
         | 
| 206 213 | 
             
                  #
         | 
| 207 214 | 
             
                  # A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
         | 
| @@ -220,15 +227,16 @@ module AvaTax | |
| 220 227 | 
             
                  # ### Security Policies
         | 
| 221 228 | 
             
                  #
         | 
| 222 229 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 223 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 230 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 231 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 224 232 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 225 233 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 226 | 
            -
                  # @return [FetchResult]
         | 
| 227 | 
            -
                  def list_attributes_for_certificate(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes"
         | 
| 228 | 
            -
                    get(path)      end
         | 
| 229 | 
            -
             | 
| 230 | 
            -
                  # List customers linked to this certificate
         | 
| 231 | 
            -
                  #
         | 
| 234 | 
            +
                  # @return [FetchResult]
         | 
| 235 | 
            +
                  def list_attributes_for_certificate(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes"
         | 
| 236 | 
            +
                    get(path, {}, "22.2.0")      end
         | 
| 237 | 
            +
             | 
| 238 | 
            +
                  # List customers linked to this certificate
         | 
| 239 | 
            +
                  #
         | 
| 232 240 | 
             
                  # List all customers linked to this certificate.
         | 
| 233 241 | 
             
                  #
         | 
| 234 242 | 
             
                  # Customers must be linked to a certificate in order to make use of its tax exemption features. You
         | 
| @@ -247,16 +255,17 @@ module AvaTax | |
| 247 255 | 
             
                  # ### Security Policies
         | 
| 248 256 | 
             
                  #
         | 
| 249 257 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 250 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 258 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 259 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 251 260 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 252 261 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 253 262 | 
             
                  # @param include [String] OPTIONAL: A comma separated list of special fetch options.   No options are currently available when fetching customers.
         | 
| 254 | 
            -
                  # @return [FetchResult]
         | 
| 255 | 
            -
                  def list_customers_for_certificate(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers"
         | 
| 256 | 
            -
                    get(path, options)      end
         | 
| 257 | 
            -
             | 
| 258 | 
            -
                  # List all certificates for a company
         | 
| 259 | 
            -
                  #
         | 
| 263 | 
            +
                  # @return [FetchResult]
         | 
| 264 | 
            +
                  def list_customers_for_certificate(companyId, id, options={})        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers"
         | 
| 265 | 
            +
                    get(path, options, "22.2.0")      end
         | 
| 266 | 
            +
             | 
| 267 | 
            +
                  # List all certificates for a company
         | 
| 268 | 
            +
                  #
         | 
| 260 269 | 
             
                  # List all certificates recorded by a company
         | 
| 261 270 | 
             
                  #
         | 
| 262 271 | 
             
                  # A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
         | 
| @@ -278,19 +287,20 @@ module AvaTax | |
| 278 287 | 
             
                  # ### Security Policies
         | 
| 279 288 | 
             
                  #
         | 
| 280 289 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 281 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 290 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 291 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 282 292 | 
             
                  # @param companyId [Integer] The ID number of the company to search
         | 
| 283 293 | 
             
                  # @param include [String] OPTIONAL: A comma separated list of special fetch options. You can specify one or more of the following:      * customers - Retrieves the list of customers linked to the certificate.   * po_numbers - Retrieves all PO numbers tied to the certificate.   * attributes - Retrieves all attributes applied to the certificate.
         | 
| 284 294 | 
             
                  # @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:* exemptionNumber, status, ecmsId, ecmsStatus, pdf, pages
         | 
| 285 295 | 
             
                  # @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.
         | 
| 286 296 | 
             
                  # @param skip [Integer] If nonzero, skip this number of results before returning data. Used with `$top` to provide pagination for large datasets.
         | 
| 287 297 | 
             
                  # @param orderBy [String] A comma separated list of sort statements in the format `(fieldname) [ASC|DESC]`, for example `id ASC`.
         | 
| 288 | 
            -
                  # @return [FetchResult]
         | 
| 289 | 
            -
                  def query_certificates(companyId, options={})        path = "/api/v2/companies/#{companyId}/certificates"
         | 
| 290 | 
            -
                    get(path, options)      end
         | 
| 291 | 
            -
             | 
| 292 | 
            -
                  # Request setup of exemption certificates for this company.
         | 
| 293 | 
            -
                  #
         | 
| 298 | 
            +
                  # @return [FetchResult]
         | 
| 299 | 
            +
                  def query_certificates(companyId, options={})        path = "/api/v2/companies/#{companyId}/certificates"
         | 
| 300 | 
            +
                    get(path, options, "22.2.0")      end
         | 
| 301 | 
            +
             | 
| 302 | 
            +
                  # Request setup of exemption certificates for this company.
         | 
| 303 | 
            +
                  #
         | 
| 294 304 | 
             
                  # Requests the setup of exemption certificates for this company.
         | 
| 295 305 | 
             
                  #
         | 
| 296 306 | 
             
                  # Exemption certificates are tracked through a different auditable data store than the one that
         | 
| @@ -304,14 +314,15 @@ module AvaTax | |
| 304 314 | 
             
                  # ### Security Policies
         | 
| 305 315 | 
             
                  #
         | 
| 306 316 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 307 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 317 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 318 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 308 319 | 
             
                  # @param companyId [Integer] 
         | 
| 309 | 
            -
                  # @return [Object]
         | 
| 310 | 
            -
                  def request_certificate_setup(companyId)        path = "/api/v2/companies/#{companyId}/certificates/setup"
         | 
| 311 | 
            -
                    post(path)      end
         | 
| 312 | 
            -
             | 
| 313 | 
            -
                  # Unlink attributes from a certificate
         | 
| 314 | 
            -
                  #
         | 
| 320 | 
            +
                  # @return [Object]
         | 
| 321 | 
            +
                  def request_certificate_setup(companyId)        path = "/api/v2/companies/#{companyId}/certificates/setup"
         | 
| 322 | 
            +
                    post(path, {}, "22.2.0")      end
         | 
| 323 | 
            +
             | 
| 324 | 
            +
                  # Unlink attributes from a certificate
         | 
| 325 | 
            +
                  #
         | 
| 315 326 | 
             
                  # Unlink one or many attributes from a certificate.
         | 
| 316 327 | 
             
                  #
         | 
| 317 328 | 
             
                  # A certificate may have multiple attributes that control its behavior. You may link or unlink attributes to a
         | 
| @@ -330,16 +341,17 @@ module AvaTax | |
| 330 341 | 
             
                  # ### Security Policies
         | 
| 331 342 | 
             
                  #
         | 
| 332 343 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 333 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 344 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 345 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 334 346 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 335 347 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 336 348 | 
             
                  # @param model [CertificateAttributeModel[]] The list of attributes to unlink from this certificate.
         | 
| 337 | 
            -
                  # @return [FetchResult]
         | 
| 338 | 
            -
                  def unlink_attributes_from_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/unlink"
         | 
| 339 | 
            -
                    post(path, model)      end
         | 
| 340 | 
            -
             | 
| 341 | 
            -
                  # Unlink customers from a certificate
         | 
| 342 | 
            -
                  #
         | 
| 349 | 
            +
                  # @return [FetchResult]
         | 
| 350 | 
            +
                  def unlink_attributes_from_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attributes/unlink"
         | 
| 351 | 
            +
                    post(path, model, {}, "22.2.0")      end
         | 
| 352 | 
            +
             | 
| 353 | 
            +
                  # Unlink customers from a certificate
         | 
| 354 | 
            +
                  #
         | 
| 343 355 | 
             
                  # Unlinks one or more customers from a certificate.
         | 
| 344 356 | 
             
                  #
         | 
| 345 357 | 
             
                  # Unlinking a certificate from a customer will prevent the certificate from being used to generate
         | 
| @@ -360,16 +372,17 @@ module AvaTax | |
| 360 372 | 
             
                  # ### Security Policies
         | 
| 361 373 | 
             
                  #
         | 
| 362 374 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 363 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 375 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 376 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 364 377 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 365 378 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 366 379 | 
             
                  # @param model [Object] The list of customers to unlink from this certificate
         | 
| 367 | 
            -
                  # @return [FetchResult]
         | 
| 368 | 
            -
                  def unlink_customers_from_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/unlink"
         | 
| 369 | 
            -
                    post(path, model)      end
         | 
| 370 | 
            -
             | 
| 371 | 
            -
                  # Update a single certificate
         | 
| 372 | 
            -
                  #
         | 
| 380 | 
            +
                  # @return [FetchResult]
         | 
| 381 | 
            +
                  def unlink_customers_from_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/customers/unlink"
         | 
| 382 | 
            +
                    post(path, model, {}, "22.2.0")      end
         | 
| 383 | 
            +
             | 
| 384 | 
            +
                  # Update a single certificate
         | 
| 385 | 
            +
                  #
         | 
| 373 386 | 
             
                  # Replace the certificate identified by this URL with a new one.
         | 
| 374 387 | 
             
                  #
         | 
| 375 388 | 
             
                  # A certificate is a document stored in either AvaTax Exemptions or CertCapture. The certificate document
         | 
| @@ -385,16 +398,17 @@ module AvaTax | |
| 385 398 | 
             
                  # ### Security Policies
         | 
| 386 399 | 
             
                  #
         | 
| 387 400 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin.
         | 
| 388 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 401 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 402 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 389 403 | 
             
                  # @param companyId [Integer] The ID number of the company that recorded this certificate
         | 
| 390 404 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 391 405 | 
             
                  # @param model [Object] The new certificate object that will replace the existing one
         | 
| 392 | 
            -
                  # @return [Object]
         | 
| 393 | 
            -
                  def update_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 394 | 
            -
                    put(path, model)      end
         | 
| 395 | 
            -
             | 
| 396 | 
            -
                  # Upload an image or PDF attachment for this certificate
         | 
| 397 | 
            -
                  #
         | 
| 406 | 
            +
                  # @return [Object]
         | 
| 407 | 
            +
                  def update_certificate(companyId, id, model)        path = "/api/v2/companies/#{companyId}/certificates/#{id}"
         | 
| 408 | 
            +
                    put(path, model, {}, "22.2.0")      end
         | 
| 409 | 
            +
             | 
| 410 | 
            +
                  # Upload an image or PDF attachment for this certificate
         | 
| 411 | 
            +
                  #
         | 
| 398 412 | 
             
                  # Upload an image or PDF attachment for this certificate.
         | 
| 399 413 | 
             
                  #
         | 
| 400 414 | 
             
                  # Image attachments can be of the format `PDF`, `JPEG`, `TIFF`, or `PNG`. To upload a multi-page image, please
         | 
| @@ -413,13 +427,14 @@ module AvaTax | |
| 413 427 | 
             
                  # ### Security Policies
         | 
| 414 428 | 
             
                  #
         | 
| 415 429 | 
             
                  # * This API requires one of the following user roles: AccountAdmin, AccountOperator, AccountUser, CompanyAdmin, CompanyUser, CSPTester, SSTAdmin, TechnicalSupportAdmin, TechnicalSupportUser.
         | 
| 416 | 
            -
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 430 | 
            +
                  # * This API depends on the following active services:*Required* (all): AvaTaxPro.
         | 
| 431 | 
            +
                  # Swagger Name: AvaTaxClient	  
         | 
| 417 432 | 
             
                  # @param companyId [Integer] The unique ID number of the company that recorded this certificate
         | 
| 418 433 | 
             
                  # @param id [Integer] The unique ID number of this certificate
         | 
| 419 434 | 
             
                  # @param file [Object] The exemption certificate file you wanted to upload. Accepted formats are: PDF, JPEG, TIFF, PNG.
         | 
| 420 | 
            -
                  # @return [String]
         | 
| 421 | 
            -
                  def upload_certificate_image(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
         | 
| 422 | 
            -
                    post(path)      end
         | 
| 423 | 
            -
                end
         | 
| 424 | 
            -
              end
         | 
| 435 | 
            +
                  # @return [String]
         | 
| 436 | 
            +
                  def upload_certificate_image(companyId, id)        path = "/api/v2/companies/#{companyId}/certificates/#{id}/attachment"
         | 
| 437 | 
            +
                    post(path, {}, "22.2.0")      end
         | 
| 438 | 
            +
                end
         | 
| 439 | 
            +
              end
         | 
| 425 440 | 
             
            end
         |