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

namespace Keyapis\Invoice\V1\PayMethod;

use UnexpectedValueException;

/**
 * Статус способа оплаты
 *
 * Protobuf type <code>keyapis.invoice.v1.PayMethod.StatusType</code>
 */
class StatusType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>STATUS_TYPE_UNKNOWN = 0;</code>
     */
    const STATUS_TYPE_UNKNOWN = 0;
    /**
     * Исправный
     *
     * Generated from protobuf enum <code>VALID = 1;</code>
     */
    const VALID = 1;
    /**
     * Истекший
     *
     * Generated from protobuf enum <code>EXPIRED = 2;</code>
     */
    const EXPIRED = 2;
    /**
     * Заблокированный
     *
     * Generated from protobuf enum <code>BLOCKED = 3;</code>
     */
    const BLOCKED = 3;

    private static $valueToName = [
        self::STATUS_TYPE_UNKNOWN => 'STATUS_TYPE_UNKNOWN',
        self::VALID => 'VALID',
        self::EXPIRED => 'EXPIRED',
        self::BLOCKED => 'BLOCKED',
    ];

    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(StatusType::class, \Keyapis\Invoice\V1\PayMethod_StatusType::class);

