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

namespace Google\Cloud\ServiceHealth\V1\Event;

use UnexpectedValueException;

/**
 * Communicates why a given incident is deemed relevant in the context of a
 * given project. This enum lists all possible detailed states of relevance.
 *
 * Protobuf type <code>google.cloud.servicehealth.v1.Event.Relevance</code>
 */
class Relevance
{
    /**
     * Unspecified relevance.
     *
     * Generated from protobuf enum <code>RELEVANCE_UNSPECIFIED = 0;</code>
     */
    const RELEVANCE_UNSPECIFIED = 0;
    /**
     * The relevance of the incident to the project is unknown.
     *
     * Generated from protobuf enum <code>UNKNOWN = 2;</code>
     */
    const UNKNOWN = 2;
    /**
     * The incident does not impact the project.
     *
     * Generated from protobuf enum <code>NOT_IMPACTED = 6;</code>
     */
    const NOT_IMPACTED = 6;
    /**
     * The incident is associated with a Google Cloud product your project uses,
     * but the incident may not be impacting your project. For example, the
     * incident may be impacting a Google Cloud product that your project uses,
     * but in a location that your project does not use.
     *
     * Generated from protobuf enum <code>PARTIALLY_RELATED = 7;</code>
     */
    const PARTIALLY_RELATED = 7;
    /**
     * The incident has a direct connection with your project and impacts a
     * Google Cloud product in a location your project uses.
     *
     * Generated from protobuf enum <code>RELATED = 8;</code>
     */
    const RELATED = 8;
    /**
     * The incident is verified to be impacting your project.
     *
     * Generated from protobuf enum <code>IMPACTED = 9;</code>
     */
    const IMPACTED = 9;

    private static $valueToName = [
        self::RELEVANCE_UNSPECIFIED => 'RELEVANCE_UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::NOT_IMPACTED => 'NOT_IMPACTED',
        self::PARTIALLY_RELATED => 'PARTIALLY_RELATED',
        self::RELATED => 'RELATED',
        self::IMPACTED => 'IMPACTED',
    ];

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


