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

namespace Google\Cloud\Filestore\V1\NetworkConfig;

use UnexpectedValueException;

/**
 * Internet protocol versions supported by Cloud Filestore.
 *
 * Protobuf type <code>google.cloud.filestore.v1.NetworkConfig.AddressMode</code>
 */
class AddressMode
{
    /**
     * Internet protocol not set.
     *
     * Generated from protobuf enum <code>ADDRESS_MODE_UNSPECIFIED = 0;</code>
     */
    const ADDRESS_MODE_UNSPECIFIED = 0;
    /**
     * Use the IPv4 internet protocol.
     *
     * Generated from protobuf enum <code>MODE_IPV4 = 1;</code>
     */
    const MODE_IPV4 = 1;

    private static $valueToName = [
        self::ADDRESS_MODE_UNSPECIFIED => 'ADDRESS_MODE_UNSPECIFIED',
        self::MODE_IPV4 => 'MODE_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);
    }
}


