<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/datasources/v1beta/fileuploads.proto

namespace Google\Shopping\Merchant\DataSources\V1beta\FileUpload\Issue;

use UnexpectedValueException;

/**
 * The severity of the issue.
 *
 * Protobuf type <code>google.shopping.merchant.datasources.v1beta.FileUpload.Issue.Severity</code>
 */
class Severity
{
    /**
     * Severity unspecified.
     *
     * Generated from protobuf enum <code>SEVERITY_UNSPECIFIED = 0;</code>
     */
    const SEVERITY_UNSPECIFIED = 0;
    /**
     * The issue is the warning.
     *
     * Generated from protobuf enum <code>WARNING = 1;</code>
     */
    const WARNING = 1;
    /**
     * The issue is an error.
     *
     * Generated from protobuf enum <code>ERROR = 2;</code>
     */
    const ERROR = 2;

    private static $valueToName = [
        self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED',
        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);
    }
}

