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

namespace Keyapis\TelemetryControl\V1\Building;

use UnexpectedValueException;

/**
 * Статусы объектов строительства
 *
 * Protobuf type <code>keyapis.telemetry_control.v1.Building.StatusType</code>
 */
class StatusType
{
    /**
     * Значение не указано
     *
     * Generated from protobuf enum <code>STATUS_TYPE_UNKNOWN = 0;</code>
     */
    const STATUS_TYPE_UNKNOWN = 0;
    /**
     * СМР
     *
     * Generated from protobuf enum <code>BUILDING = 1;</code>
     */
    const BUILDING = 1;
    /**
     * Реализован
     *
     * Generated from protobuf enum <code>ACCEPTANCE = 2;</code>
     */
    const ACCEPTANCE = 2;
    /**
     * Обслуживание
     *
     * Generated from protobuf enum <code>ACTIVE = 3;</code>
     */
    const ACTIVE = 3;
    /**
     * Снят с обслуживания
     *
     * Generated from protobuf enum <code>ARCHIVE = 4;</code>
     */
    const ARCHIVE = 4;
    /**
     * Отказ от заключения договора
     *
     * Generated from protobuf enum <code>CANCELLED = 5;</code>
     */
    const CANCELLED = 5;
    /**
     * Тестовый
     *
     * Generated from protobuf enum <code>TEST_STATUS_TYPE = 6;</code>
     */
    const TEST_STATUS_TYPE = 6;

    private static $valueToName = [
        self::STATUS_TYPE_UNKNOWN => 'STATUS_TYPE_UNKNOWN',
        self::BUILDING => 'BUILDING',
        self::ACCEPTANCE => 'ACCEPTANCE',
        self::ACTIVE => 'ACTIVE',
        self::ARCHIVE => 'ARCHIVE',
        self::CANCELLED => 'CANCELLED',
        self::TEST_STATUS_TYPE => 'TEST_STATUS_TYPE',
    ];

    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\TelemetryControl\V1\Building_StatusType::class);

