// 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';
/**
 * PdfServiceApi - axios parameter creator
 * @export
 */
export const PdfServiceApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary Creates a new task to generate a PDF export for a specific call. Useful for documenting call transcripts or associated media.
         * @param {string} callId Unique identifier of the call.
         * @param {WebitelMediaExporterPdfServiceCreateCallExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCallExport: (callId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'callId' is not null or undefined
            if (callId === null || callId === undefined) {
                throw new RequiredError('callId', 'Required parameter callId was null or undefined when calling createCallExport.');
            }
            // 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 createCallExport.');
            }
            const localVarPath = `/calls/{call_id}/exports/pdf`.replace(`{${'call_id'}}`, encodeURIComponent(String(callId)));
            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,
            };
        }),
        /**
         *
         * @summary Creates a new task to generate a PDF export for an agent\'s screen recordings. This operation is asynchronous and returns a task metadata.
         * @param {string} agentId Unique identifier of the agent.
         * @param {WebitelMediaExporterPdfServiceCreateScreenrecordingExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createScreenrecordingExport: (agentId, body, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'agentId' is not null or undefined
            if (agentId === null || agentId === undefined) {
                throw new RequiredError('agentId', 'Required parameter agentId was null or undefined when calling createScreenrecordingExport.');
            }
            // 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 createScreenrecordingExport.');
            }
            const localVarPath = `/agents/{agent_id}/exports/pdf/screenrecordings`.replace(`{${'agent_id'}}`, encodeURIComponent(String(agentId)));
            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,
            };
        }),
        /**
         *
         * @summary Deletes a specific export record from the history.
         * @param {string} id ID of the record to remove.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteExport: (id, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'id' is not null or undefined
            if (id === null || id === undefined) {
                throw new RequiredError('id', 'Required parameter id was null or undefined when calling deleteExport.');
            }
            const localVarPath = `/exports/pdf/history/{id}`.replace(`{${'id'}}`, encodeURIComponent(String(id)));
            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;
            }
            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 Lists the history of PDF exports for a specific call ID.
         * @param {string} callId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCallExports: (callId, page, size, sort, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'callId' is not null or undefined
            if (callId === null || callId === undefined) {
                throw new RequiredError('callId', 'Required parameter callId was null or undefined when calling listCallExports.');
            }
            const localVarPath = `/calls/{call_id}/exports/pdf`.replace(`{${'call_id'}}`, encodeURIComponent(String(callId)));
            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 (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            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 Lists the history of PDF exports for a specific agent.
         * @param {string} agentId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listScreenrecordingExports: (agentId, page, size, sort, options = {}) => __awaiter(this, void 0, void 0, function* () {
            // verify required parameter 'agentId' is not null or undefined
            if (agentId === null || agentId === undefined) {
                throw new RequiredError('agentId', 'Required parameter agentId was null or undefined when calling listScreenrecordingExports.');
            }
            const localVarPath = `/agents/{agent_id}/exports/pdf/screenrecordings`.replace(`{${'agent_id'}}`, encodeURIComponent(String(agentId)));
            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 (sort !== undefined) {
                localVarQueryParameter['sort'] = sort;
            }
            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,
            };
        }),
    };
};
/**
 * PdfServiceApi - functional programming interface
 * @export
 */
export const PdfServiceApiFp = function (configuration) {
    return {
        /**
         *
         * @summary Creates a new task to generate a PDF export for a specific call. Useful for documenting call transcripts or associated media.
         * @param {string} callId Unique identifier of the call.
         * @param {WebitelMediaExporterPdfServiceCreateCallExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCallExport(callId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PdfServiceApiAxiosParamCreator(configuration).createCallExport(callId, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Creates a new task to generate a PDF export for an agent\'s screen recordings. This operation is asynchronous and returns a task metadata.
         * @param {string} agentId Unique identifier of the agent.
         * @param {WebitelMediaExporterPdfServiceCreateScreenrecordingExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createScreenrecordingExport(agentId, body, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PdfServiceApiAxiosParamCreator(configuration).createScreenrecordingExport(agentId, body, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Deletes a specific export record from the history.
         * @param {string} id ID of the record to remove.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteExport(id, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PdfServiceApiAxiosParamCreator(configuration).deleteExport(id, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Lists the history of PDF exports for a specific call ID.
         * @param {string} callId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCallExports(callId, page, size, sort, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PdfServiceApiAxiosParamCreator(configuration).listCallExports(callId, page, size, sort, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
        /**
         *
         * @summary Lists the history of PDF exports for a specific agent.
         * @param {string} agentId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listScreenrecordingExports(agentId, page, size, sort, options) {
            return __awaiter(this, void 0, void 0, function* () {
                const localVarAxiosArgs = yield PdfServiceApiAxiosParamCreator(configuration).listScreenrecordingExports(agentId, page, size, sort, options);
                return (axios = globalAxios, basePath = BASE_PATH) => {
                    const axiosRequestArgs = Object.assign(Object.assign({}, localVarAxiosArgs.options), { url: basePath + localVarAxiosArgs.url });
                    return axios.request(axiosRequestArgs);
                };
            });
        },
    };
};
/**
 * PdfServiceApi - factory interface
 * @export
 */
export const PdfServiceApiFactory = function (configuration, basePath, axios) {
    return {
        /**
         *
         * @summary Creates a new task to generate a PDF export for a specific call. Useful for documenting call transcripts or associated media.
         * @param {string} callId Unique identifier of the call.
         * @param {WebitelMediaExporterPdfServiceCreateCallExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createCallExport(callId, body, options) {
            return PdfServiceApiFp(configuration)
                .createCallExport(callId, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Creates a new task to generate a PDF export for an agent\'s screen recordings. This operation is asynchronous and returns a task metadata.
         * @param {string} agentId Unique identifier of the agent.
         * @param {WebitelMediaExporterPdfServiceCreateScreenrecordingExportBody} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createScreenrecordingExport(agentId, body, options) {
            return PdfServiceApiFp(configuration)
                .createScreenrecordingExport(agentId, body, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Deletes a specific export record from the history.
         * @param {string} id ID of the record to remove.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteExport(id, options) {
            return PdfServiceApiFp(configuration)
                .deleteExport(id, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Lists the history of PDF exports for a specific call ID.
         * @param {string} callId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listCallExports(callId, page, size, sort, options) {
            return PdfServiceApiFp(configuration)
                .listCallExports(callId, page, size, sort, options)
                .then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Lists the history of PDF exports for a specific agent.
         * @param {string} agentId
         * @param {number} [page] Page number (1-based).
         * @param {number} [size] Number of items per page.
         * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listScreenrecordingExports(agentId, page, size, sort, options) {
            return PdfServiceApiFp(configuration)
                .listScreenrecordingExports(agentId, page, size, sort, options)
                .then((request) => request(axios, basePath));
        },
    };
};
/**
 * PdfServiceApi - object-oriented interface
 * @export
 * @class PdfServiceApi
 * @extends {BaseAPI}
 */
export class PdfServiceApi extends BaseAPI {
    /**
     *
     * @summary Creates a new task to generate a PDF export for a specific call. Useful for documenting call transcripts or associated media.
     * @param {string} callId Unique identifier of the call.
     * @param {WebitelMediaExporterPdfServiceCreateCallExportBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PdfServiceApi
     */
    createCallExport(callId, body, options) {
        return PdfServiceApiFp(this.configuration)
            .createCallExport(callId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Creates a new task to generate a PDF export for an agent\'s screen recordings. This operation is asynchronous and returns a task metadata.
     * @param {string} agentId Unique identifier of the agent.
     * @param {WebitelMediaExporterPdfServiceCreateScreenrecordingExportBody} body
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PdfServiceApi
     */
    createScreenrecordingExport(agentId, body, options) {
        return PdfServiceApiFp(this.configuration)
            .createScreenrecordingExport(agentId, body, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Deletes a specific export record from the history.
     * @param {string} id ID of the record to remove.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PdfServiceApi
     */
    deleteExport(id, options) {
        return PdfServiceApiFp(this.configuration)
            .deleteExport(id, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Lists the history of PDF exports for a specific call ID.
     * @param {string} callId
     * @param {number} [page] Page number (1-based).
     * @param {number} [size] Number of items per page.
     * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PdfServiceApi
     */
    listCallExports(callId, page, size, sort, options) {
        return PdfServiceApiFp(this.configuration)
            .listCallExports(callId, page, size, sort, options)
            .then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Lists the history of PDF exports for a specific agent.
     * @param {string} agentId
     * @param {number} [page] Page number (1-based).
     * @param {number} [size] Number of items per page.
     * @param {string} [sort] sorting criteria, e.g. \&quot;+created_at\&quot; or \&quot;-name\&quot;
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof PdfServiceApi
     */
    listScreenrecordingExports(agentId, page, size, sort, options) {
        return PdfServiceApiFp(this.configuration)
            .listScreenrecordingExports(agentId, page, size, sort, options)
            .then((request) => request(this.axios, this.basePath));
    }
}
//# sourceMappingURL=pdf-service-api.js.map