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

namespace Google\Cloud\Compute\V1\InterconnectOutageNotification;

use UnexpectedValueException;

/**
 * State of this notification, which can take one of the following values:
 *    - ACTIVE: This outage notification is active. The event could be in
 *    the past, present, or future. See start_time and end_time for
 *    scheduling.
 *    - CANCELLED: The outage associated with this notification was cancelled
 *    before the outage was due to start.
 *    - COMPLETED: The outage associated with this notification is complete.
 * Note that the versions of this enum prefixed with "NS_" have been
 * deprecated in favor of the unprefixed values.
 *
 * Protobuf type <code>google.cloud.compute.v1.InterconnectOutageNotification.State</code>
 */
class State
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATE = 0;</code>
     */
    const UNDEFINED_STATE = 0;
    /**
     * This outage notification is active. The event could be in the future,
     * present, or past. See start_time and end_time for scheduling.
     *
     * Generated from protobuf enum <code>ACTIVE = 314733318;</code>
     */
    const ACTIVE = 314733318;
    /**
     * The outage associated with this notification was cancelled before the
     * outage was due to start.
     *
     * Generated from protobuf enum <code>CANCELLED = 41957681;</code>
     */
    const CANCELLED = 41957681;
    /**
     * The outage associated with this notification is complete.
     *
     * Generated from protobuf enum <code>COMPLETED = 309921323;</code>
     */
    const COMPLETED = 309921323;
    /**
     * [Deprecated] This outage notification is active. The event could be in
     * the future, present, or past. See start_time and end_time for
     * scheduling.
     *
     * Generated from protobuf enum <code>NS_ACTIVE = 252563136;</code>
     */
    const NS_ACTIVE = 252563136;
    /**
     * [Deprecated] The outage associated with this notification was canceled
     * before the outage was due to start.
     *
     * Generated from protobuf enum <code>NS_CANCELED = 506579411;</code>
     */
    const NS_CANCELED = 506579411;

    private static $valueToName = [
        self::UNDEFINED_STATE => 'UNDEFINED_STATE',
        self::ACTIVE => 'ACTIVE',
        self::CANCELLED => 'CANCELLED',
        self::COMPLETED => 'COMPLETED',
        self::NS_ACTIVE => 'NS_ACTIVE',
        self::NS_CANCELED => 'NS_CANCELED',
    ];

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


