/* 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 { RealmFromJSON, RealmIdListFromJSON, RealmPrincipalFromJSON, } from '../models/index';
/**
 *
 */
export class RealmServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1RealmIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1RealmId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/realm/{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) => RealmFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1RealmId(requestParameters, initOverrides) {
        const response = await this.getRepoV1RealmIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1RealmIdPrincipalsRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getRepoV1RealmIdPrincipals().');
        }
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/realm/{id}/principals`;
        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) => RealmPrincipalFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1RealmIdPrincipals(requestParameters, initOverrides) {
        const response = await this.getRepoV1RealmIdPrincipalsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1RealmListRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/repo/v1/realm/list`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => RealmIdListFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1RealmList(initOverrides) {
        const response = await this.getRepoV1RealmListRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1RealmPrincipalsRaw(initOverrides) {
        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/realm/principals`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => RealmPrincipalFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1RealmPrincipals(initOverrides) {
        const response = await this.getRepoV1RealmPrincipalsRaw(initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=RealmServicesApi.js.map