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

namespace Google\Cloud\Compute\V1\Address;

use UnexpectedValueException;

/**
 * [Output Only] The status of the address, which can be one of RESERVING, RESERVED, or IN_USE. An address that is RESERVING is currently in the process of being reserved. A RESERVED address is currently reserved and available to use. An IN_USE address is currently being used by another resource and is not available.
 *
 * Protobuf type <code>google.cloud.compute.v1.Address.Status</code>
 */
class Status
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATUS = 0;</code>
     */
    const UNDEFINED_STATUS = 0;
    /**
     * Address is being used by another resource and is not available.
     *
     * Generated from protobuf enum <code>IN_USE = 17393485;</code>
     */
    const IN_USE = 17393485;
    /**
     * Address is reserved and available to use.
     *
     * Generated from protobuf enum <code>RESERVED = 432241448;</code>
     */
    const RESERVED = 432241448;
    /**
     * Address is being reserved.
     *
     * Generated from protobuf enum <code>RESERVING = 514587225;</code>
     */
    const RESERVING = 514587225;

    private static $valueToName = [
        self::UNDEFINED_STATUS => 'UNDEFINED_STATUS',
        self::IN_USE => 'IN_USE',
        self::RESERVED => 'RESERVED',
        self::RESERVING => 'RESERVING',
    ];

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


