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

namespace Google\Cloud\Bigtable\V2;

use UnexpectedValueException;

/**
 * Supported session types.
 *
 * Protobuf type <code>google.bigtable.v2.SessionType</code>
 */
class SessionType
{
    /**
     * Generated from protobuf enum <code>SESSION_TYPE_UNSET = 0;</code>
     */
    const SESSION_TYPE_UNSET = 0;
    /**
     * Generated from protobuf enum <code>SESSION_TYPE_TABLE = 1;</code>
     */
    const SESSION_TYPE_TABLE = 1;
    /**
     * Generated from protobuf enum <code>SESSION_TYPE_AUTHORIZED_VIEW = 2;</code>
     */
    const SESSION_TYPE_AUTHORIZED_VIEW = 2;
    /**
     * Generated from protobuf enum <code>SESSION_TYPE_MATERIALIZED_VIEW = 3;</code>
     */
    const SESSION_TYPE_MATERIALIZED_VIEW = 3;
    /**
     * For internal protocol testing only.
     *
     * Generated from protobuf enum <code>SESSION_TYPE_TEST = -1;</code>
     */
    const SESSION_TYPE_TEST = -1;

    private static $valueToName = [
        self::SESSION_TYPE_UNSET => 'SESSION_TYPE_UNSET',
        self::SESSION_TYPE_TABLE => 'SESSION_TYPE_TABLE',
        self::SESSION_TYPE_AUTHORIZED_VIEW => 'SESSION_TYPE_AUTHORIZED_VIEW',
        self::SESSION_TYPE_MATERIALIZED_VIEW => 'SESSION_TYPE_MATERIALIZED_VIEW',
        self::SESSION_TYPE_TEST => 'SESSION_TYPE_TEST',
    ];

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

