<?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.RelayOpen</code>
 */
class RelayOpen 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;
    /**
     * Тип замка
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.RelayOpen.LockType lock_type = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $lock_type = 0;
    /**
     * Общее время открытия.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 open_time_general = 3 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $open_time_general = 0;
    /**
     * Время открытия в секундах при экстренном оповещении.
     * При 0 - до конца экстренного оповещения.
     * Диапазон: 0..3600
     *
     * Generated from protobuf field <code>int32 open_time_emergency = 4 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     */
    protected $open_time_emergency = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $relay_index
     *           Индекс реле.
     *           Диапазон: 1..32767
     *     @type int $lock_type
     *           Тип замка
     *     @type int $open_time_general
     *           Общее время открытия.
     *           Диапазон: 1..200
     *     @type int $open_time_emergency
     *           Время открытия в секундах при экстренном оповещении.
     *           При 0 - до конца экстренного оповещения.
     *           Диапазон: 0..3600
     * }
     */
    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;
    }

    /**
     * Тип замка
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.RelayOpen.LockType lock_type = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return int
     */
    public function getLockType()
    {
        return $this->lock_type;
    }

    /**
     * Тип замка
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.RelayOpen.LockType lock_type = 2 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param int $var
     * @return $this
     */
    public function setLockType($var)
    {
        GPBUtil::checkEnum($var, \Deviceapis\Device\V1\RelayOpen\LockType::class);
        $this->lock_type = $var;

        return $this;
    }

    /**
     * Общее время открытия.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 open_time_general = 3 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return int
     */
    public function getOpenTimeGeneral()
    {
        return $this->open_time_general;
    }

    /**
     * Общее время открытия.
     * Диапазон: 1..200
     *
     * Generated from protobuf field <code>int32 open_time_general = 3 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param int $var
     * @return $this
     */
    public function setOpenTimeGeneral($var)
    {
        GPBUtil::checkInt32($var);
        $this->open_time_general = $var;

        return $this;
    }

    /**
     * Время открытия в секундах при экстренном оповещении.
     * При 0 - до конца экстренного оповещения.
     * Диапазон: 0..3600
     *
     * Generated from protobuf field <code>int32 open_time_emergency = 4 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @return int
     */
    public function getOpenTimeEmergency()
    {
        return $this->open_time_emergency;
    }

    /**
     * Время открытия в секундах при экстренном оповещении.
     * При 0 - до конца экстренного оповещения.
     * Диапазон: 0..3600
     *
     * Generated from protobuf field <code>int32 open_time_emergency = 4 [(.grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {</code>
     * @param int $var
     * @return $this
     */
    public function setOpenTimeEmergency($var)
    {
        GPBUtil::checkInt32($var);
        $this->open_time_emergency = $var;

        return $this;
    }

}

