<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/bigtable/admin/v2/table.proto

namespace Google\Cloud\Bigtable\Admin\V2\Table;

use UnexpectedValueException;

/**
 * Defines a view over a table's fields.
 *
 * Protobuf type <code>google.bigtable.admin.v2.Table.View</code>
 */
class View
{
    /**
     * Uses the default view for each method as documented in its request.
     *
     * Generated from protobuf enum <code>VIEW_UNSPECIFIED = 0;</code>
     */
    const VIEW_UNSPECIFIED = 0;
    /**
     * Only populates `name`.
     *
     * Generated from protobuf enum <code>NAME_ONLY = 1;</code>
     */
    const NAME_ONLY = 1;
    /**
     * Only populates `name` and fields related to the table's schema.
     *
     * Generated from protobuf enum <code>SCHEMA_VIEW = 2;</code>
     */
    const SCHEMA_VIEW = 2;
    /**
     * Only populates `name` and fields related to the table's replication
     * state.
     *
     * Generated from protobuf enum <code>REPLICATION_VIEW = 3;</code>
     */
    const REPLICATION_VIEW = 3;
    /**
     * Only populates `name` and fields related to the table's encryption state.
     *
     * Generated from protobuf enum <code>ENCRYPTION_VIEW = 5;</code>
     */
    const ENCRYPTION_VIEW = 5;
    /**
     * Populates all fields.
     *
     * Generated from protobuf enum <code>FULL = 4;</code>
     */
    const FULL = 4;

    private static $valueToName = [
        self::VIEW_UNSPECIFIED => 'VIEW_UNSPECIFIED',
        self::NAME_ONLY => 'NAME_ONLY',
        self::SCHEMA_VIEW => 'SCHEMA_VIEW',
        self::REPLICATION_VIEW => 'REPLICATION_VIEW',
        self::ENCRYPTION_VIEW => 'ENCRYPTION_VIEW',
        self::FULL => 'FULL',
    ];

    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(View::class, \Google\Cloud\Bigtable\Admin\V2\Table_View::class);

