Intent Args
data class IntentArgs(val action: Output<String>? = null, val defaultResponsePlatforms: Output<List<String>>? = null, val displayName: Output<String>? = null, val events: Output<List<String>>? = null, val inputContextNames: Output<List<String>>? = null, val isFallback: Output<Boolean>? = null, val mlDisabled: Output<Boolean>? = null, val parentFollowupIntentName: Output<String>? = null, val priority: Output<Int>? = null, val project: Output<String>? = null, val resetContexts: Output<Boolean>? = null, val webhookState: Output<String>? = null) : ConvertibleToJava<IntentArgs>
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:
How-to Guides
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());
}
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
Import
Intent can be imported using any of these accepted formats:
$ pulumi import gcp:diagflow/intent:Intent default {{name}}
Content copied to clipboard
Constructors
Link copied to clipboard
fun IntentArgs(action: Output<String>? = null, defaultResponsePlatforms: Output<List<String>>? = null, displayName: Output<String>? = null, events: Output<List<String>>? = null, inputContextNames: Output<List<String>>? = null, isFallback: Output<Boolean>? = null, mlDisabled: Output<Boolean>? = null, parentFollowupIntentName: Output<String>? = null, priority: Output<Int>? = null, project: Output<String>? = null, resetContexts: Output<Boolean>? = null, webhookState: Output<String>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard
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
Link copied to clipboard