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

namespace Keyapis\Device\V1;

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

/**
 * Задача на открытие устройства.
 * Очередь key.device.open
 *
 * Generated from protobuf message <code>keyapis.device.v1.OpenTask</code>
 */
class OpenTask extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $request_id = '';
    /**
     * Модель
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $model = '';
    /**
     * Хост
     *
     * Generated from protobuf field <code>string host = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $host = '';
    /**
     * Имя пользователя
     *
     * Generated from protobuf field <code>string username = 4;</code>
     */
    protected $username = '';
    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 5;</code>
     */
    protected $password = '';
    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_id = 0;
    /**
     * Номер реле
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value relay_index = 7;</code>
     */
    protected $relay_index = null;
    /**
     * Задержка в секундах.
     * Если не передано, то полставляется значение по умолчанию (5)
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value delay = 8;</code>
     */
    protected $delay = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $request_id
     *           Идентификатор запроса
     *     @type string $model
     *           Модель
     *     @type string $host
     *           Хост
     *     @type string $username
     *           Имя пользователя
     *     @type string $password
     *           Пароль
     *     @type int $device_id
     *           Идентификатор устройства
     *     @type \Google\Protobuf\Int32Value $relay_index
     *           Номер реле
     *     @type \Google\Protobuf\Int32Value $delay
     *           Задержка в секундах.
     *           Если не передано, то полставляется значение по умолчанию (5)
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceEventsV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * Модель
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getModel()
    {
        return $this->model;
    }

    /**
     * Модель
     *
     * Generated from protobuf field <code>string model = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setModel($var)
    {
        GPBUtil::checkString($var, True);
        $this->model = $var;

        return $this;
    }

    /**
     * Хост
     *
     * Generated from protobuf field <code>string host = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getHost()
    {
        return $this->host;
    }

    /**
     * Хост
     *
     * Generated from protobuf field <code>string host = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setHost($var)
    {
        GPBUtil::checkString($var, True);
        $this->host = $var;

        return $this;
    }

    /**
     * Имя пользователя
     *
     * Generated from protobuf field <code>string username = 4;</code>
     * @return string
     */
    public function getUsername()
    {
        return $this->username;
    }

    /**
     * Имя пользователя
     *
     * Generated from protobuf field <code>string username = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setUsername($var)
    {
        GPBUtil::checkString($var, True);
        $this->username = $var;

        return $this;
    }

    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 5;</code>
     * @return string
     */
    public function getPassword()
    {
        return $this->password;
    }

    /**
     * Пароль
     *
     * Generated from protobuf field <code>string password = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setPassword($var)
    {
        GPBUtil::checkString($var, True);
        $this->password = $var;

        return $this;
    }

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDeviceId()
    {
        return $this->device_id;
    }

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDeviceId($var)
    {
        GPBUtil::checkInt32($var);
        $this->device_id = $var;

        return $this;
    }

    /**
     * Номер реле
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value relay_index = 7;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getRelayIndex()
    {
        return $this->relay_index;
    }

    public function hasRelayIndex()
    {
        return isset($this->relay_index);
    }

    public function clearRelayIndex()
    {
        unset($this->relay_index);
    }

    /**
     * Returns the unboxed value from <code>getRelayIndex()</code>

     * Номер реле
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value relay_index = 7;</code>
     * @return int|null
     */
    public function getRelayIndexUnwrapped()
    {
        return $this->readWrapperValue("relay_index");
    }

    /**
     * Номер реле
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value relay_index = 7;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setRelayIndex($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->relay_index = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Номер реле
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value relay_index = 7;</code>
     * @param int|null $var
     * @return $this
     */
    public function setRelayIndexUnwrapped($var)
    {
        $this->writeWrapperValue("relay_index", $var);
        return $this;}

    /**
     * Задержка в секундах.
     * Если не передано, то полставляется значение по умолчанию (5)
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value delay = 8;</code>
     * @return \Google\Protobuf\Int32Value|null
     */
    public function getDelay()
    {
        return $this->delay;
    }

    public function hasDelay()
    {
        return isset($this->delay);
    }

    public function clearDelay()
    {
        unset($this->delay);
    }

    /**
     * Returns the unboxed value from <code>getDelay()</code>

     * Задержка в секундах.
     * Если не передано, то полставляется значение по умолчанию (5)
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value delay = 8;</code>
     * @return int|null
     */
    public function getDelayUnwrapped()
    {
        return $this->readWrapperValue("delay");
    }

    /**
     * Задержка в секундах.
     * Если не передано, то полставляется значение по умолчанию (5)
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value delay = 8;</code>
     * @param \Google\Protobuf\Int32Value $var
     * @return $this
     */
    public function setDelay($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Int32Value::class);
        $this->delay = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object.

     * Задержка в секундах.
     * Если не передано, то полставляется значение по умолчанию (5)
     *
     * Generated from protobuf field <code>.google.protobuf.Int32Value delay = 8;</code>
     * @param int|null $var
     * @return $this
     */
    public function setDelayUnwrapped($var)
    {
        $this->writeWrapperValue("delay", $var);
        return $this;}

}

