/* 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 { AsynchronousJobStatusFromJSON, AsynchronousRequestBodyToJSON, } from '../models/index';
/**
 *
 */
export class AsynchronousJobServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1AsynchronousJobJobIdRaw(requestParameters, initOverrides) {
        if (requestParameters['jobId'] == null) {
            throw new runtime.RequiredError('jobId', 'Required parameter "jobId" was null or undefined when calling getRepoV1AsynchronousJobJobId().');
        }
        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/asynchronous/job/{jobId}`;
        urlPath = urlPath.replace(`{${"jobId"}}`, encodeURIComponent(String(requestParameters['jobId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsynchronousJobStatusFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AsynchronousJobJobId(requestParameters, initOverrides) {
        const response = await this.getRepoV1AsynchronousJobJobIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1AsynchronousJobRaw(requestParameters, initOverrides) {
        if (requestParameters['asynchronousRequestBody'] == null) {
            throw new runtime.RequiredError('asynchronousRequestBody', 'Required parameter "asynchronousRequestBody" was null or undefined when calling postRepoV1AsynchronousJob().');
        }
        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/asynchronous/job`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AsynchronousRequestBodyToJSON(requestParameters['asynchronousRequestBody']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsynchronousJobStatusFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1AsynchronousJob(requestParameters, initOverrides) {
        const response = await this.postRepoV1AsynchronousJobRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=AsynchronousJobServicesApi.js.map