# Google Cloud Asset V1 Client - Class CreateSavedQueryRequest (2.3.3)

2.3.3 (latest) 2.3.2 2.2.3 2.1.3 2.0.1 1.16.4 1.14.1 1.13.2 1.12.2 1.11.3 1.10.2 1.9.2 Reference documentation and code samples for the Google Cloud Asset V1 Client class CreateSavedQueryRequest.

Request to create a saved query.

Generated from protobuf message `google.cloud.asset.v1.CreateSavedQueryRequest`

## Namespace

Google \\ Cloud \\ Asset \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). |
| `↳ saved_query` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.SavedQuery` Required. The saved_query details. The `name` field must be empty as it will be generated based on the parent and saved_query_id. |
| `↳ saved_query_id` | `string` Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored. |

### getParent

Required. The name of the project/folder/organization where this
saved_query should be created in. It can only be an organization number
(such as "organizations/123"), a folder number (such as "folders/123"), a
project ID (such as "projects/my-project-id"), or a project number (such as
"projects/12345").

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

### setParent

Required. The name of the project/folder/organization where this
saved_query should be created in. It can only be an organization number
(such as "organizations/123"), a folder number (such as "folders/123"), a
project ID (such as "projects/my-project-id"), or a project number (such as
"projects/12345").

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

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

### getSavedQuery

Required. The saved_query details. The `name` field must be empty as it
will be generated based on the parent and saved_query_id.

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

### hasSavedQuery

### clearSavedQuery

### setSavedQuery

Required. The saved_query details. The `name` field must be empty as it
will be generated based on the parent and saved_query_id.

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

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

### getSavedQueryId

Required. The ID to use for the saved query, which must be unique in the
specified parent. It will become the final component of the saved query's
resource name.

This value should be 4-63 characters, and valid characters
are `[a-z][0-9]-`.
Notice that this field is required in the saved query creation, and the
`name` field of the `saved_query` will be ignored.

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

### setSavedQueryId

Required. The ID to use for the saved query, which must be unique in the
specified parent. It will become the final component of the saved query's
resource name.

This value should be 4-63 characters, and valid characters
are `[a-z][0-9]-`.
Notice that this field is required in the saved query creation, and the
`name` field of the `saved_query` will be ignored.

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

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

### static::build

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `string` Required. The name of the project/folder/organization where this saved_query should be created in. It can only be an organization number (such as "organizations/123"), a folder number (such as "folders/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"). Please see AssetServiceClient::projectName() for help formatting this field. |
| `savedQuery` | `https://docs.cloud.google.com/php/docs/reference/cloud-asset/latest/V1.SavedQuery` Required. The saved_query details. The `name` field must be empty as it will be generated based on the parent and saved_query_id. |
| `savedQueryId` | `string` Required. The ID to use for the saved query, which must be unique in the specified parent. It will become the final component of the saved query's resource name. This value should be 4-63 characters, and valid characters are `[a-z][0-9]-`. Notice that this field is required in the saved query creation, and the `name` field of the `saved_query` will be ignored. |

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