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

Request for `UpdateDevice`.

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

## Namespace

Google \\ Cloud \\ Iot \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ device` | `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.Device` Required. The new values for the device. The `id` and `num_id` fields must be empty, and the field `name` must specify the name path. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0`or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. |
| `↳ update_mask` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/FieldMask` Required. Only updates the `device` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `credentials`, `blocked`, and `metadata` |

### getDevice

Required. The new values for the device. The `id` and `num_id` fields must
be empty, and the field `name` must specify the name path. For example,
`projects/p0/locations/us-central1/registries/registry0/devices/device0`or
`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.Device|null` |   |

### hasDevice

### clearDevice

### setDevice

Required. The new values for the device. The `id` and `num_id` fields must
be empty, and the field `name` must specify the name path. For example,
`projects/p0/locations/us-central1/registries/registry0/devices/device0`or
`projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.

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

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

### getUpdateMask

Required. Only updates the `device` fields indicated by this mask.

The field mask must not be empty, and it must not contain fields that
are immutable or only set by the server.
Mutable top-level fields: `credentials`, `blocked`, and `metadata`

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

### hasUpdateMask

### clearUpdateMask

### setUpdateMask

Required. Only updates the `device` fields indicated by this mask.

The field mask must not be empty, and it must not contain fields that
are immutable or only set by the server.
Mutable top-level fields: `credentials`, `blocked`, and `metadata`

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `device` | `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.Device` Required. The new values for the device. The `id` and `num_id` fields must be empty, and the field `name` must specify the name path. For example, `projects/p0/locations/us-central1/registries/registry0/devices/device0`or `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`. |
| `updateMask` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/FieldMask` Required. Only updates the `device` fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top-level fields: `credentials`, `blocked`, and `metadata` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.UpdateDeviceRequest` |   |