/* 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 { AddBatchOfFilesToDownloadListRequestToJSON, AddBatchOfFilesToDownloadListResponseFromJSON, AddToDownloadListRequestToJSON, AddToDownloadListResponseFromJSON, AddToDownloadListStatsRequestToJSON, AddToDownloadListStatsResponseFromJSON, AsyncJobIdFromJSON, DownloadListManifestRequestToJSON, DownloadListManifestResponseFromJSON, DownloadListPackageRequestToJSON, DownloadListPackageResponseFromJSON, DownloadListQueryRequestToJSON, DownloadListQueryResponseFromJSON, RemoveBatchOfFilesFromDownloadListRequestToJSON, RemoveBatchOfFilesFromDownloadListResponseFromJSON, } from '../models/index';
/**
 *
 */
export class DownloadListServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1DownloadListRaw(initOverrides) {
        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/download/list`;
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1DownloadList(initOverrides) {
        await this.deleteRepoV1DownloadListRaw(initOverrides);
    }
    /**
     */
    async getRepoV1DownloadListAddAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1DownloadListAddAsyncGetAsyncToken().');
        }
        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/download/list/add/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) => AddToDownloadListResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1DownloadListAddAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1DownloadListAddAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1DownloadListAddStatsAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1DownloadListAddStatsAsyncGetAsyncToken().');
        }
        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/download/list/add/stats/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) => AddToDownloadListStatsResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1DownloadListAddStatsAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1DownloadListAddStatsAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1DownloadListManifestAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1DownloadListManifestAsyncGetAsyncToken().');
        }
        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/download/list/manifest/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) => DownloadListManifestResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1DownloadListManifestAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1DownloadListManifestAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1DownloadListPackageAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1DownloadListPackageAsyncGetAsyncToken().');
        }
        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/download/list/package/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) => DownloadListPackageResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1DownloadListPackageAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1DownloadListPackageAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1DownloadListQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1DownloadListQueryAsyncGetAsyncToken().');
        }
        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/download/list/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) => DownloadListQueryResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1DownloadListQueryAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1DownloadListQueryAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListAddRaw(requestParameters, initOverrides) {
        if (requestParameters['addBatchOfFilesToDownloadListRequest'] == null) {
            throw new runtime.RequiredError('addBatchOfFilesToDownloadListRequest', 'Required parameter "addBatchOfFilesToDownloadListRequest" was null or undefined when calling postRepoV1DownloadListAdd().');
        }
        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/download/list/add`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AddBatchOfFilesToDownloadListRequestToJSON(requestParameters['addBatchOfFilesToDownloadListRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AddBatchOfFilesToDownloadListResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListAdd(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListAddRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListAddAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['addToDownloadListRequest'] == null) {
            throw new runtime.RequiredError('addToDownloadListRequest', 'Required parameter "addToDownloadListRequest" was null or undefined when calling postRepoV1DownloadListAddAsyncStart().');
        }
        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/download/list/add/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AddToDownloadListRequestToJSON(requestParameters['addToDownloadListRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListAddAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListAddAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListAddStatsAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['addToDownloadListStatsRequest'] == null) {
            throw new runtime.RequiredError('addToDownloadListStatsRequest', 'Required parameter "addToDownloadListStatsRequest" was null or undefined when calling postRepoV1DownloadListAddStatsAsyncStart().');
        }
        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/download/list/add/stats/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AddToDownloadListStatsRequestToJSON(requestParameters['addToDownloadListStatsRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListAddStatsAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListAddStatsAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListManifestAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['downloadListManifestRequest'] == null) {
            throw new runtime.RequiredError('downloadListManifestRequest', 'Required parameter "downloadListManifestRequest" was null or undefined when calling postRepoV1DownloadListManifestAsyncStart().');
        }
        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/download/list/manifest/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadListManifestRequestToJSON(requestParameters['downloadListManifestRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListManifestAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListManifestAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListPackageAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['downloadListPackageRequest'] == null) {
            throw new runtime.RequiredError('downloadListPackageRequest', 'Required parameter "downloadListPackageRequest" was null or undefined when calling postRepoV1DownloadListPackageAsyncStart().');
        }
        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/download/list/package/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadListPackageRequestToJSON(requestParameters['downloadListPackageRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListPackageAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListPackageAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListQueryAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['downloadListQueryRequest'] == null) {
            throw new runtime.RequiredError('downloadListQueryRequest', 'Required parameter "downloadListQueryRequest" was null or undefined when calling postRepoV1DownloadListQueryAsyncStart().');
        }
        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/download/list/query/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadListQueryRequestToJSON(requestParameters['downloadListQueryRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListQueryAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListQueryAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1DownloadListRemoveRaw(requestParameters, initOverrides) {
        if (requestParameters['removeBatchOfFilesFromDownloadListRequest'] == null) {
            throw new runtime.RequiredError('removeBatchOfFilesFromDownloadListRequest', 'Required parameter "removeBatchOfFilesFromDownloadListRequest" was null or undefined when calling postRepoV1DownloadListRemove().');
        }
        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/download/list/remove`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: RemoveBatchOfFilesFromDownloadListRequestToJSON(requestParameters['removeBatchOfFilesFromDownloadListRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => RemoveBatchOfFilesFromDownloadListResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1DownloadListRemove(requestParameters, initOverrides) {
        const response = await this.postRepoV1DownloadListRemoveRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=DownloadListServicesApi.js.map