/* 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 { EntityBundleFromJSON, EntityBundleCreateToJSON, EntityBundleRequestToJSON, } from '../models/index';
/**
 *
 */
export class EntityBundleServicesV2Api extends runtime.BaseAPI {
    /**
     */
    async postRepoV1EntityBundle2CreateRaw(requestParameters, initOverrides) {
        if (requestParameters['entityBundleCreate'] == null) {
            throw new runtime.RequiredError('entityBundleCreate', 'Required parameter "entityBundleCreate" was null or undefined when calling postRepoV1EntityBundle2Create().');
        }
        const queryParameters = {};
        if (requestParameters['generatedBy'] != null) {
            queryParameters['generatedBy'] = requestParameters['generatedBy'];
        }
        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/bundle2/create`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: EntityBundleCreateToJSON(requestParameters['entityBundleCreate']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => EntityBundleFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityBundle2Create(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityBundle2CreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdBundle2Raw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdBundle2().');
        }
        if (requestParameters['entityBundleRequest'] == null) {
            throw new runtime.RequiredError('entityBundleRequest', 'Required parameter "entityBundleRequest" was null or undefined when calling postRepoV1EntityIdBundle2().');
        }
        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}/bundle2`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: EntityBundleRequestToJSON(requestParameters['entityBundleRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => EntityBundleFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdBundle2(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdBundle2Raw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1EntityIdVersionVersionNumberBundle2Raw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postRepoV1EntityIdVersionVersionNumberBundle2().');
        }
        if (requestParameters['versionNumber'] == null) {
            throw new runtime.RequiredError('versionNumber', 'Required parameter "versionNumber" was null or undefined when calling postRepoV1EntityIdVersionVersionNumberBundle2().');
        }
        if (requestParameters['entityBundleRequest'] == null) {
            throw new runtime.RequiredError('entityBundleRequest', 'Required parameter "entityBundleRequest" was null or undefined when calling postRepoV1EntityIdVersionVersionNumberBundle2().');
        }
        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}/version/{versionNumber}/bundle2`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        urlPath = urlPath.replace(`{${"versionNumber"}}`, encodeURIComponent(String(requestParameters['versionNumber'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: EntityBundleRequestToJSON(requestParameters['entityBundleRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => EntityBundleFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1EntityIdVersionVersionNumberBundle2(requestParameters, initOverrides) {
        const response = await this.postRepoV1EntityIdVersionVersionNumberBundle2Raw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1EntityIdBundle2Raw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putRepoV1EntityIdBundle2().');
        }
        if (requestParameters['entityBundleCreate'] == null) {
            throw new runtime.RequiredError('entityBundleCreate', 'Required parameter "entityBundleCreate" was null or undefined when calling putRepoV1EntityIdBundle2().');
        }
        const queryParameters = {};
        if (requestParameters['generatedBy'] != null) {
            queryParameters['generatedBy'] = requestParameters['generatedBy'];
        }
        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}/bundle2`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: EntityBundleCreateToJSON(requestParameters['entityBundleCreate']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => EntityBundleFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1EntityIdBundle2(requestParameters, initOverrides) {
        const response = await this.putRepoV1EntityIdBundle2Raw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=EntityBundleServicesV2Api.js.map