/* 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 { ProjectStorageLocationLimitFromJSON, ProjectStorageLocationLimitToJSON, ProjectStorageUsageFromJSON, } from '../models/index';
/**
 *
 */
export class ProjectStorageServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1ProjectProjectIdStorageUsageRaw(requestParameters, initOverrides) {
        if (requestParameters['projectId'] == null) {
            throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling getRepoV1ProjectProjectIdStorageUsage().');
        }
        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/project/{projectId}/storage/usage`;
        urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters['projectId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ProjectStorageUsageFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ProjectProjectIdStorageUsage(requestParameters, initOverrides) {
        const response = await this.getRepoV1ProjectProjectIdStorageUsageRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1ProjectProjectIdStorageLimitRaw(requestParameters, initOverrides) {
        if (requestParameters['projectId'] == null) {
            throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling putRepoV1ProjectProjectIdStorageLimit().');
        }
        if (requestParameters['projectStorageLocationLimit'] == null) {
            throw new runtime.RequiredError('projectStorageLocationLimit', 'Required parameter "projectStorageLocationLimit" was null or undefined when calling putRepoV1ProjectProjectIdStorageLimit().');
        }
        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/project/{projectId}/storage/limit`;
        urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters['projectId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: ProjectStorageLocationLimitToJSON(requestParameters['projectStorageLocationLimit']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ProjectStorageLocationLimitFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1ProjectProjectIdStorageLimit(requestParameters, initOverrides) {
        const response = await this.putRepoV1ProjectProjectIdStorageLimitRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=ProjectStorageServicesApi.js.map