Intent

class Intent : KotlinCustomResource

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:

Example Usage

Dialogflow Intent Basic

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.diagflow.Agent;
import com.pulumi.gcp.diagflow.AgentArgs;
import com.pulumi.gcp.diagflow.Intent;
import com.pulumi.gcp.diagflow.IntentArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var basicAgent = new Agent("basicAgent", AgentArgs.builder()
.displayName("example_agent")
.defaultLanguageCode("en")
.timeZone("America/New_York")
.build());
var basicIntent = new Intent("basicIntent", IntentArgs.builder()
.displayName("basic-intent")
.build(), CustomResourceOptions.builder()
.dependsOn(basicAgent)
.build());
}
}

Dialogflow Intent Full

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
import com.pulumi.gcp.serviceAccount.Account;
import com.pulumi.gcp.serviceAccount.AccountArgs;
import com.pulumi.gcp.projects.IAMMember;
import com.pulumi.gcp.projects.IAMMemberArgs;
import com.pulumi.gcp.diagflow.Agent;
import com.pulumi.gcp.diagflow.AgentArgs;
import com.pulumi.gcp.diagflow.Intent;
import com.pulumi.gcp.diagflow.IntentArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var agentProjectProject = new Project("agentProjectProject", ProjectArgs.builder()
.projectId("my-project")
.orgId("123456789")
.build());
var agentProjectService = new Service("agentProjectService", ServiceArgs.builder()
.project(agentProjectProject.projectId())
.service("dialogflow.googleapis.com")
.disableDependentServices(false)
.build());
var dialogflowServiceAccount = new Account("dialogflowServiceAccount", AccountArgs.builder()
.accountId("my-account")
.build());
var agentCreate = new IAMMember("agentCreate", IAMMemberArgs.builder()
.project(agentProjectService.project())
.role("roles/dialogflow.admin")
.member(dialogflowServiceAccount.email().applyValue(email -> String.format("serviceAccount:%s", email)))
.build());
var basicAgent = new Agent("basicAgent", AgentArgs.builder()
.project(agentProjectProject.projectId())
.displayName("example_agent")
.defaultLanguageCode("en")
.timeZone("America/New_York")
.build());
var fullIntent = new Intent("fullIntent", IntentArgs.builder()
.project(agentProjectProject.projectId())
.displayName("full-intent")
.webhookState("WEBHOOK_STATE_ENABLED")
.priority(1)
.isFallback(false)
.mlDisabled(true)
.action("some_action")
.resetContexts(true)
.inputContextNames(agentProjectProject.projectId().applyValue(projectId -> String.format("projects/%s/agent/sessions/-/contexts/some_id", projectId)))
.events("some_event")
.defaultResponsePlatforms(
"FACEBOOK",
"SLACK")
.build(), CustomResourceOptions.builder()
.dependsOn(basicAgent)
.build());
}
}

Import

Intent can be imported using any of these accepted formats:

$ pulumi import gcp:diagflow/intent:Intent default {{name}}

Properties

Link copied to clipboard
val action: Output<String>

The name of the action associated with the intent. Note: The action name must not contain whitespaces.

Link copied to clipboard

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.

Link copied to clipboard
val displayName: Output<String>

The name of this intent to be displayed on the console.

Link copied to clipboard
val events: Output<List<String>>?

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 for more details.

Link copied to clipboard

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

The list of context names required for this intent to be triggered. Format: projects//agent/sessions/-/contexts/.

Link copied to clipboard
val isFallback: Output<Boolean>

Indicates whether this is a fallback intent.

Link copied to clipboard
val mlDisabled: Output<Boolean>

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.

Link copied to clipboard
val name: Output<String>

The unique identifier of this intent. Format: projects//agent/intents/.

Link copied to clipboard

The unique identifier of the parent intent in the chain of followup intents. Format: projects//agent/intents/.

Link copied to clipboard
val priority: Output<Int>

The priority of this intent. Higher numbers represent higher priorities.

Link copied to clipboard
val project: Output<String>

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resetContexts: Output<Boolean>

Indicates whether to delete all contexts in the current session when this intent is matched.

Link copied to clipboard

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//agent/intents/.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val webhookState: Output<String>

Indicates whether webhooks are enabled for the intent.