<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/conversation.proto

namespace Google\Cloud\Dialogflow\V2\Conversation\ContextReference;

use UnexpectedValueException;

/**
 * Represents the mode in which context reference contents are updated.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Conversation.ContextReference.UpdateMode</code>
 */
class UpdateMode
{
    /**
     * Unspecified update mode.
     *
     * Generated from protobuf enum <code>UPDATE_MODE_UNSPECIFIED = 0;</code>
     */
    const UPDATE_MODE_UNSPECIFIED = 0;
    /**
     * Context content updates are applied in append mode.
     *
     * Generated from protobuf enum <code>APPEND = 1;</code>
     */
    const APPEND = 1;
    /**
     * Context content updates are applied in overwrite mode.
     *
     * Generated from protobuf enum <code>OVERWRITE = 2;</code>
     */
    const OVERWRITE = 2;

    private static $valueToName = [
        self::UPDATE_MODE_UNSPECIFIED => 'UPDATE_MODE_UNSPECIFIED',
        self::APPEND => 'APPEND',
        self::OVERWRITE => 'OVERWRITE',
    ];

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


