/* tslint:disable */ /* eslint-disable */ /** * Keycloak Admin REST API * This is a REST API reference for the Keycloak Admin * * The version of the OpenAPI document: 1 * * * 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 { AuthenticationExecutionInfoRepresentation, AuthenticationExecutionInfoRepresentationFromJSON, AuthenticationExecutionInfoRepresentationToJSON, AuthenticationExecutionRepresentation, AuthenticationExecutionRepresentationFromJSON, AuthenticationExecutionRepresentationToJSON, AuthenticationFlowRepresentation, AuthenticationFlowRepresentationFromJSON, AuthenticationFlowRepresentationToJSON, AuthenticatorConfigInfoRepresentation, AuthenticatorConfigInfoRepresentationFromJSON, AuthenticatorConfigInfoRepresentationToJSON, AuthenticatorConfigRepresentation, AuthenticatorConfigRepresentationFromJSON, AuthenticatorConfigRepresentationToJSON, RequiredActionProviderRepresentation, RequiredActionProviderRepresentationFromJSON, RequiredActionProviderRepresentationToJSON, } from '../models'; export interface RealmAuthenticationAuthenticatorProvidersGetRequest { realm: string; } export interface RealmAuthenticationClientAuthenticatorProvidersGetRequest { realm: string; } export interface RealmAuthenticationConfigDescriptionProviderIdGetRequest { realm: string; providerId: string; } export interface RealmAuthenticationConfigIdDeleteRequest { realm: string; id: string; } export interface RealmAuthenticationConfigIdGetRequest { realm: string; id: string; } export interface RealmAuthenticationConfigIdPutRequest { realm: string; id: string; authenticatorConfigRepresentation: AuthenticatorConfigRepresentation; } export interface RealmAuthenticationExecutionsExecutionIdConfigPostRequest { realm: string; executionId: string; authenticatorConfigRepresentation: AuthenticatorConfigRepresentation; } export interface RealmAuthenticationExecutionsExecutionIdDeleteRequest { realm: string; executionId: string; } export interface RealmAuthenticationExecutionsExecutionIdGetRequest { realm: string; executionId: string; } export interface RealmAuthenticationExecutionsExecutionIdLowerPriorityPostRequest { realm: string; executionId: string; } export interface RealmAuthenticationExecutionsExecutionIdRaisePriorityPostRequest { realm: string; executionId: string; } export interface RealmAuthenticationExecutionsPostRequest { realm: string; authenticationExecutionRepresentation: AuthenticationExecutionRepresentation; } export interface RealmAuthenticationFlowsFlowAliasCopyPostRequest { realm: string; flowAlias: string; requestBody: { [key: string]: object; }; } export interface RealmAuthenticationFlowsFlowAliasExecutionsExecutionPostRequest { realm: string; flowAlias: string; requestBody: { [key: string]: object; }; } export interface RealmAuthenticationFlowsFlowAliasExecutionsFlowPostRequest { realm: string; flowAlias: string; requestBody: { [key: string]: object; }; } export interface RealmAuthenticationFlowsFlowAliasExecutionsGetRequest { realm: string; flowAlias: string; } export interface RealmAuthenticationFlowsFlowAliasExecutionsPutRequest { realm: string; flowAlias: string; authenticationExecutionInfoRepresentation: AuthenticationExecutionInfoRepresentation; } export interface RealmAuthenticationFlowsGetRequest { realm: string; } export interface RealmAuthenticationFlowsIdDeleteRequest { realm: string; id: string; } export interface RealmAuthenticationFlowsIdGetRequest { realm: string; id: string; } export interface RealmAuthenticationFlowsIdPutRequest { realm: string; id: string; authenticationFlowRepresentation: AuthenticationFlowRepresentation; } export interface RealmAuthenticationFlowsPostRequest { realm: string; authenticationFlowRepresentation: AuthenticationFlowRepresentation; } export interface RealmAuthenticationFormActionProvidersGetRequest { realm: string; } export interface RealmAuthenticationFormProvidersGetRequest { realm: string; } export interface RealmAuthenticationPerClientConfigDescriptionGetRequest { realm: string; } export interface RealmAuthenticationRegisterRequiredActionPostRequest { realm: string; requestBody: { [key: string]: object; }; } export interface RealmAuthenticationRequiredActionsAliasDeleteRequest { realm: string; alias: string; } export interface RealmAuthenticationRequiredActionsAliasGetRequest { realm: string; alias: string; } export interface RealmAuthenticationRequiredActionsAliasLowerPriorityPostRequest { realm: string; alias: string; } export interface RealmAuthenticationRequiredActionsAliasPutRequest { realm: string; alias: string; requiredActionProviderRepresentation: RequiredActionProviderRepresentation; } export interface RealmAuthenticationRequiredActionsAliasRaisePriorityPostRequest { realm: string; alias: string; } export interface RealmAuthenticationRequiredActionsGetRequest { realm: string; } export interface RealmAuthenticationUnregisteredRequiredActionsGetRequest { realm: string; } /** * */ export class AuthenticationManagementApi extends runtime.BaseAPI { /** * Get authenticator providers Returns a stream of authenticator providers. */ async realmAuthenticationAuthenticatorProvidersGetRaw(requestParameters: RealmAuthenticationAuthenticatorProvidersGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationAuthenticatorProvidersGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/authenticator-providers`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get authenticator providers Returns a stream of authenticator providers. */ async realmAuthenticationAuthenticatorProvidersGet(requestParameters: RealmAuthenticationAuthenticatorProvidersGetRequest): Promise> { const response = await this.realmAuthenticationAuthenticatorProvidersGetRaw(requestParameters); return await response.value(); } /** * Get client authenticator providers Returns a stream of client authenticator providers. */ async realmAuthenticationClientAuthenticatorProvidersGetRaw(requestParameters: RealmAuthenticationClientAuthenticatorProvidersGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationClientAuthenticatorProvidersGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/client-authenticator-providers`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get client authenticator providers Returns a stream of client authenticator providers. */ async realmAuthenticationClientAuthenticatorProvidersGet(requestParameters: RealmAuthenticationClientAuthenticatorProvidersGetRequest): Promise> { const response = await this.realmAuthenticationClientAuthenticatorProvidersGetRaw(requestParameters); return await response.value(); } /** * Get authenticator provider’s configuration description */ async realmAuthenticationConfigDescriptionProviderIdGetRaw(requestParameters: RealmAuthenticationConfigDescriptionProviderIdGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationConfigDescriptionProviderIdGet.'); } if (requestParameters.providerId === null || requestParameters.providerId === undefined) { throw new runtime.RequiredError('providerId','Required parameter requestParameters.providerId was null or undefined when calling realmAuthenticationConfigDescriptionProviderIdGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/config-description/{providerId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"providerId"}}`, encodeURIComponent(String(requestParameters.providerId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => AuthenticatorConfigInfoRepresentationFromJSON(jsonValue)); } /** * Get authenticator provider’s configuration description */ async realmAuthenticationConfigDescriptionProviderIdGet(requestParameters: RealmAuthenticationConfigDescriptionProviderIdGetRequest): Promise { const response = await this.realmAuthenticationConfigDescriptionProviderIdGetRaw(requestParameters); return await response.value(); } /** * Delete authenticator configuration */ async realmAuthenticationConfigIdDeleteRaw(requestParameters: RealmAuthenticationConfigIdDeleteRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationConfigIdDelete.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationConfigIdDelete.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/config/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Delete authenticator configuration */ async realmAuthenticationConfigIdDelete(requestParameters: RealmAuthenticationConfigIdDeleteRequest): Promise { await this.realmAuthenticationConfigIdDeleteRaw(requestParameters); } /** * Get authenticator configuration */ async realmAuthenticationConfigIdGetRaw(requestParameters: RealmAuthenticationConfigIdGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationConfigIdGet.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationConfigIdGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/config/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => AuthenticatorConfigRepresentationFromJSON(jsonValue)); } /** * Get authenticator configuration */ async realmAuthenticationConfigIdGet(requestParameters: RealmAuthenticationConfigIdGetRequest): Promise { const response = await this.realmAuthenticationConfigIdGetRaw(requestParameters); return await response.value(); } /** * Update authenticator configuration */ async realmAuthenticationConfigIdPutRaw(requestParameters: RealmAuthenticationConfigIdPutRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationConfigIdPut.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationConfigIdPut.'); } if (requestParameters.authenticatorConfigRepresentation === null || requestParameters.authenticatorConfigRepresentation === undefined) { throw new runtime.RequiredError('authenticatorConfigRepresentation','Required parameter requestParameters.authenticatorConfigRepresentation was null or undefined when calling realmAuthenticationConfigIdPut.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/config/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'PUT', headers: headerParameters, query: queryParameters, body: AuthenticatorConfigRepresentationToJSON(requestParameters.authenticatorConfigRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Update authenticator configuration */ async realmAuthenticationConfigIdPut(requestParameters: RealmAuthenticationConfigIdPutRequest): Promise { await this.realmAuthenticationConfigIdPutRaw(requestParameters); } /** * Update execution with new configuration */ async realmAuthenticationExecutionsExecutionIdConfigPostRaw(requestParameters: RealmAuthenticationExecutionsExecutionIdConfigPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsExecutionIdConfigPost.'); } if (requestParameters.executionId === null || requestParameters.executionId === undefined) { throw new runtime.RequiredError('executionId','Required parameter requestParameters.executionId was null or undefined when calling realmAuthenticationExecutionsExecutionIdConfigPost.'); } if (requestParameters.authenticatorConfigRepresentation === null || requestParameters.authenticatorConfigRepresentation === undefined) { throw new runtime.RequiredError('authenticatorConfigRepresentation','Required parameter requestParameters.authenticatorConfigRepresentation was null or undefined when calling realmAuthenticationExecutionsExecutionIdConfigPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions/{executionId}/config`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"executionId"}}`, encodeURIComponent(String(requestParameters.executionId))), method: 'POST', headers: headerParameters, query: queryParameters, body: AuthenticatorConfigRepresentationToJSON(requestParameters.authenticatorConfigRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Update execution with new configuration */ async realmAuthenticationExecutionsExecutionIdConfigPost(requestParameters: RealmAuthenticationExecutionsExecutionIdConfigPostRequest): Promise { await this.realmAuthenticationExecutionsExecutionIdConfigPostRaw(requestParameters); } /** * Delete execution */ async realmAuthenticationExecutionsExecutionIdDeleteRaw(requestParameters: RealmAuthenticationExecutionsExecutionIdDeleteRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsExecutionIdDelete.'); } if (requestParameters.executionId === null || requestParameters.executionId === undefined) { throw new runtime.RequiredError('executionId','Required parameter requestParameters.executionId was null or undefined when calling realmAuthenticationExecutionsExecutionIdDelete.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions/{executionId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"executionId"}}`, encodeURIComponent(String(requestParameters.executionId))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Delete execution */ async realmAuthenticationExecutionsExecutionIdDelete(requestParameters: RealmAuthenticationExecutionsExecutionIdDeleteRequest): Promise { await this.realmAuthenticationExecutionsExecutionIdDeleteRaw(requestParameters); } /** * Get Single Execution */ async realmAuthenticationExecutionsExecutionIdGetRaw(requestParameters: RealmAuthenticationExecutionsExecutionIdGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsExecutionIdGet.'); } if (requestParameters.executionId === null || requestParameters.executionId === undefined) { throw new runtime.RequiredError('executionId','Required parameter requestParameters.executionId was null or undefined when calling realmAuthenticationExecutionsExecutionIdGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions/{executionId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"executionId"}}`, encodeURIComponent(String(requestParameters.executionId))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Get Single Execution */ async realmAuthenticationExecutionsExecutionIdGet(requestParameters: RealmAuthenticationExecutionsExecutionIdGetRequest): Promise { await this.realmAuthenticationExecutionsExecutionIdGetRaw(requestParameters); } /** * Lower execution’s priority */ async realmAuthenticationExecutionsExecutionIdLowerPriorityPostRaw(requestParameters: RealmAuthenticationExecutionsExecutionIdLowerPriorityPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsExecutionIdLowerPriorityPost.'); } if (requestParameters.executionId === null || requestParameters.executionId === undefined) { throw new runtime.RequiredError('executionId','Required parameter requestParameters.executionId was null or undefined when calling realmAuthenticationExecutionsExecutionIdLowerPriorityPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions/{executionId}/lower-priority`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"executionId"}}`, encodeURIComponent(String(requestParameters.executionId))), method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Lower execution’s priority */ async realmAuthenticationExecutionsExecutionIdLowerPriorityPost(requestParameters: RealmAuthenticationExecutionsExecutionIdLowerPriorityPostRequest): Promise { await this.realmAuthenticationExecutionsExecutionIdLowerPriorityPostRaw(requestParameters); } /** * Raise execution’s priority */ async realmAuthenticationExecutionsExecutionIdRaisePriorityPostRaw(requestParameters: RealmAuthenticationExecutionsExecutionIdRaisePriorityPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsExecutionIdRaisePriorityPost.'); } if (requestParameters.executionId === null || requestParameters.executionId === undefined) { throw new runtime.RequiredError('executionId','Required parameter requestParameters.executionId was null or undefined when calling realmAuthenticationExecutionsExecutionIdRaisePriorityPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions/{executionId}/raise-priority`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"executionId"}}`, encodeURIComponent(String(requestParameters.executionId))), method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Raise execution’s priority */ async realmAuthenticationExecutionsExecutionIdRaisePriorityPost(requestParameters: RealmAuthenticationExecutionsExecutionIdRaisePriorityPostRequest): Promise { await this.realmAuthenticationExecutionsExecutionIdRaisePriorityPostRaw(requestParameters); } /** * Add new authentication execution */ async realmAuthenticationExecutionsPostRaw(requestParameters: RealmAuthenticationExecutionsPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationExecutionsPost.'); } if (requestParameters.authenticationExecutionRepresentation === null || requestParameters.authenticationExecutionRepresentation === undefined) { throw new runtime.RequiredError('authenticationExecutionRepresentation','Required parameter requestParameters.authenticationExecutionRepresentation was null or undefined when calling realmAuthenticationExecutionsPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/executions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'POST', headers: headerParameters, query: queryParameters, body: AuthenticationExecutionRepresentationToJSON(requestParameters.authenticationExecutionRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Add new authentication execution */ async realmAuthenticationExecutionsPost(requestParameters: RealmAuthenticationExecutionsPostRequest): Promise { await this.realmAuthenticationExecutionsPostRaw(requestParameters); } /** * Copy existing authentication flow under a new name The new name is given as \'newName\' attribute of the passed JSON object */ async realmAuthenticationFlowsFlowAliasCopyPostRaw(requestParameters: RealmAuthenticationFlowsFlowAliasCopyPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsFlowAliasCopyPost.'); } if (requestParameters.flowAlias === null || requestParameters.flowAlias === undefined) { throw new runtime.RequiredError('flowAlias','Required parameter requestParameters.flowAlias was null or undefined when calling realmAuthenticationFlowsFlowAliasCopyPost.'); } if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) { throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling realmAuthenticationFlowsFlowAliasCopyPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{flowAlias}/copy`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"flowAlias"}}`, encodeURIComponent(String(requestParameters.flowAlias))), method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters.requestBody, }); return new runtime.VoidApiResponse(response); } /** * Copy existing authentication flow under a new name The new name is given as \'newName\' attribute of the passed JSON object */ async realmAuthenticationFlowsFlowAliasCopyPost(requestParameters: RealmAuthenticationFlowsFlowAliasCopyPostRequest): Promise { await this.realmAuthenticationFlowsFlowAliasCopyPostRaw(requestParameters); } /** * Add new authentication execution to a flow */ async realmAuthenticationFlowsFlowAliasExecutionsExecutionPostRaw(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsExecutionPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsExecutionPost.'); } if (requestParameters.flowAlias === null || requestParameters.flowAlias === undefined) { throw new runtime.RequiredError('flowAlias','Required parameter requestParameters.flowAlias was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsExecutionPost.'); } if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) { throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsExecutionPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{flowAlias}/executions/execution`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"flowAlias"}}`, encodeURIComponent(String(requestParameters.flowAlias))), method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters.requestBody, }); return new runtime.VoidApiResponse(response); } /** * Add new authentication execution to a flow */ async realmAuthenticationFlowsFlowAliasExecutionsExecutionPost(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsExecutionPostRequest): Promise { await this.realmAuthenticationFlowsFlowAliasExecutionsExecutionPostRaw(requestParameters); } /** * Add new flow with new execution to existing flow */ async realmAuthenticationFlowsFlowAliasExecutionsFlowPostRaw(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsFlowPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsFlowPost.'); } if (requestParameters.flowAlias === null || requestParameters.flowAlias === undefined) { throw new runtime.RequiredError('flowAlias','Required parameter requestParameters.flowAlias was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsFlowPost.'); } if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) { throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsFlowPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{flowAlias}/executions/flow`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"flowAlias"}}`, encodeURIComponent(String(requestParameters.flowAlias))), method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters.requestBody, }); return new runtime.VoidApiResponse(response); } /** * Add new flow with new execution to existing flow */ async realmAuthenticationFlowsFlowAliasExecutionsFlowPost(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsFlowPostRequest): Promise { await this.realmAuthenticationFlowsFlowAliasExecutionsFlowPostRaw(requestParameters); } /** * Get authentication executions for a flow */ async realmAuthenticationFlowsFlowAliasExecutionsGetRaw(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsGet.'); } if (requestParameters.flowAlias === null || requestParameters.flowAlias === undefined) { throw new runtime.RequiredError('flowAlias','Required parameter requestParameters.flowAlias was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{flowAlias}/executions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"flowAlias"}}`, encodeURIComponent(String(requestParameters.flowAlias))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Get authentication executions for a flow */ async realmAuthenticationFlowsFlowAliasExecutionsGet(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsGetRequest): Promise { await this.realmAuthenticationFlowsFlowAliasExecutionsGetRaw(requestParameters); } /** * Update authentication executions of a Flow */ async realmAuthenticationFlowsFlowAliasExecutionsPutRaw(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsPutRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsPut.'); } if (requestParameters.flowAlias === null || requestParameters.flowAlias === undefined) { throw new runtime.RequiredError('flowAlias','Required parameter requestParameters.flowAlias was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsPut.'); } if (requestParameters.authenticationExecutionInfoRepresentation === null || requestParameters.authenticationExecutionInfoRepresentation === undefined) { throw new runtime.RequiredError('authenticationExecutionInfoRepresentation','Required parameter requestParameters.authenticationExecutionInfoRepresentation was null or undefined when calling realmAuthenticationFlowsFlowAliasExecutionsPut.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{flowAlias}/executions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"flowAlias"}}`, encodeURIComponent(String(requestParameters.flowAlias))), method: 'PUT', headers: headerParameters, query: queryParameters, body: AuthenticationExecutionInfoRepresentationToJSON(requestParameters.authenticationExecutionInfoRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Update authentication executions of a Flow */ async realmAuthenticationFlowsFlowAliasExecutionsPut(requestParameters: RealmAuthenticationFlowsFlowAliasExecutionsPutRequest): Promise { await this.realmAuthenticationFlowsFlowAliasExecutionsPutRaw(requestParameters); } /** * Get authentication flows Returns a stream of authentication flows. */ async realmAuthenticationFlowsGetRaw(requestParameters: RealmAuthenticationFlowsGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get authentication flows Returns a stream of authentication flows. */ async realmAuthenticationFlowsGet(requestParameters: RealmAuthenticationFlowsGetRequest): Promise> { const response = await this.realmAuthenticationFlowsGetRaw(requestParameters); return await response.value(); } /** * Delete an authentication flow */ async realmAuthenticationFlowsIdDeleteRaw(requestParameters: RealmAuthenticationFlowsIdDeleteRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsIdDelete.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationFlowsIdDelete.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Delete an authentication flow */ async realmAuthenticationFlowsIdDelete(requestParameters: RealmAuthenticationFlowsIdDeleteRequest): Promise { await this.realmAuthenticationFlowsIdDeleteRaw(requestParameters); } /** * Get authentication flow for id */ async realmAuthenticationFlowsIdGetRaw(requestParameters: RealmAuthenticationFlowsIdGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsIdGet.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationFlowsIdGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => AuthenticationFlowRepresentationFromJSON(jsonValue)); } /** * Get authentication flow for id */ async realmAuthenticationFlowsIdGet(requestParameters: RealmAuthenticationFlowsIdGetRequest): Promise { const response = await this.realmAuthenticationFlowsIdGetRaw(requestParameters); return await response.value(); } /** * Update an authentication flow */ async realmAuthenticationFlowsIdPutRaw(requestParameters: RealmAuthenticationFlowsIdPutRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsIdPut.'); } if (requestParameters.id === null || requestParameters.id === undefined) { throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmAuthenticationFlowsIdPut.'); } if (requestParameters.authenticationFlowRepresentation === null || requestParameters.authenticationFlowRepresentation === undefined) { throw new runtime.RequiredError('authenticationFlowRepresentation','Required parameter requestParameters.authenticationFlowRepresentation was null or undefined when calling realmAuthenticationFlowsIdPut.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))), method: 'PUT', headers: headerParameters, query: queryParameters, body: AuthenticationFlowRepresentationToJSON(requestParameters.authenticationFlowRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Update an authentication flow */ async realmAuthenticationFlowsIdPut(requestParameters: RealmAuthenticationFlowsIdPutRequest): Promise { await this.realmAuthenticationFlowsIdPutRaw(requestParameters); } /** * Create a new authentication flow */ async realmAuthenticationFlowsPostRaw(requestParameters: RealmAuthenticationFlowsPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFlowsPost.'); } if (requestParameters.authenticationFlowRepresentation === null || requestParameters.authenticationFlowRepresentation === undefined) { throw new runtime.RequiredError('authenticationFlowRepresentation','Required parameter requestParameters.authenticationFlowRepresentation was null or undefined when calling realmAuthenticationFlowsPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/flows`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'POST', headers: headerParameters, query: queryParameters, body: AuthenticationFlowRepresentationToJSON(requestParameters.authenticationFlowRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Create a new authentication flow */ async realmAuthenticationFlowsPost(requestParameters: RealmAuthenticationFlowsPostRequest): Promise { await this.realmAuthenticationFlowsPostRaw(requestParameters); } /** * Get form action providers Returns a stream of form action providers. */ async realmAuthenticationFormActionProvidersGetRaw(requestParameters: RealmAuthenticationFormActionProvidersGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFormActionProvidersGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/form-action-providers`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get form action providers Returns a stream of form action providers. */ async realmAuthenticationFormActionProvidersGet(requestParameters: RealmAuthenticationFormActionProvidersGetRequest): Promise> { const response = await this.realmAuthenticationFormActionProvidersGetRaw(requestParameters); return await response.value(); } /** * Get form providers Returns a stream of form providers. */ async realmAuthenticationFormProvidersGetRaw(requestParameters: RealmAuthenticationFormProvidersGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationFormProvidersGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/form-providers`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get form providers Returns a stream of form providers. */ async realmAuthenticationFormProvidersGet(requestParameters: RealmAuthenticationFormProvidersGetRequest): Promise> { const response = await this.realmAuthenticationFormProvidersGetRaw(requestParameters); return await response.value(); } /** * Get configuration descriptions for all clients */ async realmAuthenticationPerClientConfigDescriptionGetRaw(requestParameters: RealmAuthenticationPerClientConfigDescriptionGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationPerClientConfigDescriptionGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/per-client-config-description`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get configuration descriptions for all clients */ async realmAuthenticationPerClientConfigDescriptionGet(requestParameters: RealmAuthenticationPerClientConfigDescriptionGetRequest): Promise<{ [key: string]: object; }> { const response = await this.realmAuthenticationPerClientConfigDescriptionGetRaw(requestParameters); return await response.value(); } /** * Register a new required actions */ async realmAuthenticationRegisterRequiredActionPostRaw(requestParameters: RealmAuthenticationRegisterRequiredActionPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRegisterRequiredActionPost.'); } if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) { throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling realmAuthenticationRegisterRequiredActionPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/register-required-action`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'POST', headers: headerParameters, query: queryParameters, body: requestParameters.requestBody, }); return new runtime.VoidApiResponse(response); } /** * Register a new required actions */ async realmAuthenticationRegisterRequiredActionPost(requestParameters: RealmAuthenticationRegisterRequiredActionPostRequest): Promise { await this.realmAuthenticationRegisterRequiredActionPostRaw(requestParameters); } /** * Delete required action */ async realmAuthenticationRequiredActionsAliasDeleteRaw(requestParameters: RealmAuthenticationRequiredActionsAliasDeleteRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsAliasDelete.'); } if (requestParameters.alias === null || requestParameters.alias === undefined) { throw new runtime.RequiredError('alias','Required parameter requestParameters.alias was null or undefined when calling realmAuthenticationRequiredActionsAliasDelete.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions/{alias}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"alias"}}`, encodeURIComponent(String(requestParameters.alias))), method: 'DELETE', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Delete required action */ async realmAuthenticationRequiredActionsAliasDelete(requestParameters: RealmAuthenticationRequiredActionsAliasDeleteRequest): Promise { await this.realmAuthenticationRequiredActionsAliasDeleteRaw(requestParameters); } /** * Get required action for alias */ async realmAuthenticationRequiredActionsAliasGetRaw(requestParameters: RealmAuthenticationRequiredActionsAliasGetRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsAliasGet.'); } if (requestParameters.alias === null || requestParameters.alias === undefined) { throw new runtime.RequiredError('alias','Required parameter requestParameters.alias was null or undefined when calling realmAuthenticationRequiredActionsAliasGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions/{alias}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"alias"}}`, encodeURIComponent(String(requestParameters.alias))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response, (jsonValue) => RequiredActionProviderRepresentationFromJSON(jsonValue)); } /** * Get required action for alias */ async realmAuthenticationRequiredActionsAliasGet(requestParameters: RealmAuthenticationRequiredActionsAliasGetRequest): Promise { const response = await this.realmAuthenticationRequiredActionsAliasGetRaw(requestParameters); return await response.value(); } /** * Lower required action’s priority */ async realmAuthenticationRequiredActionsAliasLowerPriorityPostRaw(requestParameters: RealmAuthenticationRequiredActionsAliasLowerPriorityPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsAliasLowerPriorityPost.'); } if (requestParameters.alias === null || requestParameters.alias === undefined) { throw new runtime.RequiredError('alias','Required parameter requestParameters.alias was null or undefined when calling realmAuthenticationRequiredActionsAliasLowerPriorityPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions/{alias}/lower-priority`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"alias"}}`, encodeURIComponent(String(requestParameters.alias))), method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Lower required action’s priority */ async realmAuthenticationRequiredActionsAliasLowerPriorityPost(requestParameters: RealmAuthenticationRequiredActionsAliasLowerPriorityPostRequest): Promise { await this.realmAuthenticationRequiredActionsAliasLowerPriorityPostRaw(requestParameters); } /** * Update required action */ async realmAuthenticationRequiredActionsAliasPutRaw(requestParameters: RealmAuthenticationRequiredActionsAliasPutRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsAliasPut.'); } if (requestParameters.alias === null || requestParameters.alias === undefined) { throw new runtime.RequiredError('alias','Required parameter requestParameters.alias was null or undefined when calling realmAuthenticationRequiredActionsAliasPut.'); } if (requestParameters.requiredActionProviderRepresentation === null || requestParameters.requiredActionProviderRepresentation === undefined) { throw new runtime.RequiredError('requiredActionProviderRepresentation','Required parameter requestParameters.requiredActionProviderRepresentation was null or undefined when calling realmAuthenticationRequiredActionsAliasPut.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions/{alias}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"alias"}}`, encodeURIComponent(String(requestParameters.alias))), method: 'PUT', headers: headerParameters, query: queryParameters, body: RequiredActionProviderRepresentationToJSON(requestParameters.requiredActionProviderRepresentation), }); return new runtime.VoidApiResponse(response); } /** * Update required action */ async realmAuthenticationRequiredActionsAliasPut(requestParameters: RealmAuthenticationRequiredActionsAliasPutRequest): Promise { await this.realmAuthenticationRequiredActionsAliasPutRaw(requestParameters); } /** * Raise required action’s priority */ async realmAuthenticationRequiredActionsAliasRaisePriorityPostRaw(requestParameters: RealmAuthenticationRequiredActionsAliasRaisePriorityPostRequest): Promise> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsAliasRaisePriorityPost.'); } if (requestParameters.alias === null || requestParameters.alias === undefined) { throw new runtime.RequiredError('alias','Required parameter requestParameters.alias was null or undefined when calling realmAuthenticationRequiredActionsAliasRaisePriorityPost.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions/{alias}/raise-priority`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"alias"}}`, encodeURIComponent(String(requestParameters.alias))), method: 'POST', headers: headerParameters, query: queryParameters, }); return new runtime.VoidApiResponse(response); } /** * Raise required action’s priority */ async realmAuthenticationRequiredActionsAliasRaisePriorityPost(requestParameters: RealmAuthenticationRequiredActionsAliasRaisePriorityPostRequest): Promise { await this.realmAuthenticationRequiredActionsAliasRaisePriorityPostRaw(requestParameters); } /** * Get required actions Returns a stream of required actions. */ async realmAuthenticationRequiredActionsGetRaw(requestParameters: RealmAuthenticationRequiredActionsGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationRequiredActionsGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/required-actions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get required actions Returns a stream of required actions. */ async realmAuthenticationRequiredActionsGet(requestParameters: RealmAuthenticationRequiredActionsGetRequest): Promise> { const response = await this.realmAuthenticationRequiredActionsGetRaw(requestParameters); return await response.value(); } /** * Get unregistered required actions Returns a stream of unregistered required actions. */ async realmAuthenticationUnregisteredRequiredActionsGetRaw(requestParameters: RealmAuthenticationUnregisteredRequiredActionsGetRequest): Promise>> { if (requestParameters.realm === null || requestParameters.realm === undefined) { throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmAuthenticationUnregisteredRequiredActionsGet.'); } const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; if (this.configuration && this.configuration.accessToken) { const token = this.configuration.accessToken; const tokenString = typeof token === 'function' ? token("access_token", []) : token; if (tokenString) { headerParameters["Authorization"] = `Bearer ${tokenString}`; } } const response = await this.request({ path: `/{realm}/authentication/unregistered-required-actions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))), method: 'GET', headers: headerParameters, query: queryParameters, }); return new runtime.JSONApiResponse(response); } /** * Get unregistered required actions Returns a stream of unregistered required actions. */ async realmAuthenticationUnregisteredRequiredActionsGet(requestParameters: RealmAuthenticationUnregisteredRequiredActionsGetRequest): Promise> { const response = await this.realmAuthenticationUnregisteredRequiredActionsGetRaw(requestParameters); return await response.value(); } }