// tslint:disable
/**
 * Webitel API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 24.04.0
 * Contact: support@webitel.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as globalImportUrl from 'url';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, BaseAPI, RequiredError, } from '../base';
/**
 * SchemaVersionServiceApi - axios parameter creator
 * @export
 */
export const SchemaVersionServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {string} schemaId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchSchemaVersion: async (schemaId, page, size, q, sort, fields, options = {}) => {
            // verify required parameter 'schemaId' is not null or undefined
            if (schemaId === null || schemaId === undefined) {
                throw new RequiredError('schemaId', 'Required parameter schemaId was null or undefined when calling searchSchemaVersion.');
            }
            const localVarPath = `/routing/schema/{schema_id}/versions`.replace(`{${'schema_id'}}`, encodeURIComponent(String(schemaId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = {
                method: 'GET',
                ...baseOptions,
                ...options,
            };
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? await configuration.apiKey('X-Webitel-Access')
                    : await configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (size !== undefined) {
                localVarQueryParameter['size'] = size;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            if (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarUrlObj.query = {
                ...localVarUrlObj.query,
                ...localVarQueryParameter,
                ...options.query,
            };
            // fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
            delete localVarUrlObj.search;
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {
                ...localVarHeaderParameter,
                ...headersFromBaseOptions,
                ...options.headers,
            };
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
/**
 * SchemaVersionServiceApi - functional programming interface
 * @export
 */
export const SchemaVersionServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {string} schemaId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async searchSchemaVersion(schemaId, page, size, q, sort, fields, options) {
            const localVarAxiosArgs = await SchemaVersionServiceApiAxiosParamCreator(configuration).searchSchemaVersion(schemaId, page, size, q, sort, fields, options);
            return (axios = globalAxios, basePath = BASE_PATH) => {
                const axiosRequestArgs = {
                    ...localVarAxiosArgs.options,
                    url: basePath + localVarAxiosArgs.url,
                };
                return axios.request(axiosRequestArgs);
            };
        },
    };
};
/**
 * SchemaVersionServiceApi - factory interface
 * @export
 */
export const SchemaVersionServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {string} schemaId
         * @param {number} [page]
         * @param {number} [size]
         * @param {string} [q]
         * @param {string} [sort]
         * @param {Array<string>} [fields]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchSchemaVersion(schemaId, page, size, q, sort, fields, options) {
            return SchemaVersionServiceApiFp(configuration)
                .searchSchemaVersion(schemaId, page, size, q, sort, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * SchemaVersionServiceApi - object-oriented interface
 * @export
 * @class SchemaVersionServiceApi
 * @extends {BaseAPI}
 */
export class SchemaVersionServiceApi extends BaseAPI {
    /**
     *
     * @param {string} schemaId
     * @param {number} [page]
     * @param {number} [size]
     * @param {string} [q]
     * @param {string} [sort]
     * @param {Array<string>} [fields]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SchemaVersionServiceApi
     */
    searchSchemaVersion(schemaId, page, size, q, sort, fields, options) {
        return SchemaVersionServiceApiFp(this.configuration)
            .searchSchemaVersion(schemaId, page, size, q, sort, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=schema-version-service-api.js.map