/* tslint:disable */ /* eslint-disable */ /** * Sonatype Lifecycle Public REST API * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 1.207.0-01 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { mapValues } from '../runtime'; import type { Condition } from './Condition'; import { ConditionFromJSON, ConditionFromJSONTyped, ConditionToJSON, ConditionToJSONTyped, } from './Condition'; /** * * @export * @interface Constraint */ export interface Constraint { /** * * @type {Array} * @memberof Constraint */ conditions?: Array; /** * * @type {string} * @memberof Constraint */ id?: string; /** * * @type {string} * @memberof Constraint */ name?: string; /** * * @type {string} * @memberof Constraint */ operator?: ConstraintOperatorEnum; } /** * @export */ export const ConstraintOperatorEnum = { And: 'AND', Or: 'OR' } as const; export type ConstraintOperatorEnum = typeof ConstraintOperatorEnum[keyof typeof ConstraintOperatorEnum]; /** * Check if a given object implements the Constraint interface. */ export function instanceOfConstraint(value: object): value is Constraint { return true; } export function ConstraintFromJSON(json: any): Constraint { return ConstraintFromJSONTyped(json, false); } export function ConstraintFromJSONTyped(json: any, ignoreDiscriminator: boolean): Constraint { if (json == null) { return json; } return { 'conditions': json['conditions'] == null ? undefined : ((json['conditions'] as Array).map(ConditionFromJSON)), 'id': json['id'] == null ? undefined : json['id'], 'name': json['name'] == null ? undefined : json['name'], 'operator': json['operator'] == null ? undefined : json['operator'], }; } export function ConstraintToJSON(json: any): Constraint { return ConstraintToJSONTyped(json, false); } export function ConstraintToJSONTyped(value?: Constraint | null, ignoreDiscriminator: boolean = false): any { if (value == null) { return value; } return { 'conditions': value['conditions'] == null ? undefined : ((value['conditions'] as Array).map(ConditionToJSON)), 'id': value['id'], 'name': value['name'], 'operator': value['operator'], }; }