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

namespace Keyapis\IotConnect\V1\DeviceState;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Значение статуса устройства
 *
 * Generated from protobuf message <code>keyapis.iot_connect.v1.DeviceState.Value</code>
 */
class Value extends \Google\Protobuf\Internal\Message
{
    /**
     * Тип значения статуса устройства
     *
     * Generated from protobuf field <code>.keyapis.iot_connect.v1.DeviceState.Value.Type type = 1;</code>
     */
    protected $type = 0;
    protected $value;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           Тип значения статуса устройства
     *     @type bool $is_value
     *           Значение логического типа
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\IotConnect\V1\KeyapisIotConnectCallbackV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Тип значения статуса устройства
     *
     * Generated from protobuf field <code>.keyapis.iot_connect.v1.DeviceState.Value.Type type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Тип значения статуса устройства
     *
     * Generated from protobuf field <code>.keyapis.iot_connect.v1.DeviceState.Value.Type type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\IotConnect\V1\DeviceState\Value\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Значение логического типа
     *
     * Generated from protobuf field <code>bool is_value = 2 [json_name = "bool_value"];</code>
     * @return bool
     */
    public function getIsValue()
    {
        return $this->readOneof(2);
    }

    public function hasIsValue()
    {
        return $this->hasOneof(2);
    }

    /**
     * Значение логического типа
     *
     * Generated from protobuf field <code>bool is_value = 2 [json_name = "bool_value"];</code>
     * @param bool $var
     * @return $this
     */
    public function setIsValue($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getValue()
    {
        return $this->whichOneof("value");
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Value::class, \Keyapis\IotConnect\V1\DeviceState_Value::class);

