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

namespace Google\Cloud\NetworkConnectivity\V1\PolicyBasedRoute\Filter;

use UnexpectedValueException;

/**
 * The internet protocol version.
 *
 * Protobuf type <code>google.cloud.networkconnectivity.v1.PolicyBasedRoute.Filter.ProtocolVersion</code>
 */
class ProtocolVersion
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>PROTOCOL_VERSION_UNSPECIFIED = 0;</code>
     */
    const PROTOCOL_VERSION_UNSPECIFIED = 0;
    /**
     * The PBR is for IPv4 internet protocol traffic.
     *
     * Generated from protobuf enum <code>IPV4 = 1;</code>
     */
    const IPV4 = 1;

    private static $valueToName = [
        self::PROTOCOL_VERSION_UNSPECIFIED => 'PROTOCOL_VERSION_UNSPECIFIED',
        self::IPV4 => 'IPV4',
    ];

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


