com.pulumi.gcp.diagflow.kotlin.IntentArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.diagflow.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.diagflow.IntentArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* 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
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const basicAgent = new gcp.diagflow.Agent("basic_agent", {
* displayName: "example_agent",
* defaultLanguageCode: "en",
* timeZone: "America/New_York",
* });
* const basicIntent = new gcp.diagflow.Intent("basic_intent", {displayName: "basic-intent"});
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* basic_agent = gcp.diagflow.Agent("basic_agent",
* display_name="example_agent",
* default_language_code="en",
* time_zone="America/New_York")
* basic_intent = gcp.diagflow.Intent("basic_intent", display_name="basic-intent")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var basicAgent = new Gcp.Diagflow.Agent("basic_agent", new()
* {
* DisplayName = "example_agent",
* DefaultLanguageCode = "en",
* TimeZone = "America/New_York",
* });
* var basicIntent = new Gcp.Diagflow.Intent("basic_intent", new()
* {
* DisplayName = "basic-intent",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/diagflow"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := diagflow.NewAgent(ctx, "basic_agent", &diagflow.AgentArgs{
* DisplayName: pulumi.String("example_agent"),
* DefaultLanguageCode: pulumi.String("en"),
* TimeZone: pulumi.String("America/New_York"),
* })
* if err != nil {
* return err
* }
* _, err = diagflow.NewIntent(ctx, "basic_intent", &diagflow.IntentArgs{
* DisplayName: pulumi.String("basic-intent"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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 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());
* }
* }
* ```
* ```yaml
* resources:
* basicAgent:
* type: gcp:diagflow:Agent
* name: basic_agent
* properties:
* displayName: example_agent
* defaultLanguageCode: en
* timeZone: America/New_York
* basicIntent:
* type: gcp:diagflow:Intent
* name: basic_intent
* properties:
* displayName: basic-intent
* ```
*
* ### Dialogflow Intent Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const agentProject = new gcp.organizations.Project("agent_project", {
* projectId: "my-project",
* name: "my-project",
* orgId: "123456789",
* });
* const agentProjectService = new gcp.projects.Service("agent_project", {
* project: agentProject.projectId,
* service: "dialogflow.googleapis.com",
* disableDependentServices: false,
* });
* const dialogflowServiceAccount = new gcp.serviceaccount.Account("dialogflow_service_account", {accountId: "my-account"});
* const agentCreate = new gcp.projects.IAMMember("agent_create", {
* project: agentProjectService.project,
* role: "roles/dialogflow.admin",
* member: pulumi.interpolate`serviceAccount:${dialogflowServiceAccount.email}`,
* });
* const basicAgent = new gcp.diagflow.Agent("basic_agent", {
* project: agentProject.projectId,
* displayName: "example_agent",
* defaultLanguageCode: "en",
* timeZone: "America/New_York",
* });
* const fullIntent = new gcp.diagflow.Intent("full_intent", {
* project: agentProject.projectId,
* displayName: "full-intent",
* webhookState: "WEBHOOK_STATE_ENABLED",
* priority: 1,
* isFallback: false,
* mlDisabled: true,
* action: "some_action",
* resetContexts: true,
* inputContextNames: [pulumi.interpolate`projects/${agentProject.projectId}/agent/sessions/-/contexts/some_id`],
* events: ["some_event"],
* defaultResponsePlatforms: [
* "FACEBOOK",
* "SLACK",
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* agent_project = gcp.organizations.Project("agent_project",
* project_id="my-project",
* name="my-project",
* org_id="123456789")
* agent_project_service = gcp.projects.Service("agent_project",
* project=agent_project.project_id,
* service="dialogflow.googleapis.com",
* disable_dependent_services=False)
* dialogflow_service_account = gcp.serviceaccount.Account("dialogflow_service_account", account_id="my-account")
* agent_create = gcp.projects.IAMMember("agent_create",
* project=agent_project_service.project,
* role="roles/dialogflow.admin",
* member=dialogflow_service_account.email.apply(lambda email: f"serviceAccount:{email}"))
* basic_agent = gcp.diagflow.Agent("basic_agent",
* project=agent_project.project_id,
* display_name="example_agent",
* default_language_code="en",
* time_zone="America/New_York")
* full_intent = gcp.diagflow.Intent("full_intent",
* project=agent_project.project_id,
* 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=[agent_project.project_id.apply(lambda project_id: f"projects/{project_id}/agent/sessions/-/contexts/some_id")],
* events=["some_event"],
* default_response_platforms=[
* "FACEBOOK",
* "SLACK",
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var agentProject = new Gcp.Organizations.Project("agent_project", new()
* {
* ProjectId = "my-project",
* Name = "my-project",
* OrgId = "123456789",
* });
* var agentProjectService = new Gcp.Projects.Service("agent_project", new()
* {
* Project = agentProject.ProjectId,
* ServiceName = "dialogflow.googleapis.com",
* DisableDependentServices = false,
* });
* var dialogflowServiceAccount = new Gcp.ServiceAccount.Account("dialogflow_service_account", new()
* {
* AccountId = "my-account",
* });
* var agentCreate = new Gcp.Projects.IAMMember("agent_create", new()
* {
* Project = agentProjectService.Project,
* Role = "roles/dialogflow.admin",
* Member = dialogflowServiceAccount.Email.Apply(email => $"serviceAccount:{email}"),
* });
* var basicAgent = new Gcp.Diagflow.Agent("basic_agent", new()
* {
* Project = agentProject.ProjectId,
* DisplayName = "example_agent",
* DefaultLanguageCode = "en",
* TimeZone = "America/New_York",
* });
* var fullIntent = new Gcp.Diagflow.Intent("full_intent", new()
* {
* Project = agentProject.ProjectId,
* DisplayName = "full-intent",
* WebhookState = "WEBHOOK_STATE_ENABLED",
* Priority = 1,
* IsFallback = false,
* MlDisabled = true,
* Action = "some_action",
* ResetContexts = true,
* InputContextNames = new[]
* {
* agentProject.ProjectId.Apply(projectId => $"projects/{projectId}/agent/sessions/-/contexts/some_id"),
* },
* Events = new[]
* {
* "some_event",
* },
* DefaultResponsePlatforms = new[]
* {
* "FACEBOOK",
* "SLACK",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "fmt"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/diagflow"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/projects"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/serviceaccount"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* agentProject, err := organizations.NewProject(ctx, "agent_project", &organizations.ProjectArgs{
* ProjectId: pulumi.String("my-project"),
* Name: pulumi.String("my-project"),
* OrgId: pulumi.String("123456789"),
* })
* if err != nil {
* return err
* }
* agentProjectService, err := projects.NewService(ctx, "agent_project", &projects.ServiceArgs{
* Project: agentProject.ProjectId,
* Service: pulumi.String("dialogflow.googleapis.com"),
* DisableDependentServices: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* dialogflowServiceAccount, err := serviceaccount.NewAccount(ctx, "dialogflow_service_account", &serviceaccount.AccountArgs{
* AccountId: pulumi.String("my-account"),
* })
* if err != nil {
* return err
* }
* _, err = projects.NewIAMMember(ctx, "agent_create", &projects.IAMMemberArgs{
* Project: agentProjectService.Project,
* Role: pulumi.String("roles/dialogflow.admin"),
* Member: dialogflowServiceAccount.Email.ApplyT(func(email string) (string, error) {
* return fmt.Sprintf("serviceAccount:%v", email), nil
* }).(pulumi.StringOutput),
* })
* if err != nil {
* return err
* }
* _, err = diagflow.NewAgent(ctx, "basic_agent", &diagflow.AgentArgs{
* Project: agentProject.ProjectId,
* DisplayName: pulumi.String("example_agent"),
* DefaultLanguageCode: pulumi.String("en"),
* TimeZone: pulumi.String("America/New_York"),
* })
* if err != nil {
* return err
* }
* _, err = diagflow.NewIntent(ctx, "full_intent", &diagflow.IntentArgs{
* Project: agentProject.ProjectId,
* DisplayName: pulumi.String("full-intent"),
* WebhookState: pulumi.String("WEBHOOK_STATE_ENABLED"),
* Priority: pulumi.Int(1),
* IsFallback: pulumi.Bool(false),
* MlDisabled: pulumi.Bool(true),
* Action: pulumi.String("some_action"),
* ResetContexts: pulumi.Bool(true),
* InputContextNames: pulumi.StringArray{
* agentProject.ProjectId.ApplyT(func(projectId string) (string, error) {
* return fmt.Sprintf("projects/%v/agent/sessions/-/contexts/some_id", projectId), nil
* }).(pulumi.StringOutput),
* },
* Events: pulumi.StringArray{
* pulumi.String("some_event"),
* },
* DefaultResponsePlatforms: pulumi.StringArray{
* pulumi.String("FACEBOOK"),
* pulumi.String("SLACK"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* 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 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 agentProject = new Project("agentProject", ProjectArgs.builder()
* .projectId("my-project")
* .name("my-project")
* .orgId("123456789")
* .build());
* var agentProjectService = new Service("agentProjectService", ServiceArgs.builder()
* .project(agentProject.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(agentProject.projectId())
* .displayName("example_agent")
* .defaultLanguageCode("en")
* .timeZone("America/New_York")
* .build());
* var fullIntent = new Intent("fullIntent", IntentArgs.builder()
* .project(agentProject.projectId())
* .displayName("full-intent")
* .webhookState("WEBHOOK_STATE_ENABLED")
* .priority(1)
* .isFallback(false)
* .mlDisabled(true)
* .action("some_action")
* .resetContexts(true)
* .inputContextNames(agentProject.projectId().applyValue(projectId -> String.format("projects/%s/agent/sessions/-/contexts/some_id", projectId)))
* .events("some_event")
* .defaultResponsePlatforms(
* "FACEBOOK",
* "SLACK")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* agentProject:
* type: gcp:organizations:Project
* name: agent_project
* properties:
* projectId: my-project
* name: my-project
* orgId: '123456789'
* agentProjectService:
* type: gcp:projects:Service
* name: agent_project
* properties:
* project: ${agentProject.projectId}
* service: dialogflow.googleapis.com
* disableDependentServices: false
* dialogflowServiceAccount:
* type: gcp:serviceaccount:Account
* name: dialogflow_service_account
* properties:
* accountId: my-account
* agentCreate:
* type: gcp:projects:IAMMember
* name: agent_create
* properties:
* project: ${agentProjectService.project}
* role: roles/dialogflow.admin
* member: serviceAccount:${dialogflowServiceAccount.email}
* basicAgent:
* type: gcp:diagflow:Agent
* name: basic_agent
* properties:
* project: ${agentProject.projectId}
* displayName: example_agent
* defaultLanguageCode: en
* timeZone: America/New_York
* fullIntent:
* type: gcp:diagflow:Intent
* name: full_intent
* properties:
* project: ${agentProject.projectId}
* displayName: full-intent
* webhookState: WEBHOOK_STATE_ENABLED
* priority: 1
* isFallback: false
* mlDisabled: true
* action: some_action
* resetContexts: true
* inputContextNames:
* - projects/${agentProject.projectId}/agent/sessions/-/contexts/some_id
* events:
* - some_event
* defaultResponsePlatforms:
* - FACEBOOK
* - SLACK
* ```
*
* ## Import
* Intent can be imported using any of these accepted formats:
* * `{{name}}`
* When using the `pulumi import` command, Intent can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:diagflow/intent:Intent default {{name}}
* ```
* @property action The name of the action associated with the intent.
* Note: The action name must not contain whitespaces.
* @property defaultResponsePlatforms 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`.
* @property displayName The name of this intent to be displayed on the console.
* - - -
* @property events 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.
* @property inputContextNames The list of context names required for this intent to be triggered.
* Format: projects//agent/sessions/-/contexts/.
* @property isFallback Indicates whether this is a fallback intent.
* @property mlDisabled 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.
* @property parentFollowupIntentName The unique identifier of the parent intent in the chain of followup intents.
* Format: projects//agent/intents/.
* @property priority 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.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property resetContexts Indicates whether to delete all contexts in the current session when this intent is matched.
* @property webhookState 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`.
*/
public data class IntentArgs(
public val action: Output? = null,
public val defaultResponsePlatforms: Output>? = null,
public val displayName: Output? = null,
public val events: Output>? = null,
public val inputContextNames: Output>? = null,
public val isFallback: Output? = null,
public val mlDisabled: Output? = null,
public val parentFollowupIntentName: Output? = null,
public val priority: Output? = null,
public val project: Output? = null,
public val resetContexts: Output? = null,
public val webhookState: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.diagflow.IntentArgs =
com.pulumi.gcp.diagflow.IntentArgs.builder()
.action(action?.applyValue({ args0 -> args0 }))
.defaultResponsePlatforms(
defaultResponsePlatforms?.applyValue({ args0 ->
args0.map({ args0 ->
args0
})
}),
)
.displayName(displayName?.applyValue({ args0 -> args0 }))
.events(events?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.inputContextNames(inputContextNames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.isFallback(isFallback?.applyValue({ args0 -> args0 }))
.mlDisabled(mlDisabled?.applyValue({ args0 -> args0 }))
.parentFollowupIntentName(parentFollowupIntentName?.applyValue({ args0 -> args0 }))
.priority(priority?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.resetContexts(resetContexts?.applyValue({ args0 -> args0 }))
.webhookState(webhookState?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [IntentArgs].
*/
@PulumiTagMarker
public class IntentArgsBuilder internal constructor() {
private var action: Output? = null
private var defaultResponsePlatforms: Output>? = null
private var displayName: Output? = null
private var events: Output>? = null
private var inputContextNames: Output>? = null
private var isFallback: Output? = null
private var mlDisabled: Output? = null
private var parentFollowupIntentName: Output? = null
private var priority: Output? = null
private var project: Output? = null
private var resetContexts: Output? = null
private var webhookState: Output? = null
/**
* @param value The name of the action associated with the intent.
* Note: The action name must not contain whitespaces.
*/
@JvmName("xsufwqfsrgobajsu")
public suspend fun action(`value`: Output) {
this.action = value
}
/**
* @param value 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`.
*/
@JvmName("ekbldwmaklarwlkw")
public suspend fun defaultResponsePlatforms(`value`: Output>) {
this.defaultResponsePlatforms = value
}
@JvmName("kimydrtxauvfcyjh")
public suspend fun defaultResponsePlatforms(vararg values: Output) {
this.defaultResponsePlatforms = Output.all(values.asList())
}
/**
* @param values 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`.
*/
@JvmName("pplibepbdligjppq")
public suspend fun defaultResponsePlatforms(values: List
© 2015 - 2024 Weber Informatics LLC | Privacy Policy