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

A container for a group of devices.

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

## Namespace

Google \\ Cloud \\ Iot \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ id` | `string` The identifier of this device registry. For example, `myRegistry`. |
| `↳ name` | `string` The resource path name. For example, `projects/example-project/locations/us-central1/registries/my-registry`. |
| `↳ event_notification_configs` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.EventNotificationConfig>` The configuration for notification of telemetry events received from the device. All telemetry events that were successfully published by the device and acknowledged by Cloud IoT Core are guaranteed to be delivered to Cloud Pub/Sub. If multiple configurations match a message, only the first matching configuration is used. If you try to publish a device telemetry event using MQTT without specifying a Cloud Pub/Sub topic for the device's registry, the connection closes automatically. If you try to do so using an HTTP connection, an error is returned. Up to 10 configurations may be provided. |
| `↳ state_notification_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.StateNotificationConfig` The configuration for notification of new states received from the device. State updates are guaranteed to be stored in the state history, but notifications to Cloud Pub/Sub are not guaranteed. For example, if permissions are misconfigured or the specified topic doesn't exist, no notification will be published but the state will still be stored in Cloud IoT Core. |
| `↳ mqtt_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.MqttConfig` The MQTT configuration for this device registry. |
| `↳ http_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.HttpConfig` The DeviceService (HTTP) configuration for this device registry. |
| `↳ log_level` | `int` **Beta Feature** The default logging verbosity for activity from devices in this registry. The verbosity level can be overridden by Device.log_level. |
| `↳ credentials` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-iot/latest/V1.RegistryCredential>` The credentials used to verify the device credentials. No more than 10 credentials can be bound to a single registry at a time. The verification process occurs at the time of device creation or update. If this field is empty, no verification is performed. Otherwise, the credentials of a newly created device or added credentials of an updated device should be signed with one of these registry credentials. Note, however, that existing devices will never be affected by modifications to this list of credentials: after a device has been successfully created in a registry, it should be able to connect even if its registry credentials are revoked, deleted, or modified. |

### getId

The identifier of this device registry. For example, `myRegistry`.

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

### setId

The identifier of this device registry. For example, `myRegistry`.

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

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

### getName

The resource path name. For example,
`projects/example-project/locations/us-central1/registries/my-registry`.

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

### setName

The resource path name. For example,
`projects/example-project/locations/us-central1/registries/my-registry`.

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

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

### getEventNotificationConfigs

The configuration for notification of telemetry events received from the
device. All telemetry events that were successfully published by the
device and acknowledged by Cloud IoT Core are guaranteed to be
delivered to Cloud Pub/Sub. If multiple configurations match a message,
only the first matching configuration is used. If you try to publish a
device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
for the device's registry, the connection closes automatically. If you try
to do so using an HTTP connection, an error is returned. Up to 10
configurations may be provided.

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

### setEventNotificationConfigs

The configuration for notification of telemetry events received from the
device. All telemetry events that were successfully published by the
device and acknowledged by Cloud IoT Core are guaranteed to be
delivered to Cloud Pub/Sub. If multiple configurations match a message,
only the first matching configuration is used. If you try to publish a
device telemetry event using MQTT without specifying a Cloud Pub/Sub topic
for the device's registry, the connection closes automatically. If you try
to do so using an HTTP connection, an error is returned. Up to 10
configurations may be provided.

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

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

### getStateNotificationConfig

The configuration for notification of new states received from the device.

State updates are guaranteed to be stored in the state history, but
notifications to Cloud Pub/Sub are not guaranteed. For example, if
permissions are misconfigured or the specified topic doesn't exist, no
notification will be published but the state will still be stored in Cloud
IoT Core.

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

### hasStateNotificationConfig

### clearStateNotificationConfig

### setStateNotificationConfig

The configuration for notification of new states received from the device.

State updates are guaranteed to be stored in the state history, but
notifications to Cloud Pub/Sub are not guaranteed. For example, if
permissions are misconfigured or the specified topic doesn't exist, no
notification will be published but the state will still be stored in Cloud
IoT Core.

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

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

### getMqttConfig

The MQTT configuration for this device registry.

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

### hasMqttConfig

### clearMqttConfig

### setMqttConfig

The MQTT configuration for this device registry.

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

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

### getHttpConfig

The DeviceService (HTTP) configuration for this device registry.

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

### hasHttpConfig

### clearHttpConfig

### setHttpConfig

The DeviceService (HTTP) configuration for this device registry.

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

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

### getLogLevel

**Beta Feature**
The default logging verbosity for activity from devices in this registry.

The verbosity level can be overridden by Device.log_level.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setLogLevel

**Beta Feature**
The default logging verbosity for activity from devices in this registry.

The verbosity level can be overridden by Device.log_level.

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

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

### getCredentials

The credentials used to verify the device credentials. No more than 10
credentials can be bound to a single registry at a time. The verification
process occurs at the time of device creation or update. If this field is
empty, no verification is performed. Otherwise, the credentials of a newly
created device or added credentials of an updated device should be signed
with one of these registry credentials.

Note, however, that existing devices will never be affected by
modifications to this list of credentials: after a device has been
successfully created in a registry, it should be able to connect even if
its registry credentials are revoked, deleted, or modified.

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

### setCredentials

The credentials used to verify the device credentials. No more than 10
credentials can be bound to a single registry at a time. The verification
process occurs at the time of device creation or update. If this field is
empty, no verification is performed. Otherwise, the credentials of a newly
created device or added credentials of an updated device should be signed
with one of these registry credentials.

Note, however, that existing devices will never be affected by
modifications to this list of credentials: after a device has been
successfully created in a registry, it should be able to connect even if
its registry credentials are revoked, deleted, or modified.

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

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