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

namespace Google\Apps\Chat\V1\QuotedMessageMetadata;

use UnexpectedValueException;

/**
 * The quote type of the quoted message.
 *
 * Protobuf type <code>google.chat.v1.QuotedMessageMetadata.QuoteType</code>
 */
class QuoteType
{
    /**
     * Reserved. This value is unused.
     *
     * Generated from protobuf enum <code>QUOTE_TYPE_UNSPECIFIED = 0;</code>
     */
    const QUOTE_TYPE_UNSPECIFIED = 0;
    /**
     * If quote_type is `REPLY`, you can do the following:
     * * If you're replying in a thread, you can quote another message in that
     * thread.
     * * If you're creating a root message, you can quote another root message
     * in that space.
     * You can't quote a message reply from a different thread.
     *
     * Generated from protobuf enum <code>REPLY = 1;</code>
     */
    const REPLY = 1;

    private static $valueToName = [
        self::QUOTE_TYPE_UNSPECIFIED => 'QUOTE_TYPE_UNSPECIFIED',
        self::REPLY => 'REPLY',
    ];

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

