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

namespace Google\Cloud\NetworkManagement\V1\LoadBalancerInfo;

use UnexpectedValueException;

/**
 * The type definition for a load balancer:
 *
 * Protobuf type <code>google.cloud.networkmanagement.v1.LoadBalancerInfo.LoadBalancerType</code>
 */
class LoadBalancerType
{
    /**
     * Type is unspecified.
     *
     * Generated from protobuf enum <code>LOAD_BALANCER_TYPE_UNSPECIFIED = 0;</code>
     */
    const LOAD_BALANCER_TYPE_UNSPECIFIED = 0;
    /**
     * Internal TCP/UDP load balancer.
     *
     * Generated from protobuf enum <code>INTERNAL_TCP_UDP = 1;</code>
     */
    const INTERNAL_TCP_UDP = 1;
    /**
     * Network TCP/UDP load balancer.
     *
     * Generated from protobuf enum <code>NETWORK_TCP_UDP = 2;</code>
     */
    const NETWORK_TCP_UDP = 2;
    /**
     * HTTP(S) proxy load balancer.
     *
     * Generated from protobuf enum <code>HTTP_PROXY = 3;</code>
     */
    const HTTP_PROXY = 3;
    /**
     * TCP proxy load balancer.
     *
     * Generated from protobuf enum <code>TCP_PROXY = 4;</code>
     */
    const TCP_PROXY = 4;
    /**
     * SSL proxy load balancer.
     *
     * Generated from protobuf enum <code>SSL_PROXY = 5;</code>
     */
    const SSL_PROXY = 5;

    private static $valueToName = [
        self::LOAD_BALANCER_TYPE_UNSPECIFIED => 'LOAD_BALANCER_TYPE_UNSPECIFIED',
        self::INTERNAL_TCP_UDP => 'INTERNAL_TCP_UDP',
        self::NETWORK_TCP_UDP => 'NETWORK_TCP_UDP',
        self::HTTP_PROXY => 'HTTP_PROXY',
        self::TCP_PROXY => 'TCP_PROXY',
        self::SSL_PROXY => 'SSL_PROXY',
    ];

    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(LoadBalancerType::class, \Google\Cloud\NetworkManagement\V1\LoadBalancerInfo_LoadBalancerType::class);

