/* tslint:disable */ /* eslint-disable */ /** * Kubernetes * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: unversioned * * * 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 } from '../runtime'; import { IoK8sApiFlowcontrolV1FlowDistinguisherMethod, IoK8sApiFlowcontrolV1FlowDistinguisherMethodFromJSON, IoK8sApiFlowcontrolV1FlowDistinguisherMethodToJSON, IoK8sApiFlowcontrolV1PolicyRulesWithSubjects, IoK8sApiFlowcontrolV1PolicyRulesWithSubjectsFromJSON, IoK8sApiFlowcontrolV1PolicyRulesWithSubjectsToJSON, IoK8sApiFlowcontrolV1PriorityLevelConfigurationReference, IoK8sApiFlowcontrolV1PriorityLevelConfigurationReferenceFromJSON, IoK8sApiFlowcontrolV1PriorityLevelConfigurationReferenceToJSON, } from './'; /** * FlowSchemaSpec describes how the FlowSchema's specification looks like. * @export * @interface IoK8sApiFlowcontrolV1FlowSchemaSpec */ export interface IoK8sApiFlowcontrolV1FlowSchemaSpec { /** * * @type {IoK8sApiFlowcontrolV1FlowDistinguisherMethod} * @memberof IoK8sApiFlowcontrolV1FlowSchemaSpec */ distinguisherMethod?: IoK8sApiFlowcontrolV1FlowDistinguisherMethod; /** * `matchingPrecedence` is used to choose among the FlowSchemas that match a given request. The chosen FlowSchema is among those with the numerically lowest (which we take to be logically highest) MatchingPrecedence. Each MatchingPrecedence value must be ranged in [1,10000]. Note that if the precedence is not specified, it will be set to 1000 as default. * @type {number} * @memberof IoK8sApiFlowcontrolV1FlowSchemaSpec */ matchingPrecedence?: number; /** * * @type {IoK8sApiFlowcontrolV1PriorityLevelConfigurationReference} * @memberof IoK8sApiFlowcontrolV1FlowSchemaSpec */ priorityLevelConfiguration: IoK8sApiFlowcontrolV1PriorityLevelConfigurationReference; /** * `rules` describes which requests will match this flow schema. This FlowSchema matches a request if and only if at least one member of rules matches the request. if it is an empty slice, there will be no requests matching the FlowSchema. * @type {Array} * @memberof IoK8sApiFlowcontrolV1FlowSchemaSpec */ rules?: Array; } export function IoK8sApiFlowcontrolV1FlowSchemaSpecFromJSON( json: any, ): IoK8sApiFlowcontrolV1FlowSchemaSpec { return IoK8sApiFlowcontrolV1FlowSchemaSpecFromJSONTyped(json, false); } export function IoK8sApiFlowcontrolV1FlowSchemaSpecFromJSONTyped( json: any, _ignoreDiscriminator: boolean, ): IoK8sApiFlowcontrolV1FlowSchemaSpec { if (json === undefined || json === null) { return json; } return { distinguisherMethod: !exists(json, 'distinguisherMethod') ? undefined : IoK8sApiFlowcontrolV1FlowDistinguisherMethodFromJSON(json['distinguisherMethod']), matchingPrecedence: !exists(json, 'matchingPrecedence') ? undefined : json['matchingPrecedence'], priorityLevelConfiguration: IoK8sApiFlowcontrolV1PriorityLevelConfigurationReferenceFromJSON( json['priorityLevelConfiguration'], ), rules: !exists(json, 'rules') ? undefined : (json['rules'] as Array).map(IoK8sApiFlowcontrolV1PolicyRulesWithSubjectsFromJSON), }; } export function IoK8sApiFlowcontrolV1FlowSchemaSpecToJSON( value?: IoK8sApiFlowcontrolV1FlowSchemaSpec | null, ): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { distinguisherMethod: IoK8sApiFlowcontrolV1FlowDistinguisherMethodToJSON( value.distinguisherMethod, ), matchingPrecedence: value.matchingPrecedence, priorityLevelConfiguration: IoK8sApiFlowcontrolV1PriorityLevelConfigurationReferenceToJSON( value.priorityLevelConfiguration, ), rules: value.rules === undefined ? undefined : (value.rules as Array).map(IoK8sApiFlowcontrolV1PolicyRulesWithSubjectsToJSON), }; }