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

namespace Google\Cloud\Compute\V1\ForwardingRule;

use UnexpectedValueException;

/**
 * Specifies the forwarding rule type. For more information about forwarding rules, refer to Forwarding rule concepts.
 *
 * Protobuf type <code>google.cloud.compute.v1.ForwardingRule.LoadBalancingScheme</code>
 */
class LoadBalancingScheme
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_LOAD_BALANCING_SCHEME = 0;</code>
     */
    const UNDEFINED_LOAD_BALANCING_SCHEME = 0;
    /**
     * Generated from protobuf enum <code>EXTERNAL = 35607499;</code>
     */
    const EXTERNAL = 35607499;
    /**
     * Generated from protobuf enum <code>EXTERNAL_MANAGED = 512006923;</code>
     */
    const EXTERNAL_MANAGED = 512006923;
    /**
     * Generated from protobuf enum <code>INTERNAL = 279295677;</code>
     */
    const INTERNAL = 279295677;
    /**
     * Generated from protobuf enum <code>INTERNAL_MANAGED = 37350397;</code>
     */
    const INTERNAL_MANAGED = 37350397;
    /**
     * Generated from protobuf enum <code>INTERNAL_SELF_MANAGED = 236211150;</code>
     */
    const INTERNAL_SELF_MANAGED = 236211150;
    /**
     * Generated from protobuf enum <code>INVALID = 530283991;</code>
     */
    const INVALID = 530283991;

    private static $valueToName = [
        self::UNDEFINED_LOAD_BALANCING_SCHEME => 'UNDEFINED_LOAD_BALANCING_SCHEME',
        self::EXTERNAL => 'EXTERNAL',
        self::EXTERNAL_MANAGED => 'EXTERNAL_MANAGED',
        self::INTERNAL => 'INTERNAL',
        self::INTERNAL_MANAGED => 'INTERNAL_MANAGED',
        self::INTERNAL_SELF_MANAGED => 'INTERNAL_SELF_MANAGED',
        self::INVALID => 'INVALID',
    ];

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


