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

namespace Keyapis\Notification\V1\PushToken;

use UnexpectedValueException;

/**
 * Справочников типов пуш-токенов.
 * # Тип: byte
 *
 * Protobuf type <code>keyapis.notification.v1.PushToken.Type</code>
 */
class Type
{
    /**
     * Не указан
     *
     * Generated from protobuf enum <code>TYPE_UNKNOWN = 0;</code>
     */
    const TYPE_UNKNOWN = 0;
    /**
     * Для Mobile Firebase Cloud Messaging
     *
     * Generated from protobuf enum <code>MOBILE_FCM = 1;</code>
     */
    const MOBILE_FCM = 1;
    /**
     * Для Mobile Huawei Messaging System
     *
     * Generated from protobuf enum <code>MOBILE_HMS = 2;</code>
     */
    const MOBILE_HMS = 2;
    /**
     * Для Mobile Apple PushToken System для текста
     *
     * Generated from protobuf enum <code>MOBILE_APNS_TEXT = 3;</code>
     */
    const MOBILE_APNS_TEXT = 3;
    /**
     * Для Mobile Apple PushToken System для звонков
     *
     * Generated from protobuf enum <code>MOBILE_APNS_CALL = 4;</code>
     */
    const MOBILE_APNS_CALL = 4;
    /**
     * Для PWA Firebase Cloud Messaging
     *
     * Generated from protobuf enum <code>PWA_FCM = 5;</code>
     */
    const PWA_FCM = 5;
    /**
     * Для PWA Apple PushToken System
     *
     * Generated from protobuf enum <code>PWA_APNS = 6;</code>
     */
    const PWA_APNS = 6;
    /**
     * Для Mobile RuStore
     *
     * Generated from protobuf enum <code>MOBILE_RUSTORE = 7;</code>
     */
    const MOBILE_RUSTORE = 7;

    private static $valueToName = [
        self::TYPE_UNKNOWN => 'TYPE_UNKNOWN',
        self::MOBILE_FCM => 'MOBILE_FCM',
        self::MOBILE_HMS => 'MOBILE_HMS',
        self::MOBILE_APNS_TEXT => 'MOBILE_APNS_TEXT',
        self::MOBILE_APNS_CALL => 'MOBILE_APNS_CALL',
        self::PWA_FCM => 'PWA_FCM',
        self::PWA_APNS => 'PWA_APNS',
        self::MOBILE_RUSTORE => 'MOBILE_RUSTORE',
    ];

    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(Type::class, \Keyapis\Notification\V1\PushToken_Type::class);

