/* tslint:disable */
/* eslint-disable */
/**
 * Unleash API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 4.11.0-beta.2
 * 
 *
 * 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';
/**
 * 
 * @export
 * @interface ConstraintSchema
 */
export interface ConstraintSchema {
    /**
     * 
     * @type {string}
     * @memberof ConstraintSchema
     */
    contextName: string;
    /**
     * 
     * @type {string}
     * @memberof ConstraintSchema
     */
    operator: ConstraintSchemaOperatorEnum;
    /**
     * 
     * @type {boolean}
     * @memberof ConstraintSchema
     */
    caseInsensitive?: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof ConstraintSchema
     */
    inverted?: boolean;
    /**
     * 
     * @type {Array<string>}
     * @memberof ConstraintSchema
     */
    values?: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof ConstraintSchema
     */
    value?: string;
}


/**
 * @export
 */
export const ConstraintSchemaOperatorEnum = {
    NotIn: 'NOT_IN',
    In: 'IN',
    StrEndsWith: 'STR_ENDS_WITH',
    StrStartsWith: 'STR_STARTS_WITH',
    StrContains: 'STR_CONTAINS',
    NumEq: 'NUM_EQ',
    NumGt: 'NUM_GT',
    NumGte: 'NUM_GTE',
    NumLt: 'NUM_LT',
    NumLte: 'NUM_LTE',
    DateAfter: 'DATE_AFTER',
    DateBefore: 'DATE_BEFORE',
    SemverEq: 'SEMVER_EQ',
    SemverGt: 'SEMVER_GT',
    SemverLt: 'SEMVER_LT'
} as const;
export type ConstraintSchemaOperatorEnum = typeof ConstraintSchemaOperatorEnum[keyof typeof ConstraintSchemaOperatorEnum];


export function ConstraintSchemaFromJSON(json: any): ConstraintSchema {
    return ConstraintSchemaFromJSONTyped(json, false);
}

export function ConstraintSchemaFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConstraintSchema {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'contextName': json['contextName'],
        'operator': json['operator'],
        'caseInsensitive': !exists(json, 'caseInsensitive') ? undefined : json['caseInsensitive'],
        'inverted': !exists(json, 'inverted') ? undefined : json['inverted'],
        'values': !exists(json, 'values') ? undefined : json['values'],
        'value': !exists(json, 'value') ? undefined : json['value'],
    };
}

export function ConstraintSchemaToJSON(value?: ConstraintSchema | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'contextName': value.contextName,
        'operator': value.operator,
        'caseInsensitive': value.caseInsensitive,
        'inverted': value.inverted,
        'values': value.values,
        'value': value.value,
    };
}

