<?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 state, as reported by the device.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.DeviceState</code>
 */
class DeviceState extends \Google\Protobuf\Internal\Message
{
    /**
     * [Output only] The time at which this state version was updated in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 1;</code>
     */
    private $update_time = null;
    /**
     * The device state data.
     *
     * Generated from protobuf field <code>bytes binary_data = 2;</code>
     */
    private $binary_data = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $update_time
     *           [Output only] The time at which this state version was updated in Cloud
     *           IoT Core.
     *     @type string $binary_data
     *           The device state data.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * [Output only] The time at which this state version was updated in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 1;</code>
     * @return \Google\Protobuf\Timestamp
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    /**
     * [Output only] The time at which this state version was updated in Cloud
     * IoT Core.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

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

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

        return $this;
    }

}

