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

namespace Google\Cloud\DataCatalog\V1;

use UnexpectedValueException;

/**
 * Table source type.
 *
 * Protobuf type <code>google.cloud.datacatalog.v1.TableSourceType</code>
 */
class TableSourceType
{
    /**
     * Default unknown type.
     *
     * Generated from protobuf enum <code>TABLE_SOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const TABLE_SOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * Table view.
     *
     * Generated from protobuf enum <code>BIGQUERY_VIEW = 2;</code>
     */
    const BIGQUERY_VIEW = 2;
    /**
     * BigQuery native table.
     *
     * Generated from protobuf enum <code>BIGQUERY_TABLE = 5;</code>
     */
    const BIGQUERY_TABLE = 5;

    private static $valueToName = [
        self::TABLE_SOURCE_TYPE_UNSPECIFIED => 'TABLE_SOURCE_TYPE_UNSPECIFIED',
        self::BIGQUERY_VIEW => 'BIGQUERY_VIEW',
        self::BIGQUERY_TABLE => 'BIGQUERY_TABLE',
    ];

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

