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

namespace Google\Cloud\NetworkSecurity\V1\AddressGroup;

use UnexpectedValueException;

/**
 * Purpose of the Address Group.
 *
 * Protobuf type <code>google.cloud.networksecurity.v1.AddressGroup.Purpose</code>
 */
class Purpose
{
    /**
     * Default value. Should never happen.
     *
     * Generated from protobuf enum <code>PURPOSE_UNSPECIFIED = 0;</code>
     */
    const PURPOSE_UNSPECIFIED = 0;
    /**
     * Address Group is distributed to VMC, and is usable in Firewall Policies
     * and other systems that rely on VMC.
     *
     * Generated from protobuf enum <code>DEFAULT = 1;</code>
     */
    const PBDEFAULT = 1;
    /**
     * Address Group is usable in Cloud Armor.
     *
     * Generated from protobuf enum <code>CLOUD_ARMOR = 2;</code>
     */
    const CLOUD_ARMOR = 2;

    private static $valueToName = [
        self::PURPOSE_UNSPECIFIED => 'PURPOSE_UNSPECIFIED',
        self::PBDEFAULT => 'DEFAULT',
        self::CLOUD_ARMOR => 'CLOUD_ARMOR',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}


