# Google Cloud KMS Inventory V1 Client - Class SearchProtectedResourcesRequest (1.4.0)

1.4.0 (latest) 1.3.0 1.2.3 1.1.1 1.0.4 0.4.5 0.3.1 0.2.3 0.1.2 Reference documentation and code samples for the Google Cloud KMS Inventory V1 Client class SearchProtectedResourcesRequest.

Request message for
[KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__).

Generated from protobuf message `google.cloud.kms.inventory.v1.SearchProtectedResourcesRequest`

## Namespace

Google \\ Cloud \\ Kms \\ Inventory \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ scope` | `string` Required. A scope can be an organization or a project. Resources protected by the crypto key in provided scope will be returned. The following values are allowed: \* \* organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/12345678") \* \* projects/{PROJECT_ID} (e.g., "projects/foo-bar") \* \* projects/{PROJECT_NUMBER} (e.g., "projects/12345678") |
| `↳ crypto_key` | `string` Required. The resource name of the [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.html). |
| `↳ page_size` | `int` The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500. |
| `↳ page_token` | `string` A page token, received from a previous [KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__) must match the call that provided the page token. |
| `↳ resource_types` | `string[]` Optional. A list of resource types that this request searches for. If empty, it will search all the [trackable resource types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types). Regular expressions are also supported. For example: \* \* `compute.googleapis.com.*` snapshots resources whose type starts with `compute.googleapis.com`. \* \* `.*Image` snapshots resources whose type ends with `Image`. \* \* `.*Image.*` snapshots resources whose type contains `Image`. See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned. |

### getScope

Required. A scope can be an organization or a project. Resources protected
by the crypto key in provided scope will be returned.

The following values are allowed:

- organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/12345678")
- projects/{PROJECT_ID} (e.g., "projects/foo-bar")
- projects/{PROJECT_NUMBER} (e.g., "projects/12345678")

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

### setScope

Required. A scope can be an organization or a project. Resources protected
by the crypto key in provided scope will be returned.

The following values are allowed:

- organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/12345678")
- projects/{PROJECT_ID} (e.g., "projects/foo-bar")
- projects/{PROJECT_NUMBER} (e.g., "projects/12345678")

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

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

### getCryptoKey

Required. The resource name of the
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.html).

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

### setCryptoKey

Required. The resource name of the
[CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.html).

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

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

### getPageSize

The maximum number of resources to return. The service may return fewer
than this value.

If unspecified, at most 500 resources will be returned.
The maximum value is 500; values above 500 will be coerced to 500.

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

### setPageSize

The maximum number of resources to return. The service may return fewer
than this value.

If unspecified, at most 500 resources will be returned.
The maximum value is 500; values above 500 will be coerced to 500.

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

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

### getPageToken

A page token, received from a previous
[KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__)
call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to
[KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__)
must match the call that provided the page token.

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

### setPageToken

A page token, received from a previous
[KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__)
call. Provide this to retrieve the subsequent page.

When paginating, all other parameters provided to
[KeyTrackingService.SearchProtectedResources](https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.Client.KeyTrackingServiceClient#_Google_Cloud_Kms_Inventory_V1_Client_KeyTrackingServiceClient__searchProtectedResources__)
must match the call that provided the page token.

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

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

### getResourceTypes

Optional. A list of resource types that this request searches for. If
empty, it will search all the [trackable resource
types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types).

Regular expressions are also supported. For example:

- `compute.googleapis.com.*` snapshots resources whose type starts with `compute.googleapis.com`.
- `.*Image` snapshots resources whose type ends with `Image`.
- `.*Image.*` snapshots resources whose type contains `Image`. See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned.

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

### setResourceTypes

Optional. A list of resource types that this request searches for. If
empty, it will search all the [trackable resource
types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types).

Regular expressions are also supported. For example:

- `compute.googleapis.com.*` snapshots resources whose type starts with `compute.googleapis.com`.
- `.*Image` snapshots resources whose type ends with `Image`.
- `.*Image.*` snapshots resources whose type contains `Image`. See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `scope` | `string` Required. A scope can be an organization or a project. Resources protected by the crypto key in provided scope will be returned. The following values are allowed: - - organizations/{ORGANIZATION_NUMBER} (e.g., "organizations/12345678") - - projects/{PROJECT_ID} (e.g., "projects/foo-bar") - - projects/{PROJECT_NUMBER} (e.g., "projects/12345678") Please see KeyTrackingServiceClient::projectName() for help formatting this field. |
| `cryptoKey` | `string` Required. The resource name of the [CryptoKey](https://docs.cloud.google.com/php/docs/reference/cloud-kms/latest/V1.CryptoKey.html). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-kms-inventory/latest/V1.SearchProtectedResourcesRequest` |   |