# Google Cloud Workload Manager V1 Client - Class ResourceFilter (0.2.0)

0.2.0 (latest) 0.1.0 Reference documentation and code samples for the Google Cloud Workload Manager V1 Client class ResourceFilter.

Resource filter for an evaluation defining the scope of resources to be
evaluated.

Generated from protobuf message `google.cloud.workloadmanager.v1.ResourceFilter`

## Namespace

Google \\ Cloud \\ WorkloadManager \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ scopes` | `string[]` The scopes of evaluation resource. Format: \* \* `projects/{project_id}` \* \* `folders/{folder_id}` \* \* `organizations/{organization_id}` |
| `↳ resource_id_patterns` | `string[]` The pattern to filter resources by their id For example, a pattern of ".*prod-cluster.*" will match all resources that contain "prod-cluster" in their ID. |
| `↳ inclusion_labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Labels to filter resources by. Each key-value pair in the map must exist on the resource for it to be included (e.g. VM instance labels). For example, specifying `{ "env": "prod", "database": "nosql" }` will only include resources that have labels `env=prod` and `database=nosql`. |
| `↳ gce_instance_filter` | `https://docs.cloud.google.com/php/docs/reference/cloud-workloadmanager/latest/V1.GceInstanceFilter` Filter compute engine resources. |

### getScopes

The scopes of evaluation resource.

Format:

- `projects/{project_id}`
- `folders/{folder_id}`
- `organizations/{organization_id}`

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

### setScopes

The scopes of evaluation resource.

Format:

- `projects/{project_id}`
- `folders/{folder_id}`
- `organizations/{organization_id}`

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

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

### getResourceIdPatterns

The pattern to filter resources by their id
For example, a pattern of ".*prod-cluster.*" will match all resources that
contain "prod-cluster" in their ID.

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

### setResourceIdPatterns

The pattern to filter resources by their id
For example, a pattern of ".*prod-cluster.*" will match all resources that
contain "prod-cluster" in their ID.

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

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

### getInclusionLabels

Labels to filter resources by. Each key-value pair in the map must exist
on the resource for it to be included (e.g. VM instance labels).

For example, specifying `{ "env": "prod", "database": "nosql" }` will only
include resources that have labels `env=prod` and `database=nosql`.

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

### setInclusionLabels

Labels to filter resources by. Each key-value pair in the map must exist
on the resource for it to be included (e.g. VM instance labels).

For example, specifying `{ "env": "prod", "database": "nosql" }` will only
include resources that have labels `env=prod` and `database=nosql`.

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

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

### getGceInstanceFilter

Filter compute engine resources.

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

### hasGceInstanceFilter

### clearGceInstanceFilter

### setGceInstanceFilter

Filter compute engine resources.

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

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