<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datalabeling/v1beta1/dataset.proto

namespace Google\Cloud\DataLabeling\V1beta1;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.datalabeling.v1beta1.DataType</code>
 */
class DataType
{
    /**
     * Generated from protobuf enum <code>DATA_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_TYPE_UNSPECIFIED = 0;
    /**
     * Allowed for continuous evaluation.
     *
     * Generated from protobuf enum <code>IMAGE = 1;</code>
     */
    const IMAGE = 1;
    /**
     * Generated from protobuf enum <code>VIDEO = 2;</code>
     */
    const VIDEO = 2;
    /**
     * Allowed for continuous evaluation.
     *
     * Generated from protobuf enum <code>TEXT = 4;</code>
     */
    const TEXT = 4;
    /**
     * Allowed for continuous evaluation.
     *
     * Generated from protobuf enum <code>GENERAL_DATA = 6;</code>
     */
    const GENERAL_DATA = 6;

    private static $valueToName = [
        self::DATA_TYPE_UNSPECIFIED => 'DATA_TYPE_UNSPECIFIED',
        self::IMAGE => 'IMAGE',
        self::VIDEO => 'VIDEO',
        self::TEXT => 'TEXT',
        self::GENERAL_DATA => 'GENERAL_DATA',
    ];

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

