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

namespace Google\Apps\Card\V1\Validation;

use UnexpectedValueException;

/**
 * The type of the input widget.
 *
 * Protobuf type <code>google.apps.card.v1.Validation.InputType</code>
 */
class InputType
{
    /**
     * Unspecified type. Do not use.
     *
     * Generated from protobuf enum <code>INPUT_TYPE_UNSPECIFIED = 0;</code>
     */
    const INPUT_TYPE_UNSPECIFIED = 0;
    /**
     * Regular text that accepts all characters.
     *
     * Generated from protobuf enum <code>TEXT = 1;</code>
     */
    const TEXT = 1;
    /**
     * An integer value.
     *
     * Generated from protobuf enum <code>INTEGER = 2;</code>
     */
    const INTEGER = 2;
    /**
     * A float value.
     *
     * Generated from protobuf enum <code>FLOAT = 3;</code>
     */
    const FLOAT = 3;
    /**
     * An email address.
     *
     * Generated from protobuf enum <code>EMAIL = 4;</code>
     */
    const EMAIL = 4;
    /**
     * A emoji selected from system-provided emoji picker.
     *
     * Generated from protobuf enum <code>EMOJI_PICKER = 5;</code>
     */
    const EMOJI_PICKER = 5;

    private static $valueToName = [
        self::INPUT_TYPE_UNSPECIFIED => 'INPUT_TYPE_UNSPECIFIED',
        self::TEXT => 'TEXT',
        self::INTEGER => 'INTEGER',
        self::FLOAT => 'FLOAT',
        self::EMAIL => 'EMAIL',
        self::EMOJI_PICKER => 'EMOJI_PICKER',
    ];

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


