<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/monitoring/v3/alert.proto

namespace Google\Cloud\Monitoring\V3\AlertPolicy\AlertStrategy;

use UnexpectedValueException;

/**
 * Control when notifications will be sent out.
 *
 * Protobuf type <code>google.monitoring.v3.AlertPolicy.AlertStrategy.NotificationPrompt</code>
 */
class NotificationPrompt
{
    /**
     * No strategy specified. Treated as error.
     *
     * Generated from protobuf enum <code>NOTIFICATION_PROMPT_UNSPECIFIED = 0;</code>
     */
    const NOTIFICATION_PROMPT_UNSPECIFIED = 0;
    /**
     * Notify when an incident is opened.
     *
     * Generated from protobuf enum <code>OPENED = 1;</code>
     */
    const OPENED = 1;
    /**
     * Notify when an incident is closed.
     *
     * Generated from protobuf enum <code>CLOSED = 3;</code>
     */
    const CLOSED = 3;

    private static $valueToName = [
        self::NOTIFICATION_PROMPT_UNSPECIFIED => 'NOTIFICATION_PROMPT_UNSPECIFIED',
        self::OPENED => 'OPENED',
        self::CLOSED => 'CLOSED',
    ];

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


