/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import * as runtime from '../runtime';
import { AsyncJobIdFromJSON, ComputeTaskExecutionResponseFromJSON, CurationTaskFromJSON, CurationTaskToJSON, ListCurationTaskRequestToJSON, ListCurationTaskResponseFromJSON, TaskStatusFromJSON, TaskStatusToJSON, } from '../models/index';
/**
 *
 */
export class CurationTaskServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling deleteRepoV1CurationTaskTaskId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1CurationTaskTaskId(requestParameters, initOverrides) {
        await this.deleteRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling getRepoV1CurationTaskTaskId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CurationTaskFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1CurationTaskTaskId(requestParameters, initOverrides) {
        const response = await this.getRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1CurationTaskTaskIdExecuteAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling getRepoV1CurationTaskTaskIdExecuteAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1CurationTaskTaskIdExecuteAsyncGetAsyncToken().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}/execute/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        urlPath = urlPath.replace(`{${"asyncToken"}}`, encodeURIComponent(String(requestParameters['asyncToken'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ComputeTaskExecutionResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1CurationTaskTaskIdExecuteAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1CurationTaskTaskIdExecuteAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1CurationTaskTaskIdStatusRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling getRepoV1CurationTaskTaskIdStatus().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}/status`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TaskStatusFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1CurationTaskTaskIdStatus(requestParameters, initOverrides) {
        const response = await this.getRepoV1CurationTaskTaskIdStatusRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1CurationTaskRaw(requestParameters, initOverrides) {
        if (requestParameters['curationTask'] == null) {
            throw new runtime.RequiredError('curationTask', 'Required parameter "curationTask" was null or undefined when calling postRepoV1CurationTask().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CurationTaskToJSON(requestParameters['curationTask']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CurationTaskFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1CurationTask(requestParameters, initOverrides) {
        const response = await this.postRepoV1CurationTaskRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1CurationTaskListRaw(requestParameters, initOverrides) {
        if (requestParameters['listCurationTaskRequest'] == null) {
            throw new runtime.RequiredError('listCurationTaskRequest', 'Required parameter "listCurationTaskRequest" was null or undefined when calling postRepoV1CurationTaskList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/list`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListCurationTaskRequestToJSON(requestParameters['listCurationTaskRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListCurationTaskResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1CurationTaskList(requestParameters, initOverrides) {
        const response = await this.postRepoV1CurationTaskListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1CurationTaskTaskIdExecuteAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling postRepoV1CurationTaskTaskIdExecuteAsyncStart().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}/execute/async/start`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1CurationTaskTaskIdExecuteAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1CurationTaskTaskIdExecuteAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling putRepoV1CurationTaskTaskId().');
        }
        if (requestParameters['curationTask'] == null) {
            throw new runtime.RequiredError('curationTask', 'Required parameter "curationTask" was null or undefined when calling putRepoV1CurationTaskTaskId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: CurationTaskToJSON(requestParameters['curationTask']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CurationTaskFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1CurationTaskTaskId(requestParameters, initOverrides) {
        const response = await this.putRepoV1CurationTaskTaskIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1CurationTaskTaskIdStatusRaw(requestParameters, initOverrides) {
        if (requestParameters['taskId'] == null) {
            throw new runtime.RequiredError('taskId', 'Required parameter "taskId" was null or undefined when calling putRepoV1CurationTaskTaskIdStatus().');
        }
        if (requestParameters['taskStatus'] == null) {
            throw new runtime.RequiredError('taskStatus', 'Required parameter "taskStatus" was null or undefined when calling putRepoV1CurationTaskTaskIdStatus().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/curation/task/{taskId}/status`;
        urlPath = urlPath.replace(`{${"taskId"}}`, encodeURIComponent(String(requestParameters['taskId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: TaskStatusToJSON(requestParameters['taskStatus']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TaskStatusFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1CurationTaskTaskIdStatus(requestParameters, initOverrides) {
        const response = await this.putRepoV1CurationTaskTaskIdStatusRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=CurationTaskServicesApi.js.map