<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_relay_v1.proto

namespace Deviceapis\Device\V1;

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

/**
 * Запрос открытия реле
 *
 * Generated from protobuf message <code>deviceapis.device.v1.PostRelayOpenRequest</code>
 */
class PostRelayOpenRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Индекс реле.
     * Диапазон: 1..32767
     *
     * Generated from protobuf field <code>int32 relay_index = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $relay_index = 0;
    /**
     * Задержка в секундах.
     * Если не передано, используется установленное значение времени открытия из настроек.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 current_open_time = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $current_open_time = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $relay_index
     *           Индекс реле.
     *           Диапазон: 1..32767
     *     @type int $current_open_time
     *           Задержка в секундах.
     *           Если не передано, используется установленное значение времени открытия из настроек.
     *           Диапазон: 1..200
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceRelayV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Индекс реле.
     * Диапазон: 1..32767
     *
     * Generated from protobuf field <code>int32 relay_index = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return int
     */
    public function getRelayIndex()
    {
        return $this->relay_index;
    }

    /**
     * Индекс реле.
     * Диапазон: 1..32767
     *
     * Generated from protobuf field <code>int32 relay_index = 1 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param int $var
     * @return $this
     */
    public function setRelayIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->relay_index = $var;

        return $this;
    }

    /**
     * Задержка в секундах.
     * Если не передано, используется установленное значение времени открытия из настроек.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 current_open_time = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return int
     */
    public function getCurrentOpenTime()
    {
        return $this->current_open_time;
    }

    /**
     * Задержка в секундах.
     * Если не передано, используется установленное значение времени открытия из настроек.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 current_open_time = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param int $var
     * @return $this
     */
    public function setCurrentOpenTime($var)
    {
        GPBUtil::checkInt32($var);
        $this->current_open_time = $var;

        return $this;
    }

}

