// 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';
/**
 * AgentWorkingScheduleServiceApi - axios parameter creator
 * @export
 */
export const AgentWorkingScheduleServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @param {string} workingScheduleId
         * @param {InlineObject3} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAgentsWorkingScheduleShifts: (workingScheduleId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'workingScheduleId' is not null or undefined
            if (workingScheduleId === null || workingScheduleId === undefined) {
                throw new RequiredError('workingScheduleId', 'Required parameter workingScheduleId was null or undefined when calling createAgentsWorkingScheduleShifts.');
            }
            // verify required parameter 'body' is not null or undefined
            if (body === null || body === undefined) {
                throw new RequiredError('body', 'Required parameter body was null or undefined when calling createAgentsWorkingScheduleShifts.');
            }
            const localVarPath = `/wfm/agents/working_schedules/{working_schedule_id}`.replace(`{${'working_schedule_id'}}`, encodeURIComponent(String(workingScheduleId)));
            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;
            }
            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 body !== 'string' ||
                localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data = needsSerialization
                ? JSON.stringify(body !== undefined ? body : {})
                : body || '';
            return {
                url: globalImportUrl.format(localVarUrlObj),
                options: localVarRequestOptions,
            };
        }),
        /**
         *
         * @param {string} workingScheduleId
         * @param {string} [dateFrom]
         * @param {string} [dateTo]
         * @param {Array<string>} [supervisorId]
         * @param {Array<string>} [teamId]
         * @param {Array<string>} [skillId]
         * @param {string} [q]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchAgentsWorkingSchedule: (workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'workingScheduleId' is not null or undefined
            if (workingScheduleId === null || workingScheduleId === undefined) {
                throw new RequiredError('workingScheduleId', 'Required parameter workingScheduleId was null or undefined when calling searchAgentsWorkingSchedule.');
            }
            const localVarPath = `/wfm/agents/working_schedules/{working_schedule_id}`.replace(`{${'working_schedule_id'}}`, encodeURIComponent(String(workingScheduleId)));
            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 (dateFrom !== undefined) {
                localVarQueryParameter['date.from'] = dateFrom;
            }
            if (dateTo !== undefined) {
                localVarQueryParameter['date.to'] = dateTo;
            }
            if (supervisorId) {
                localVarQueryParameter['supervisor_id'] = supervisorId;
            }
            if (teamId) {
                localVarQueryParameter['team_id'] = teamId;
            }
            if (skillId) {
                localVarQueryParameter['skill_id'] = skillId;
            }
            if (q !== undefined) {
                localVarQueryParameter['q'] = q;
            }
            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,
            };
        }),
    };
};
/**
 * AgentWorkingScheduleServiceApi - functional programming interface
 * @export
 */
export const AgentWorkingScheduleServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @param {string} workingScheduleId
         * @param {InlineObject3} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAgentsWorkingScheduleShifts(workingScheduleId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentWorkingScheduleServiceApiAxiosParamCreator(configuration).createAgentsWorkingScheduleShifts(workingScheduleId, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @param {string} workingScheduleId
         * @param {string} [dateFrom]
         * @param {string} [dateTo]
         * @param {Array<string>} [supervisorId]
         * @param {Array<string>} [teamId]
         * @param {Array<string>} [skillId]
         * @param {string} [q]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield AgentWorkingScheduleServiceApiAxiosParamCreator(configuration).searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * AgentWorkingScheduleServiceApi - factory interface
 * @export
 */
export const AgentWorkingScheduleServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @param {string} workingScheduleId
         * @param {InlineObject3} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createAgentsWorkingScheduleShifts(workingScheduleId, body, options) {
            return AgentWorkingScheduleServiceApiFp(configuration)
                .createAgentsWorkingScheduleShifts(workingScheduleId, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @param {string} workingScheduleId
         * @param {string} [dateFrom]
         * @param {string} [dateTo]
         * @param {Array<string>} [supervisorId]
         * @param {Array<string>} [teamId]
         * @param {Array<string>} [skillId]
         * @param {string} [q]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options) {
            return AgentWorkingScheduleServiceApiFp(configuration)
                .searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * AgentWorkingScheduleServiceApi - object-oriented interface
 * @export
 * @class AgentWorkingScheduleServiceApi
 * @extends {BaseAPI}
 */
export class AgentWorkingScheduleServiceApi extends BaseAPI {
    /**
     *
     * @param {string} workingScheduleId
     * @param {InlineObject3} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentWorkingScheduleServiceApi
     */
    createAgentsWorkingScheduleShifts(workingScheduleId, body, options) {
        return AgentWorkingScheduleServiceApiFp(this.configuration)
            .createAgentsWorkingScheduleShifts(workingScheduleId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @param {string} workingScheduleId
     * @param {string} [dateFrom]
     * @param {string} [dateTo]
     * @param {Array<string>} [supervisorId]
     * @param {Array<string>} [teamId]
     * @param {Array<string>} [skillId]
     * @param {string} [q]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgentWorkingScheduleServiceApi
     */
    searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options) {
        return AgentWorkingScheduleServiceApiFp(this.configuration)
            .searchAgentsWorkingSchedule(workingScheduleId, dateFrom, dateTo, supervisorId, teamId, skillId, q, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=agent-working-schedule-service-api.js.map