<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/iot/v1/resources.proto

namespace Google\Cloud\Iot\V1;

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

/**
 * The device configuration. Eventually delivered to devices.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.DeviceConfig</code>
 */
class DeviceConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     */
    private $version = 0;
    /**
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     */
    private $cloud_update_time = null;
    /**
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     */
    private $device_ack_time = null;
    /**
     * The device configuration data.
     *
     * Generated from protobuf field <code>bytes binary_data = 4;</code>
     */
    private $binary_data = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $version
     *           [Output only] The version of this update. The version number is assigned by
     *           the server, and is always greater than 0 after device creation. The
     *           version must be 0 on the `CreateDevice` request if a `config` is
     *           specified; the response of `CreateDevice` will always have a value of 1.
     *     @type \Google\Protobuf\Timestamp $cloud_update_time
     *           [Output only] The time at which this configuration version was updated in
     *           Cloud IoT Core. This timestamp is set by the server.
     *     @type \Google\Protobuf\Timestamp $device_ack_time
     *           [Output only] The time at which Cloud IoT Core received the
     *           acknowledgment from the device, indicating that the device has received
     *           this configuration version. If this field is not present, the device has
     *           not yet acknowledged that it received this version. Note that when
     *           the config was sent to the device, many config versions may have been
     *           available in Cloud IoT Core while the device was disconnected, and on
     *           connection, only the latest version is sent to the device. Some
     *           versions may never be sent to the device, and therefore are never
     *           acknowledged. This timestamp is set by Cloud IoT Core.
     *     @type string $binary_data
     *           The device configuration data.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     * @return int|string
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * [Output only] The version of this update. The version number is assigned by
     * the server, and is always greater than 0 after device creation. The
     * version must be 0 on the `CreateDevice` request if a `config` is
     * specified; the response of `CreateDevice` will always have a value of 1.
     *
     * Generated from protobuf field <code>int64 version = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkInt64($var);
        $this->version = $var;

        return $this;
    }

    /**
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCloudUpdateTime()
    {
        return $this->cloud_update_time;
    }

    public function hasCloudUpdateTime()
    {
        return isset($this->cloud_update_time);
    }

    public function clearCloudUpdateTime()
    {
        unset($this->cloud_update_time);
    }

    /**
     * [Output only] The time at which this configuration version was updated in
     * Cloud IoT Core. This timestamp is set by the server.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp cloud_update_time = 2;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCloudUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->cloud_update_time = $var;

        return $this;
    }

    /**
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getDeviceAckTime()
    {
        return $this->device_ack_time;
    }

    public function hasDeviceAckTime()
    {
        return isset($this->device_ack_time);
    }

    public function clearDeviceAckTime()
    {
        unset($this->device_ack_time);
    }

    /**
     * [Output only] The time at which Cloud IoT Core received the
     * acknowledgment from the device, indicating that the device has received
     * this configuration version. If this field is not present, the device has
     * not yet acknowledged that it received this version. Note that when
     * the config was sent to the device, many config versions may have been
     * available in Cloud IoT Core while the device was disconnected, and on
     * connection, only the latest version is sent to the device. Some
     * versions may never be sent to the device, and therefore are never
     * acknowledged. This timestamp is set by Cloud IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp device_ack_time = 3;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setDeviceAckTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->device_ack_time = $var;

        return $this;
    }

    /**
     * The device configuration data.
     *
     * Generated from protobuf field <code>bytes binary_data = 4;</code>
     * @return string
     */
    public function getBinaryData()
    {
        return $this->binary_data;
    }

    /**
     * The device configuration data.
     *
     * Generated from protobuf field <code>bytes binary_data = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setBinaryData($var)
    {
        GPBUtil::checkString($var, False);
        $this->binary_data = $var;

        return $this;
    }

}

