All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.diagflow.kotlin.CxEnvironmentArgs.kt Maven / Gradle / Ivy

@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.CxEnvironmentArgs.builder
import com.pulumi.gcp.diagflow.kotlin.inputs.CxEnvironmentVersionConfigArgs
import com.pulumi.gcp.diagflow.kotlin.inputs.CxEnvironmentVersionConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Represents an environment for an agent. You can create multiple versions of your agent and publish them to separate environments.
 * When you edit an agent, you are editing the draft agent. At any point, you can save the draft agent as an agent version, which is an immutable snapshot of your agent.
 * When you save the draft agent, it is published to the default environment. When you create agent versions, you can publish them to custom environments. You can create a variety of custom environments for testing, development, production, etc.
 * To get more information about Environment, see:
 * * [API documentation](https://cloud.google.com/dialogflow/cx/docs/reference/rest/v3/projects.locations.agents.environments)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/dialogflow/cx/docs)
 * ## Example Usage
 * ### Dialogflowcx Environment Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const agent = new gcp.diagflow.CxAgent("agent", {
 *     displayName: "dialogflowcx-agent",
 *     location: "global",
 *     defaultLanguageCode: "en",
 *     supportedLanguageCodes: [
 *         "fr",
 *         "de",
 *         "es",
 *     ],
 *     timeZone: "America/New_York",
 *     description: "Example description.",
 *     avatarUri: "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *     enableStackdriverLogging: true,
 *     enableSpellCorrection: true,
 *     speechToTextSettings: {
 *         enableSpeechAdaptation: true,
 *     },
 * });
 * const version1 = new gcp.diagflow.CxVersion("version_1", {
 *     parent: agent.startFlow,
 *     displayName: "1.0.0",
 *     description: "version 1.0.0",
 * });
 * const development = new gcp.diagflow.CxEnvironment("development", {
 *     parent: agent.id,
 *     displayName: "Development",
 *     description: "Development Environment",
 *     versionConfigs: [{
 *         version: version1.id,
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * agent = gcp.diagflow.CxAgent("agent",
 *     display_name="dialogflowcx-agent",
 *     location="global",
 *     default_language_code="en",
 *     supported_language_codes=[
 *         "fr",
 *         "de",
 *         "es",
 *     ],
 *     time_zone="America/New_York",
 *     description="Example description.",
 *     avatar_uri="https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *     enable_stackdriver_logging=True,
 *     enable_spell_correction=True,
 *     speech_to_text_settings={
 *         "enable_speech_adaptation": True,
 *     })
 * version1 = gcp.diagflow.CxVersion("version_1",
 *     parent=agent.start_flow,
 *     display_name="1.0.0",
 *     description="version 1.0.0")
 * development = gcp.diagflow.CxEnvironment("development",
 *     parent=agent.id,
 *     display_name="Development",
 *     description="Development Environment",
 *     version_configs=[{
 *         "version": version1.id,
 *     }])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var agent = new Gcp.Diagflow.CxAgent("agent", new()
 *     {
 *         DisplayName = "dialogflowcx-agent",
 *         Location = "global",
 *         DefaultLanguageCode = "en",
 *         SupportedLanguageCodes = new[]
 *         {
 *             "fr",
 *             "de",
 *             "es",
 *         },
 *         TimeZone = "America/New_York",
 *         Description = "Example description.",
 *         AvatarUri = "https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png",
 *         EnableStackdriverLogging = true,
 *         EnableSpellCorrection = true,
 *         SpeechToTextSettings = new Gcp.Diagflow.Inputs.CxAgentSpeechToTextSettingsArgs
 *         {
 *             EnableSpeechAdaptation = true,
 *         },
 *     });
 *     var version1 = new Gcp.Diagflow.CxVersion("version_1", new()
 *     {
 *         Parent = agent.StartFlow,
 *         DisplayName = "1.0.0",
 *         Description = "version 1.0.0",
 *     });
 *     var development = new Gcp.Diagflow.CxEnvironment("development", new()
 *     {
 *         Parent = agent.Id,
 *         DisplayName = "Development",
 *         Description = "Development Environment",
 *         VersionConfigs = new[]
 *         {
 *             new Gcp.Diagflow.Inputs.CxEnvironmentVersionConfigArgs
 *             {
 *                 Version = version1.Id,
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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 {
 * 		agent, err := diagflow.NewCxAgent(ctx, "agent", &diagflow.CxAgentArgs{
 * 			DisplayName:         pulumi.String("dialogflowcx-agent"),
 * 			Location:            pulumi.String("global"),
 * 			DefaultLanguageCode: pulumi.String("en"),
 * 			SupportedLanguageCodes: pulumi.StringArray{
 * 				pulumi.String("fr"),
 * 				pulumi.String("de"),
 * 				pulumi.String("es"),
 * 			},
 * 			TimeZone:                 pulumi.String("America/New_York"),
 * 			Description:              pulumi.String("Example description."),
 * 			AvatarUri:                pulumi.String("https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png"),
 * 			EnableStackdriverLogging: pulumi.Bool(true),
 * 			EnableSpellCorrection:    pulumi.Bool(true),
 * 			SpeechToTextSettings: &diagflow.CxAgentSpeechToTextSettingsArgs{
 * 				EnableSpeechAdaptation: pulumi.Bool(true),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		version1, err := diagflow.NewCxVersion(ctx, "version_1", &diagflow.CxVersionArgs{
 * 			Parent:      agent.StartFlow,
 * 			DisplayName: pulumi.String("1.0.0"),
 * 			Description: pulumi.String("version 1.0.0"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = diagflow.NewCxEnvironment(ctx, "development", &diagflow.CxEnvironmentArgs{
 * 			Parent:      agent.ID(),
 * 			DisplayName: pulumi.String("Development"),
 * 			Description: pulumi.String("Development Environment"),
 * 			VersionConfigs: diagflow.CxEnvironmentVersionConfigArray{
 * 				&diagflow.CxEnvironmentVersionConfigArgs{
 * 					Version: version1.ID(),
 * 				},
 * 			},
 * 		})
 * 		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.CxAgent;
 * import com.pulumi.gcp.diagflow.CxAgentArgs;
 * import com.pulumi.gcp.diagflow.inputs.CxAgentSpeechToTextSettingsArgs;
 * import com.pulumi.gcp.diagflow.CxVersion;
 * import com.pulumi.gcp.diagflow.CxVersionArgs;
 * import com.pulumi.gcp.diagflow.CxEnvironment;
 * import com.pulumi.gcp.diagflow.CxEnvironmentArgs;
 * import com.pulumi.gcp.diagflow.inputs.CxEnvironmentVersionConfigArgs;
 * 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 agent = new CxAgent("agent", CxAgentArgs.builder()
 *             .displayName("dialogflowcx-agent")
 *             .location("global")
 *             .defaultLanguageCode("en")
 *             .supportedLanguageCodes(
 *                 "fr",
 *                 "de",
 *                 "es")
 *             .timeZone("America/New_York")
 *             .description("Example description.")
 *             .avatarUri("https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png")
 *             .enableStackdriverLogging(true)
 *             .enableSpellCorrection(true)
 *             .speechToTextSettings(CxAgentSpeechToTextSettingsArgs.builder()
 *                 .enableSpeechAdaptation(true)
 *                 .build())
 *             .build());
 *         var version1 = new CxVersion("version1", CxVersionArgs.builder()
 *             .parent(agent.startFlow())
 *             .displayName("1.0.0")
 *             .description("version 1.0.0")
 *             .build());
 *         var development = new CxEnvironment("development", CxEnvironmentArgs.builder()
 *             .parent(agent.id())
 *             .displayName("Development")
 *             .description("Development Environment")
 *             .versionConfigs(CxEnvironmentVersionConfigArgs.builder()
 *                 .version(version1.id())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   agent:
 *     type: gcp:diagflow:CxAgent
 *     properties:
 *       displayName: dialogflowcx-agent
 *       location: global
 *       defaultLanguageCode: en
 *       supportedLanguageCodes:
 *         - fr
 *         - de
 *         - es
 *       timeZone: America/New_York
 *       description: Example description.
 *       avatarUri: https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png
 *       enableStackdriverLogging: true
 *       enableSpellCorrection: true
 *       speechToTextSettings:
 *         enableSpeechAdaptation: true
 *   version1:
 *     type: gcp:diagflow:CxVersion
 *     name: version_1
 *     properties:
 *       parent: ${agent.startFlow}
 *       displayName: 1.0.0
 *       description: version 1.0.0
 *   development:
 *     type: gcp:diagflow:CxEnvironment
 *     properties:
 *       parent: ${agent.id}
 *       displayName: Development
 *       description: Development Environment
 *       versionConfigs:
 *         - version: ${version1.id}
 * ```
 * 
 * ## Import
 * Environment can be imported using any of these accepted formats:
 * * `{{parent}}/environments/{{name}}`
 * * `{{parent}}/{{name}}`
 * When using the `pulumi import` command, Environment can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/environments/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/{{name}}
 * ```
 * @property description The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is
 * rejected.
 * @property displayName The human-readable name of the environment (unique in an agent). Limit of 64 characters.
 * @property parent The Agent to create an Environment for. Format: projects//locations//agents/.
 * @property versionConfigs A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
 * Structure is documented below.
 */
public data class CxEnvironmentArgs(
    public val description: Output? = null,
    public val displayName: Output? = null,
    public val parent: Output? = null,
    public val versionConfigs: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.diagflow.CxEnvironmentArgs =
        com.pulumi.gcp.diagflow.CxEnvironmentArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 }))
            .versionConfigs(
                versionConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [CxEnvironmentArgs].
 */
@PulumiTagMarker
public class CxEnvironmentArgsBuilder internal constructor() {
    private var description: Output? = null

    private var displayName: Output? = null

    private var parent: Output? = null

    private var versionConfigs: Output>? = null

    /**
     * @param value The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is
     * rejected.
     */
    @JvmName("huqqesitcujsdael")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The human-readable name of the environment (unique in an agent). Limit of 64 characters.
     */
    @JvmName("yhpeovnbgrmilamy")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value The Agent to create an Environment for. Format: projects//locations//agents/.
     */
    @JvmName("doapwluotgoapadm")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("wwtfrdsyjqckcoos")
    public suspend fun versionConfigs(`value`: Output>) {
        this.versionConfigs = value
    }

    @JvmName("ciexqfybykfctnoi")
    public suspend fun versionConfigs(vararg values: Output) {
        this.versionConfigs = Output.all(values.asList())
    }

    /**
     * @param values A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("xtealroxrkfkvurc")
    public suspend fun versionConfigs(values: List>) {
        this.versionConfigs = Output.all(values)
    }

    /**
     * @param value The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is
     * rejected.
     */
    @JvmName("clnkpjjahruuxvdy")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value The human-readable name of the environment (unique in an agent). Limit of 64 characters.
     */
    @JvmName("cghlwdbkwmibiwgj")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value The Agent to create an Environment for. Format: projects//locations//agents/.
     */
    @JvmName("uywjyxntwkcgxkpt")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    /**
     * @param value A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("jqxldhsstnfalbny")
    public suspend fun versionConfigs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.versionConfigs = mapped
    }

    /**
     * @param argument A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("mhuuhxsidluqoiat")
    public suspend fun versionConfigs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            CxEnvironmentVersionConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.versionConfigs = mapped
    }

    /**
     * @param argument A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("agqxsqqsupyjljve")
    public suspend fun versionConfigs(vararg argument: suspend CxEnvironmentVersionConfigArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            CxEnvironmentVersionConfigArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.versionConfigs = mapped
    }

    /**
     * @param argument A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("eohaxnosvubycmnp")
    public suspend fun versionConfigs(argument: suspend CxEnvironmentVersionConfigArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            CxEnvironmentVersionConfigArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.versionConfigs = mapped
    }

    /**
     * @param values A list of configurations for flow versions. You should include version configs for all flows that are reachable from [Start Flow][Agent.start_flow] in the agent. Otherwise, an error will be returned.
     * Structure is documented below.
     */
    @JvmName("ukbnxireowgvorlk")
    public suspend fun versionConfigs(vararg values: CxEnvironmentVersionConfigArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.versionConfigs = mapped
    }

    internal fun build(): CxEnvironmentArgs = CxEnvironmentArgs(
        description = description,
        displayName = displayName,
        parent = parent,
        versionConfigs = versionConfigs,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy