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

namespace Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo\FieldSchema;

use UnexpectedValueException;

/**
 * LINT.IfChange
 * Field type.
 *
 * Protobuf type <code>google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.FieldSchema.Type</code>
 */
class Type
{
    /**
     * Illegal value.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * 64K, UTF8.
     *
     * Generated from protobuf enum <code>STRING = 1;</code>
     */
    const STRING = 1;
    /**
     * 64-bit signed.
     *
     * Generated from protobuf enum <code>INTEGER = 2;</code>
     */
    const INTEGER = 2;
    /**
     * 64-bit IEEE floating point.
     *
     * Generated from protobuf enum <code>FLOAT = 3;</code>
     */
    const FLOAT = 3;
    /**
     * Aggregate type.
     *
     * Generated from protobuf enum <code>RECORD = 4;</code>
     */
    const RECORD = 4;
    /**
     * 64K, Binary.
     *
     * Generated from protobuf enum <code>BYTES = 5;</code>
     */
    const BYTES = 5;
    /**
     * 2-valued.
     *
     * Generated from protobuf enum <code>BOOLEAN = 6;</code>
     */
    const BOOLEAN = 6;
    /**
     * 64-bit signed usec since UTC epoch.
     *
     * Generated from protobuf enum <code>TIMESTAMP = 7;</code>
     */
    const TIMESTAMP = 7;
    /**
     * Civil date - Year, Month, Day.
     *
     * Generated from protobuf enum <code>DATE = 8;</code>
     */
    const DATE = 8;
    /**
     * Civil time - Hour, Minute, Second, Microseconds.
     *
     * Generated from protobuf enum <code>TIME = 9;</code>
     */
    const TIME = 9;
    /**
     * Combination of civil date and civil time.
     *
     * Generated from protobuf enum <code>DATETIME = 10;</code>
     */
    const DATETIME = 10;
    /**
     * Numeric type with 38 decimal digits of precision and 9 decimal digits
     * of scale.
     *
     * Generated from protobuf enum <code>NUMERIC = 11;</code>
     */
    const NUMERIC = 11;
    /**
     * Geography object (go/googlesql_geography).
     *
     * Generated from protobuf enum <code>GEOGRAPHY = 12;</code>
     */
    const GEOGRAPHY = 12;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::STRING => 'STRING',
        self::INTEGER => 'INTEGER',
        self::FLOAT => 'FLOAT',
        self::RECORD => 'RECORD',
        self::BYTES => 'BYTES',
        self::BOOLEAN => 'BOOLEAN',
        self::TIMESTAMP => 'TIMESTAMP',
        self::DATE => 'DATE',
        self::TIME => 'TIME',
        self::DATETIME => 'DATETIME',
        self::NUMERIC => 'NUMERIC',
        self::GEOGRAPHY => 'GEOGRAPHY',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Type::class, \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo_FieldSchema_Type::class);

