# Google Cloud IoT Core V1 Client - Class ListDeviceStatesResponse (1.7.5)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [1.7.5 (latest)](https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.ListDeviceStatesResponse)
- [1.7.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.7.4/V1.ListDeviceStatesResponse)
- [1.6.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.6.4/V1.ListDeviceStatesResponse)
- [1.5.12](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.5.12/V1.ListDeviceStatesResponse)
Reference documentation and code samples for the Google Cloud IoT Core V1 Client class ListDeviceStatesResponse.

Response for `ListDeviceStates`.

Generated from protobuf message `google.cloud.iot.v1.ListDeviceStatesResponse`

## Namespace

Google \\ Cloud \\ Iot \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ device_states` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.DeviceState>` The last few device states. States are listed in descending order of server update time, starting from the most recent one. |

### getDeviceStates

The last few device states. States are listed in descending order of server
update time, starting from the most recent one.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/RepeatedField` |   |

### setDeviceStates

The last few device states. States are listed in descending order of server
update time, starting from the most recent one.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.DeviceState>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |