/* 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, DownloadStorageReportRequestToJSON, DownloadStorageReportResponseFromJSON, } from '../models/index';
/**
 *
 */
export class StorageReportServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1StorageReportAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1StorageReportAsyncGetAsyncToken().');
        }
        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/storageReport/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) => DownloadStorageReportResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1StorageReportAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1StorageReportAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1StorageReportAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['downloadStorageReportRequest'] == null) {
            throw new runtime.RequiredError('downloadStorageReportRequest', 'Required parameter "downloadStorageReportRequest" was null or undefined when calling postRepoV1StorageReportAsyncStart().');
        }
        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/storageReport/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: DownloadStorageReportRequestToJSON(requestParameters['downloadStorageReportRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1StorageReportAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1StorageReportAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=StorageReportServicesApi.js.map