# REST Resource: projects.locations.collections.engines.assistants.cannedQueries

- [Resource: CannedQuery](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery.SCHEMA_REPRESENTATION)
- [CannedQueryTexts](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts.SCHEMA_REPRESENTATION)
- [SuggestedPrompt](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#SuggestedPrompt)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#SuggestedPrompt.SCHEMA_REPRESENTATION)
- [AssistantCapability](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#AssistantCapability)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#AssistantCapability.SCHEMA_REPRESENTATION)
- [Methods](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#METHODS_SUMMARY)

## Resource: CannedQuery

Canned query resource of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant`. It represents a short-cut to a predefined conversation start.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "defaultTexts": { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts`) }, "localizedTexts": { string: { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts`) }, ... }, "requiredCapabilities": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#AssistantCapability`) } ], "enabled": boolean, "googleDefined": boolean } ``` |

| Fields ||
|---|---|
| `name` | `string` Immutable. Resource name of the canned query. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}/cannedQueries/{cannedQuery}` It must be a UTF-8 encoded string with a length limit of 1024 characters. |
| `displayName` | `string` The display name of the canned query. It must be a UTF-8 encoded string with a length limit of 128 characters. |
| `defaultTexts` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts`)`` Required. The default (non-localized) values for the text attributes. |
| `localizedTexts` | ``map (key: string, value: object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQueryTexts`))`` Optional. The translations of the text attributes. The keys should be BCP-47 language codes. |
| `requiredCapabilities[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#AssistantCapability`)`` Optional. The capabilities the Assistant needs to have to use this canned query. |
| `enabled` | `boolean` Whether this canned query is enabled. |
| `googleDefined` | `boolean` Output only. Whether this is a Google-defined, read-only canned query. |

## CannedQueryTexts

The text pieces for the canned query, which can be localized.

| JSON representation |
|---|
| ``` { "title": string, "prefix": string, "suggestedPrompts": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#SuggestedPrompt`) } ] } ``` |

| Fields ||
|---|---|
| `title` | `string` Required. The title that is for the end user. |
| `prefix` | `string` Optional. The prefix that `suggestedPrompts` should start with. |
| `suggestedPrompts[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#SuggestedPrompt`)`` Required. The prompts the canned query will offer to the user. |

## SuggestedPrompt

A suggested prompt for the canned query.

| JSON representation |
|---|
| ``` { "promptText": string } ``` |

| Fields ||
|---|---|
| `promptText` | `string` Required. The text of the suggested prompt. |

## AssistantCapability

Capability of an assistant needed to use this canned query.

| JSON representation |
|---|
| ``` { // Union field `capability` can be only one of the following: "actionName": string // End of list of possible types for union field `capability`. } ``` |

| Fields ||
|---|---|
| Union field `capability`. Capability of an assistant, either an action or a tool. `capability` can be only one of the following: ||
| `actionName` | `string` The name of the action that the Assistant needs to have set up to use this canned query. |

| ## Methods ||
|---|---|
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/create` | Creates a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/delete` | Deletes a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/get` | Gets a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/list` | Lists all `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`s under an `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants#Assistant`. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/listActiveCannedQueryUserViews` | Lists the `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/listActiveCannedQueryUserViews#CannedQueryUserView`s for all active `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`s. |
| ### `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries/patch` | Updates a `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.collections.engines.assistants.cannedQueries#CannedQuery`. |