/* 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 { AccessUrlFromJSON, DrsObjectFromJSON, ServiceInformationFromJSON, } from '../models/index';
/**
 *
 */
export class DrsServicesApi extends runtime.BaseAPI {
    /**
     */
    async getGa4ghDrsV1ObjectsObjectIdRaw(requestParameters, initOverrides) {
        if (requestParameters['objectId'] == null) {
            throw new runtime.RequiredError('objectId', 'Required parameter "objectId" was null or undefined when calling getGa4ghDrsV1ObjectsObjectId().');
        }
        if (requestParameters['expand'] == null) {
            throw new runtime.RequiredError('expand', 'Required parameter "expand" was null or undefined when calling getGa4ghDrsV1ObjectsObjectId().');
        }
        const queryParameters = {};
        if (requestParameters['expand'] != null) {
            queryParameters['expand'] = requestParameters['expand'];
        }
        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 = `/ga4gh/drs/v1/objects/{object_id}`;
        urlPath = urlPath.replace(`{${"object_id"}}`, encodeURIComponent(String(requestParameters['objectId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => DrsObjectFromJSON(jsonValue));
    }
    /**
     */
    async getGa4ghDrsV1ObjectsObjectId(requestParameters, initOverrides) {
        const response = await this.getGa4ghDrsV1ObjectsObjectIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getGa4ghDrsV1ObjectsObjectIdAccessAccessIdRaw(requestParameters, initOverrides) {
        if (requestParameters['objectId'] == null) {
            throw new runtime.RequiredError('objectId', 'Required parameter "objectId" was null or undefined when calling getGa4ghDrsV1ObjectsObjectIdAccessAccessId().');
        }
        if (requestParameters['accessId'] == null) {
            throw new runtime.RequiredError('accessId', 'Required parameter "accessId" was null or undefined when calling getGa4ghDrsV1ObjectsObjectIdAccessAccessId().');
        }
        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 = `/ga4gh/drs/v1/objects/{object_id}/access/{access_id}`;
        urlPath = urlPath.replace(`{${"object_id"}}`, encodeURIComponent(String(requestParameters['objectId'])));
        urlPath = urlPath.replace(`{${"access_id"}}`, encodeURIComponent(String(requestParameters['accessId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AccessUrlFromJSON(jsonValue));
    }
    /**
     */
    async getGa4ghDrsV1ObjectsObjectIdAccessAccessId(requestParameters, initOverrides) {
        const response = await this.getGa4ghDrsV1ObjectsObjectIdAccessAccessIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getGa4ghDrsV1ServiceInfoRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/ga4gh/drs/v1/service-info`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => ServiceInformationFromJSON(jsonValue));
    }
    /**
     */
    async getGa4ghDrsV1ServiceInfo(initOverrides) {
        const response = await this.getGa4ghDrsV1ServiceInfoRaw(initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=DrsServicesApi.js.map