// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;

namespace Pulumi.AliCloud.Oos
{
    /// <summary>
    /// Provides a OOS Execution resource. For information about Alicloud OOS Execution and how to use it, see [What is Resource Alicloud OOS Execution](https://www.alibabacloud.com/help/doc-detail/120771.htm).
    /// 
    /// &gt; **NOTE:** Available in 1.93.0+.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var @default = new AliCloud.Oos.Template("default", new()
    ///     {
    ///         Content = @"  {
    ///     ""FormatVersion"": ""OOS-2019-06-01"",
    ///     ""Description"": ""Update Describe instances of given status"",
    ///     ""Parameters"":{
    ///       ""Status"":{
    ///         ""Type"": ""String"",
    ///         ""Description"": ""(Required) The status of the Ecs instance.""
    ///       }
    ///     },
    ///     ""Tasks"": [
    ///       {
    ///         ""Properties"" :{
    ///           ""Parameters"":{
    ///             ""Status"": ""{{ Status }}""
    ///           },
    ///           ""API"": ""DescribeInstances"",
    ///           ""Service"": ""Ecs""
    ///         },
    ///         ""Name"": ""foo"",
    ///         ""Action"": ""ACS::ExecuteApi""
    ///       }]
    ///   }
    /// ",
    ///         TemplateName = "test-name",
    ///         VersionName = "test",
    ///         Tags = 
    ///         {
    ///             { "Created", "TF" },
    ///             { "For", "acceptance Test" },
    ///         },
    ///     });
    /// 
    ///     var example = new AliCloud.Oos.Execution("example", new()
    ///     {
    ///         TemplateName = @default.TemplateName,
    ///         Description = "From TF Test",
    ///         Parameters = @"				{""Status"":""Running""}
    /// ",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// OOS Execution can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:oos/execution:Execution example exec-ef6xxxx
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:oos/execution:Execution")]
    public partial class Execution : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The counters of OOS Execution.
        /// </summary>
        [Output("counters")]
        public Output<string> Counters { get; private set; } = null!;

        /// <summary>
        /// The time when the execution was created.
        /// </summary>
        [Output("createDate")]
        public Output<string> CreateDate { get; private set; } = null!;

        /// <summary>
        /// The description of OOS Execution.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// The time when the execution was ended.
        /// </summary>
        [Output("endDate")]
        public Output<string> EndDate { get; private set; } = null!;

        /// <summary>
        /// The user who execute the template.
        /// </summary>
        [Output("executedBy")]
        public Output<string> ExecutedBy { get; private set; } = null!;

        /// <summary>
        /// Whether to include subtasks.
        /// </summary>
        [Output("isParent")]
        public Output<bool> IsParent { get; private set; } = null!;

        /// <summary>
        /// The loop mode of OOS Execution.
        /// </summary>
        [Output("loopMode")]
        public Output<string?> LoopMode { get; private set; } = null!;

        /// <summary>
        /// The mode of OOS Execution. Valid: `Automatic`, `Debug`. Default to `Automatic`.
        /// </summary>
        [Output("mode")]
        public Output<string?> Mode { get; private set; } = null!;

        /// <summary>
        /// The outputs of OOS Execution.
        /// </summary>
        [Output("outputs")]
        public Output<string> Outputs { get; private set; } = null!;

        /// <summary>
        /// The parameters required by the template. Default to `{}`.
        /// </summary>
        [Output("parameters")]
        public Output<string?> Parameters { get; private set; } = null!;

        /// <summary>
        /// The id of parent execution.
        /// </summary>
        [Output("parentExecutionId")]
        public Output<string?> ParentExecutionId { get; private set; } = null!;

        /// <summary>
        /// The role that executes the current template.
        /// </summary>
        [Output("ramRole")]
        public Output<string> RamRole { get; private set; } = null!;

        /// <summary>
        /// The mode of safety check.
        /// </summary>
        [Output("safetyCheck")]
        public Output<string?> SafetyCheck { get; private set; } = null!;

        /// <summary>
        /// The time when the execution was started.
        /// </summary>
        [Output("startDate")]
        public Output<string> StartDate { get; private set; } = null!;

        /// <summary>
        /// The status of OOS Execution.
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// The message of status.
        /// </summary>
        [Output("statusMessage")]
        public Output<string> StatusMessage { get; private set; } = null!;

        /// <summary>
        /// The content of template. When the user selects an existing template to create and execute a task, it is not necessary to pass in this field.
        /// </summary>
        [Output("templateContent")]
        public Output<string?> TemplateContent { get; private set; } = null!;

        /// <summary>
        /// The id of template.
        /// </summary>
        [Output("templateId")]
        public Output<string> TemplateId { get; private set; } = null!;

        /// <summary>
        /// The name of execution template.
        /// </summary>
        [Output("templateName")]
        public Output<string> TemplateName { get; private set; } = null!;

        /// <summary>
        /// The version of execution template.
        /// </summary>
        [Output("templateVersion")]
        public Output<string> TemplateVersion { get; private set; } = null!;

        /// <summary>
        /// The time when the execution was updated.
        /// </summary>
        [Output("updateDate")]
        public Output<string> UpdateDate { get; private set; } = null!;


        /// <summary>
        /// Create a Execution resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Execution(string name, ExecutionArgs args, CustomResourceOptions? options = null)
            : base("alicloud:oos/execution:Execution", name, args ?? new ExecutionArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Execution(string name, Input<string> id, ExecutionState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:oos/execution:Execution", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Execution resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Execution Get(string name, Input<string> id, ExecutionState? state = null, CustomResourceOptions? options = null)
        {
            return new Execution(name, id, state, options);
        }
    }

    public sealed class ExecutionArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The description of OOS Execution.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The loop mode of OOS Execution.
        /// </summary>
        [Input("loopMode")]
        public Input<string>? LoopMode { get; set; }

        /// <summary>
        /// The mode of OOS Execution. Valid: `Automatic`, `Debug`. Default to `Automatic`.
        /// </summary>
        [Input("mode")]
        public Input<string>? Mode { get; set; }

        /// <summary>
        /// The parameters required by the template. Default to `{}`.
        /// </summary>
        [Input("parameters")]
        public Input<string>? Parameters { get; set; }

        /// <summary>
        /// The id of parent execution.
        /// </summary>
        [Input("parentExecutionId")]
        public Input<string>? ParentExecutionId { get; set; }

        /// <summary>
        /// The mode of safety check.
        /// </summary>
        [Input("safetyCheck")]
        public Input<string>? SafetyCheck { get; set; }

        /// <summary>
        /// The content of template. When the user selects an existing template to create and execute a task, it is not necessary to pass in this field.
        /// </summary>
        [Input("templateContent")]
        public Input<string>? TemplateContent { get; set; }

        /// <summary>
        /// The name of execution template.
        /// </summary>
        [Input("templateName", required: true)]
        public Input<string> TemplateName { get; set; } = null!;

        /// <summary>
        /// The version of execution template.
        /// </summary>
        [Input("templateVersion")]
        public Input<string>? TemplateVersion { get; set; }

        public ExecutionArgs()
        {
        }
        public static new ExecutionArgs Empty => new ExecutionArgs();
    }

    public sealed class ExecutionState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The counters of OOS Execution.
        /// </summary>
        [Input("counters")]
        public Input<string>? Counters { get; set; }

        /// <summary>
        /// The time when the execution was created.
        /// </summary>
        [Input("createDate")]
        public Input<string>? CreateDate { get; set; }

        /// <summary>
        /// The description of OOS Execution.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The time when the execution was ended.
        /// </summary>
        [Input("endDate")]
        public Input<string>? EndDate { get; set; }

        /// <summary>
        /// The user who execute the template.
        /// </summary>
        [Input("executedBy")]
        public Input<string>? ExecutedBy { get; set; }

        /// <summary>
        /// Whether to include subtasks.
        /// </summary>
        [Input("isParent")]
        public Input<bool>? IsParent { get; set; }

        /// <summary>
        /// The loop mode of OOS Execution.
        /// </summary>
        [Input("loopMode")]
        public Input<string>? LoopMode { get; set; }

        /// <summary>
        /// The mode of OOS Execution. Valid: `Automatic`, `Debug`. Default to `Automatic`.
        /// </summary>
        [Input("mode")]
        public Input<string>? Mode { get; set; }

        /// <summary>
        /// The outputs of OOS Execution.
        /// </summary>
        [Input("outputs")]
        public Input<string>? Outputs { get; set; }

        /// <summary>
        /// The parameters required by the template. Default to `{}`.
        /// </summary>
        [Input("parameters")]
        public Input<string>? Parameters { get; set; }

        /// <summary>
        /// The id of parent execution.
        /// </summary>
        [Input("parentExecutionId")]
        public Input<string>? ParentExecutionId { get; set; }

        /// <summary>
        /// The role that executes the current template.
        /// </summary>
        [Input("ramRole")]
        public Input<string>? RamRole { get; set; }

        /// <summary>
        /// The mode of safety check.
        /// </summary>
        [Input("safetyCheck")]
        public Input<string>? SafetyCheck { get; set; }

        /// <summary>
        /// The time when the execution was started.
        /// </summary>
        [Input("startDate")]
        public Input<string>? StartDate { get; set; }

        /// <summary>
        /// The status of OOS Execution.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// The message of status.
        /// </summary>
        [Input("statusMessage")]
        public Input<string>? StatusMessage { get; set; }

        /// <summary>
        /// The content of template. When the user selects an existing template to create and execute a task, it is not necessary to pass in this field.
        /// </summary>
        [Input("templateContent")]
        public Input<string>? TemplateContent { get; set; }

        /// <summary>
        /// The id of template.
        /// </summary>
        [Input("templateId")]
        public Input<string>? TemplateId { get; set; }

        /// <summary>
        /// The name of execution template.
        /// </summary>
        [Input("templateName")]
        public Input<string>? TemplateName { get; set; }

        /// <summary>
        /// The version of execution template.
        /// </summary>
        [Input("templateVersion")]
        public Input<string>? TemplateVersion { get; set; }

        /// <summary>
        /// The time when the execution was updated.
        /// </summary>
        [Input("updateDate")]
        public Input<string>? UpdateDate { get; set; }

        public ExecutionState()
        {
        }
        public static new ExecutionState Empty => new ExecutionState();
    }
}
