<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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.Sae
{
    public static class GetApplications
    {
        /// <summary>
        /// This data source provides the Sae Applications of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.161.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "tf-testacc";
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var vpc = new AliCloud.Vpc.Network("vpc", new()
        ///     {
        ///         VpcName = "tf_testacc",
        ///         CidrBlock = "172.16.0.0/12",
        ///     });
        /// 
        ///     var vsw = new AliCloud.Vpc.Switch("vsw", new()
        ///     {
        ///         VpcId = vpc.Id,
        ///         CidrBlock = "172.16.0.0/24",
        ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var defaultNamespace = new AliCloud.Sae.Namespace("defaultNamespace", new()
        ///     {
        ///         NamespaceDescription = name,
        ///         NamespaceId = "cn-hangzhou:tfacctest",
        ///         NamespaceName = name,
        ///     });
        /// 
        ///     var defaultApplication = new AliCloud.Sae.Application("defaultApplication", new()
        ///     {
        ///         AppDescription = "tf-testaccDescription",
        ///         AppName = "tf-testaccAppName131",
        ///         NamespaceId = defaultNamespace.Id,
        ///         ImageUrl = "registry-vpc.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5",
        ///         PackageType = "Image",
        ///         VswitchId = vsw.Id,
        ///         Timezone = "Asia/Beijing",
        ///         Replicas = 5,
        ///         Cpu = 500,
        ///         Memory = 2048,
        ///     });
        /// 
        ///     var defaultApplications = AliCloud.Sae.GetApplications.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultApplication.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["saeApplicationId"] = defaultApplications.Apply(getApplicationsResult =&gt; getApplicationsResult.Applications[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetApplicationsResult> InvokeAsync(GetApplicationsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetApplicationsResult>("alicloud:sae/getApplications:getApplications", args ?? new GetApplicationsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Sae Applications of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.161.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var config = new Config();
        ///     var name = config.Get("name") ?? "tf-testacc";
        ///     var defaultZones = AliCloud.GetZones.Invoke(new()
        ///     {
        ///         AvailableResourceCreation = "VSwitch",
        ///     });
        /// 
        ///     var vpc = new AliCloud.Vpc.Network("vpc", new()
        ///     {
        ///         VpcName = "tf_testacc",
        ///         CidrBlock = "172.16.0.0/12",
        ///     });
        /// 
        ///     var vsw = new AliCloud.Vpc.Switch("vsw", new()
        ///     {
        ///         VpcId = vpc.Id,
        ///         CidrBlock = "172.16.0.0/24",
        ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
        ///         VswitchName = name,
        ///     });
        /// 
        ///     var defaultNamespace = new AliCloud.Sae.Namespace("defaultNamespace", new()
        ///     {
        ///         NamespaceDescription = name,
        ///         NamespaceId = "cn-hangzhou:tfacctest",
        ///         NamespaceName = name,
        ///     });
        /// 
        ///     var defaultApplication = new AliCloud.Sae.Application("defaultApplication", new()
        ///     {
        ///         AppDescription = "tf-testaccDescription",
        ///         AppName = "tf-testaccAppName131",
        ///         NamespaceId = defaultNamespace.Id,
        ///         ImageUrl = "registry-vpc.cn-hangzhou.aliyuncs.com/lxepoo/apache-php5",
        ///         PackageType = "Image",
        ///         VswitchId = vsw.Id,
        ///         Timezone = "Asia/Beijing",
        ///         Replicas = 5,
        ///         Cpu = 500,
        ///         Memory = 2048,
        ///     });
        /// 
        ///     var defaultApplications = AliCloud.Sae.GetApplications.Invoke(new()
        ///     {
        ///         Ids = new[]
        ///         {
        ///             defaultApplication.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["saeApplicationId"] = defaultApplications.Apply(getApplicationsResult =&gt; getApplicationsResult.Applications[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetApplicationsResult> Invoke(GetApplicationsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetApplicationsResult>("alicloud:sae/getApplications:getApplications", args ?? new GetApplicationsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetApplicationsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Application Name. Combinations of numbers, letters, and dashes (-) are allowed. It must start with a letter and the maximum length is 36 characters.
        /// </summary>
        [Input("appName")]
        public string? AppName { get; set; }

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        /// <summary>
        /// The field type. Valid values:`appName`, `appIds`, `slbIps`, `instanceIps`
        /// </summary>
        [Input("fieldType")]
        public string? FieldType { get; set; }

        /// <summary>
        /// The field value.
        /// </summary>
        [Input("fieldValue")]
        public string? FieldValue { get; set; }

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

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

        /// <summary>
        /// SAE namespace ID. Only namespaces whose names are lowercase letters and dashes (-) are supported, and must start with a letter. The namespace can be obtained by calling the DescribeNamespaceList interface.
        /// </summary>
        [Input("namespaceId")]
        public string? NamespaceId { get; set; }

        /// <summary>
        /// The order by.Valid values:`running`,`instances`.
        /// </summary>
        [Input("orderBy")]
        public string? OrderBy { get; set; }

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

        /// <summary>
        /// The reverse.
        /// </summary>
        [Input("reverse")]
        public bool? Reverse { get; set; }

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

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

    public sealed class GetApplicationsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Application Name. Combinations of numbers, letters, and dashes (-) are allowed. It must start with a letter and the maximum length is 36 characters.
        /// </summary>
        [Input("appName")]
        public Input<string>? AppName { get; set; }

        /// <summary>
        /// Default to `false`. Set it to `true` can output more details about resource attributes.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        /// <summary>
        /// The field type. Valid values:`appName`, `appIds`, `slbIps`, `instanceIps`
        /// </summary>
        [Input("fieldType")]
        public Input<string>? FieldType { get; set; }

        /// <summary>
        /// The field value.
        /// </summary>
        [Input("fieldValue")]
        public Input<string>? FieldValue { get; set; }

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

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

        /// <summary>
        /// SAE namespace ID. Only namespaces whose names are lowercase letters and dashes (-) are supported, and must start with a letter. The namespace can be obtained by calling the DescribeNamespaceList interface.
        /// </summary>
        [Input("namespaceId")]
        public Input<string>? NamespaceId { get; set; }

        /// <summary>
        /// The order by.Valid values:`running`,`instances`.
        /// </summary>
        [Input("orderBy")]
        public Input<string>? OrderBy { get; set; }

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

        /// <summary>
        /// The reverse.
        /// </summary>
        [Input("reverse")]
        public Input<bool>? Reverse { get; set; }

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

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


    [OutputType]
    public sealed class GetApplicationsResult
    {
        public readonly string? AppName;
        public readonly ImmutableArray<Outputs.GetApplicationsApplicationResult> Applications;
        public readonly bool? EnableDetails;
        public readonly string? FieldType;
        public readonly string? FieldValue;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? NamespaceId;
        public readonly string? OrderBy;
        public readonly string? OutputFile;
        public readonly bool? Reverse;
        public readonly string? Status;

        [OutputConstructor]
        private GetApplicationsResult(
            string? appName,

            ImmutableArray<Outputs.GetApplicationsApplicationResult> applications,

            bool? enableDetails,

            string? fieldType,

            string? fieldValue,

            string id,

            ImmutableArray<string> ids,

            string? namespaceId,

            string? orderBy,

            string? outputFile,

            bool? reverse,

            string? status)
        {
            AppName = appName;
            Applications = applications;
            EnableDetails = enableDetails;
            FieldType = fieldType;
            FieldValue = fieldValue;
            Id = id;
            Ids = ids;
            NamespaceId = namespaceId;
            OrderBy = orderBy;
            OutputFile = outputFile;
            Reverse = reverse;
            Status = status;
        }
    }
}
