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

namespace Keyapis\Device\V1;

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

/**
 * Статус конфигурации устройства.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.device.v1.DeviceConfigurationStatus</code>
 */
class DeviceConfigurationStatus extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     */
    protected $id = 0;
    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_id = 0;
    /**
     * Тип конфигурации
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.ConfigurationType configuration_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $configuration_type = 0;
    /**
     * Статус конфигурации настройки устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.StatusType status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $status_type = 0;
    /**
     * Дата последней конфигурации устройства.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp configured_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $configured_at = null;
    /**
     * Текст ошибки
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue error_message = 6;</code>
     */
    protected $error_message = null;
    /**
     * Количество попыток
     *
     * Generated from protobuf field <code>int32 retry_count = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $retry_count = 0;
    /**
     * Дополнительная полезная нагрузка
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.Payload payload = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $payload = null;
    /**
     * Минимально возможная дата выполнения следующей попытки.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_retry_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $next_retry_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор
     *     @type int $device_id
     *           Идентификатор устройства
     *     @type int $configuration_type
     *           Тип конфигурации
     *     @type int $status_type
     *           Статус конфигурации настройки устройства
     *     @type \Google\Protobuf\Timestamp $configured_at
     *           Дата последней конфигурации устройства.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\StringValue $error_message
     *           Текст ошибки
     *     @type int $retry_count
     *           Количество попыток
     *     @type \Keyapis\Device\V1\DeviceConfigurationStatus\Payload $payload
     *           Дополнительная полезная нагрузка
     *     @type \Google\Protobuf\Timestamp $next_retry_at
     *           Минимально возможная дата выполнения следующей попытки.
     *           # Тип: DateTime
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Device\V1\KeyapisDeviceDeviceV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

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

    /**
     * Идентификатор устройства
     *
     * Generated from protobuf field <code>int32 device_id = 2 [(.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>.keyapis.device.v1.DeviceConfigurationStatus.ConfigurationType configuration_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getConfigurationType()
    {
        return $this->configuration_type;
    }

    /**
     * Тип конфигурации
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.ConfigurationType configuration_type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setConfigurationType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\DeviceConfigurationStatus\ConfigurationType::class);
        $this->configuration_type = $var;

        return $this;
    }

    /**
     * Статус конфигурации настройки устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.StatusType status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getStatusType()
    {
        return $this->status_type;
    }

    /**
     * Статус конфигурации настройки устройства
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.StatusType status_type = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Device\V1\DeviceConfigurationStatus\StatusType::class);
        $this->status_type = $var;

        return $this;
    }

    /**
     * Дата последней конфигурации устройства.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp configured_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getConfiguredAt()
    {
        return $this->configured_at;
    }

    public function hasConfiguredAt()
    {
        return isset($this->configured_at);
    }

    public function clearConfiguredAt()
    {
        unset($this->configured_at);
    }

    /**
     * Дата последней конфигурации устройства.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp configured_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setConfiguredAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->configured_at = $var;

        return $this;
    }

    /**
     * Текст ошибки
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue error_message = 6;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getErrorMessage()
    {
        return $this->error_message;
    }

    public function hasErrorMessage()
    {
        return isset($this->error_message);
    }

    public function clearErrorMessage()
    {
        unset($this->error_message);
    }

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

     * Текст ошибки
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue error_message = 6;</code>
     * @return string|null
     */
    public function getErrorMessageUnwrapped()
    {
        return $this->readWrapperValue("error_message");
    }

    /**
     * Текст ошибки
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue error_message = 6;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setErrorMessage($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->error_message = $var;

        return $this;
    }

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

     * Текст ошибки
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue error_message = 6;</code>
     * @param string|null $var
     * @return $this
     */
    public function setErrorMessageUnwrapped($var)
    {
        $this->writeWrapperValue("error_message", $var);
        return $this;}

    /**
     * Количество попыток
     *
     * Generated from protobuf field <code>int32 retry_count = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getRetryCount()
    {
        return $this->retry_count;
    }

    /**
     * Количество попыток
     *
     * Generated from protobuf field <code>int32 retry_count = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setRetryCount($var)
    {
        GPBUtil::checkInt32($var);
        $this->retry_count = $var;

        return $this;
    }

    /**
     * Дополнительная полезная нагрузка
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.Payload payload = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Keyapis\Device\V1\DeviceConfigurationStatus\Payload|null
     */
    public function getPayload()
    {
        return $this->payload;
    }

    public function hasPayload()
    {
        return isset($this->payload);
    }

    public function clearPayload()
    {
        unset($this->payload);
    }

    /**
     * Дополнительная полезная нагрузка
     *
     * Generated from protobuf field <code>.keyapis.device.v1.DeviceConfigurationStatus.Payload payload = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Keyapis\Device\V1\DeviceConfigurationStatus\Payload $var
     * @return $this
     */
    public function setPayload($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Device\V1\DeviceConfigurationStatus\Payload::class);
        $this->payload = $var;

        return $this;
    }

    /**
     * Минимально возможная дата выполнения следующей попытки.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_retry_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getNextRetryAt()
    {
        return $this->next_retry_at;
    }

    public function hasNextRetryAt()
    {
        return isset($this->next_retry_at);
    }

    public function clearNextRetryAt()
    {
        unset($this->next_retry_at);
    }

    /**
     * Минимально возможная дата выполнения следующей попытки.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp next_retry_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setNextRetryAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->next_retry_at = $var;

        return $this;
    }

}

