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

namespace Google\Apps\Chat\V1;

use UnexpectedValueException;

/**
 * Type of the annotation.
 *
 * Protobuf type <code>google.chat.v1.AnnotationType</code>
 */
class AnnotationType
{
    /**
     * Default value for the enum. Don't use.
     *
     * Generated from protobuf enum <code>ANNOTATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const ANNOTATION_TYPE_UNSPECIFIED = 0;
    /**
     * A user is mentioned.
     *
     * Generated from protobuf enum <code>USER_MENTION = 1;</code>
     */
    const USER_MENTION = 1;
    /**
     * A slash command is invoked.
     *
     * Generated from protobuf enum <code>SLASH_COMMAND = 2;</code>
     */
    const SLASH_COMMAND = 2;
    /**
     * A rich link annotation.
     *
     * Generated from protobuf enum <code>RICH_LINK = 3;</code>
     */
    const RICH_LINK = 3;
    /**
     * A custom emoji annotation.
     *
     * Generated from protobuf enum <code>CUSTOM_EMOJI = 4;</code>
     */
    const CUSTOM_EMOJI = 4;

    private static $valueToName = [
        self::ANNOTATION_TYPE_UNSPECIFIED => 'ANNOTATION_TYPE_UNSPECIFIED',
        self::USER_MENTION => 'USER_MENTION',
        self::SLASH_COMMAND => 'SLASH_COMMAND',
        self::RICH_LINK => 'RICH_LINK',
        self::CUSTOM_EMOJI => 'CUSTOM_EMOJI',
    ];

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

