/* 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 { exists, mapValues } from '../runtime'; import { ResourceRepresentation, ResourceRepresentationFromJSON, ResourceRepresentationFromJSONTyped, ResourceRepresentationToJSON, ScopeRepresentation, ScopeRepresentationFromJSON, ScopeRepresentationFromJSONTyped, ScopeRepresentationToJSON, } from './'; /** * * @export * @interface PolicyRepresentation */ export interface PolicyRepresentation { /** * * @type {{ [key: string]: object; }} * @memberof PolicyRepresentation */ config?: { [key: string]: object; }; /** * * @type {string} * @memberof PolicyRepresentation */ decisionStrategy?: PolicyRepresentationDecisionStrategyEnum; /** * * @type {string} * @memberof PolicyRepresentation */ description?: string; /** * * @type {string} * @memberof PolicyRepresentation */ id?: string; /** * * @type {string} * @memberof PolicyRepresentation */ logic?: PolicyRepresentationLogicEnum; /** * * @type {string} * @memberof PolicyRepresentation */ name?: string; /** * * @type {string} * @memberof PolicyRepresentation */ owner?: string; /** * * @type {Array} * @memberof PolicyRepresentation */ policies?: Array; /** * * @type {Array} * @memberof PolicyRepresentation */ resources?: Array; /** * * @type {Array} * @memberof PolicyRepresentation */ resourcesData?: Array; /** * * @type {Array} * @memberof PolicyRepresentation */ scopes?: Array; /** * * @type {Array} * @memberof PolicyRepresentation */ scopesData?: Array; /** * * @type {string} * @memberof PolicyRepresentation */ type?: string; } export function PolicyRepresentationFromJSON(json: any): PolicyRepresentation { return PolicyRepresentationFromJSONTyped(json, false); } export function PolicyRepresentationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PolicyRepresentation { if ((json === undefined) || (json === null)) { return json; } return { 'config': !exists(json, 'config') ? undefined : json['config'], 'decisionStrategy': !exists(json, 'decisionStrategy') ? undefined : json['decisionStrategy'], 'description': !exists(json, 'description') ? undefined : json['description'], 'id': !exists(json, 'id') ? undefined : json['id'], 'logic': !exists(json, 'logic') ? undefined : json['logic'], 'name': !exists(json, 'name') ? undefined : json['name'], 'owner': !exists(json, 'owner') ? undefined : json['owner'], 'policies': !exists(json, 'policies') ? undefined : json['policies'], 'resources': !exists(json, 'resources') ? undefined : json['resources'], 'resourcesData': !exists(json, 'resourcesData') ? undefined : ((json['resourcesData'] as Array).map(ResourceRepresentationFromJSON)), 'scopes': !exists(json, 'scopes') ? undefined : json['scopes'], 'scopesData': !exists(json, 'scopesData') ? undefined : ((json['scopesData'] as Array).map(ScopeRepresentationFromJSON)), 'type': !exists(json, 'type') ? undefined : json['type'], }; } export function PolicyRepresentationToJSON(value?: PolicyRepresentation | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'config': value.config, 'decisionStrategy': value.decisionStrategy, 'description': value.description, 'id': value.id, 'logic': value.logic, 'name': value.name, 'owner': value.owner, 'policies': value.policies, 'resources': value.resources, 'resourcesData': value.resourcesData === undefined ? undefined : ((value.resourcesData as Array).map(ResourceRepresentationToJSON)), 'scopes': value.scopes, 'scopesData': value.scopesData === undefined ? undefined : ((value.scopesData as Array).map(ScopeRepresentationToJSON)), 'type': value.type, }; } /** * @export * @enum {string} */ export enum PolicyRepresentationDecisionStrategyEnum { AFFIRMATIVE = 'AFFIRMATIVE', UNANIMOUS = 'UNANIMOUS', CONSENSUS = 'CONSENSUS' } /** * @export * @enum {string} */ export enum PolicyRepresentationLogicEnum { POSITIVE = 'POSITIVE', NEGATIVE = 'NEGATIVE' }