<?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\ApplicabilityRules;

use UnexpectedValueException;

/**
 * Справочник типов клиентов
 *
 * Protobuf type <code>keyapis.subscription.v1.OfferTemplate.ApplicabilityRules.ClientType</code>
 */
class ClientType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>CLIENT_TYPE_UNKNOWN = 0;</code>
     */
    const CLIENT_TYPE_UNKNOWN = 0;
    /**
     * Управляющая компания
     *
     * Generated from protobuf enum <code>MANAGEMENT_COMPANY = 1;</code>
     */
    const MANAGEMENT_COMPANY = 1;
    /**
     * Домофонная компания
     *
     * Generated from protobuf enum <code>INTERCOM_COMPANY = 2;</code>
     */
    const INTERCOM_COMPANY = 2;

    private static $valueToName = [
        self::CLIENT_TYPE_UNKNOWN => 'CLIENT_TYPE_UNKNOWN',
        self::MANAGEMENT_COMPANY => 'MANAGEMENT_COMPANY',
        self::INTERCOM_COMPANY => 'INTERCOM_COMPANY',
    ];

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

