# Google Cloud IoT Core V1 Client - Class DeviceState (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.DeviceState)
- [1.7.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.7.4/V1.DeviceState)
- [1.6.4](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.6.4/V1.DeviceState)
- [1.5.12](https://docs.cloud.google.com/php/docs/reference/cloud-iot/1.5.12/V1.DeviceState)
Reference documentation and code samples for the Google Cloud IoT Core V1 Client class DeviceState.

The device state, as reported by the device.

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

## Namespace

Google \\ Cloud \\ Iot \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` \[Output only\] The time at which this state version was updated in Cloud IoT Core. |
| `↳ binary_data` | `string` The device state data. |

### getUpdateTime

\[Output only\] The time at which this state version was updated in Cloud
IoT Core.

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

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

\[Output only\] The time at which this state version was updated in Cloud
IoT Core.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getBinaryData

The device state data.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setBinaryData

The device state data.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

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