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

namespace Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage;

use UnexpectedValueException;

/**
 * Represents data transfer user facing message severity.
 *
 * Protobuf type <code>google.cloud.bigquery.datatransfer.v1.TransferMessage.MessageSeverity</code>
 */
class MessageSeverity
{
    /**
     * No severity specified.
     *
     * Generated from protobuf enum <code>MESSAGE_SEVERITY_UNSPECIFIED = 0;</code>
     */
    const MESSAGE_SEVERITY_UNSPECIFIED = 0;
    /**
     * Informational message.
     *
     * Generated from protobuf enum <code>INFO = 1;</code>
     */
    const INFO = 1;
    /**
     * Warning message.
     *
     * Generated from protobuf enum <code>WARNING = 2;</code>
     */
    const WARNING = 2;
    /**
     * Error message.
     *
     * Generated from protobuf enum <code>ERROR = 3;</code>
     */
    const ERROR = 3;

    private static $valueToName = [
        self::MESSAGE_SEVERITY_UNSPECIFIED => 'MESSAGE_SEVERITY_UNSPECIFIED',
        self::INFO => 'INFO',
        self::WARNING => 'WARNING',
        self::ERROR => 'ERROR',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MessageSeverity::class, \Google\Cloud\BigQuery\DataTransfer\V1\TransferMessage_MessageSeverity::class);

