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

namespace Google\Cloud\AIPlatform\V1\Tensor;

use UnexpectedValueException;

/**
 * Data type of the tensor.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.Tensor.DataType</code>
 */
class DataType
{
    /**
     * Not a legal value for DataType. Used to indicate a DataType field has not
     * been set.
     *
     * Generated from protobuf enum <code>DATA_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_TYPE_UNSPECIFIED = 0;
    /**
     * Data types that all computation devices are expected to be
     * capable to support.
     *
     * Generated from protobuf enum <code>BOOL = 1;</code>
     */
    const BOOL = 1;
    /**
     * Generated from protobuf enum <code>STRING = 2;</code>
     */
    const STRING = 2;
    /**
     * Generated from protobuf enum <code>FLOAT = 3;</code>
     */
    const FLOAT = 3;
    /**
     * Generated from protobuf enum <code>DOUBLE = 4;</code>
     */
    const DOUBLE = 4;
    /**
     * Generated from protobuf enum <code>INT8 = 5;</code>
     */
    const INT8 = 5;
    /**
     * Generated from protobuf enum <code>INT16 = 6;</code>
     */
    const INT16 = 6;
    /**
     * Generated from protobuf enum <code>INT32 = 7;</code>
     */
    const INT32 = 7;
    /**
     * Generated from protobuf enum <code>INT64 = 8;</code>
     */
    const INT64 = 8;
    /**
     * Generated from protobuf enum <code>UINT8 = 9;</code>
     */
    const UINT8 = 9;
    /**
     * Generated from protobuf enum <code>UINT16 = 10;</code>
     */
    const UINT16 = 10;
    /**
     * Generated from protobuf enum <code>UINT32 = 11;</code>
     */
    const UINT32 = 11;
    /**
     * Generated from protobuf enum <code>UINT64 = 12;</code>
     */
    const UINT64 = 12;

    private static $valueToName = [
        self::DATA_TYPE_UNSPECIFIED => 'DATA_TYPE_UNSPECIFIED',
        self::BOOL => 'BOOL',
        self::STRING => 'STRING',
        self::FLOAT => 'FLOAT',
        self::DOUBLE => 'DOUBLE',
        self::INT8 => 'INT8',
        self::INT16 => 'INT16',
        self::INT32 => 'INT32',
        self::INT64 => 'INT64',
        self::UINT8 => 'UINT8',
        self::UINT16 => 'UINT16',
        self::UINT32 => 'UINT32',
        self::UINT64 => 'UINT64',
    ];

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


