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

namespace Google\Apps\Chat\V1\Attachment;

use UnexpectedValueException;

/**
 * The source of the attachment.
 *
 * Protobuf type <code>google.chat.v1.Attachment.Source</code>
 */
class Source
{
    /**
     * Reserved.
     *
     * Generated from protobuf enum <code>SOURCE_UNSPECIFIED = 0;</code>
     */
    const SOURCE_UNSPECIFIED = 0;
    /**
     * The file is a Google Drive file.
     *
     * Generated from protobuf enum <code>DRIVE_FILE = 1;</code>
     */
    const DRIVE_FILE = 1;
    /**
     * The file is uploaded to Chat.
     *
     * Generated from protobuf enum <code>UPLOADED_CONTENT = 2;</code>
     */
    const UPLOADED_CONTENT = 2;

    private static $valueToName = [
        self::SOURCE_UNSPECIFIED => 'SOURCE_UNSPECIFIED',
        self::DRIVE_FILE => 'DRIVE_FILE',
        self::UPLOADED_CONTENT => 'UPLOADED_CONTENT',
    ];

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


