/* 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 { DockerAuthorizationTokenFromJSON, } from '../models/index';
/**
 *
 */
export class DockerAuthorizationServicesApi extends runtime.BaseAPI {
    /**
     */
    async getDockerV1BearerTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['service'] == null) {
            throw new runtime.RequiredError('service', 'Required parameter "service" was null or undefined when calling getDockerV1BearerToken().');
        }
        const queryParameters = {};
        if (requestParameters['service'] != null) {
            queryParameters['service'] = requestParameters['service'];
        }
        if (requestParameters['scope'] != null) {
            queryParameters['scope'] = requestParameters['scope'];
        }
        const headerParameters = {};
        if (requestParameters['synapseAuthorization'] != null) {
            headerParameters['Synapse-Authorization'] = String(requestParameters['synapseAuthorization']);
        }
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/docker/v1/bearerToken`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => DockerAuthorizationTokenFromJSON(jsonValue));
    }
    /**
     */
    async getDockerV1BearerToken(requestParameters, initOverrides) {
        const response = await this.getDockerV1BearerTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=DockerAuthorizationServicesApi.js.map