<?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.ServiceType</code>
 */
class ServiceType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>SERVICE_TYPE_UNKNOWN = 0;</code>
     */
    const SERVICE_TYPE_UNKNOWN = 0;
    /**
     * Умный домофон
     *
     * Generated from protobuf enum <code>INTERCOM = 1;</code>
     */
    const INTERCOM = 1;
    /**
     * Комплексное видеонаблюдение
     *
     * Generated from protobuf enum <code>CAMERAS = 2;</code>
     */
    const CAMERAS = 2;
    /**
     * Умные счётчики
     *
     * Generated from protobuf enum <code>TELEMETRY = 3;</code>
     */
    const TELEMETRY = 3;
    /**
     * Система контроля и управления доступом
     *
     * Generated from protobuf enum <code>ACCESS_CONTROL_PANEL = 4;</code>
     */
    const ACCESS_CONTROL_PANEL = 4;
    /**
     * Умный шлагбаум
     *
     * Generated from protobuf enum <code>BARRIER = 5;</code>
     */
    const BARRIER = 5;

    private static $valueToName = [
        self::SERVICE_TYPE_UNKNOWN => 'SERVICE_TYPE_UNKNOWN',
        self::INTERCOM => 'INTERCOM',
        self::CAMERAS => 'CAMERAS',
        self::TELEMETRY => 'TELEMETRY',
        self::ACCESS_CONTROL_PANEL => 'ACCESS_CONTROL_PANEL',
        self::BARRIER => 'BARRIER',
    ];

    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(ServiceType::class, \Keyapis\Subscription\V1\OfferTemplate_ServiceType::class);

