/* 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, CreateGridPresignedUrlRequestToJSON, CreateGridPresignedUrlResponseFromJSON, CreateGridRequestToJSON, CreateGridResponseFromJSON, CreateReplicaRequestToJSON, CreateReplicaResponseFromJSON, DownloadFromGridRequestToJSON, DownloadFromGridResultFromJSON, GridCsvImportRequestToJSON, GridCsvImportResponseFromJSON, GridQueryJobRequestToJSON, GridQueryJobResponseFromJSON, GridRecordSetExportRequestToJSON, GridRecordSetExportResponseFromJSON, GridReplicaFromJSON, GridSessionFromJSON, GridUpdateJobRequestToJSON, GridUpdateJobResponseFromJSON, ListGridReplicasRequestToJSON, ListGridReplicasResponseFromJSON, ListGridSessionsRequestToJSON, ListGridSessionsResponseFromJSON, SynchronizeGridRequestToJSON, SynchronizeGridResponseFromJSON, } from '../models/index';
/**
 *
 */
export class GridServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1GridSessionSessionIdRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling deleteRepoV1GridSessionSessionId().');
        }
        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/grid/session/{sessionId}`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1GridSessionSessionId(requestParameters, initOverrides) {
        await this.deleteRepoV1GridSessionSessionIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1GridDownloadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridDownloadCsvAsyncGetAsyncToken().');
        }
        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/grid/download/csv/async/get/{asyncToken}`;
        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) => DownloadFromGridResultFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridDownloadCsvAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridDownloadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * @deprecated
     */
    async getRepoV1GridExportRecordsetAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridExportRecordsetAsyncGetAsyncToken().');
        }
        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/grid/export/recordset/async/get/{asyncToken}`;
        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) => GridRecordSetExportResponseFromJSON(jsonValue));
    }
    /**
     * @deprecated
     */
    async getRepoV1GridExportRecordsetAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridExportRecordsetAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridImportCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridImportCsvAsyncGetAsyncToken().');
        }
        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/grid/import/csv/async/get/{asyncToken}`;
        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) => GridCsvImportResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridImportCsvAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridImportCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSessionAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridSessionAsyncGetAsyncToken().');
        }
        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/grid/session/async/get/{asyncToken}`;
        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) => CreateGridResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSessionAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSessionAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSessionQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridSessionQueryAsyncGetAsyncToken().');
        }
        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/grid/session/query/async/get/{asyncToken}`;
        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) => GridQueryJobResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSessionQueryAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSessionQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSessionSessionIdRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling getRepoV1GridSessionSessionId().');
        }
        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/grid/session/{sessionId}`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => GridSessionFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSessionSessionId(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSessionSessionIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSessionSessionIdReplicaReplicaIdRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling getRepoV1GridSessionSessionIdReplicaReplicaId().');
        }
        if (requestParameters['replicaId'] == null) {
            throw new runtime.RequiredError('replicaId', 'Required parameter "replicaId" was null or undefined when calling getRepoV1GridSessionSessionIdReplicaReplicaId().');
        }
        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/grid/session/{sessionId}/replica/{replicaId}`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        urlPath = urlPath.replace(`{${"replicaId"}}`, encodeURIComponent(String(requestParameters['replicaId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => GridReplicaFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSessionSessionIdReplicaReplicaId(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSessionSessionIdReplicaReplicaIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSessionUpdateAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridSessionUpdateAsyncGetAsyncToken().');
        }
        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/grid/session/update/async/get/{asyncToken}`;
        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) => GridUpdateJobResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSessionUpdateAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSessionUpdateAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1GridSynchronizeAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1GridSynchronizeAsyncGetAsyncToken().');
        }
        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/grid/synchronize/async/get/{asyncToken}`;
        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) => SynchronizeGridResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1GridSynchronizeAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1GridSynchronizeAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridDownloadCsvAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['downloadFromGridRequest'] == null) {
            throw new runtime.RequiredError('downloadFromGridRequest', 'Required parameter "downloadFromGridRequest" was null or undefined when calling postRepoV1GridDownloadCsvAsyncStart().');
        }
        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/grid/download/csv/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadFromGridRequestToJSON(requestParameters['downloadFromGridRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridDownloadCsvAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridDownloadCsvAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * @deprecated
     */
    async postRepoV1GridExportRecordsetAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['gridRecordSetExportRequest'] == null) {
            throw new runtime.RequiredError('gridRecordSetExportRequest', 'Required parameter "gridRecordSetExportRequest" was null or undefined when calling postRepoV1GridExportRecordsetAsyncStart().');
        }
        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/grid/export/recordset/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GridRecordSetExportRequestToJSON(requestParameters['gridRecordSetExportRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     * @deprecated
     */
    async postRepoV1GridExportRecordsetAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridExportRecordsetAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridImportCsvAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['gridCsvImportRequest'] == null) {
            throw new runtime.RequiredError('gridCsvImportRequest', 'Required parameter "gridCsvImportRequest" was null or undefined when calling postRepoV1GridImportCsvAsyncStart().');
        }
        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/grid/import/csv/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GridCsvImportRequestToJSON(requestParameters['gridCsvImportRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridImportCsvAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridImportCsvAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['createGridRequest'] == null) {
            throw new runtime.RequiredError('createGridRequest', 'Required parameter "createGridRequest" was null or undefined when calling postRepoV1GridSessionAsyncStart().');
        }
        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/grid/session/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateGridRequestToJSON(requestParameters['createGridRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionListRaw(requestParameters, initOverrides) {
        if (requestParameters['listGridSessionsRequest'] == null) {
            throw new runtime.RequiredError('listGridSessionsRequest', 'Required parameter "listGridSessionsRequest" was null or undefined when calling postRepoV1GridSessionList().');
        }
        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/grid/session/list`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListGridSessionsRequestToJSON(requestParameters['listGridSessionsRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListGridSessionsResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionList(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionQueryAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['gridQueryJobRequest'] == null) {
            throw new runtime.RequiredError('gridQueryJobRequest', 'Required parameter "gridQueryJobRequest" was null or undefined when calling postRepoV1GridSessionQueryAsyncStart().');
        }
        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/grid/session/query/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GridQueryJobRequestToJSON(requestParameters['gridQueryJobRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionQueryAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionQueryAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionSessionIdPresignedUrlRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling postRepoV1GridSessionSessionIdPresignedUrl().');
        }
        if (requestParameters['createGridPresignedUrlRequest'] == null) {
            throw new runtime.RequiredError('createGridPresignedUrlRequest', 'Required parameter "createGridPresignedUrlRequest" was null or undefined when calling postRepoV1GridSessionSessionIdPresignedUrl().');
        }
        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/grid/session/{sessionId}/presigned/url`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateGridPresignedUrlRequestToJSON(requestParameters['createGridPresignedUrlRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CreateGridPresignedUrlResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionSessionIdPresignedUrl(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionSessionIdPresignedUrlRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionSessionIdReplicaRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling postRepoV1GridSessionSessionIdReplica().');
        }
        if (requestParameters['createReplicaRequest'] == null) {
            throw new runtime.RequiredError('createReplicaRequest', 'Required parameter "createReplicaRequest" was null or undefined when calling postRepoV1GridSessionSessionIdReplica().');
        }
        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/grid/session/{sessionId}/replica`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateReplicaRequestToJSON(requestParameters['createReplicaRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => CreateReplicaResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionSessionIdReplica(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionSessionIdReplicaRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionSessionIdReplicaListRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling postRepoV1GridSessionSessionIdReplicaList().');
        }
        if (requestParameters['listGridReplicasRequest'] == null) {
            throw new runtime.RequiredError('listGridReplicasRequest', 'Required parameter "listGridReplicasRequest" was null or undefined when calling postRepoV1GridSessionSessionIdReplicaList().');
        }
        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/grid/session/{sessionId}/replica/list`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListGridReplicasRequestToJSON(requestParameters['listGridReplicasRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListGridReplicasResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionSessionIdReplicaList(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionSessionIdReplicaListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSessionUpdateAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['gridUpdateJobRequest'] == null) {
            throw new runtime.RequiredError('gridUpdateJobRequest', 'Required parameter "gridUpdateJobRequest" was null or undefined when calling postRepoV1GridSessionUpdateAsyncStart().');
        }
        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/grid/session/update/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GridUpdateJobRequestToJSON(requestParameters['gridUpdateJobRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSessionUpdateAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSessionUpdateAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1GridSynchronizeAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['synchronizeGridRequest'] == null) {
            throw new runtime.RequiredError('synchronizeGridRequest', 'Required parameter "synchronizeGridRequest" was null or undefined when calling postRepoV1GridSynchronizeAsyncStart().');
        }
        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/grid/synchronize/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SynchronizeGridRequestToJSON(requestParameters['synchronizeGridRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1GridSynchronizeAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1GridSynchronizeAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=GridServicesApi.js.map