1781 lines
81 KiB
TypeScript
1781 lines
81 KiB
TypeScript
/* 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 {
|
||
AccessToken,
|
||
AccessTokenFromJSON,
|
||
AccessTokenToJSON,
|
||
ClientRepresentation,
|
||
ClientRepresentationFromJSON,
|
||
ClientRepresentationToJSON,
|
||
CredentialRepresentation,
|
||
CredentialRepresentationFromJSON,
|
||
CredentialRepresentationToJSON,
|
||
GlobalRequestResult,
|
||
GlobalRequestResultFromJSON,
|
||
GlobalRequestResultToJSON,
|
||
IDToken,
|
||
IDTokenFromJSON,
|
||
IDTokenToJSON,
|
||
ManagementPermissionReference,
|
||
ManagementPermissionReferenceFromJSON,
|
||
ManagementPermissionReferenceToJSON,
|
||
UserRepresentation,
|
||
UserRepresentationFromJSON,
|
||
UserRepresentationToJSON,
|
||
} from '../models';
|
||
|
||
export interface RealmClientsGetRequest {
|
||
realm: string;
|
||
clientId?: string;
|
||
first?: number;
|
||
max?: number;
|
||
q?: string;
|
||
search?: boolean;
|
||
viewableOnly?: boolean;
|
||
}
|
||
|
||
export interface RealmClientsIdClientSecretGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdClientSecretPostRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdClientSecretRotatedDeleteRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdClientSecretRotatedGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdDefaultClientScopesClientScopeIdDeleteRequest {
|
||
realm: string;
|
||
id: string;
|
||
clientScopeId: string;
|
||
}
|
||
|
||
export interface RealmClientsIdDefaultClientScopesClientScopeIdPutRequest {
|
||
realm: string;
|
||
id: string;
|
||
clientScopeId: string;
|
||
}
|
||
|
||
export interface RealmClientsIdDefaultClientScopesGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdDeleteRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesGenerateExampleAccessTokenGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
scope?: string;
|
||
userId?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesGenerateExampleIdTokenGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
scope?: string;
|
||
userId?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesGenerateExampleUserinfoGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
scope?: string;
|
||
userId?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesProtocolMappersGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
scope?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
roleContainerId: string;
|
||
scope?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
roleContainerId: string;
|
||
scope?: string;
|
||
}
|
||
|
||
export interface RealmClientsIdGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdInstallationProvidersProviderIdGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
providerId: string;
|
||
}
|
||
|
||
export interface RealmClientsIdManagementPermissionsGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdManagementPermissionsPutRequest {
|
||
realm: string;
|
||
id: string;
|
||
managementPermissionReference: ManagementPermissionReference;
|
||
}
|
||
|
||
export interface RealmClientsIdNodesNodeDeleteRequest {
|
||
realm: string;
|
||
id: string;
|
||
node: string;
|
||
}
|
||
|
||
export interface RealmClientsIdNodesPostRequest {
|
||
realm: string;
|
||
id: string;
|
||
requestBody: { [key: string]: object; };
|
||
}
|
||
|
||
export interface RealmClientsIdOfflineSessionCountGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdOfflineSessionsGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
first?: number;
|
||
max?: number;
|
||
}
|
||
|
||
export interface RealmClientsIdOptionalClientScopesClientScopeIdDeleteRequest {
|
||
realm: string;
|
||
id: string;
|
||
clientScopeId: string;
|
||
}
|
||
|
||
export interface RealmClientsIdOptionalClientScopesClientScopeIdPutRequest {
|
||
realm: string;
|
||
id: string;
|
||
clientScopeId: string;
|
||
}
|
||
|
||
export interface RealmClientsIdOptionalClientScopesGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdPushRevocationPostRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdPutRequest {
|
||
realm: string;
|
||
id: string;
|
||
clientRepresentation: ClientRepresentation;
|
||
}
|
||
|
||
export interface RealmClientsIdRegistrationAccessTokenPostRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdServiceAccountUserGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdSessionCountGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdTestNodesAvailableGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
}
|
||
|
||
export interface RealmClientsIdUserSessionsGetRequest {
|
||
realm: string;
|
||
id: string;
|
||
first?: number;
|
||
max?: number;
|
||
}
|
||
|
||
export interface RealmClientsPostRequest {
|
||
realm: string;
|
||
clientRepresentation: ClientRepresentation;
|
||
}
|
||
|
||
/**
|
||
*
|
||
*/
|
||
export class ClientsApi extends runtime.BaseAPI {
|
||
|
||
/**
|
||
* Get clients belonging to the realm.
|
||
*/
|
||
async realmClientsGetRaw(requestParameters: RealmClientsGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.clientId !== undefined) {
|
||
queryParameters['clientId'] = requestParameters.clientId;
|
||
}
|
||
|
||
if (requestParameters.first !== undefined) {
|
||
queryParameters['first'] = requestParameters.first;
|
||
}
|
||
|
||
if (requestParameters.max !== undefined) {
|
||
queryParameters['max'] = requestParameters.max;
|
||
}
|
||
|
||
if (requestParameters.q !== undefined) {
|
||
queryParameters['q'] = requestParameters.q;
|
||
}
|
||
|
||
if (requestParameters.search !== undefined) {
|
||
queryParameters['search'] = requestParameters.search;
|
||
}
|
||
|
||
if (requestParameters.viewableOnly !== undefined) {
|
||
queryParameters['viewableOnly'] = requestParameters.viewableOnly;
|
||
}
|
||
|
||
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}/clients`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get clients belonging to the realm.
|
||
*/
|
||
async realmClientsGet(requestParameters: RealmClientsGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get the client secret
|
||
*/
|
||
async realmClientsIdClientSecretGetRaw(requestParameters: RealmClientsIdClientSecretGetRequest): Promise<runtime.ApiResponse<CredentialRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdClientSecretGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdClientSecretGet.');
|
||
}
|
||
|
||
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}/clients/{id}/client-secret`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => CredentialRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Get the client secret
|
||
*/
|
||
async realmClientsIdClientSecretGet(requestParameters: RealmClientsIdClientSecretGetRequest): Promise<CredentialRepresentation> {
|
||
const response = await this.realmClientsIdClientSecretGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Generate a new secret for the client
|
||
*/
|
||
async realmClientsIdClientSecretPostRaw(requestParameters: RealmClientsIdClientSecretPostRequest): Promise<runtime.ApiResponse<CredentialRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdClientSecretPost.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdClientSecretPost.');
|
||
}
|
||
|
||
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}/clients/{id}/client-secret`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => CredentialRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Generate a new secret for the client
|
||
*/
|
||
async realmClientsIdClientSecretPost(requestParameters: RealmClientsIdClientSecretPostRequest): Promise<CredentialRepresentation> {
|
||
const response = await this.realmClientsIdClientSecretPostRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Invalidate the rotated secret for the client
|
||
*/
|
||
async realmClientsIdClientSecretRotatedDeleteRaw(requestParameters: RealmClientsIdClientSecretRotatedDeleteRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdClientSecretRotatedDelete.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdClientSecretRotatedDelete.');
|
||
}
|
||
|
||
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}/clients/{id}/client-secret/rotated`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'DELETE',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
* Invalidate the rotated secret for the client
|
||
*/
|
||
async realmClientsIdClientSecretRotatedDelete(requestParameters: RealmClientsIdClientSecretRotatedDeleteRequest): Promise<void> {
|
||
await this.realmClientsIdClientSecretRotatedDeleteRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Get the rotated client secret
|
||
*/
|
||
async realmClientsIdClientSecretRotatedGetRaw(requestParameters: RealmClientsIdClientSecretRotatedGetRequest): Promise<runtime.ApiResponse<CredentialRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdClientSecretRotatedGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdClientSecretRotatedGet.');
|
||
}
|
||
|
||
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}/clients/{id}/client-secret/rotated`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => CredentialRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Get the rotated client secret
|
||
*/
|
||
async realmClientsIdClientSecretRotatedGet(requestParameters: RealmClientsIdClientSecretRotatedGetRequest): Promise<CredentialRepresentation> {
|
||
const response = await this.realmClientsIdClientSecretRotatedGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdDefaultClientScopesClientScopeIdDeleteRaw(requestParameters: RealmClientsIdDefaultClientScopesClientScopeIdDeleteRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
if (requestParameters.clientScopeId === null || requestParameters.clientScopeId === undefined) {
|
||
throw new runtime.RequiredError('clientScopeId','Required parameter requestParameters.clientScopeId was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
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}/clients/{id}/default-client-scopes/{clientScopeId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"clientScopeId"}}`, encodeURIComponent(String(requestParameters.clientScopeId))),
|
||
method: 'DELETE',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdDefaultClientScopesClientScopeIdDelete(requestParameters: RealmClientsIdDefaultClientScopesClientScopeIdDeleteRequest): Promise<void> {
|
||
await this.realmClientsIdDefaultClientScopesClientScopeIdDeleteRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdDefaultClientScopesClientScopeIdPutRaw(requestParameters: RealmClientsIdDefaultClientScopesClientScopeIdPutRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
if (requestParameters.clientScopeId === null || requestParameters.clientScopeId === undefined) {
|
||
throw new runtime.RequiredError('clientScopeId','Required parameter requestParameters.clientScopeId was null or undefined when calling realmClientsIdDefaultClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
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}/clients/{id}/default-client-scopes/{clientScopeId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"clientScopeId"}}`, encodeURIComponent(String(requestParameters.clientScopeId))),
|
||
method: 'PUT',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdDefaultClientScopesClientScopeIdPut(requestParameters: RealmClientsIdDefaultClientScopesClientScopeIdPutRequest): Promise<void> {
|
||
await this.realmClientsIdDefaultClientScopesClientScopeIdPutRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Get default client scopes.
|
||
*/
|
||
async realmClientsIdDefaultClientScopesGetRaw(requestParameters: RealmClientsIdDefaultClientScopesGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdDefaultClientScopesGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdDefaultClientScopesGet.');
|
||
}
|
||
|
||
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}/clients/{id}/default-client-scopes`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get default client scopes.
|
||
*/
|
||
async realmClientsIdDefaultClientScopesGet(requestParameters: RealmClientsIdDefaultClientScopesGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdDefaultClientScopesGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Delete the client
|
||
*/
|
||
async realmClientsIdDeleteRaw(requestParameters: RealmClientsIdDeleteRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdDelete.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdDelete.');
|
||
}
|
||
|
||
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}/clients/{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 the client
|
||
*/
|
||
async realmClientsIdDelete(requestParameters: RealmClientsIdDeleteRequest): Promise<void> {
|
||
await this.realmClientsIdDeleteRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example access token
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleAccessTokenGetRaw(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleAccessTokenGetRequest): Promise<runtime.ApiResponse<AccessToken>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleAccessTokenGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleAccessTokenGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
if (requestParameters.userId !== undefined) {
|
||
queryParameters['userId'] = requestParameters.userId;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/generate-example-access-token`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => AccessTokenFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example access token
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleAccessTokenGet(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleAccessTokenGetRequest): Promise<AccessToken> {
|
||
const response = await this.realmClientsIdEvaluateScopesGenerateExampleAccessTokenGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example id token
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleIdTokenGetRaw(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleIdTokenGetRequest): Promise<runtime.ApiResponse<IDToken>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleIdTokenGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleIdTokenGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
if (requestParameters.userId !== undefined) {
|
||
queryParameters['userId'] = requestParameters.userId;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/generate-example-id-token`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => IDTokenFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example id token
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleIdTokenGet(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleIdTokenGetRequest): Promise<IDToken> {
|
||
const response = await this.realmClientsIdEvaluateScopesGenerateExampleIdTokenGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example user info
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleUserinfoGetRaw(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleUserinfoGetRequest): Promise<runtime.ApiResponse<{ [key: string]: object; }>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleUserinfoGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesGenerateExampleUserinfoGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
if (requestParameters.userId !== undefined) {
|
||
queryParameters['userId'] = requestParameters.userId;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/generate-example-userinfo`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Create JSON with payload of example user info
|
||
*/
|
||
async realmClientsIdEvaluateScopesGenerateExampleUserinfoGet(requestParameters: RealmClientsIdEvaluateScopesGenerateExampleUserinfoGetRequest): Promise<{ [key: string]: object; }> {
|
||
const response = await this.realmClientsIdEvaluateScopesGenerateExampleUserinfoGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Return list of all protocol mappers, which will be used when generating tokens issued for particular client.
|
||
*/
|
||
async realmClientsIdEvaluateScopesProtocolMappersGetRaw(requestParameters: RealmClientsIdEvaluateScopesProtocolMappersGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesProtocolMappersGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesProtocolMappersGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/protocol-mappers`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Return list of all protocol mappers, which will be used when generating tokens issued for particular client.
|
||
*/
|
||
async realmClientsIdEvaluateScopesProtocolMappersGet(requestParameters: RealmClientsIdEvaluateScopesProtocolMappersGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdEvaluateScopesProtocolMappersGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get effective scope mapping of all roles of particular role container, which this client is defacto allowed to have in the accessToken issued for him.
|
||
*/
|
||
async realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGetRaw(requestParameters: RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGet.');
|
||
}
|
||
|
||
if (requestParameters.roleContainerId === null || requestParameters.roleContainerId === undefined) {
|
||
throw new runtime.RequiredError('roleContainerId','Required parameter requestParameters.roleContainerId was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/granted`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"roleContainerId"}}`, encodeURIComponent(String(requestParameters.roleContainerId))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get effective scope mapping of all roles of particular role container, which this client is defacto allowed to have in the accessToken issued for him.
|
||
*/
|
||
async realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGet(requestParameters: RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdGrantedGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get roles, which this client doesn’t have scope for and can’t have them in the accessToken issued for him.
|
||
*/
|
||
async realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGetRaw(requestParameters: RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGet.');
|
||
}
|
||
|
||
if (requestParameters.roleContainerId === null || requestParameters.roleContainerId === undefined) {
|
||
throw new runtime.RequiredError('roleContainerId','Required parameter requestParameters.roleContainerId was null or undefined when calling realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.scope !== undefined) {
|
||
queryParameters['scope'] = requestParameters.scope;
|
||
}
|
||
|
||
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}/clients/{id}/evaluate-scopes/scope-mappings/{roleContainerId}/not-granted`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"roleContainerId"}}`, encodeURIComponent(String(requestParameters.roleContainerId))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get roles, which this client doesn’t have scope for and can’t have them in the accessToken issued for him.
|
||
*/
|
||
async realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGet(requestParameters: RealmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdEvaluateScopesScopeMappingsRoleContainerIdNotGrantedGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get representation of the client
|
||
*/
|
||
async realmClientsIdGetRaw(requestParameters: RealmClientsIdGetRequest): Promise<runtime.ApiResponse<ClientRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdGet.');
|
||
}
|
||
|
||
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}/clients/{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) => ClientRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Get representation of the client
|
||
*/
|
||
async realmClientsIdGet(requestParameters: RealmClientsIdGetRequest): Promise<ClientRepresentation> {
|
||
const response = await this.realmClientsIdGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdInstallationProvidersProviderIdGetRaw(requestParameters: RealmClientsIdInstallationProvidersProviderIdGetRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdInstallationProvidersProviderIdGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdInstallationProvidersProviderIdGet.');
|
||
}
|
||
|
||
if (requestParameters.providerId === null || requestParameters.providerId === undefined) {
|
||
throw new runtime.RequiredError('providerId','Required parameter requestParameters.providerId was null or undefined when calling realmClientsIdInstallationProvidersProviderIdGet.');
|
||
}
|
||
|
||
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}/clients/{id}/installation/providers/{providerId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"providerId"}}`, encodeURIComponent(String(requestParameters.providerId))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdInstallationProvidersProviderIdGet(requestParameters: RealmClientsIdInstallationProvidersProviderIdGetRequest): Promise<void> {
|
||
await this.realmClientsIdInstallationProvidersProviderIdGetRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Return object stating whether client Authorization permissions have been initialized or not and a reference
|
||
*/
|
||
async realmClientsIdManagementPermissionsGetRaw(requestParameters: RealmClientsIdManagementPermissionsGetRequest): Promise<runtime.ApiResponse<ManagementPermissionReference>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdManagementPermissionsGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdManagementPermissionsGet.');
|
||
}
|
||
|
||
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}/clients/{id}/management/permissions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => ManagementPermissionReferenceFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Return object stating whether client Authorization permissions have been initialized or not and a reference
|
||
*/
|
||
async realmClientsIdManagementPermissionsGet(requestParameters: RealmClientsIdManagementPermissionsGetRequest): Promise<ManagementPermissionReference> {
|
||
const response = await this.realmClientsIdManagementPermissionsGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Return object stating whether client Authorization permissions have been initialized or not and a reference
|
||
*/
|
||
async realmClientsIdManagementPermissionsPutRaw(requestParameters: RealmClientsIdManagementPermissionsPutRequest): Promise<runtime.ApiResponse<ManagementPermissionReference>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdManagementPermissionsPut.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdManagementPermissionsPut.');
|
||
}
|
||
|
||
if (requestParameters.managementPermissionReference === null || requestParameters.managementPermissionReference === undefined) {
|
||
throw new runtime.RequiredError('managementPermissionReference','Required parameter requestParameters.managementPermissionReference was null or undefined when calling realmClientsIdManagementPermissionsPut.');
|
||
}
|
||
|
||
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}/clients/{id}/management/permissions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'PUT',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: ManagementPermissionReferenceToJSON(requestParameters.managementPermissionReference),
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => ManagementPermissionReferenceFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Return object stating whether client Authorization permissions have been initialized or not and a reference
|
||
*/
|
||
async realmClientsIdManagementPermissionsPut(requestParameters: RealmClientsIdManagementPermissionsPutRequest): Promise<ManagementPermissionReference> {
|
||
const response = await this.realmClientsIdManagementPermissionsPutRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Unregister a cluster node from the client
|
||
*/
|
||
async realmClientsIdNodesNodeDeleteRaw(requestParameters: RealmClientsIdNodesNodeDeleteRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdNodesNodeDelete.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdNodesNodeDelete.');
|
||
}
|
||
|
||
if (requestParameters.node === null || requestParameters.node === undefined) {
|
||
throw new runtime.RequiredError('node','Required parameter requestParameters.node was null or undefined when calling realmClientsIdNodesNodeDelete.');
|
||
}
|
||
|
||
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}/clients/{id}/nodes/{node}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"node"}}`, encodeURIComponent(String(requestParameters.node))),
|
||
method: 'DELETE',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
* Unregister a cluster node from the client
|
||
*/
|
||
async realmClientsIdNodesNodeDelete(requestParameters: RealmClientsIdNodesNodeDeleteRequest): Promise<void> {
|
||
await this.realmClientsIdNodesNodeDeleteRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Register a cluster node with the client Manually register cluster node to this client - usually it’s not needed to call this directly as adapter should handle by sending registration request to Keycloak
|
||
*/
|
||
async realmClientsIdNodesPostRaw(requestParameters: RealmClientsIdNodesPostRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdNodesPost.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdNodesPost.');
|
||
}
|
||
|
||
if (requestParameters.requestBody === null || requestParameters.requestBody === undefined) {
|
||
throw new runtime.RequiredError('requestBody','Required parameter requestParameters.requestBody was null or undefined when calling realmClientsIdNodesPost.');
|
||
}
|
||
|
||
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}/clients/{id}/nodes`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: requestParameters.requestBody,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
* Register a cluster node with the client Manually register cluster node to this client - usually it’s not needed to call this directly as adapter should handle by sending registration request to Keycloak
|
||
*/
|
||
async realmClientsIdNodesPost(requestParameters: RealmClientsIdNodesPostRequest): Promise<void> {
|
||
await this.realmClientsIdNodesPostRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Get application offline session count Returns a number of offline user sessions associated with this client { \"count\": number }
|
||
*/
|
||
async realmClientsIdOfflineSessionCountGetRaw(requestParameters: RealmClientsIdOfflineSessionCountGetRequest): Promise<runtime.ApiResponse<{ [key: string]: object; }>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdOfflineSessionCountGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdOfflineSessionCountGet.');
|
||
}
|
||
|
||
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}/clients/{id}/offline-session-count`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get application offline session count Returns a number of offline user sessions associated with this client { \"count\": number }
|
||
*/
|
||
async realmClientsIdOfflineSessionCountGet(requestParameters: RealmClientsIdOfflineSessionCountGetRequest): Promise<{ [key: string]: object; }> {
|
||
const response = await this.realmClientsIdOfflineSessionCountGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get offline sessions for client Returns a list of offline user sessions associated with this client
|
||
*/
|
||
async realmClientsIdOfflineSessionsGetRaw(requestParameters: RealmClientsIdOfflineSessionsGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdOfflineSessionsGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdOfflineSessionsGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.first !== undefined) {
|
||
queryParameters['first'] = requestParameters.first;
|
||
}
|
||
|
||
if (requestParameters.max !== undefined) {
|
||
queryParameters['max'] = requestParameters.max;
|
||
}
|
||
|
||
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}/clients/{id}/offline-sessions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get offline sessions for client Returns a list of offline user sessions associated with this client
|
||
*/
|
||
async realmClientsIdOfflineSessionsGet(requestParameters: RealmClientsIdOfflineSessionsGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdOfflineSessionsGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdOptionalClientScopesClientScopeIdDeleteRaw(requestParameters: RealmClientsIdOptionalClientScopesClientScopeIdDeleteRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
if (requestParameters.clientScopeId === null || requestParameters.clientScopeId === undefined) {
|
||
throw new runtime.RequiredError('clientScopeId','Required parameter requestParameters.clientScopeId was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdDelete.');
|
||
}
|
||
|
||
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}/clients/{id}/optional-client-scopes/{clientScopeId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"clientScopeId"}}`, encodeURIComponent(String(requestParameters.clientScopeId))),
|
||
method: 'DELETE',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdOptionalClientScopesClientScopeIdDelete(requestParameters: RealmClientsIdOptionalClientScopesClientScopeIdDeleteRequest): Promise<void> {
|
||
await this.realmClientsIdOptionalClientScopesClientScopeIdDeleteRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdOptionalClientScopesClientScopeIdPutRaw(requestParameters: RealmClientsIdOptionalClientScopesClientScopeIdPutRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
if (requestParameters.clientScopeId === null || requestParameters.clientScopeId === undefined) {
|
||
throw new runtime.RequiredError('clientScopeId','Required parameter requestParameters.clientScopeId was null or undefined when calling realmClientsIdOptionalClientScopesClientScopeIdPut.');
|
||
}
|
||
|
||
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}/clients/{id}/optional-client-scopes/{clientScopeId}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))).replace(`{${"clientScopeId"}}`, encodeURIComponent(String(requestParameters.clientScopeId))),
|
||
method: 'PUT',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
*/
|
||
async realmClientsIdOptionalClientScopesClientScopeIdPut(requestParameters: RealmClientsIdOptionalClientScopesClientScopeIdPutRequest): Promise<void> {
|
||
await this.realmClientsIdOptionalClientScopesClientScopeIdPutRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Get optional client scopes.
|
||
*/
|
||
async realmClientsIdOptionalClientScopesGetRaw(requestParameters: RealmClientsIdOptionalClientScopesGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdOptionalClientScopesGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdOptionalClientScopesGet.');
|
||
}
|
||
|
||
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}/clients/{id}/optional-client-scopes`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get optional client scopes.
|
||
*/
|
||
async realmClientsIdOptionalClientScopesGet(requestParameters: RealmClientsIdOptionalClientScopesGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdOptionalClientScopesGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Push the client’s revocation policy to its admin URL If the client has an admin URL, push revocation policy to it.
|
||
*/
|
||
async realmClientsIdPushRevocationPostRaw(requestParameters: RealmClientsIdPushRevocationPostRequest): Promise<runtime.ApiResponse<GlobalRequestResult>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdPushRevocationPost.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdPushRevocationPost.');
|
||
}
|
||
|
||
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}/clients/{id}/push-revocation`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => GlobalRequestResultFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Push the client’s revocation policy to its admin URL If the client has an admin URL, push revocation policy to it.
|
||
*/
|
||
async realmClientsIdPushRevocationPost(requestParameters: RealmClientsIdPushRevocationPostRequest): Promise<GlobalRequestResult> {
|
||
const response = await this.realmClientsIdPushRevocationPostRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Update the client
|
||
*/
|
||
async realmClientsIdPutRaw(requestParameters: RealmClientsIdPutRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdPut.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdPut.');
|
||
}
|
||
|
||
if (requestParameters.clientRepresentation === null || requestParameters.clientRepresentation === undefined) {
|
||
throw new runtime.RequiredError('clientRepresentation','Required parameter requestParameters.clientRepresentation was null or undefined when calling realmClientsIdPut.');
|
||
}
|
||
|
||
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}/clients/{id}`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'PUT',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: ClientRepresentationToJSON(requestParameters.clientRepresentation),
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
* Update the client
|
||
*/
|
||
async realmClientsIdPut(requestParameters: RealmClientsIdPutRequest): Promise<void> {
|
||
await this.realmClientsIdPutRaw(requestParameters);
|
||
}
|
||
|
||
/**
|
||
* Generate a new registration access token for the client
|
||
*/
|
||
async realmClientsIdRegistrationAccessTokenPostRaw(requestParameters: RealmClientsIdRegistrationAccessTokenPostRequest): Promise<runtime.ApiResponse<ClientRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdRegistrationAccessTokenPost.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdRegistrationAccessTokenPost.');
|
||
}
|
||
|
||
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}/clients/{id}/registration-access-token`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => ClientRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Generate a new registration access token for the client
|
||
*/
|
||
async realmClientsIdRegistrationAccessTokenPost(requestParameters: RealmClientsIdRegistrationAccessTokenPostRequest): Promise<ClientRepresentation> {
|
||
const response = await this.realmClientsIdRegistrationAccessTokenPostRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get a user dedicated to the service account
|
||
*/
|
||
async realmClientsIdServiceAccountUserGetRaw(requestParameters: RealmClientsIdServiceAccountUserGetRequest): Promise<runtime.ApiResponse<UserRepresentation>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdServiceAccountUserGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdServiceAccountUserGet.');
|
||
}
|
||
|
||
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}/clients/{id}/service-account-user`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => UserRepresentationFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Get a user dedicated to the service account
|
||
*/
|
||
async realmClientsIdServiceAccountUserGet(requestParameters: RealmClientsIdServiceAccountUserGetRequest): Promise<UserRepresentation> {
|
||
const response = await this.realmClientsIdServiceAccountUserGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get application session count Returns a number of user sessions associated with this client { \"count\": number }
|
||
*/
|
||
async realmClientsIdSessionCountGetRaw(requestParameters: RealmClientsIdSessionCountGetRequest): Promise<runtime.ApiResponse<{ [key: string]: object; }>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdSessionCountGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdSessionCountGet.');
|
||
}
|
||
|
||
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}/clients/{id}/session-count`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get application session count Returns a number of user sessions associated with this client { \"count\": number }
|
||
*/
|
||
async realmClientsIdSessionCountGet(requestParameters: RealmClientsIdSessionCountGetRequest): Promise<{ [key: string]: object; }> {
|
||
const response = await this.realmClientsIdSessionCountGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Test if registered cluster nodes are available Tests availability by sending \'ping\' request to all cluster nodes.
|
||
*/
|
||
async realmClientsIdTestNodesAvailableGetRaw(requestParameters: RealmClientsIdTestNodesAvailableGetRequest): Promise<runtime.ApiResponse<GlobalRequestResult>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdTestNodesAvailableGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdTestNodesAvailableGet.');
|
||
}
|
||
|
||
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}/clients/{id}/test-nodes-available`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse(response, (jsonValue) => GlobalRequestResultFromJSON(jsonValue));
|
||
}
|
||
|
||
/**
|
||
* Test if registered cluster nodes are available Tests availability by sending \'ping\' request to all cluster nodes.
|
||
*/
|
||
async realmClientsIdTestNodesAvailableGet(requestParameters: RealmClientsIdTestNodesAvailableGetRequest): Promise<GlobalRequestResult> {
|
||
const response = await this.realmClientsIdTestNodesAvailableGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Get user sessions for client Returns a list of user sessions associated with this client
|
||
*/
|
||
async realmClientsIdUserSessionsGetRaw(requestParameters: RealmClientsIdUserSessionsGetRequest): Promise<runtime.ApiResponse<Array<{ [key: string]: object; }>>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsIdUserSessionsGet.');
|
||
}
|
||
|
||
if (requestParameters.id === null || requestParameters.id === undefined) {
|
||
throw new runtime.RequiredError('id','Required parameter requestParameters.id was null or undefined when calling realmClientsIdUserSessionsGet.');
|
||
}
|
||
|
||
const queryParameters: runtime.HTTPQuery = {};
|
||
|
||
if (requestParameters.first !== undefined) {
|
||
queryParameters['first'] = requestParameters.first;
|
||
}
|
||
|
||
if (requestParameters.max !== undefined) {
|
||
queryParameters['max'] = requestParameters.max;
|
||
}
|
||
|
||
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}/clients/{id}/user-sessions`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))).replace(`{${"id"}}`, encodeURIComponent(String(requestParameters.id))),
|
||
method: 'GET',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
});
|
||
|
||
return new runtime.JSONApiResponse<any>(response);
|
||
}
|
||
|
||
/**
|
||
* Get user sessions for client Returns a list of user sessions associated with this client
|
||
*/
|
||
async realmClientsIdUserSessionsGet(requestParameters: RealmClientsIdUserSessionsGetRequest): Promise<Array<{ [key: string]: object; }>> {
|
||
const response = await this.realmClientsIdUserSessionsGetRaw(requestParameters);
|
||
return await response.value();
|
||
}
|
||
|
||
/**
|
||
* Create a new client Client’s client_id must be unique!
|
||
*/
|
||
async realmClientsPostRaw(requestParameters: RealmClientsPostRequest): Promise<runtime.ApiResponse<void>> {
|
||
if (requestParameters.realm === null || requestParameters.realm === undefined) {
|
||
throw new runtime.RequiredError('realm','Required parameter requestParameters.realm was null or undefined when calling realmClientsPost.');
|
||
}
|
||
|
||
if (requestParameters.clientRepresentation === null || requestParameters.clientRepresentation === undefined) {
|
||
throw new runtime.RequiredError('clientRepresentation','Required parameter requestParameters.clientRepresentation was null or undefined when calling realmClientsPost.');
|
||
}
|
||
|
||
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}/clients`.replace(`{${"realm"}}`, encodeURIComponent(String(requestParameters.realm))),
|
||
method: 'POST',
|
||
headers: headerParameters,
|
||
query: queryParameters,
|
||
body: ClientRepresentationToJSON(requestParameters.clientRepresentation),
|
||
});
|
||
|
||
return new runtime.VoidApiResponse(response);
|
||
}
|
||
|
||
/**
|
||
* Create a new client Client’s client_id must be unique!
|
||
*/
|
||
async realmClientsPost(requestParameters: RealmClientsPostRequest): Promise<void> {
|
||
await this.realmClientsPostRaw(requestParameters);
|
||
}
|
||
|
||
}
|