// *** 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 Pulumiverse.Fortios
{
    public static class GetIpmaskCidr
    {
        /// <summary>
        /// Convert IP/Mask to CIDR
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// ### Example1
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Fortios = Pulumi.Fortios;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var trnameSystemInterface = Fortios.GetSystemInterface.Invoke(new()
        ///     {
        ///         Name = "port3",
        ///     });
        /// 
        ///     var trnameIpmaskCidr = Fortios.GetIpmaskCidr.Invoke(new()
        ///     {
        ///         Ipmask = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["output1"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidr),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% example %}}
        /// ### Example2
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Fortios = Pulumi.Fortios;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var trnameSystemInterface = Fortios.GetSystemInterface.Invoke(new()
        ///     {
        ///         Name = "port3",
        ///     });
        /// 
        ///     var trnameIpmaskCidr = Fortios.GetIpmaskCidr.Invoke(new()
        ///     {
        ///         Ipmask = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///         Ipmasklists = new[]
        ///         {
        ///             "172.16.17.32 255.255.255.0",
        ///             "192.168.3.11 255.255.255.240",
        ///             "192.168.3.11 255.255.255.224",
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["outputConv1"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidr),
        ///         ["outputConv2"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidrlists),
        ///         ["outputOrignal"] = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetIpmaskCidrResult> InvokeAsync(GetIpmaskCidrArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIpmaskCidrResult>("fortios:index/getIpmaskCidr:getIpmaskCidr", args ?? new GetIpmaskCidrArgs(), options.WithDefaults());

        /// <summary>
        /// Convert IP/Mask to CIDR
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// ### Example1
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Fortios = Pulumi.Fortios;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var trnameSystemInterface = Fortios.GetSystemInterface.Invoke(new()
        ///     {
        ///         Name = "port3",
        ///     });
        /// 
        ///     var trnameIpmaskCidr = Fortios.GetIpmaskCidr.Invoke(new()
        ///     {
        ///         Ipmask = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["output1"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidr),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% example %}}
        /// ### Example2
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using System.Linq;
        /// using Pulumi;
        /// using Fortios = Pulumi.Fortios;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var trnameSystemInterface = Fortios.GetSystemInterface.Invoke(new()
        ///     {
        ///         Name = "port3",
        ///     });
        /// 
        ///     var trnameIpmaskCidr = Fortios.GetIpmaskCidr.Invoke(new()
        ///     {
        ///         Ipmask = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///         Ipmasklists = new[]
        ///         {
        ///             "172.16.17.32 255.255.255.0",
        ///             "192.168.3.11 255.255.255.240",
        ///             "192.168.3.11 255.255.255.224",
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["outputConv1"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidr),
        ///         ["outputConv2"] = trnameIpmaskCidr.Apply(getIpmaskCidrResult =&gt; getIpmaskCidrResult.Cidrlists),
        ///         ["outputOrignal"] = trnameSystemInterface.Apply(getSystemInterfaceResult =&gt; getSystemInterfaceResult.Ip),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetIpmaskCidrResult> Invoke(GetIpmaskCidrInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIpmaskCidrResult>("fortios:index/getIpmaskCidr:getIpmaskCidr", args ?? new GetIpmaskCidrInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetIpmaskCidrArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Specify IP/MASK.
        /// </summary>
        [Input("ipmask")]
        public string? Ipmask { get; set; }

        [Input("ipmasklists")]
        private List<string>? _ipmasklists;

        /// <summary>
        /// Specify IP/MASK list.
        /// </summary>
        public List<string> Ipmasklists
        {
            get => _ipmasklists ?? (_ipmasklists = new List<string>());
            set => _ipmasklists = value;
        }

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

    public sealed class GetIpmaskCidrInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Specify IP/MASK.
        /// </summary>
        [Input("ipmask")]
        public Input<string>? Ipmask { get; set; }

        [Input("ipmasklists")]
        private InputList<string>? _ipmasklists;

        /// <summary>
        /// Specify IP/MASK list.
        /// </summary>
        public InputList<string> Ipmasklists
        {
            get => _ipmasklists ?? (_ipmasklists = new InputList<string>());
            set => _ipmasklists = value;
        }

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


    [OutputType]
    public sealed class GetIpmaskCidrResult
    {
        /// <summary>
        /// Classless Inter-Domain Routing of the IP/MASK.
        /// </summary>
        public readonly string Cidr;
        /// <summary>
        /// Classless Inter-Domain Routing list converted from the IP/MASK list.
        /// </summary>
        public readonly ImmutableArray<string> Cidrlists;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// IP/MASK.
        /// </summary>
        public readonly string? Ipmask;
        /// <summary>
        /// IP/MASK list.
        /// </summary>
        public readonly ImmutableArray<string> Ipmasklists;

        [OutputConstructor]
        private GetIpmaskCidrResult(
            string cidr,

            ImmutableArray<string> cidrlists,

            string id,

            string? ipmask,

            ImmutableArray<string> ipmasklists)
        {
            Cidr = cidr;
            Cidrlists = cidrlists;
            Id = id;
            Ipmask = ipmask;
            Ipmasklists = ipmasklists;
        }
    }
}
