// *** 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
{
    public static class GetExecutions
    {
        /// <summary>
        /// This data source provides a list of OOS Executions in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.93.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Oos.GetExecutions.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "execution_id",
        ///         },
        ///         Status = "Success",
        ///         TemplateName = "name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstExecutionId"] = example.Apply(getExecutionsResult =&gt; getExecutionsResult.Executions[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetExecutionsResult> InvokeAsync(GetExecutionsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetExecutionsResult>("alicloud:oos/getExecutions:getExecutions", args ?? new GetExecutionsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides a list of OOS Executions in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.93.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Oos.GetExecutions.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             "execution_id",
        ///         },
        ///         Status = "Success",
        ///         TemplateName = "name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstExecutionId"] = example.Apply(getExecutionsResult =&gt; getExecutionsResult.Executions[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetExecutionsResult> Invoke(GetExecutionsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetExecutionsResult>("alicloud:oos/getExecutions:getExecutions", args ?? new GetExecutionsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetExecutionsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The category of template. Valid: `AlarmTrigger`, `EventTrigger`, `Other` and `TimerTrigger`.
        /// </summary>
        [Input("category")]
        public string? Category { get; set; }

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

        /// <summary>
        /// Execution whose end time is less than or equal to the specified time.
        /// </summary>
        [Input("endDateAfter")]
        public string? EndDateAfter { get; set; }

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

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of OOS Execution ids.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        /// <summary>
        /// Whether to include sub-execution.
        /// </summary>
        [Input("includeChildExecution")]
        public bool? IncludeChildExecution { get; set; }

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

        [Input("outputFile")]
        public string? OutputFile { get; set; }

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

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

        /// <summary>
        /// The sort field.
        /// </summary>
        [Input("sortField")]
        public string? SortField { get; set; }

        /// <summary>
        /// The sort order.
        /// </summary>
        [Input("sortOrder")]
        public string? SortOrder { get; set; }

        /// <summary>
        /// The execution whose start time is greater than or equal to the specified time.
        /// </summary>
        [Input("startDateAfter")]
        public string? StartDateAfter { get; set; }

        /// <summary>
        /// The execution with start time less than or equal to the specified time.
        /// </summary>
        [Input("startDateBefore")]
        public string? StartDateBefore { get; set; }

        /// <summary>
        /// The Status of OOS Execution. Valid: `Cancelled`, `Failed`, `Queued`, `Running`, `Started`, `Success`, `Waiting`.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

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

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

    public sealed class GetExecutionsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The category of template. Valid: `AlarmTrigger`, `EventTrigger`, `Other` and `TimerTrigger`.
        /// </summary>
        [Input("category")]
        public Input<string>? Category { get; set; }

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

        /// <summary>
        /// Execution whose end time is less than or equal to the specified time.
        /// </summary>
        [Input("endDateAfter")]
        public Input<string>? EndDateAfter { get; set; }

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

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of OOS Execution ids.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        /// <summary>
        /// Whether to include sub-execution.
        /// </summary>
        [Input("includeChildExecution")]
        public Input<bool>? IncludeChildExecution { get; set; }

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

        [Input("outputFile")]
        public Input<string>? OutputFile { get; set; }

        /// <summary>
        /// The id of parent OOS 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 sort field.
        /// </summary>
        [Input("sortField")]
        public Input<string>? SortField { get; set; }

        /// <summary>
        /// The sort order.
        /// </summary>
        [Input("sortOrder")]
        public Input<string>? SortOrder { get; set; }

        /// <summary>
        /// The execution whose start time is greater than or equal to the specified time.
        /// </summary>
        [Input("startDateAfter")]
        public Input<string>? StartDateAfter { get; set; }

        /// <summary>
        /// The execution with start time less than or equal to the specified time.
        /// </summary>
        [Input("startDateBefore")]
        public Input<string>? StartDateBefore { get; set; }

        /// <summary>
        /// The Status of OOS Execution. Valid: `Cancelled`, `Failed`, `Queued`, `Running`, `Started`, `Success`, `Waiting`.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

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

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


    [OutputType]
    public sealed class GetExecutionsResult
    {
        public readonly string? Category;
        public readonly string? EndDate;
        public readonly string? EndDateAfter;
        public readonly string? ExecutedBy;
        /// <summary>
        /// A list of OOS Executions. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetExecutionsExecutionResult> Executions;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of OOS Execution ids.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly bool? IncludeChildExecution;
        public readonly string? Mode;
        public readonly string? OutputFile;
        public readonly string? ParentExecutionId;
        public readonly string? RamRole;
        public readonly string? SortField;
        public readonly string? SortOrder;
        public readonly string? StartDateAfter;
        public readonly string? StartDateBefore;
        public readonly string? Status;
        public readonly ImmutableDictionary<string, object>? Tags;
        public readonly string? TemplateName;

        [OutputConstructor]
        private GetExecutionsResult(
            string? category,

            string? endDate,

            string? endDateAfter,

            string? executedBy,

            ImmutableArray<Outputs.GetExecutionsExecutionResult> executions,

            string id,

            ImmutableArray<string> ids,

            bool? includeChildExecution,

            string? mode,

            string? outputFile,

            string? parentExecutionId,

            string? ramRole,

            string? sortField,

            string? sortOrder,

            string? startDateAfter,

            string? startDateBefore,

            string? status,

            ImmutableDictionary<string, object>? tags,

            string? templateName)
        {
            Category = category;
            EndDate = endDate;
            EndDateAfter = endDateAfter;
            ExecutedBy = executedBy;
            Executions = executions;
            Id = id;
            Ids = ids;
            IncludeChildExecution = includeChildExecution;
            Mode = mode;
            OutputFile = outputFile;
            ParentExecutionId = parentExecutionId;
            RamRole = ramRole;
            SortField = sortField;
            SortOrder = sortOrder;
            StartDateAfter = startDateAfter;
            StartDateBefore = startDateBefore;
            Status = status;
            Tags = tags;
            TemplateName = templateName;
        }
    }
}
