/* 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, ColumnModelFromJSON, ColumnModelToJSON, DownloadFromTableRequestToJSON, DownloadFromTableResultFromJSON, DownloadPFBRequestToJSON, DownloadPFBResultFromJSON, ListWrapperOfColumnModelFromJSON, ListWrapperOfColumnModelToJSON, PaginatedColumnModelsFromJSON, QueryBundleRequestToJSON, QueryResultBundleFromJSON, RowReferenceSetToJSON, SnapshotRequestToJSON, SnapshotResponseFromJSON, TableFileHandleResultsFromJSON, TableUpdateTransactionRequestToJSON, TableUpdateTransactionResponseFromJSON, UploadToTablePreviewRequestToJSON, UploadToTablePreviewResultFromJSON, UploadToTableRequestToJSON, UploadToTableResultFromJSON, ValidateDefiningSqlRequestToJSON, ValidateDefiningSqlResponseFromJSON, ViewColumnModelRequestToJSON, ViewColumnModelResponseFromJSON, } from '../models/index';
/**
 *
 */
export class TableServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1ColumnRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['prefix'] != null) {
            queryParameters['prefix'] = requestParameters['prefix'];
        }
        if (requestParameters['limit'] != null) {
            queryParameters['limit'] = requestParameters['limit'];
        }
        if (requestParameters['offset'] != null) {
            queryParameters['offset'] = requestParameters['offset'];
        }
        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/column`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedColumnModelsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1Column(requestParameters = {}, initOverrides) {
        const response = await this.getRepoV1ColumnRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1ColumnColumnIdRaw(requestParameters, initOverrides) {
        if (requestParameters['columnId'] == null) {
            throw new runtime.RequiredError('columnId', 'Required parameter "columnId" was null or undefined when calling getRepoV1ColumnColumnId().');
        }
        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/column/{columnId}`;
        urlPath = urlPath.replace(`{${"columnId"}}`, encodeURIComponent(String(requestParameters['columnId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ColumnModelFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ColumnColumnId(requestParameters, initOverrides) {
        const response = await this.getRepoV1ColumnColumnIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1ColumnTableviewDefaultsRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['viewEntityType'] != null) {
            queryParameters['viewEntityType'] = requestParameters['viewEntityType'];
        }
        if (requestParameters['viewTypeMask'] != null) {
            queryParameters['viewTypeMask'] = requestParameters['viewTypeMask'];
        }
        const headerParameters = {};
        let urlPath = `/repo/v1/column/tableview/defaults`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListWrapperOfColumnModelFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ColumnTableviewDefaults(requestParameters = {}, initOverrides) {
        const response = await this.getRepoV1ColumnTableviewDefaultsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1ColumnViewScopeAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1ColumnViewScopeAsyncGetAsyncToken().');
        }
        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/column/view/scope/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) => ViewColumnModelResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ColumnViewScopeAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1ColumnViewScopeAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdColumnRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdColumn().');
        }
        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/entity/{id}/column`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedColumnModelsFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdColumn(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdColumnRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFileRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFile().');
        }
        if (requestParameters['columnId'] == null) {
            throw new runtime.RequiredError('columnId', 'Required parameter "columnId" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFile().');
        }
        if (requestParameters['rowId'] == null) {
            throw new runtime.RequiredError('rowId', 'Required parameter "rowId" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFile().');
        }
        if (requestParameters['versionNumber'] == null) {
            throw new runtime.RequiredError('versionNumber', 'Required parameter "versionNumber" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFile().');
        }
        const queryParameters = {};
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        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/entity/{id}/table/column/{columnId}/row/{rowId}/version/{versionNumber}/file`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"columnId"}}`, encodeURIComponent(String(requestParameters['columnId'])));
        urlPath = urlPath.replace(`{${"rowId"}}`, encodeURIComponent(String(requestParameters['rowId'])));
        urlPath = urlPath.replace(`{${"versionNumber"}}`, encodeURIComponent(String(requestParameters['versionNumber'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFile(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFileRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreviewRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreview().');
        }
        if (requestParameters['columnId'] == null) {
            throw new runtime.RequiredError('columnId', 'Required parameter "columnId" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreview().');
        }
        if (requestParameters['rowId'] == null) {
            throw new runtime.RequiredError('rowId', 'Required parameter "rowId" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreview().');
        }
        if (requestParameters['versionNumber'] == null) {
            throw new runtime.RequiredError('versionNumber', 'Required parameter "versionNumber" was null or undefined when calling getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreview().');
        }
        const queryParameters = {};
        if (requestParameters['redirect'] != null) {
            queryParameters['redirect'] = requestParameters['redirect'];
        }
        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/entity/{id}/table/column/{columnId}/row/{rowId}/version/{versionNumber}/filepreview`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"columnId"}}`, encodeURIComponent(String(requestParameters['columnId'])));
        urlPath = urlPath.replace(`{${"rowId"}}`, encodeURIComponent(String(requestParameters['rowId'])));
        urlPath = urlPath.replace(`{${"versionNumber"}}`, encodeURIComponent(String(requestParameters['versionNumber'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        if (this.isJsonMime(response.headers.get('content-type'))) {
            return new runtime.JSONApiResponse(response);
        }
        else {
            return new runtime.TextApiResponse(response);
        }
    }
    /**
     */
    async getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreview(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableColumnColumnIdRowRowIdVersionVersionNumberFilepreviewRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableDownloadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableDownloadCsvAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1EntityIdTableDownloadCsvAsyncGetAsyncToken().');
        }
        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/entity/{id}/table/download/csv/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        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) => DownloadFromTableResultFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdTableDownloadCsvAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableDownloadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableDownloadPfbAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableDownloadPfbAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1EntityIdTableDownloadPfbAsyncGetAsyncToken().');
        }
        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/entity/{id}/table/download/pfb/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        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) => DownloadPFBResultFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdTableDownloadPfbAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableDownloadPfbAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableQueryAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1EntityIdTableQueryAsyncGetAsyncToken().');
        }
        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/entity/{id}/table/query/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        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) => QueryResultBundleFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdTableQueryAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableTransactionAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableTransactionAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1EntityIdTableTransactionAsyncGetAsyncToken().');
        }
        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/entity/{id}/table/transaction/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        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) => TableUpdateTransactionResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdTableTransactionAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableTransactionAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1EntityIdTableUploadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1EntityIdTableUploadCsvAsyncGetAsyncToken().');
        }
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1EntityIdTableUploadCsvAsyncGetAsyncToken().');
        }
        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/entity/{id}/table/upload/csv/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        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) => UploadToTableResultFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1EntityIdTableUploadCsvAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1EntityIdTableUploadCsvAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1TableUploadCsvPreviewAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1TableUploadCsvPreviewAsyncGetAsyncToken().');
        }
        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/table/upload/csv/preview/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) => UploadToTablePreviewResultFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1TableUploadCsvPreviewAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1TableUploadCsvPreviewAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ColumnRaw(requestParameters, initOverrides) {
        if (requestParameters['columnModel'] == null) {
            throw new runtime.RequiredError('columnModel', 'Required parameter "columnModel" was null or undefined when calling postRepoV1Column().');
        }
        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/column`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ColumnModelToJSON(requestParameters['columnModel']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ColumnModelFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1Column(requestParameters, initOverrides) {
        const response = await this.postRepoV1ColumnRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ColumnBatchRaw(requestParameters, initOverrides) {
        if (requestParameters['listWrapperOfColumnModel'] == null) {
            throw new runtime.RequiredError('listWrapperOfColumnModel', 'Required parameter "listWrapperOfColumnModel" was null or undefined when calling postRepoV1ColumnBatch().');
        }
        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/column/batch`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ListWrapperOfColumnModelToJSON(requestParameters['listWrapperOfColumnModel']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ListWrapperOfColumnModelFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1ColumnBatch(requestParameters, initOverrides) {
        const response = await this.postRepoV1ColumnBatchRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ColumnViewScopeAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['viewColumnModelRequest'] == null) {
            throw new runtime.RequiredError('viewColumnModelRequest', 'Required parameter "viewColumnModelRequest" was null or undefined when calling postRepoV1ColumnViewScopeAsyncStart().');
        }
        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/column/view/scope/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ViewColumnModelRequestToJSON(requestParameters['viewColumnModelRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1ColumnViewScopeAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1ColumnViewScopeAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableDownloadCsvAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableDownloadCsvAsyncStart().');
        }
        if (requestParameters['downloadFromTableRequest'] == null) {
            throw new runtime.RequiredError('downloadFromTableRequest', 'Required parameter "downloadFromTableRequest" was null or undefined when calling postRepoV1EntityIdTableDownloadCsvAsyncStart().');
        }
        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/entity/{id}/table/download/csv/async/start`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadFromTableRequestToJSON(requestParameters['downloadFromTableRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableDownloadCsvAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableDownloadCsvAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableDownloadPfbAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableDownloadPfbAsyncStart().');
        }
        if (requestParameters['downloadPFBRequest'] == null) {
            throw new runtime.RequiredError('downloadPFBRequest', 'Required parameter "downloadPFBRequest" was null or undefined when calling postRepoV1EntityIdTableDownloadPfbAsyncStart().');
        }
        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/entity/{id}/table/download/pfb/async/start`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadPFBRequestToJSON(requestParameters['downloadPFBRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableDownloadPfbAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableDownloadPfbAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableFilehandlesRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableFilehandles().');
        }
        if (requestParameters['rowReferenceSet'] == null) {
            throw new runtime.RequiredError('rowReferenceSet', 'Required parameter "rowReferenceSet" was null or undefined when calling postRepoV1EntityIdTableFilehandles().');
        }
        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/entity/{id}/table/filehandles`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: RowReferenceSetToJSON(requestParameters['rowReferenceSet']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TableFileHandleResultsFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableFilehandles(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableFilehandlesRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableQueryAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableQueryAsyncStart().');
        }
        if (requestParameters['queryBundleRequest'] == null) {
            throw new runtime.RequiredError('queryBundleRequest', 'Required parameter "queryBundleRequest" was null or undefined when calling postRepoV1EntityIdTableQueryAsyncStart().');
        }
        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/entity/{id}/table/query/async/start`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: QueryBundleRequestToJSON(requestParameters['queryBundleRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableQueryAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableQueryAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableSnapshotRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableSnapshot().');
        }
        if (requestParameters['snapshotRequest'] == null) {
            throw new runtime.RequiredError('snapshotRequest', 'Required parameter "snapshotRequest" was null or undefined when calling postRepoV1EntityIdTableSnapshot().');
        }
        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/entity/{id}/table/snapshot`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: SnapshotRequestToJSON(requestParameters['snapshotRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => SnapshotResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableSnapshot(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableSnapshotRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableTransactionAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableTransactionAsyncStart().');
        }
        if (requestParameters['tableUpdateTransactionRequest'] == null) {
            throw new runtime.RequiredError('tableUpdateTransactionRequest', 'Required parameter "tableUpdateTransactionRequest" was null or undefined when calling postRepoV1EntityIdTableTransactionAsyncStart().');
        }
        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/entity/{id}/table/transaction/async/start`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TableUpdateTransactionRequestToJSON(requestParameters['tableUpdateTransactionRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableTransactionAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableTransactionAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdTableUploadCsvAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdTableUploadCsvAsyncStart().');
        }
        if (requestParameters['uploadToTableRequest'] == null) {
            throw new runtime.RequiredError('uploadToTableRequest', 'Required parameter "uploadToTableRequest" was null or undefined when calling postRepoV1EntityIdTableUploadCsvAsyncStart().');
        }
        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/entity/{id}/table/upload/csv/async/start`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: UploadToTableRequestToJSON(requestParameters['uploadToTableRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdTableUploadCsvAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdTableUploadCsvAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1TableUploadCsvPreviewAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['uploadToTablePreviewRequest'] == null) {
            throw new runtime.RequiredError('uploadToTablePreviewRequest', 'Required parameter "uploadToTablePreviewRequest" was null or undefined when calling postRepoV1TableUploadCsvPreviewAsyncStart().');
        }
        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/table/upload/csv/preview/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: UploadToTablePreviewRequestToJSON(requestParameters['uploadToTablePreviewRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1TableUploadCsvPreviewAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1TableUploadCsvPreviewAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ValidateDefiningSqlRaw(requestParameters, initOverrides) {
        if (requestParameters['validateDefiningSqlRequest'] == null) {
            throw new runtime.RequiredError('validateDefiningSqlRequest', 'Required parameter "validateDefiningSqlRequest" was null or undefined when calling postRepoV1ValidateDefiningSql().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/repo/v1/validateDefiningSql`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: ValidateDefiningSqlRequestToJSON(requestParameters['validateDefiningSqlRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ValidateDefiningSqlResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1ValidateDefiningSql(requestParameters, initOverrides) {
        const response = await this.postRepoV1ValidateDefiningSqlRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=TableServicesApi.js.map