// 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 { __awaiter } from "tslib";
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';
/**
 * PhonesApi - axios parameter creator
 * @export
 */
export const PhonesApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Remove the Contact\'s phone number
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique link ID to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhone: (contactId, etag, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling deletePhone.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling deletePhone.');
            }
            const localVarPath = `/contacts/{contact_id}/phones/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Remove the Contact\'s phone number association(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {Array<string>} etag Set of linked ID(s) to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhones: (contactId, etag, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling deletePhones.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling deletePhones.');
            }
            const localVarPath = `/contacts/{contact_id}/phones`.replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (etag) {
                localVarQueryParameter['etag'] = etag;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Search phone number(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [q] Search term: phone number. &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {Array<string>} [id] Link(s) with unique ID only.
         * @param {boolean} [primary] Primary phone  only.
         * @param {boolean} [verified] Verified phone only.
         * @param {string} [typeId] Reference Object unique ID.
         * @param {string} [typeType] Reference Object well-known type.
         * @param {string} [typeName] Reference Object display name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listPhones: (contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling listPhones.');
            }
            const localVarPath = `/contacts/{contact_id}/phones`.replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield 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) {
                localVarQueryParameter['sort'] = sort;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            if (id) {
                localVarQueryParameter['id'] = id;
            }
            if (primary !== undefined) {
                localVarQueryParameter['primary'] = primary;
            }
            if (verified !== undefined) {
                localVarQueryParameter['verified'] = verified;
            }
            if (typeId !== undefined) {
                localVarQueryParameter['type.id'] = typeId;
            }
            if (typeType !== undefined) {
                localVarQueryParameter['type.type'] = typeType;
            }
            if (typeName !== undefined) {
                localVarQueryParameter['type.name'] = typeName;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Locate the Contact\'s phone number association.
         * @param {string} contactId Reference Contact unique ID.
         * @param {string} etag
         * @param {Array<string>} [fields] Fields [Q]uery to build result record.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locatePhone: (contactId, etag, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling locatePhone.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling locatePhone.');
            }
            const localVarPath = `/contacts/{contact_id}/phones/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Associate phone number(s) with the Contact
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Fixed set of phone number(s) to be linked with the Contact. Phone number(s) that conflicts with already linked will be updated.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergePhones: (contactId, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling mergePhones.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling mergePhones.');
            }
            const localVarPath = `/contacts/{contact_id}/phones`.replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Reset the Contact\'s phone numbers to fit given data set.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Final set of phone number(s) to be linked with the contact. Phone number(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetPhones: (contactId, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling resetPhones.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling resetPhones.');
            }
            const localVarPath = `/contacts/{contact_id}/phones`.replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone: (contactId, etag, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling updatePhone.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling updatePhone.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling updatePhone.');
            }
            const localVarPath = `/contacts/{contact_id}/phones/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone2: (contactId, etag, input, fields, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'contactId' is not null or undefined
            if (contactId === null || contactId === undefined) {
                throw new RequiredError('contactId', 'Required parameter contactId was null or undefined when calling updatePhone2.');
            }
            // verify required parameter 'etag' is not null or undefined
            if (etag === null || etag === undefined) {
                throw new RequiredError('etag', 'Required parameter etag was null or undefined when calling updatePhone2.');
            }
            // verify required parameter 'input' is not null or undefined
            if (input === null || input === undefined) {
                throw new RequiredError('input', 'Required parameter input was null or undefined when calling updatePhone2.');
            }
            const localVarPath = `/contacts/{contact_id}/phones/{etag}`
                .replace(`{${'contact_id'}}`, encodeURIComponent(String(contactId)))
                .replace(`{${'etag'}}`, encodeURIComponent(String(etag)));
            const localVarUrlObj = globalImportUrl.parse(localVarPath, true);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication AccessToken required
            if (configuration && configuration.apiKey) {
                const localVarApiKeyValue = typeof configuration.apiKey === 'function'
                    ? yield configuration.apiKey('X-Webitel-Access')
                    : yield configuration.apiKey;
                localVarHeaderParameter['X-Webitel-Access'] = localVarApiKeyValue;
            }
            if (fields) {
                localVarQueryParameter['fields'] = fields;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarUrlObj.query = Object.assign(Object.assign(Object.assign({}, 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 = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            const needsSerialization = typeof input !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(input !== undefined ? input : {})
                : input || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
    };
};
/**
 * PhonesApi - functional programming interface
 * @export
 */
export const PhonesApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Remove the Contact\'s phone number
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique link ID to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhone(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).deletePhone(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Remove the Contact\'s phone number association(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {Array<string>} etag Set of linked ID(s) to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhones(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).deletePhones(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Search phone number(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [q] Search term: phone number. &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {Array<string>} [id] Link(s) with unique ID only.
         * @param {boolean} [primary] Primary phone  only.
         * @param {boolean} [verified] Verified phone only.
         * @param {string} [typeId] Reference Object unique ID.
         * @param {string} [typeType] Reference Object well-known type.
         * @param {string} [typeName] Reference Object display name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Locate the Contact\'s phone number association.
         * @param {string} contactId Reference Contact unique ID.
         * @param {string} etag
         * @param {Array<string>} [fields] Fields [Q]uery to build result record.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locatePhone(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).locatePhone(contactId, etag, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Associate phone number(s) with the Contact
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Fixed set of phone number(s) to be linked with the Contact. Phone number(s) that conflicts with already linked will be updated.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergePhones(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).mergePhones(contactId, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Reset the Contact\'s phone numbers to fit given data set.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Final set of phone number(s) to be linked with the contact. Phone number(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetPhones(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).resetPhones(contactId, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).updatePhone(contactId, etag, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone2(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PhonesApiAxiosParamCreator(configuration).updatePhone2(contactId, etag, input, fields, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * PhonesApi - factory interface
 * @export
 */
export const PhonesApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Remove the Contact\'s phone number
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique link ID to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhone(contactId, etag, fields, options) {
            return PhonesApiFp(configuration)
                .deletePhone(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove the Contact\'s phone number association(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {Array<string>} etag Set of linked ID(s) to be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deletePhones(contactId, etag, fields, options) {
            return PhonesApiFp(configuration)
                .deletePhones(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Search phone number(s)
         * @param {string} contactId The Contact ID associated with.
         * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
         * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
         * @param {string} [q] Search term: phone number. &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
         * @param {Array<string>} [sort] Sort the result according to fields.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {Array<string>} [id] Link(s) with unique ID only.
         * @param {boolean} [primary] Primary phone  only.
         * @param {boolean} [verified] Verified phone only.
         * @param {string} [typeId] Reference Object unique ID.
         * @param {string} [typeType] Reference Object well-known type.
         * @param {string} [typeName] Reference Object display name.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
            return PhonesApiFp(configuration)
                .listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locate the Contact\'s phone number association.
         * @param {string} contactId Reference Contact unique ID.
         * @param {string} etag
         * @param {Array<string>} [fields] Fields [Q]uery to build result record.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locatePhone(contactId, etag, fields, options) {
            return PhonesApiFp(configuration)
                .locatePhone(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Associate phone number(s) with the Contact
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Fixed set of phone number(s) to be linked with the Contact. Phone number(s) that conflicts with already linked will be updated.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        mergePhones(contactId, input, fields, options) {
            return PhonesApiFp(configuration)
                .mergePhones(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Reset the Contact\'s phone numbers to fit given data set.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputPhoneNumber>} input Final set of phone number(s) to be linked with the contact. Phone number(s) that are already linked with the contact but not given in here will be removed.
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        resetPhones(contactId, input, fields, options) {
            return PhonesApiFp(configuration)
                .resetPhones(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone(contactId, etag, input, fields, options) {
            return PhonesApiFp(configuration)
                .updatePhone(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the Contact\'s phone number association details
         * @param {string} contactId The Contact ID to be associated with.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfThePhoneNumberDetails1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updatePhone2(contactId, etag, input, fields, options) {
            return PhonesApiFp(configuration)
                .updatePhone2(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * PhonesApi - object-oriented interface
 * @export
 * @class PhonesApi
 * @extends {BaseAPI}
 */
export class PhonesApi extends BaseAPI {
    /**
     *
     * @summary Remove the Contact\'s phone number
     * @param {string} contactId Link contact ID.
     * @param {string} etag Unique link ID to be removed.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    deletePhone(contactId, etag, fields, options) {
        return PhonesApiFp(this.configuration)
            .deletePhone(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove the Contact\'s phone number association(s)
     * @param {string} contactId The Contact ID associated with.
     * @param {Array<string>} etag Set of linked ID(s) to be removed.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    deletePhones(contactId, etag, fields, options) {
        return PhonesApiFp(this.configuration)
            .deletePhones(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Search phone number(s)
     * @param {string} contactId The Contact ID associated with.
     * @param {number} [page] Page number of result dataset records. offset &#x3D; (page*size)
     * @param {number} [size] Size count of records on result page. limit &#x3D; (size++)
     * @param {string} [q] Search term: phone number. &#x60;?&#x60; - matches any one character &#x60;*&#x60; - matches 0 or more characters
     * @param {Array<string>} [sort] Sort the result according to fields.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {Array<string>} [id] Link(s) with unique ID only.
     * @param {boolean} [primary] Primary phone  only.
     * @param {boolean} [verified] Verified phone only.
     * @param {string} [typeId] Reference Object unique ID.
     * @param {string} [typeType] Reference Object well-known type.
     * @param {string} [typeName] Reference Object display name.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
        return PhonesApiFp(this.configuration)
            .listPhones(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locate the Contact\'s phone number association.
     * @param {string} contactId Reference Contact unique ID.
     * @param {string} etag
     * @param {Array<string>} [fields] Fields [Q]uery to build result record.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    locatePhone(contactId, etag, fields, options) {
        return PhonesApiFp(this.configuration)
            .locatePhone(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Associate phone number(s) with the Contact
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputPhoneNumber>} input Fixed set of phone number(s) to be linked with the Contact. Phone number(s) that conflicts with already linked will be updated.
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    mergePhones(contactId, input, fields, options) {
        return PhonesApiFp(this.configuration)
            .mergePhones(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Reset the Contact\'s phone numbers to fit given data set.
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputPhoneNumber>} input Final set of phone number(s) to be linked with the contact. Phone number(s) that are already linked with the contact but not given in here will be removed.
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    resetPhones(contactId, input, fields, options) {
        return PhonesApiFp(this.configuration)
            .resetPhones(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the Contact\'s phone number association details
     * @param {string} contactId The Contact ID to be associated with.
     * @param {string} etag Unique ID of the latest version of an existing resorce.
     * @param {NEWUpdateOfThePhoneNumberDetails} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    updatePhone(contactId, etag, input, fields, options) {
        return PhonesApiFp(this.configuration)
            .updatePhone(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the Contact\'s phone number association details
     * @param {string} contactId The Contact ID to be associated with.
     * @param {string} etag Unique ID of the latest version of an existing resorce.
     * @param {NEWUpdateOfThePhoneNumberDetails1} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PhonesApi
     */
    updatePhone2(contactId, etag, input, fields, options) {
        return PhonesApiFp(this.configuration)
            .updatePhone2(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=phones-api.js.map