<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/feature_online_store_service.proto

namespace Google\Cloud\AIPlatform\V1\NearestNeighborQuery\NumericFilter;

use UnexpectedValueException;

/**
 * Datapoints for which Operator is true relative to the query's Value
 * field will be allowlisted.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.NearestNeighborQuery.NumericFilter.Operator</code>
 */
class Operator
{
    /**
     * Unspecified operator.
     *
     * Generated from protobuf enum <code>OPERATOR_UNSPECIFIED = 0;</code>
     */
    const OPERATOR_UNSPECIFIED = 0;
    /**
     * Entities are eligible if their value is < the query's.
     *
     * Generated from protobuf enum <code>LESS = 1;</code>
     */
    const LESS = 1;
    /**
     * Entities are eligible if their value is <= the query's.
     *
     * Generated from protobuf enum <code>LESS_EQUAL = 2;</code>
     */
    const LESS_EQUAL = 2;
    /**
     * Entities are eligible if their value is == the query's.
     *
     * Generated from protobuf enum <code>EQUAL = 3;</code>
     */
    const EQUAL = 3;
    /**
     * Entities are eligible if their value is >= the query's.
     *
     * Generated from protobuf enum <code>GREATER_EQUAL = 4;</code>
     */
    const GREATER_EQUAL = 4;
    /**
     * Entities are eligible if their value is > the query's.
     *
     * Generated from protobuf enum <code>GREATER = 5;</code>
     */
    const GREATER = 5;
    /**
     * Entities are eligible if their value is != the query's.
     *
     * Generated from protobuf enum <code>NOT_EQUAL = 6;</code>
     */
    const NOT_EQUAL = 6;

    private static $valueToName = [
        self::OPERATOR_UNSPECIFIED => 'OPERATOR_UNSPECIFIED',
        self::LESS => 'LESS',
        self::LESS_EQUAL => 'LESS_EQUAL',
        self::EQUAL => 'EQUAL',
        self::GREATER_EQUAL => 'GREATER_EQUAL',
        self::GREATER => 'GREATER',
        self::NOT_EQUAL => 'NOT_EQUAL',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

