// *** 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.Vpc
{
    public static class GetNetworks
    {
        /// <summary>
        /// This data source provides VPCs available to the user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var vpcsDs = AliCloud.Vpc.GetNetworks.Invoke(new()
        ///     {
        ///         CidrBlock = "172.16.0.0/12",
        ///         NameRegex = "^foo",
        ///         Status = "Available",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstVpcId"] = vpcsDs.Apply(getNetworksResult =&gt; getNetworksResult.Vpcs[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetNetworksResult> InvokeAsync(GetNetworksArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetNetworksResult>("alicloud:vpc/getNetworks:getNetworks", args ?? new GetNetworksArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides VPCs available to the user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var vpcsDs = AliCloud.Vpc.GetNetworks.Invoke(new()
        ///     {
        ///         CidrBlock = "172.16.0.0/12",
        ///         NameRegex = "^foo",
        ///         Status = "Available",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstVpcId"] = vpcsDs.Apply(getNetworksResult =&gt; getNetworksResult.Vpcs[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetNetworksResult> Invoke(GetNetworksInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetNetworksResult>("alicloud:vpc/getNetworks:getNetworks", args ?? new GetNetworksInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetNetworksArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter results by a specific CIDR block. For example: "172.16.0.0/12".
        /// </summary>
        [Input("cidrBlock")]
        public string? CidrBlock { get; set; }

        /// <summary>
        /// The ID of dhcp options set.
        /// </summary>
        [Input("dhcpOptionsSetId")]
        public string? DhcpOptionsSetId { get; set; }

        /// <summary>
        /// Indicates whether to check this request only. Valid values: `true` and `false`.
        /// </summary>
        [Input("dryRun")]
        public bool? DryRun { get; set; }

        /// <summary>
        /// -(Optional, Available in v1.119.0+) Default to `true`. Set it to true can output the `route_table_id`.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

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

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

        /// <summary>
        /// Indicate whether the VPC is the default one in the specified region.
        /// </summary>
        [Input("isDefault")]
        public bool? IsDefault { get; set; }

        /// <summary>
        /// A regex string to filter VPCs by name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

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

        [Input("pageNumber")]
        public int? PageNumber { get; set; }

        [Input("pageSize")]
        public int? PageSize { get; set; }

        /// <summary>
        /// The Id of resource group which VPC belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public string? ResourceGroupId { get; set; }

        /// <summary>
        /// Filter results by a specific status. Valid value are `Pending` and `Available`.
        /// </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 the VPC.
        /// </summary>
        [Input("vpcName")]
        public string? VpcName { get; set; }

        /// <summary>
        /// The owner ID of VPC.
        /// </summary>
        [Input("vpcOwnerId")]
        public int? VpcOwnerId { get; set; }

        /// <summary>
        /// Filter results by the specified VSwitch.
        /// </summary>
        [Input("vswitchId")]
        public string? VswitchId { get; set; }

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

    public sealed class GetNetworksInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Filter results by a specific CIDR block. For example: "172.16.0.0/12".
        /// </summary>
        [Input("cidrBlock")]
        public Input<string>? CidrBlock { get; set; }

        /// <summary>
        /// The ID of dhcp options set.
        /// </summary>
        [Input("dhcpOptionsSetId")]
        public Input<string>? DhcpOptionsSetId { get; set; }

        /// <summary>
        /// Indicates whether to check this request only. Valid values: `true` and `false`.
        /// </summary>
        [Input("dryRun")]
        public Input<bool>? DryRun { get; set; }

        /// <summary>
        /// -(Optional, Available in v1.119.0+) Default to `true`. Set it to true can output the `route_table_id`.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

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

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

        /// <summary>
        /// Indicate whether the VPC is the default one in the specified region.
        /// </summary>
        [Input("isDefault")]
        public Input<bool>? IsDefault { get; set; }

        /// <summary>
        /// A regex string to filter VPCs by name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

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

        [Input("pageNumber")]
        public Input<int>? PageNumber { get; set; }

        [Input("pageSize")]
        public Input<int>? PageSize { get; set; }

        /// <summary>
        /// The Id of resource group which VPC belongs.
        /// </summary>
        [Input("resourceGroupId")]
        public Input<string>? ResourceGroupId { get; set; }

        /// <summary>
        /// Filter results by a specific status. Valid value are `Pending` and `Available`.
        /// </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 the VPC.
        /// </summary>
        [Input("vpcName")]
        public Input<string>? VpcName { get; set; }

        /// <summary>
        /// The owner ID of VPC.
        /// </summary>
        [Input("vpcOwnerId")]
        public Input<int>? VpcOwnerId { get; set; }

        /// <summary>
        /// Filter results by the specified VSwitch.
        /// </summary>
        [Input("vswitchId")]
        public Input<string>? VswitchId { get; set; }

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


    [OutputType]
    public sealed class GetNetworksResult
    {
        /// <summary>
        /// CIDR block of the VPC.
        /// </summary>
        public readonly string? CidrBlock;
        public readonly string? DhcpOptionsSetId;
        public readonly bool? DryRun;
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of VPC IDs.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        /// <summary>
        /// Whether the VPC is the default VPC in the region.
        /// </summary>
        public readonly bool? IsDefault;
        public readonly string? NameRegex;
        /// <summary>
        /// A list of VPC names.
        /// </summary>
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;
        public readonly int? PageNumber;
        public readonly int? PageSize;
        public readonly string? ResourceGroupId;
        /// <summary>
        /// Status of the VPC.
        /// </summary>
        public readonly string? Status;
        /// <summary>
        /// A map of tags assigned to the VPC.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;
        public readonly int TotalCount;
        /// <summary>
        /// Name of the VPC.
        /// </summary>
        public readonly string? VpcName;
        public readonly int? VpcOwnerId;
        /// <summary>
        /// A list of VPCs. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetNetworksVpcResult> Vpcs;
        public readonly string? VswitchId;

        [OutputConstructor]
        private GetNetworksResult(
            string? cidrBlock,

            string? dhcpOptionsSetId,

            bool? dryRun,

            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            bool? isDefault,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            int? pageNumber,

            int? pageSize,

            string? resourceGroupId,

            string? status,

            ImmutableDictionary<string, object>? tags,

            int totalCount,

            string? vpcName,

            int? vpcOwnerId,

            ImmutableArray<Outputs.GetNetworksVpcResult> vpcs,

            string? vswitchId)
        {
            CidrBlock = cidrBlock;
            DhcpOptionsSetId = dhcpOptionsSetId;
            DryRun = dryRun;
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            IsDefault = isDefault;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            PageNumber = pageNumber;
            PageSize = pageSize;
            ResourceGroupId = resourceGroupId;
            Status = status;
            Tags = tags;
            TotalCount = totalCount;
            VpcName = vpcName;
            VpcOwnerId = vpcOwnerId;
            Vpcs = vpcs;
            VswitchId = vswitchId;
        }
    }
}
