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

namespace Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig;

use UnexpectedValueException;

/**
 * The mode of the predictor to be used in dynamic retrieval.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode</code>
 */
class Mode
{
    /**
     * Always trigger retrieval.
     *
     * Generated from protobuf enum <code>MODE_UNSPECIFIED = 0;</code>
     */
    const MODE_UNSPECIFIED = 0;
    /**
     * Run retrieval only when system decides it is necessary.
     *
     * Generated from protobuf enum <code>MODE_DYNAMIC = 1;</code>
     */
    const MODE_DYNAMIC = 1;

    private static $valueToName = [
        self::MODE_UNSPECIFIED => 'MODE_UNSPECIFIED',
        self::MODE_DYNAMIC => 'MODE_DYNAMIC',
    ];

    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);
    }
}


