// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.diagflow;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.diagflow.CxEnvironmentArgs;
import com.pulumi.gcp.diagflow.inputs.CxEnvironmentState;
import com.pulumi.gcp.diagflow.outputs.CxEnvironmentVersionConfig;
import java.lang.String;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * 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
 * ```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(&#34;agent&#34;, CxAgentArgs.builder()        
 *             .displayName(&#34;dialogflowcx-agent&#34;)
 *             .location(&#34;global&#34;)
 *             .defaultLanguageCode(&#34;en&#34;)
 *             .supportedLanguageCodes(            
 *                 &#34;fr&#34;,
 *                 &#34;de&#34;,
 *                 &#34;es&#34;)
 *             .timeZone(&#34;America/New_York&#34;)
 *             .description(&#34;Example description.&#34;)
 *             .avatarUri(&#34;https://cloud.google.com/_static/images/cloud/icons/favicons/onecloud/super_cloud.png&#34;)
 *             .enableStackdriverLogging(true)
 *             .enableSpellCorrection(true)
 *             .speechToTextSettings(CxAgentSpeechToTextSettingsArgs.builder()
 *                 .enableSpeechAdaptation(true)
 *                 .build())
 *             .build());
 * 
 *         var version1 = new CxVersion(&#34;version1&#34;, CxVersionArgs.builder()        
 *             .parent(agent.startFlow())
 *             .displayName(&#34;1.0.0&#34;)
 *             .description(&#34;version 1.0.0&#34;)
 *             .build());
 * 
 *         var development = new CxEnvironment(&#34;development&#34;, CxEnvironmentArgs.builder()        
 *             .parent(agent.id())
 *             .displayName(&#34;Development&#34;)
 *             .description(&#34;Development Environment&#34;)
 *             .versionConfigs(CxEnvironmentVersionConfigArgs.builder()
 *                 .version(version1.id())
 *                 .build())
 *             .build());
 * 
 *     }
 * }
 * ```
 * 
 * ## Import
 * 
 * Environment can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/environments/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:diagflow/cxEnvironment:CxEnvironment default {{parent}}/{{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:diagflow/cxEnvironment:CxEnvironment")
public class CxEnvironment extends com.pulumi.resources.CustomResource {
    /**
     * The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is rejected.
     * 
     */
    @Export(name="description", type=String.class, parameters={})
    private Output</* @Nullable */ String> description;

    /**
     * @return The human-readable description of the environment. The maximum length is 500 characters. If exceeded, the request is rejected.
     * 
     */
    public Output<Optional<String>> description() {
        return Codegen.optional(this.description);
    }
    /**
     * The human-readable name of the environment (unique in an agent). Limit of 64 characters.
     * 
     */
    @Export(name="displayName", type=String.class, parameters={})
    private Output<String> displayName;

    /**
     * @return The human-readable name of the environment (unique in an agent). Limit of 64 characters.
     * 
     */
    public Output<String> displayName() {
        return this.displayName;
    }
    /**
     * The name of the environment.
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return The name of the environment.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The Agent to create an Environment for.
     * Format: projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;.
     * 
     */
    @Export(name="parent", type=String.class, parameters={})
    private Output</* @Nullable */ String> parent;

    /**
     * @return The Agent to create an Environment for.
     * Format: projects/&lt;Project ID&gt;/locations/&lt;Location ID&gt;/agents/&lt;Agent ID&gt;.
     * 
     */
    public Output<Optional<String>> parent() {
        return Codegen.optional(this.parent);
    }
    /**
     * Update time of this environment. A timestamp in RFC3339 UTC &#34;Zulu&#34; format, with nanosecond resolution and up to nine fractional digits. Examples: &#34;2014-10-02T15:01:23Z&#34; and &#34;2014-10-02T15:01:23.045123456Z&#34;.
     * 
     */
    @Export(name="updateTime", type=String.class, parameters={})
    private Output<String> updateTime;

    /**
     * @return Update time of this environment. A timestamp in RFC3339 UTC &#34;Zulu&#34; format, with nanosecond resolution and up to nine fractional digits. Examples: &#34;2014-10-02T15:01:23Z&#34; and &#34;2014-10-02T15:01:23.045123456Z&#34;.
     * 
     */
    public Output<String> updateTime() {
        return this.updateTime;
    }
    /**
     * 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.
     * 
     */
    @Export(name="versionConfigs", type=List.class, parameters={CxEnvironmentVersionConfig.class})
    private Output<List<CxEnvironmentVersionConfig>> versionConfigs;

    /**
     * @return 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 Output<List<CxEnvironmentVersionConfig>> versionConfigs() {
        return this.versionConfigs;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public CxEnvironment(String name) {
        this(name, CxEnvironmentArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public CxEnvironment(String name, CxEnvironmentArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public CxEnvironment(String name, CxEnvironmentArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:diagflow/cxEnvironment:CxEnvironment", name, args == null ? CxEnvironmentArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private CxEnvironment(String name, Output<String> id, @Nullable CxEnvironmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:diagflow/cxEnvironment:CxEnvironment", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static CxEnvironment get(String name, Output<String> id, @Nullable CxEnvironmentState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new CxEnvironment(name, id, state, options);
    }
}
