// *** 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;
using Pulumi;

namespace PiersKarsenbarg.Nutanix
{
    /// <summary>
    /// Provides a resource to create a subnet based on the input parameters. A subnet is a block of IP addresses.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Nutanix = PiersKarsenbarg.Nutanix;
    /// using Nutanix = Pulumi.Nutanix;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var clusters = Output.Create(Nutanix.GetClusters.InvokeAsync(
    ///         {
    ///             { "metadata", 
    ///             {
    ///                 { "length", 2 },
    ///             } },
    ///         }));
    ///         this.Cluster = clusters.Apply(clusters =&gt; clusters.Entities?[0]?.Metadata?.Uuid);
    ///         var next_iac_managed = new Nutanix.Subnet("next-iac-managed", new Nutanix.SubnetArgs
    ///         {
    ///             ClusterUuid = clusters.Apply(clusters =&gt; clusters.Entities?[0]?.Metadata?.Uuid),
    ///             VlanId = 101,
    ///             SubnetType = "VLAN",
    ///             PrefixLength = 20,
    ///             DefaultGatewayIp = "10.5.80.1",
    ///             SubnetIp = "10.5.80.0",
    ///             DhcpDomainNameServerLists = 
    ///             {
    ///                 "8.8.8.8",
    ///                 "192.168.127.12",
    ///             },
    ///             DhcpDomainSearchLists = 
    ///             {
    ///                 "nutanix.com",
    ///                 "eng.nutanix.com",
    ///             },
    ///         });
    ///     }
    /// 
    ///     [Output("cluster")]
    ///     public Output&lt;string&gt; Cluster { get; set; }
    /// }
    /// ```
    /// </summary>
    [NutanixResourceType("nutanix:index/subnet:Subnet")]
    public partial class Subnet : Pulumi.CustomResource
    {
        /// <summary>
        /// The version of the API.
        /// </summary>
        [Output("apiVersion")]
        public Output<string> ApiVersion { get; private set; } = null!;

        [Output("availabilityZoneReference")]
        public Output<ImmutableDictionary<string, string>> AvailabilityZoneReference { get; private set; } = null!;

        [Output("categories")]
        public Output<ImmutableArray<Outputs.SubnetCategory>> Categories { get; private set; } = null!;

        [Output("clusterName")]
        public Output<string> ClusterName { get; private set; } = null!;

        [Output("clusterUuid")]
        public Output<string?> ClusterUuid { get; private set; } = null!;

        [Output("defaultGatewayIp")]
        public Output<string> DefaultGatewayIp { get; private set; } = null!;

        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        [Output("dhcpDomainNameServerLists")]
        public Output<ImmutableArray<string>> DhcpDomainNameServerLists { get; private set; } = null!;

        [Output("dhcpDomainSearchLists")]
        public Output<ImmutableArray<string>> DhcpDomainSearchLists { get; private set; } = null!;

        [Output("dhcpOptions")]
        public Output<ImmutableDictionary<string, string>> DhcpOptions { get; private set; } = null!;

        [Output("dhcpServerAddress")]
        public Output<ImmutableDictionary<string, string>> DhcpServerAddress { get; private set; } = null!;

        [Output("dhcpServerAddressPort")]
        public Output<int> DhcpServerAddressPort { get; private set; } = null!;

        [Output("enableNat")]
        public Output<bool> EnableNat { get; private set; } = null!;

        [Output("ipConfigPoolListRanges")]
        public Output<ImmutableArray<string>> IpConfigPoolListRanges { get; private set; } = null!;

        [Output("isExternal")]
        public Output<bool> IsExternal { get; private set; } = null!;

        [Output("metadata")]
        public Output<ImmutableDictionary<string, string>> Metadata { get; private set; } = null!;

        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        [Output("networkFunctionChainReference")]
        public Output<ImmutableDictionary<string, string>> NetworkFunctionChainReference { get; private set; } = null!;

        [Output("ownerReference")]
        public Output<ImmutableDictionary<string, string>> OwnerReference { get; private set; } = null!;

        [Output("prefixLength")]
        public Output<int> PrefixLength { get; private set; } = null!;

        [Output("projectReference")]
        public Output<ImmutableDictionary<string, string>> ProjectReference { get; private set; } = null!;

        [Output("state")]
        public Output<string> State { get; private set; } = null!;

        [Output("subnetIp")]
        public Output<string> SubnetIp { get; private set; } = null!;

        [Output("subnetType")]
        public Output<string> SubnetType { get; private set; } = null!;

        [Output("vlanId")]
        public Output<int> VlanId { get; private set; } = null!;

        [Output("vpcReferenceUuid")]
        public Output<string> VpcReferenceUuid { get; private set; } = null!;

        [Output("vswitchName")]
        public Output<string> VswitchName { get; private set; } = null!;


        /// <summary>
        /// Create a Subnet 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 Subnet(string name, SubnetArgs args, CustomResourceOptions? options = null)
            : base("nutanix:index/subnet:Subnet", name, args ?? new SubnetArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Subnet(string name, Input<string> id, SubnetState? state = null, CustomResourceOptions? options = null)
            : base("nutanix:index/subnet:Subnet", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "https://github.com/pierskarsenbarg/pulumi-nutanix/releases/download/${VERSION}",
            };
            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 Subnet 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 Subnet Get(string name, Input<string> id, SubnetState? state = null, CustomResourceOptions? options = null)
        {
            return new Subnet(name, id, state, options);
        }
    }

    public sealed class SubnetArgs : Pulumi.ResourceArgs
    {
        [Input("availabilityZoneReference")]
        private InputMap<string>? _availabilityZoneReference;
        public InputMap<string> AvailabilityZoneReference
        {
            get => _availabilityZoneReference ?? (_availabilityZoneReference = new InputMap<string>());
            set => _availabilityZoneReference = value;
        }

        [Input("categories")]
        private InputList<Inputs.SubnetCategoryArgs>? _categories;
        public InputList<Inputs.SubnetCategoryArgs> Categories
        {
            get => _categories ?? (_categories = new InputList<Inputs.SubnetCategoryArgs>());
            set => _categories = value;
        }

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

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

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

        [Input("dhcpDomainNameServerLists")]
        private InputList<string>? _dhcpDomainNameServerLists;
        public InputList<string> DhcpDomainNameServerLists
        {
            get => _dhcpDomainNameServerLists ?? (_dhcpDomainNameServerLists = new InputList<string>());
            set => _dhcpDomainNameServerLists = value;
        }

        [Input("dhcpDomainSearchLists")]
        private InputList<string>? _dhcpDomainSearchLists;
        public InputList<string> DhcpDomainSearchLists
        {
            get => _dhcpDomainSearchLists ?? (_dhcpDomainSearchLists = new InputList<string>());
            set => _dhcpDomainSearchLists = value;
        }

        [Input("dhcpOptions")]
        private InputMap<string>? _dhcpOptions;
        public InputMap<string> DhcpOptions
        {
            get => _dhcpOptions ?? (_dhcpOptions = new InputMap<string>());
            set => _dhcpOptions = value;
        }

        [Input("dhcpServerAddress")]
        private InputMap<string>? _dhcpServerAddress;
        public InputMap<string> DhcpServerAddress
        {
            get => _dhcpServerAddress ?? (_dhcpServerAddress = new InputMap<string>());
            set => _dhcpServerAddress = value;
        }

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

        [Input("enableNat")]
        public Input<bool>? EnableNat { get; set; }

        [Input("ipConfigPoolListRanges")]
        private InputList<string>? _ipConfigPoolListRanges;
        public InputList<string> IpConfigPoolListRanges
        {
            get => _ipConfigPoolListRanges ?? (_ipConfigPoolListRanges = new InputList<string>());
            set => _ipConfigPoolListRanges = value;
        }

        [Input("isExternal")]
        public Input<bool>? IsExternal { get; set; }

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

        [Input("networkFunctionChainReference")]
        private InputMap<string>? _networkFunctionChainReference;
        public InputMap<string> NetworkFunctionChainReference
        {
            get => _networkFunctionChainReference ?? (_networkFunctionChainReference = new InputMap<string>());
            set => _networkFunctionChainReference = value;
        }

        [Input("ownerReference")]
        private InputMap<string>? _ownerReference;
        public InputMap<string> OwnerReference
        {
            get => _ownerReference ?? (_ownerReference = new InputMap<string>());
            set => _ownerReference = value;
        }

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

        [Input("projectReference")]
        private InputMap<string>? _projectReference;
        public InputMap<string> ProjectReference
        {
            get => _projectReference ?? (_projectReference = new InputMap<string>());
            set => _projectReference = value;
        }

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

        [Input("subnetType", required: true)]
        public Input<string> SubnetType { get; set; } = null!;

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

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

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

        public SubnetArgs()
        {
        }
    }

    public sealed class SubnetState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// The version of the API.
        /// </summary>
        [Input("apiVersion")]
        public Input<string>? ApiVersion { get; set; }

        [Input("availabilityZoneReference")]
        private InputMap<string>? _availabilityZoneReference;
        public InputMap<string> AvailabilityZoneReference
        {
            get => _availabilityZoneReference ?? (_availabilityZoneReference = new InputMap<string>());
            set => _availabilityZoneReference = value;
        }

        [Input("categories")]
        private InputList<Inputs.SubnetCategoryGetArgs>? _categories;
        public InputList<Inputs.SubnetCategoryGetArgs> Categories
        {
            get => _categories ?? (_categories = new InputList<Inputs.SubnetCategoryGetArgs>());
            set => _categories = value;
        }

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

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

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

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

        [Input("dhcpDomainNameServerLists")]
        private InputList<string>? _dhcpDomainNameServerLists;
        public InputList<string> DhcpDomainNameServerLists
        {
            get => _dhcpDomainNameServerLists ?? (_dhcpDomainNameServerLists = new InputList<string>());
            set => _dhcpDomainNameServerLists = value;
        }

        [Input("dhcpDomainSearchLists")]
        private InputList<string>? _dhcpDomainSearchLists;
        public InputList<string> DhcpDomainSearchLists
        {
            get => _dhcpDomainSearchLists ?? (_dhcpDomainSearchLists = new InputList<string>());
            set => _dhcpDomainSearchLists = value;
        }

        [Input("dhcpOptions")]
        private InputMap<string>? _dhcpOptions;
        public InputMap<string> DhcpOptions
        {
            get => _dhcpOptions ?? (_dhcpOptions = new InputMap<string>());
            set => _dhcpOptions = value;
        }

        [Input("dhcpServerAddress")]
        private InputMap<string>? _dhcpServerAddress;
        public InputMap<string> DhcpServerAddress
        {
            get => _dhcpServerAddress ?? (_dhcpServerAddress = new InputMap<string>());
            set => _dhcpServerAddress = value;
        }

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

        [Input("enableNat")]
        public Input<bool>? EnableNat { get; set; }

        [Input("ipConfigPoolListRanges")]
        private InputList<string>? _ipConfigPoolListRanges;
        public InputList<string> IpConfigPoolListRanges
        {
            get => _ipConfigPoolListRanges ?? (_ipConfigPoolListRanges = new InputList<string>());
            set => _ipConfigPoolListRanges = value;
        }

        [Input("isExternal")]
        public Input<bool>? IsExternal { get; set; }

        [Input("metadata")]
        private InputMap<string>? _metadata;
        public InputMap<string> Metadata
        {
            get => _metadata ?? (_metadata = new InputMap<string>());
            set => _metadata = value;
        }

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

        [Input("networkFunctionChainReference")]
        private InputMap<string>? _networkFunctionChainReference;
        public InputMap<string> NetworkFunctionChainReference
        {
            get => _networkFunctionChainReference ?? (_networkFunctionChainReference = new InputMap<string>());
            set => _networkFunctionChainReference = value;
        }

        [Input("ownerReference")]
        private InputMap<string>? _ownerReference;
        public InputMap<string> OwnerReference
        {
            get => _ownerReference ?? (_ownerReference = new InputMap<string>());
            set => _ownerReference = value;
        }

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

        [Input("projectReference")]
        private InputMap<string>? _projectReference;
        public InputMap<string> ProjectReference
        {
            get => _projectReference ?? (_projectReference = new InputMap<string>());
            set => _projectReference = value;
        }

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

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

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

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

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

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

        public SubnetState()
        {
        }
    }
}
