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

namespace Google\Cloud\Bigtable\V2\PeerInfo;

use UnexpectedValueException;

/**
 * The transport type that the client used to connect to this peer.
 *
 * Protobuf type <code>google.bigtable.v2.PeerInfo.TransportType</code>
 */
class TransportType
{
    /**
     * The transport type is unknown.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_UNKNOWN = 0;</code>
     */
    const TRANSPORT_TYPE_UNKNOWN = 0;
    /**
     * The client connected to this peer via an external network
     * (e.g. outside Google Coud).
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_EXTERNAL = 1;</code>
     */
    const TRANSPORT_TYPE_EXTERNAL = 1;
    /**
     * The client connected to this peer via CloudPath.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_CLOUD_PATH = 2;</code>
     */
    const TRANSPORT_TYPE_CLOUD_PATH = 2;
    /**
     * The client connected to this peer via DirectAccess.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_DIRECT_ACCESS = 3;</code>
     */
    const TRANSPORT_TYPE_DIRECT_ACCESS = 3;
    /**
     * The client connected to this peer via Bigtable Sessions using an unknown
     * transport type.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_SESSION_UNKNOWN = 4;</code>
     */
    const TRANSPORT_TYPE_SESSION_UNKNOWN = 4;
    /**
     * The client connected to this peer via Bigtable Sessions on an external
     * network (e.g. outside Google Cloud).
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_SESSION_EXTERNAL = 5;</code>
     */
    const TRANSPORT_TYPE_SESSION_EXTERNAL = 5;
    /**
     * The client connected to this peer via Bigtable Sessions using CloudPath.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6;</code>
     */
    const TRANSPORT_TYPE_SESSION_CLOUD_PATH = 6;
    /**
     * The client connected to this peer via Bigtable Sessions using
     * DirectAccess.
     *
     * Generated from protobuf enum <code>TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7;</code>
     */
    const TRANSPORT_TYPE_SESSION_DIRECT_ACCESS = 7;

    private static $valueToName = [
        self::TRANSPORT_TYPE_UNKNOWN => 'TRANSPORT_TYPE_UNKNOWN',
        self::TRANSPORT_TYPE_EXTERNAL => 'TRANSPORT_TYPE_EXTERNAL',
        self::TRANSPORT_TYPE_CLOUD_PATH => 'TRANSPORT_TYPE_CLOUD_PATH',
        self::TRANSPORT_TYPE_DIRECT_ACCESS => 'TRANSPORT_TYPE_DIRECT_ACCESS',
        self::TRANSPORT_TYPE_SESSION_UNKNOWN => 'TRANSPORT_TYPE_SESSION_UNKNOWN',
        self::TRANSPORT_TYPE_SESSION_EXTERNAL => 'TRANSPORT_TYPE_SESSION_EXTERNAL',
        self::TRANSPORT_TYPE_SESSION_CLOUD_PATH => 'TRANSPORT_TYPE_SESSION_CLOUD_PATH',
        self::TRANSPORT_TYPE_SESSION_DIRECT_ACCESS => 'TRANSPORT_TYPE_SESSION_DIRECT_ACCESS',
    ];

    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(TransportType::class, \Google\Cloud\Bigtable\V2\PeerInfo_TransportType::class);

