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

namespace Google\Cloud\MigrationCenter\V1\NetworkAddress;

use UnexpectedValueException;

/**
 * Network address assignment.
 *
 * Protobuf type <code>google.cloud.migrationcenter.v1.NetworkAddress.AddressAssignment</code>
 */
class AddressAssignment
{
    /**
     * Unknown (default value).
     *
     * Generated from protobuf enum <code>ADDRESS_ASSIGNMENT_UNSPECIFIED = 0;</code>
     */
    const ADDRESS_ASSIGNMENT_UNSPECIFIED = 0;
    /**
     * Staticly assigned IP.
     *
     * Generated from protobuf enum <code>ADDRESS_ASSIGNMENT_STATIC = 1;</code>
     */
    const ADDRESS_ASSIGNMENT_STATIC = 1;
    /**
     * Dynamically assigned IP (DHCP).
     *
     * Generated from protobuf enum <code>ADDRESS_ASSIGNMENT_DHCP = 2;</code>
     */
    const ADDRESS_ASSIGNMENT_DHCP = 2;

    private static $valueToName = [
        self::ADDRESS_ASSIGNMENT_UNSPECIFIED => 'ADDRESS_ASSIGNMENT_UNSPECIFIED',
        self::ADDRESS_ASSIGNMENT_STATIC => 'ADDRESS_ASSIGNMENT_STATIC',
        self::ADDRESS_ASSIGNMENT_DHCP => 'ADDRESS_ASSIGNMENT_DHCP',
    ];

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


