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

namespace Google\Cloud\AIPlatform\V1\Index;

use UnexpectedValueException;

/**
 * The update method of an Index.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.Index.IndexUpdateMethod</code>
 */
class IndexUpdateMethod
{
    /**
     * Should not be used.
     *
     * Generated from protobuf enum <code>INDEX_UPDATE_METHOD_UNSPECIFIED = 0;</code>
     */
    const INDEX_UPDATE_METHOD_UNSPECIFIED = 0;
    /**
     * BatchUpdate: user can call UpdateIndex with files on Cloud Storage of
     * datapoints to update.
     *
     * Generated from protobuf enum <code>BATCH_UPDATE = 1;</code>
     */
    const BATCH_UPDATE = 1;
    /**
     * StreamUpdate: user can call UpsertDatapoints/DeleteDatapoints to update
     * the Index and the updates will be applied in corresponding
     * DeployedIndexes in nearly real-time.
     *
     * Generated from protobuf enum <code>STREAM_UPDATE = 2;</code>
     */
    const STREAM_UPDATE = 2;

    private static $valueToName = [
        self::INDEX_UPDATE_METHOD_UNSPECIFIED => 'INDEX_UPDATE_METHOD_UNSPECIFIED',
        self::BATCH_UPDATE => 'BATCH_UPDATE',
        self::STREAM_UPDATE => 'STREAM_UPDATE',
    ];

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


