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

namespace Keyapis\Subscription\V1\OfferTemplate;

use UnexpectedValueException;

/**
 * Справочник статусов шаблона КВ
 *
 * Protobuf type <code>keyapis.subscription.v1.OfferTemplate.StatusType</code>
 */
class StatusType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>STATUS_TYPE_UNKNOWN = 0;</code>
     */
    const STATUS_TYPE_UNKNOWN = 0;
    /**
     * Активен
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * Архивирован
     *
     * Generated from protobuf enum <code>ARCHIVED = 2;</code>
     */
    const ARCHIVED = 2;

    private static $valueToName = [
        self::STATUS_TYPE_UNKNOWN => 'STATUS_TYPE_UNKNOWN',
        self::ACTIVE => 'ACTIVE',
        self::ARCHIVED => 'ARCHIVED',
    ];

    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\Subscription\V1\OfferTemplate_StatusType::class);

