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

namespace Google\Cloud\ApiHub\V1\HttpOperationDetails;

use UnexpectedValueException;

/**
 * Type of data
 *
 * Protobuf type <code>google.cloud.apihub.v1.HttpOperationDetails.DataType</code>
 */
class DataType
{
    /**
     * Unspecified data type
     *
     * Generated from protobuf enum <code>DATA_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_TYPE_UNSPECIFIED = 0;
    /**
     * Boolean data type
     *
     * Generated from protobuf enum <code>BOOL = 1;</code>
     */
    const BOOL = 1;
    /**
     * Integer data type
     *
     * Generated from protobuf enum <code>INTEGER = 2;</code>
     */
    const INTEGER = 2;
    /**
     * Float data type
     *
     * Generated from protobuf enum <code>FLOAT = 3;</code>
     */
    const FLOAT = 3;
    /**
     * String data type
     *
     * Generated from protobuf enum <code>STRING = 4;</code>
     */
    const STRING = 4;
    /**
     * UUID data type
     *
     * Generated from protobuf enum <code>UUID = 5;</code>
     */
    const UUID = 5;

    private static $valueToName = [
        self::DATA_TYPE_UNSPECIFIED => 'DATA_TYPE_UNSPECIFIED',
        self::BOOL => 'BOOL',
        self::INTEGER => 'INTEGER',
        self::FLOAT => 'FLOAT',
        self::STRING => 'STRING',
        self::UUID => 'UUID',
    ];

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


