/* 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 { AccessControlListFromJSON, AccessControlListToJSON, JsonWebKeySetFromJSON, OAuthAuthorizationResponseFromJSON, OAuthClientFromJSON, OAuthClientToJSON, OAuthClientAuthorizationHistoryListFromJSON, OAuthClientIdAndSecretFromJSON, OAuthClientListFromJSON, OAuthClientVerificationPrecheckResultFromJSON, OAuthConsentGrantedResponseFromJSON, OAuthRefreshTokenInformationFromJSON, OAuthRefreshTokenInformationToJSON, OAuthRefreshTokenInformationListFromJSON, OAuthTokenIntrospectionRequestToJSON, OAuthTokenIntrospectionResponseFromJSON, OAuthTokenRevocationRequestToJSON, OIDCAuthorizationRequestToJSON, OIDCAuthorizationRequestDescriptionFromJSON, OIDCTokenResponseFromJSON, OIDConnectConfigurationFromJSON, } from '../models/index';
/**
 *
 */
export class OpenIDConnectServicesApi extends runtime.BaseAPI {
    /**
     */
    async deleteAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAuthV1Oauth2ClientId().');
        }
        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 = `/auth/v1/oauth2/client/{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 deleteAuthV1Oauth2ClientId(requestParameters, initOverrides) {
        await this.deleteAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides);
    }
    /**
     */
    async getAuthV1Oauth2AuditGrantedClientsRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['nextPageToken'] != null) {
            queryParameters['nextPageToken'] = requestParameters['nextPageToken'];
        }
        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 = `/auth/v1/oauth2/audit/grantedClients`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientAuthorizationHistoryListFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2AuditGrantedClients(requestParameters = {}, initOverrides) {
        const response = await this.getAuthV1Oauth2AuditGrantedClientsRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2AuditGrantedClientsClientIdTokensRaw(requestParameters, initOverrides) {
        if (requestParameters['clientId'] == null) {
            throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling getAuthV1Oauth2AuditGrantedClientsClientIdTokens().');
        }
        const queryParameters = {};
        if (requestParameters['nextPageToken'] != null) {
            queryParameters['nextPageToken'] = requestParameters['nextPageToken'];
        }
        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 = `/auth/v1/oauth2/audit/grantedClients/{clientId}/tokens`;
        urlPath = urlPath.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters['clientId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthRefreshTokenInformationListFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2AuditGrantedClientsClientIdTokens(requestParameters, initOverrides) {
        const response = await this.getAuthV1Oauth2AuditGrantedClientsClientIdTokensRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2AuditTokensTokenIdMetadataRaw(requestParameters, initOverrides) {
        if (requestParameters['tokenId'] == null) {
            throw new runtime.RequiredError('tokenId', 'Required parameter "tokenId" was null or undefined when calling getAuthV1Oauth2AuditTokensTokenIdMetadata().');
        }
        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 = `/auth/v1/oauth2/audit/tokens/{tokenId}/metadata`;
        urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthRefreshTokenInformationFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2AuditTokensTokenIdMetadata(requestParameters, initOverrides) {
        const response = await this.getAuthV1Oauth2AuditTokensTokenIdMetadataRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2ClientRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters['nextPageToken'] != null) {
            queryParameters['nextPageToken'] = requestParameters['nextPageToken'];
        }
        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 = `/auth/v1/oauth2/client`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientListFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2Client(requestParameters = {}, initOverrides) {
        const response = await this.getAuthV1Oauth2ClientRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getAuthV1Oauth2ClientId().');
        }
        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 = `/auth/v1/oauth2/client/{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) => OAuthClientFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2ClientId(requestParameters, initOverrides) {
        const response = await this.getAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2ClientIdAclRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getAuthV1Oauth2ClientIdAcl().');
        }
        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 = `/auth/v1/oauth2/client/{id}/acl`;
        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) => AccessControlListFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2ClientIdAcl(requestParameters, initOverrides) {
        const response = await this.getAuthV1Oauth2ClientIdAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2JwksRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/auth/v1/oauth2/jwks`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => JsonWebKeySetFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2Jwks(initOverrides) {
        const response = await this.getAuthV1Oauth2JwksRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2TokenTokenIdMetadataRaw(requestParameters, initOverrides) {
        if (requestParameters['verifiedOauthClientId'] == null) {
            throw new runtime.RequiredError('verifiedOauthClientId', 'Required parameter "verifiedOauthClientId" was null or undefined when calling getAuthV1Oauth2TokenTokenIdMetadata().');
        }
        if (requestParameters['tokenId'] == null) {
            throw new runtime.RequiredError('tokenId', 'Required parameter "tokenId" was null or undefined when calling getAuthV1Oauth2TokenTokenIdMetadata().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (requestParameters['verifiedOauthClientId'] != null) {
            headerParameters['verifiedOauthClientId'] = String(requestParameters['verifiedOauthClientId']);
        }
        let urlPath = `/auth/v1/oauth2/token/{tokenId}/metadata`;
        urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthRefreshTokenInformationFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1Oauth2TokenTokenIdMetadata(requestParameters, initOverrides) {
        const response = await this.getAuthV1Oauth2TokenTokenIdMetadataRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1Oauth2UserinfoRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (requestParameters['synapseAuthorization'] != null) {
            headerParameters['Synapse-Authorization'] = String(requestParameters['synapseAuthorization']);
        }
        if (requestParameters['accept'] != null) {
            headerParameters['Accept'] = String(requestParameters['accept']);
        }
        let urlPath = `/auth/v1/oauth2/userinfo`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response);
    }
    /**
     */
    async getAuthV1Oauth2Userinfo(requestParameters = {}, initOverrides) {
        const response = await this.getAuthV1Oauth2UserinfoRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getAuthV1WellKnownOpenidConfigurationRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        let urlPath = `/auth/v1/.well-known/openid-configuration`;
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OIDConnectConfigurationFromJSON(jsonValue));
    }
    /**
     */
    async getAuthV1WellKnownOpenidConfiguration(initOverrides) {
        const response = await this.getAuthV1WellKnownOpenidConfigurationRaw(initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2AuditGrantedClientsClientIdRevokeRaw(requestParameters, initOverrides) {
        if (requestParameters['clientId'] == null) {
            throw new runtime.RequiredError('clientId', 'Required parameter "clientId" was null or undefined when calling postAuthV1Oauth2AuditGrantedClientsClientIdRevoke().');
        }
        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 = `/auth/v1/oauth2/audit/grantedClients/{clientId}/revoke`;
        urlPath = urlPath.replace(`{${"clientId"}}`, encodeURIComponent(String(requestParameters['clientId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postAuthV1Oauth2AuditGrantedClientsClientIdRevoke(requestParameters, initOverrides) {
        await this.postAuthV1Oauth2AuditGrantedClientsClientIdRevokeRaw(requestParameters, initOverrides);
    }
    /**
     */
    async postAuthV1Oauth2AuditTokensTokenIdRevokeRaw(requestParameters, initOverrides) {
        if (requestParameters['tokenId'] == null) {
            throw new runtime.RequiredError('tokenId', 'Required parameter "tokenId" was null or undefined when calling postAuthV1Oauth2AuditTokensTokenIdRevoke().');
        }
        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 = `/auth/v1/oauth2/audit/tokens/{tokenId}/revoke`;
        urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postAuthV1Oauth2AuditTokensTokenIdRevoke(requestParameters, initOverrides) {
        await this.postAuthV1Oauth2AuditTokensTokenIdRevokeRaw(requestParameters, initOverrides);
    }
    /**
     */
    async postAuthV1Oauth2ClientRaw(requestParameters, initOverrides) {
        if (requestParameters['oAuthClient'] == null) {
            throw new runtime.RequiredError('oAuthClient', 'Required parameter "oAuthClient" was null or undefined when calling postAuthV1Oauth2Client().');
        }
        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 = `/auth/v1/oauth2/client`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthClientToJSON(requestParameters['oAuthClient']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Client(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2ClientRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2ClientSecretIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling postAuthV1Oauth2ClientSecretId().');
        }
        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 = `/auth/v1/oauth2/client/secret/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientIdAndSecretFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2ClientSecretId(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2ClientSecretIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2ConsentRaw(requestParameters, initOverrides) {
        if (requestParameters['oIDCAuthorizationRequest'] == null) {
            throw new runtime.RequiredError('oIDCAuthorizationRequest', 'Required parameter "oIDCAuthorizationRequest" was null or undefined when calling postAuthV1Oauth2Consent().');
        }
        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 = `/auth/v1/oauth2/consent`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OIDCAuthorizationRequestToJSON(requestParameters['oIDCAuthorizationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthAuthorizationResponseFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Consent(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2ConsentRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2ConsentcheckRaw(requestParameters, initOverrides) {
        if (requestParameters['oIDCAuthorizationRequest'] == null) {
            throw new runtime.RequiredError('oIDCAuthorizationRequest', 'Required parameter "oIDCAuthorizationRequest" was null or undefined when calling postAuthV1Oauth2Consentcheck().');
        }
        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 = `/auth/v1/oauth2/consentcheck`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OIDCAuthorizationRequestToJSON(requestParameters['oIDCAuthorizationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthConsentGrantedResponseFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Consentcheck(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2ConsentcheckRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2DescriptionRaw(requestParameters, initOverrides) {
        if (requestParameters['oIDCAuthorizationRequest'] == null) {
            throw new runtime.RequiredError('oIDCAuthorizationRequest', 'Required parameter "oIDCAuthorizationRequest" was null or undefined when calling postAuthV1Oauth2Description().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        let urlPath = `/auth/v1/oauth2/description`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OIDCAuthorizationRequestToJSON(requestParameters['oIDCAuthorizationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OIDCAuthorizationRequestDescriptionFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Description(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2DescriptionRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2IntrospectRaw(requestParameters, initOverrides) {
        if (requestParameters['oAuthTokenIntrospectionRequest'] == null) {
            throw new runtime.RequiredError('oAuthTokenIntrospectionRequest', 'Required parameter "oAuthTokenIntrospectionRequest" was null or undefined when calling postAuthV1Oauth2Introspect().');
        }
        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 = `/auth/v1/oauth2/introspect`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthTokenIntrospectionRequestToJSON(requestParameters['oAuthTokenIntrospectionRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthTokenIntrospectionResponseFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Introspect(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2IntrospectRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2RevokeRaw(requestParameters, initOverrides) {
        if (requestParameters['verifiedOauthClientId'] == null) {
            throw new runtime.RequiredError('verifiedOauthClientId', 'Required parameter "verifiedOauthClientId" was null or undefined when calling postAuthV1Oauth2Revoke().');
        }
        if (requestParameters['oAuthTokenRevocationRequest'] == null) {
            throw new runtime.RequiredError('oAuthTokenRevocationRequest', 'Required parameter "oAuthTokenRevocationRequest" was null or undefined when calling postAuthV1Oauth2Revoke().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (requestParameters['verifiedOauthClientId'] != null) {
            headerParameters['verifiedOauthClientId'] = String(requestParameters['verifiedOauthClientId']);
        }
        let urlPath = `/auth/v1/oauth2/revoke`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthTokenRevocationRequestToJSON(requestParameters['oAuthTokenRevocationRequest']),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async postAuthV1Oauth2Revoke(requestParameters, initOverrides) {
        await this.postAuthV1Oauth2RevokeRaw(requestParameters, initOverrides);
    }
    /**
     */
    async postAuthV1Oauth2TokenRaw(requestParameters, initOverrides) {
        if (requestParameters['verifiedOauthClientId'] == null) {
            throw new runtime.RequiredError('verifiedOauthClientId', 'Required parameter "verifiedOauthClientId" was null or undefined when calling postAuthV1Oauth2Token().');
        }
        if (requestParameters['grantType'] == null) {
            throw new runtime.RequiredError('grantType', 'Required parameter "grantType" was null or undefined when calling postAuthV1Oauth2Token().');
        }
        const queryParameters = {};
        if (requestParameters['grantType'] != null) {
            queryParameters['grant_type'] = requestParameters['grantType'];
        }
        if (requestParameters['code'] != null) {
            queryParameters['code'] = requestParameters['code'];
        }
        if (requestParameters['redirectUri'] != null) {
            queryParameters['redirect_uri'] = requestParameters['redirectUri'];
        }
        if (requestParameters['refreshToken'] != null) {
            queryParameters['refresh_token'] = requestParameters['refreshToken'];
        }
        if (requestParameters['scope'] != null) {
            queryParameters['scope'] = requestParameters['scope'];
        }
        const headerParameters = {};
        if (requestParameters['verifiedOauthClientId'] != null) {
            headerParameters['verifiedOauthClientId'] = String(requestParameters['verifiedOauthClientId']);
        }
        let urlPath = `/auth/v1/oauth2/token`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OIDCTokenResponseFromJSON(jsonValue));
    }
    /**
     */
    async postAuthV1Oauth2Token(requestParameters, initOverrides) {
        const response = await this.postAuthV1Oauth2TokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postAuthV1Oauth2UserinfoRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (requestParameters['synapseAuthorization'] != null) {
            headerParameters['Synapse-Authorization'] = String(requestParameters['synapseAuthorization']);
        }
        if (requestParameters['accept'] != null) {
            headerParameters['Accept'] = String(requestParameters['accept']);
        }
        let urlPath = `/auth/v1/oauth2/userinfo`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response);
    }
    /**
     */
    async postAuthV1Oauth2Userinfo(requestParameters = {}, initOverrides) {
        const response = await this.postAuthV1Oauth2UserinfoRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putAuthV1Oauth2AuditTokensTokenIdMetadataRaw(requestParameters, initOverrides) {
        if (requestParameters['tokenId'] == null) {
            throw new runtime.RequiredError('tokenId', 'Required parameter "tokenId" was null or undefined when calling putAuthV1Oauth2AuditTokensTokenIdMetadata().');
        }
        if (requestParameters['oAuthRefreshTokenInformation'] == null) {
            throw new runtime.RequiredError('oAuthRefreshTokenInformation', 'Required parameter "oAuthRefreshTokenInformation" was null or undefined when calling putAuthV1Oauth2AuditTokensTokenIdMetadata().');
        }
        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 = `/auth/v1/oauth2/audit/tokens/{tokenId}/metadata`;
        urlPath = urlPath.replace(`{${"tokenId"}}`, encodeURIComponent(String(requestParameters['tokenId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthRefreshTokenInformationToJSON(requestParameters['oAuthRefreshTokenInformation']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthRefreshTokenInformationFromJSON(jsonValue));
    }
    /**
     */
    async putAuthV1Oauth2AuditTokensTokenIdMetadata(requestParameters, initOverrides) {
        const response = await this.putAuthV1Oauth2AuditTokensTokenIdMetadataRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putAuthV1Oauth2ClientId().');
        }
        if (requestParameters['oAuthClient'] == null) {
            throw new runtime.RequiredError('oAuthClient', 'Required parameter "oAuthClient" was null or undefined when calling putAuthV1Oauth2ClientId().');
        }
        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 = `/auth/v1/oauth2/client/{id}`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthClientToJSON(requestParameters['oAuthClient']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientFromJSON(jsonValue));
    }
    /**
     */
    async putAuthV1Oauth2ClientId(requestParameters, initOverrides) {
        const response = await this.putAuthV1Oauth2ClientIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putAuthV1Oauth2ClientIdAclRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putAuthV1Oauth2ClientIdAcl().');
        }
        if (requestParameters['accessControlList'] == null) {
            throw new runtime.RequiredError('accessControlList', 'Required parameter "accessControlList" was null or undefined when calling putAuthV1Oauth2ClientIdAcl().');
        }
        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 = `/auth/v1/oauth2/client/{id}/acl`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: AccessControlListToJSON(requestParameters['accessControlList']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AccessControlListFromJSON(jsonValue));
    }
    /**
     */
    async putAuthV1Oauth2ClientIdAcl(requestParameters, initOverrides) {
        const response = await this.putAuthV1Oauth2ClientIdAclRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putAuthV1Oauth2ClientIdVerificationPrecheckRaw(requestParameters, initOverrides) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling putAuthV1Oauth2ClientIdVerificationPrecheck().');
        }
        if (requestParameters['oAuthClient'] == null) {
            throw new runtime.RequiredError('oAuthClient', 'Required parameter "oAuthClient" was null or undefined when calling putAuthV1Oauth2ClientIdVerificationPrecheck().');
        }
        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 = `/auth/v1/oauth2/client/{id}/verificationPrecheck`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: OAuthClientToJSON(requestParameters['oAuthClient']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => OAuthClientVerificationPrecheckResultFromJSON(jsonValue));
    }
    /**
     */
    async putAuthV1Oauth2ClientIdVerificationPrecheck(requestParameters, initOverrides) {
        const response = await this.putAuthV1Oauth2ClientIdVerificationPrecheckRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=OpenIDConnectServicesApi.js.map