// 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';
/**
 * EmailsApi - axios parameter creator
 * @export
 */
export const EmailsApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Remove the contact\'s email address link
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmail: (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 deleteEmail.');
            }
            // 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 deleteEmail.');
            }
            const localVarPath = `/contacts/{contact_id}/emails/{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 email address(es) of the contact.
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmails: (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 deleteEmails.');
            }
            // 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 deleteEmails.');
            }
            const localVarPath = `/contacts/{contact_id}/emails`.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 Locates email address(es) of the contact.
         * @param {string} contactId The Contact ID linked 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: email address. &#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 email address only.
         * @param {boolean} [verified] Verified email addresses 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}
         */
        listEmails: (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 listEmails.');
            }
            const localVarPath = `/contacts/{contact_id}/emails`.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 email address link.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique mail address link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateEmail: (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 locateEmail.');
            }
            // 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 locateEmail.');
            }
            const localVarPath = `/contacts/{contact_id}/emails/{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 Update or append email address(es) of the contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Fixed set of email address(es) to be linked with the contact. Email address(es) that conflicts(email) 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}
         */
        mergeEmails: (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 mergeEmails.');
            }
            // 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 mergeEmails.');
            }
            const localVarPath = `/contacts/{contact_id}/emails`.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 Resets all emails of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Final set of email address(es) to be linked with the contact. Email address(es) 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}
         */
        resetEmails: (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 resetEmails.');
            }
            // 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 resetEmails.');
            }
            const localVarPath = `/contacts/{contact_id}/emails`.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 email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail: (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 updateEmail.');
            }
            // 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 updateEmail.');
            }
            // 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 updateEmail.');
            }
            const localVarPath = `/contacts/{contact_id}/emails/{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 email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail2: (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 updateEmail2.');
            }
            // 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 updateEmail2.');
            }
            // 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 updateEmail2.');
            }
            const localVarPath = `/contacts/{contact_id}/emails/{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,
            };
        }),
    };
};
/**
 * EmailsApi - functional programming interface
 * @export
 */
export const EmailsApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Remove the contact\'s email address link
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmail(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).deleteEmail(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 email address(es) of the contact.
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmails(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).deleteEmails(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 Locates email address(es) of the contact.
         * @param {string} contactId The Contact ID linked 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: email address. &#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 email address only.
         * @param {boolean} [verified] Verified email addresses 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}
         */
        listEmails(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).listEmails(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 email address link.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique mail address link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateEmail(contactId, etag, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).locateEmail(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 Update or append email address(es) of the contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Fixed set of email address(es) to be linked with the contact. Email address(es) that conflicts(email) 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}
         */
        mergeEmails(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).mergeEmails(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 Resets all emails of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Final set of email address(es) to be linked with the contact. Email address(es) 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}
         */
        resetEmails(contactId, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).resetEmails(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 email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).updateEmail(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 email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail2(contactId, etag, input, fields, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield EmailsApiAxiosParamCreator(configuration).updateEmail2(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);
                };
            });
        },
    };
};
/**
 * EmailsApi - factory interface
 * @export
 */
export const EmailsApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Remove the contact\'s email address link
         * @param {string} contactId Contact ID associated with.
         * @param {string} etag Unique ID to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmail(contactId, etag, fields, options) {
            return EmailsApiFp(configuration)
                .deleteEmail(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Remove email address(es) of the contact.
         * @param {string} contactId Contact ID associated with.
         * @param {Array<string>} etag Set of unique ID(s) to remove.
         * @param {Array<string>} [fields] Fields to be retrieved as a result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteEmails(contactId, etag, fields, options) {
            return EmailsApiFp(configuration)
                .deleteEmails(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locates email address(es) of the contact.
         * @param {string} contactId The Contact ID linked 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: email address. &#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 email address only.
         * @param {boolean} [verified] Verified email addresses 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}
         */
        listEmails(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
            return EmailsApiFp(configuration)
                .listEmails(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Locate the email address link.
         * @param {string} contactId Contact source ID.
         * @param {string} etag Unique mail address link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
         * @param {Array<string>} [fields] Fields to be retrieved into result.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        locateEmail(contactId, etag, fields, options) {
            return EmailsApiFp(configuration)
                .locateEmail(contactId, etag, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update or append email address(es) of the contact.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Fixed set of email address(es) to be linked with the contact. Email address(es) that conflicts(email) 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}
         */
        mergeEmails(contactId, input, fields, options) {
            return EmailsApiFp(configuration)
                .mergeEmails(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Resets all emails of the contact according to the input dataset.
         * @param {string} contactId Link contact ID.
         * @param {Array<WebitelContactsInputEmailAddress>} input Final set of email address(es) to be linked with the contact. Email address(es) 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}
         */
        resetEmails(contactId, input, fields, options) {
            return EmailsApiFp(configuration)
                .resetEmails(contactId, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the contact\'s email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail(contactId, etag, input, fields, options) {
            return EmailsApiFp(configuration)
                .updateEmail(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Update the contact\'s email address link details
         * @param {string} contactId Link contact ID.
         * @param {string} etag Unique ID of the latest version of an existing resorce.
         * @param {NEWUpdateOfTheEmailAddressLink1} input
         * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateEmail2(contactId, etag, input, fields, options) {
            return EmailsApiFp(configuration)
                .updateEmail2(contactId, etag, input, fields, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * EmailsApi - object-oriented interface
 * @export
 * @class EmailsApi
 * @extends {BaseAPI}
 */
export class EmailsApi extends BaseAPI {
    /**
     *
     * @summary Remove the contact\'s email address link
     * @param {string} contactId Contact ID associated with.
     * @param {string} etag Unique ID to remove.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EmailsApi
     */
    deleteEmail(contactId, etag, fields, options) {
        return EmailsApiFp(this.configuration)
            .deleteEmail(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Remove email address(es) of the contact.
     * @param {string} contactId Contact ID associated with.
     * @param {Array<string>} etag Set of unique ID(s) to remove.
     * @param {Array<string>} [fields] Fields to be retrieved as a result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EmailsApi
     */
    deleteEmails(contactId, etag, fields, options) {
        return EmailsApiFp(this.configuration)
            .deleteEmails(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locates email address(es) of the contact.
     * @param {string} contactId The Contact ID linked 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: email address. &#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 email address only.
     * @param {boolean} [verified] Verified email addresses 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 EmailsApi
     */
    listEmails(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options) {
        return EmailsApiFp(this.configuration)
            .listEmails(contactId, page, size, q, sort, fields, id, primary, verified, typeId, typeType, typeName, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Locate the email address link.
     * @param {string} contactId Contact source ID.
     * @param {string} etag Unique mail address link IDentifier. Accept: &#x60;etag&#x60; (obsolete+) or &#x60;id&#x60;.
     * @param {Array<string>} [fields] Fields to be retrieved into result.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EmailsApi
     */
    locateEmail(contactId, etag, fields, options) {
        return EmailsApiFp(this.configuration)
            .locateEmail(contactId, etag, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update or append email address(es) of the contact.
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputEmailAddress>} input Fixed set of email address(es) to be linked with the contact. Email address(es) that conflicts(email) 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 EmailsApi
     */
    mergeEmails(contactId, input, fields, options) {
        return EmailsApiFp(this.configuration)
            .mergeEmails(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Resets all emails of the contact according to the input dataset.
     * @param {string} contactId Link contact ID.
     * @param {Array<WebitelContactsInputEmailAddress>} input Final set of email address(es) to be linked with the contact. Email address(es) 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 EmailsApi
     */
    resetEmails(contactId, input, fields, options) {
        return EmailsApiFp(this.configuration)
            .resetEmails(contactId, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the contact\'s email address link details
     * @param {string} contactId Link contact ID.
     * @param {string} etag Unique ID of the latest version of an existing resorce.
     * @param {NEWUpdateOfTheEmailAddressLink} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EmailsApi
     */
    updateEmail(contactId, etag, input, fields, options) {
        return EmailsApiFp(this.configuration)
            .updateEmail(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Update the contact\'s email address link details
     * @param {string} contactId Link contact ID.
     * @param {string} etag Unique ID of the latest version of an existing resorce.
     * @param {NEWUpdateOfTheEmailAddressLink1} input
     * @param {Array<string>} [fields] Fields to be retrieved into result of changes.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof EmailsApi
     */
    updateEmail2(contactId, etag, input, fields, options) {
        return EmailsApiFp(this.configuration)
            .updateEmail2(contactId, etag, input, fields, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=emails-api.js.map