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

namespace Google\Cloud\Iot\V1;

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

/**
 * Response for `ListDeviceStates`.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.ListDeviceStatesResponse</code>
 */
class ListDeviceStatesResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     */
    private $device_states;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Iot\V1\DeviceState>|\Google\Protobuf\Internal\RepeatedField $device_states
     *           The last few device states. States are listed in descending order of server
     *           update time, starting from the most recent one.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\DeviceManager::initOnce();
        parent::__construct($data);
    }

    /**
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDeviceStates()
    {
        return $this->device_states;
    }

    /**
     * The last few device states. States are listed in descending order of server
     * update time, starting from the most recent one.
     *
     * Generated from protobuf field <code>repeated .google.cloud.iot.v1.DeviceState device_states = 1;</code>
     * @param array<\Google\Cloud\Iot\V1\DeviceState>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDeviceStates($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Iot\V1\DeviceState::class);
        $this->device_states = $arr;

        return $this;
    }

}

