# Google Cloud OsConfig V1 Client - Class LabelSet (2.2.3)

2.2.3 (latest) 2.2.2 2.1.0 2.0.5 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Google Cloud OsConfig V1 Client class LabelSet.

Message representing label set.

- A label is a key value pair set for a VM.
- A LabelSet is a set of labels.
- Labels within a LabelSet are ANDed. In other words, a LabelSet is applicable for a VM only if it matches all the labels in the LabelSet.
- Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will only be applicable for those VMs with both labels present.

Generated from protobuf message `google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet`

## Namespace

Google \\ Cloud \\ OsConfig \\ V1 \\ OSPolicyAssignment

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Labels are identified by key/value pairs in this map. A VM should contain all the key/value pairs specified in this map to be selected. |

### getLabels

Labels are identified by key/value pairs in this map.

A VM should contain all the key/value pairs specified in this
map to be selected.

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

### setLabels

Labels are identified by key/value pairs in this map.

A VM should contain all the key/value pairs specified in this
map to be selected.

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

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