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

namespace Google\Cloud\Compute\V1\NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy;

use UnexpectedValueException;

/**
 * [Output Only] The type of the firewall policy.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworksGetEffectiveFirewallsResponseEffectiveFirewallPolicy.Type</code>
 */
class Type
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_TYPE = 0;</code>
     */
    const UNDEFINED_TYPE = 0;
    /**
     * Generated from protobuf enum <code>HIERARCHY = 69902869;</code>
     */
    const HIERARCHY = 69902869;
    /**
     * Generated from protobuf enum <code>NETWORK = 413984270;</code>
     */
    const NETWORK = 413984270;
    /**
     * Generated from protobuf enum <code>SYSTEM = 313484847;</code>
     */
    const SYSTEM = 313484847;
    /**
     * Generated from protobuf enum <code>UNSPECIFIED = 526786327;</code>
     */
    const UNSPECIFIED = 526786327;

    private static $valueToName = [
        self::UNDEFINED_TYPE => 'UNDEFINED_TYPE',
        self::HIERARCHY => 'HIERARCHY',
        self::NETWORK => 'NETWORK',
        self::SYSTEM => 'SYSTEM',
        self::UNSPECIFIED => 'UNSPECIFIED',
    ];

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


