blob: a46be44e6b18d53f0079a0abccab87ff43bcfe40 [file] [log] [blame]
---
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** Type: MMv1 ***
#
# ----------------------------------------------------------------------------
#
# This file is automatically generated by Magic Modules and manual
# changes will be clobbered when the file is regenerated.
#
# Please read more about how to change this file in
# .github/CONTRIBUTING.md.
#
# ----------------------------------------------------------------------------
subcategory: "Dialogflow"
description: |-
Represents a Dialogflow intent.
---
# google\_dialogflow\_intent
Represents a Dialogflow intent. Intents convert a number of user expressions or patterns into an action. An action
is an extraction of a user command or sentence semantics.
To get more information about Intent, see:
* [API documentation](https://cloud.google.com/dialogflow/docs/reference/rest/v2/projects.agent.intents)
* How-to Guides
* [Official Documentation](https://cloud.google.com/dialogflow/docs/)
## Example Usage - Dialogflow Intent Basic
```hcl
resource "google_dialogflow_agent" "basic_agent" {
display_name = "example_agent"
default_language_code = "en"
time_zone = "America/New_York"
}
resource "google_dialogflow_intent" "basic_intent" {
depends_on = [google_dialogflow_agent.basic_agent]
display_name = "basic-intent"
}
```
## Example Usage - Dialogflow Intent Full
```hcl
resource "google_project" "agent_project" {
project_id = "my-project"
name = "my-project"
org_id = "123456789"
}
resource "google_project_service" "agent_project" {
project = google_project.agent_project.project_id
service = "dialogflow.googleapis.com"
disable_dependent_services = false
}
resource "google_service_account" "dialogflow_service_account" {
account_id = "my-account"
}
resource "google_project_iam_member" "agent_create" {
project = google_project_service.agent_project.project
role = "roles/dialogflow.admin"
member = "serviceAccount:${google_service_account.dialogflow_service_account.email}"
}
resource "google_dialogflow_agent" "basic_agent" {
project = google_project.agent_project.project_id
display_name = "example_agent"
default_language_code = "en"
time_zone = "America/New_York"
}
resource "google_dialogflow_intent" "full_intent" {
project = google_project.agent_project.project_id
depends_on = [google_dialogflow_agent.basic_agent]
display_name = "full-intent"
webhook_state = "WEBHOOK_STATE_ENABLED"
priority = 1
is_fallback = false
ml_disabled = true
action = "some_action"
reset_contexts = true
input_context_names = ["projects/${google_project.agent_project.project_id}/agent/sessions/-/contexts/some_id"]
events = ["some_event"]
default_response_platforms = ["FACEBOOK","SLACK"]
}
```
## Argument Reference
The following arguments are supported:
* `display_name` -
(Required)
The name of this intent to be displayed on the console.
- - -
* `webhook_state` -
(Optional)
Indicates whether webhooks are enabled for the intent.
* WEBHOOK_STATE_ENABLED: Webhook is enabled in the agent and in the intent.
* WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING: Webhook is enabled in the agent and in the intent. Also, each slot
filling prompt is forwarded to the webhook.
Possible values are: `WEBHOOK_STATE_ENABLED`, `WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING`.
* `priority` -
(Optional)
The priority of this intent. Higher numbers represent higher priorities.
- If the supplied value is unspecified or 0, the service translates the value to 500,000, which corresponds
to the Normal priority in the console.
- If the supplied value is negative, the intent is ignored in runtime detect intent requests.
* `is_fallback` -
(Optional)
Indicates whether this is a fallback intent.
* `ml_disabled` -
(Optional)
Indicates whether Machine Learning is disabled for the intent.
Note: If mlDisabled setting is set to true, then this intent is not taken into account during inference in ML
ONLY match mode. Also, auto-markup in the UI is turned off.
* `input_context_names` -
(Optional)
The list of context names required for this intent to be triggered.
Format: projects/<Project ID>/agent/sessions/-/contexts/<Context ID>.
* `events` -
(Optional)
The collection of event names that trigger the intent. If the collection of input contexts is not empty, all of
the contexts must be present in the active user session for an event to trigger this intent. See the
[events reference](https://cloud.google.com/dialogflow/docs/events-overview) for more details.
* `action` -
(Optional)
The name of the action associated with the intent.
Note: The action name must not contain whitespaces.
* `reset_contexts` -
(Optional)
Indicates whether to delete all contexts in the current session when this intent is matched.
* `default_response_platforms` -
(Optional)
The list of platforms for which the first responses will be copied from the messages in PLATFORM_UNSPECIFIED
(i.e. default platform).
Each value may be one of: `FACEBOOK`, `SLACK`, `TELEGRAM`, `KIK`, `SKYPE`, `LINE`, `VIBER`, `ACTIONS_ON_GOOGLE`, `GOOGLE_HANGOUTS`.
* `parent_followup_intent_name` -
(Optional)
The unique identifier of the parent intent in the chain of followup intents.
Format: projects/<Project ID>/agent/intents/<Intent ID>.
* `project` - (Optional) The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
## Attributes Reference
In addition to the arguments listed above, the following computed attributes are exported:
* `id` - an identifier for the resource with format `{{name}}`
* `name` -
The unique identifier of this intent.
Format: projects/<Project ID>/agent/intents/<Intent ID>.
* `root_followup_intent_name` -
The unique identifier of the root intent in the chain of followup intents. It identifies the correct followup
intents chain for this intent.
Format: projects/<Project ID>/agent/intents/<Intent ID>.
* `followup_intent_info` -
Information about all followup intents that have this intent as a direct or indirect parent. We populate this field
only in the output.
Structure is [documented below](#nested_followup_intent_info).
<a name="nested_followup_intent_info"></a>The `followup_intent_info` block contains:
* `followup_intent_name` -
(Optional)
The unique identifier of the followup intent.
Format: projects/<Project ID>/agent/intents/<Intent ID>.
* `parent_followup_intent_name` -
(Optional)
The unique identifier of the followup intent's parent.
Format: projects/<Project ID>/agent/intents/<Intent ID>.
## Timeouts
This resource provides the following
[Timeouts](https://developer.hashicorp.com/terraform/plugin/sdkv2/resources/retries-and-customizable-timeouts) configuration options:
- `create` - Default is 20 minutes.
- `update` - Default is 20 minutes.
- `delete` - Default is 20 minutes.
## Import
Intent can be imported using any of these accepted formats:
* `{{name}}`
In Terraform v1.5.0 and later, use an [`import` block](https://developer.hashicorp.com/terraform/language/import) to import Intent using one of the formats above. For example:
```tf
import {
id = "{{name}}"
to = google_dialogflow_intent.default
}
```
When using the [`terraform import` command](https://developer.hashicorp.com/terraform/cli/commands/import), Intent can be imported using one of the formats above. For example:
```
$ terraform import google_dialogflow_intent.default {{name}}
```
## User Project Overrides
This resource supports [User Project Overrides](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/provider_reference#user_project_override).