"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Octane API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AvalaraApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class AvalaraApi extends runtime.BaseAPI {
    /**
     * Lists the companies found in your Avalara account.
     * Get Avalara companies
     */
    async integrationTaxAvalaraCompanyGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/company`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.CompanyFromJSON));
    }
    /**
     * Lists the companies found in your Avalara account.
     * Get Avalara companies
     */
    async integrationTaxAvalaraCompanyGet(initOverrides) {
        const response = await this.integrationTaxAvalaraCompanyGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Validates the Avalara credentials for you vendor.
     * Validate Avalara credentials
     */
    async integrationTaxAvalaraCredentialsValidPostRaw(requestParameters, initOverrides) {
        if (requestParameters.validateCredentialsArgs === null || requestParameters.validateCredentialsArgs === undefined) {
            throw new runtime.RequiredError('validateCredentialsArgs', 'Required parameter requestParameters.validateCredentialsArgs was null or undefined when calling integrationTaxAvalaraCredentialsValidPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/credentials/valid`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.ValidateCredentialsArgsToJSON)(requestParameters.validateCredentialsArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ValidateCredentialsRespFromJSON)(jsonValue));
    }
    /**
     * Validates the Avalara credentials for you vendor.
     * Validate Avalara credentials
     */
    async integrationTaxAvalaraCredentialsValidPost(requestParameters, initOverrides) {
        const response = await this.integrationTaxAvalaraCredentialsValidPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Lists the entity codes available in avalara.
     * Get Avalara entity codes
     */
    async integrationTaxAvalaraEntityUseCodeGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/entity_use_code`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.EntityUseCodeFromJSON));
    }
    /**
     * Lists the entity codes available in avalara.
     * Get Avalara entity codes
     */
    async integrationTaxAvalaraEntityUseCodeGet(initOverrides) {
        const response = await this.integrationTaxAvalaraEntityUseCodeGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Returns the vendor Avalara settings.
     * Get Vendor Avalara Settings
     */
    async integrationTaxAvalaraSettingsGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/settings`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.VendorAvalaraSettingsFromJSON)(jsonValue));
    }
    /**
     * Returns the vendor Avalara settings.
     * Get Vendor Avalara Settings
     */
    async integrationTaxAvalaraSettingsGet(initOverrides) {
        const response = await this.integrationTaxAvalaraSettingsGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Creates the Avalara settings for you vendor.
     * Create vendor Avalara settings
     */
    async integrationTaxAvalaraSettingsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.createVendorAvalaraSettingsArgs === null || requestParameters.createVendorAvalaraSettingsArgs === undefined) {
            throw new runtime.RequiredError('createVendorAvalaraSettingsArgs', 'Required parameter requestParameters.createVendorAvalaraSettingsArgs was null or undefined when calling integrationTaxAvalaraSettingsPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/settings`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CreateVendorAvalaraSettingsArgsToJSON)(requestParameters.createVendorAvalaraSettingsArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.VendorAvalaraSettingsFromJSON)(jsonValue));
    }
    /**
     * Creates the Avalara settings for you vendor.
     * Create vendor Avalara settings
     */
    async integrationTaxAvalaraSettingsPost(requestParameters, initOverrides) {
        const response = await this.integrationTaxAvalaraSettingsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Updates the Avalara settings for you vendor.
     * Update vendor Avalara settings
     */
    async integrationTaxAvalaraSettingsPutRaw(requestParameters, initOverrides) {
        if (requestParameters.updateVendorAvalaraSettingsArgs === null || requestParameters.updateVendorAvalaraSettingsArgs === undefined) {
            throw new runtime.RequiredError('updateVendorAvalaraSettingsArgs', 'Required parameter requestParameters.updateVendorAvalaraSettingsArgs was null or undefined when calling integrationTaxAvalaraSettingsPut.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/settings`,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdateVendorAvalaraSettingsArgsToJSON)(requestParameters.updateVendorAvalaraSettingsArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.VendorAvalaraSettingsFromJSON)(jsonValue));
    }
    /**
     * Updates the Avalara settings for you vendor.
     * Update vendor Avalara settings
     */
    async integrationTaxAvalaraSettingsPut(requestParameters, initOverrides) {
        const response = await this.integrationTaxAvalaraSettingsPutRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Lists the Avalara Tax codes associated for a specific company.
     * Get Avalara Tax Codes
     */
    async integrationTaxAvalaraTaxCodeGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/integration/tax/avalara/tax_code`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.TaxCodeFromJSON));
    }
    /**
     * Lists the Avalara Tax codes associated for a specific company.
     * Get Avalara Tax Codes
     */
    async integrationTaxAvalaraTaxCodeGet(initOverrides) {
        const response = await this.integrationTaxAvalaraTaxCodeGetRaw(initOverrides);
        return await response.value();
    }
}
exports.AvalaraApi = AvalaraApi;
//# sourceMappingURL=data:application/json;base64, 