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

namespace Google\Cloud\Compute\V1\PacketMirroring;

use UnexpectedValueException;

/**
 * Indicates whether or not this packet mirroring takes effect. If set to FALSE, this packet mirroring policy will not be enforced on the network. The default is TRUE.
 *
 * Protobuf type <code>google.cloud.compute.v1.PacketMirroring.Enable</code>
 */
class Enable
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ENABLE = 0;</code>
     */
    const UNDEFINED_ENABLE = 0;
    /**
     * Generated from protobuf enum <code>FALSE = 66658563;</code>
     */
    const FALSE = 66658563;
    /**
     * Generated from protobuf enum <code>TRUE = 2583950;</code>
     */
    const TRUE = 2583950;

    private static $valueToName = [
        self::UNDEFINED_ENABLE => 'UNDEFINED_ENABLE',
        self::FALSE => 'FALSE',
        self::TRUE => 'TRUE',
    ];

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


