<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/bell/v1/keyapis_bell_notification_v1.proto

namespace Keyapis\Bell\V1\Notification;

use UnexpectedValueException;

/**
 * Статус
 *
 * Protobuf type <code>keyapis.bell.v1.Notification.StatusType</code>
 */
class StatusType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>STATUS_TYPE_UNKNOWN = 0;</code>
     */
    const STATUS_TYPE_UNKNOWN = 0;
    /**
     * Новый.
     * Устанавливается по умолчанию
     *
     * Generated from protobuf enum <code>NEW = 1;</code>
     */
    const PBNEW = 1;
    /**
     * Доставлен
     *
     * Generated from protobuf enum <code>DELIVERED = 2;</code>
     */
    const DELIVERED = 2;
    /**
     * Просмотрен
     *
     * Generated from protobuf enum <code>VIEWED = 3;</code>
     */
    const VIEWED = 3;

    private static $valueToName = [
        self::STATUS_TYPE_UNKNOWN => 'STATUS_TYPE_UNKNOWN',
        self::PBNEW => 'NEW',
        self::DELIVERED => 'DELIVERED',
        self::VIEWED => 'VIEWED',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(StatusType::class, \Keyapis\Bell\V1\Notification_StatusType::class);

