/* 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 { StorageLocationSettingFromJSON, StorageLocationSettingToJSON, UploadDestinationListSettingFromJSON, } from '../models/index';
/**
 *
 */
export class ProjectSettingsServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteRepoV1ProjectSettingsIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteRepoV1ProjectSettingsId().');
        }
        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/projectSettings/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async deleteRepoV1ProjectSettingsId(requestParameters, initOverrides) {
        await this.deleteRepoV1ProjectSettingsIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getRepoV1ProjectSettingsIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1ProjectSettingsId().');
        }
        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/projectSettings/{id}`;
        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) => UploadDestinationListSettingFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ProjectSettingsId(requestParameters, initOverrides) {
        const response = await this.getRepoV1ProjectSettingsIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1ProjectSettingsProjectIdTypeTypeRaw(requestParameters, initOverrides) {
        if (requestParameters['projectId'] == null) {
            throw new runtime.RequiredError('projectId', 'Required parameter "projectId" was null or undefined when calling getRepoV1ProjectSettingsProjectIdTypeType().');
        }
        if (requestParameters['type'] == null) {
            throw new runtime.RequiredError('type', 'Required parameter "type" was null or undefined when calling getRepoV1ProjectSettingsProjectIdTypeType().');
        }
        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/projectSettings/{projectId}/type/{type}`;
        urlPath = urlPath.replace(`{${"projectId"}}`, encodeURIComponent(String(requestParameters['projectId'])));
        urlPath = urlPath.replace(`{${"type"}}`, encodeURIComponent(String(requestParameters['type'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => UploadDestinationListSettingFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1ProjectSettingsProjectIdTypeType(requestParameters, initOverrides) {
        const response = await this.getRepoV1ProjectSettingsProjectIdTypeTypeRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1StorageLocationIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1StorageLocationId().');
        }
        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/storageLocation/{id}`;
        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) => StorageLocationSettingFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1StorageLocationId(requestParameters, initOverrides) {
        const response = await this.getRepoV1StorageLocationIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1ProjectSettingsRaw(requestParameters, initOverrides) {
        if (requestParameters['body'] == null) {
            throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling postRepoV1ProjectSettings().');
        }
        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/projectSettings`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters['body'],
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => UploadDestinationListSettingFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1ProjectSettings(requestParameters, initOverrides) {
        const response = await this.postRepoV1ProjectSettingsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1StorageLocationRaw(requestParameters, initOverrides) {
        if (requestParameters['storageLocationSetting'] == null) {
            throw new runtime.RequiredError('storageLocationSetting', 'Required parameter "storageLocationSetting" was null or undefined when calling postRepoV1StorageLocation().');
        }
        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/storageLocation`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: StorageLocationSettingToJSON(requestParameters['storageLocationSetting']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => StorageLocationSettingFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1StorageLocation(requestParameters, initOverrides) {
        const response = await this.postRepoV1StorageLocationRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1ProjectSettingsRaw(requestParameters, initOverrides) {
        if (requestParameters['body'] == null) {
            throw new runtime.RequiredError('body', 'Required parameter "body" was null or undefined when calling putRepoV1ProjectSettings().');
        }
        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/projectSettings`;
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters['body'],
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async putRepoV1ProjectSettings(requestParameters, initOverrides) {
        await this.putRepoV1ProjectSettingsRaw(requestParameters, initOverrides);
    }
}
//# sourceMappingURL=ProjectSettingsServicesApi.js.map