// *** 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
{
    public static class GetRegions
    {
        /// <summary>
        /// This data source provides Alibaba Cloud regions.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var currentRegionDs = AliCloud.GetRegions.Invoke(new()
        ///     {
        ///         Current = true,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["currentRegionId"] = currentRegionDs.Apply(getRegionsResult =&gt; getRegionsResult.Regions[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRegionsResult> InvokeAsync(GetRegionsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRegionsResult>("alicloud:index/getRegions:getRegions", args ?? new GetRegionsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides Alibaba Cloud regions.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var currentRegionDs = AliCloud.GetRegions.Invoke(new()
        ///     {
        ///         Current = true,
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["currentRegionId"] = currentRegionDs.Apply(getRegionsResult =&gt; getRegionsResult.Regions[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRegionsResult> Invoke(GetRegionsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRegionsResult>("alicloud:index/getRegions:getRegions", args ?? new GetRegionsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRegionsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Set to true to match only the region configured in the provider.
        /// </summary>
        [Input("current")]
        public bool? Current { get; set; }

        /// <summary>
        /// The name of the region to select, such as `eu-central-1`.
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

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

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

    public sealed class GetRegionsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Set to true to match only the region configured in the provider.
        /// </summary>
        [Input("current")]
        public Input<bool>? Current { get; set; }

        /// <summary>
        /// The name of the region to select, such as `eu-central-1`.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

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


    [OutputType]
    public sealed class GetRegionsResult
    {
        public readonly bool Current;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of region IDs.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly string Name;
        public readonly string? OutputFile;
        /// <summary>
        /// A list of regions. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetRegionsRegionResult> Regions;

        [OutputConstructor]
        private GetRegionsResult(
            bool current,

            string id,

            ImmutableArray<string> ids,

            string name,

            string? outputFile,

            ImmutableArray<Outputs.GetRegionsRegionResult> regions)
        {
            Current = current;
            Id = id;
            Ids = ids;
            Name = name;
            OutputFile = outputFile;
            Regions = regions;
        }
    }
}
