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

namespace Google\Apps\Card\V1\SelectionInput\PlatformDataSource;

use UnexpectedValueException;

/**
 * A data source shared by all [Google Workspace
 * applications]
 * (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
 * [Google Chat apps](https://developers.google.com/workspace/chat):
 *
 * Protobuf type <code>google.apps.card.v1.SelectionInput.PlatformDataSource.CommonDataSource</code>
 */
class CommonDataSource
{
    /**
     * Default value. Don't use.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Google Workspace users. The user can only view and select users from
     * their Google Workspace organization.
     *
     * Generated from protobuf enum <code>USER = 1;</code>
     */
    const USER = 1;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::USER => 'USER',
    ];

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


