// *** 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.Elasticstack
{
    public static class GetIngestProcessorNetworkDirection
    {
        /// <summary>
        /// Calculates the network direction given a source IP address, destination IP address, and a list of internal networks.
        /// 
        /// The network direction processor reads IP addresses from Elastic Common Schema (ECS) fields by default. If you use the ECS, only the `internal_networks` option must be specified.
        /// 
        /// 
        /// One of either `internal_networks` or `internal_networks_field` must be specified. If `internal_networks_field` is specified, it follows the behavior specified by `ignore_missing`.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var networkDirection = Elasticstack.GetIngestProcessorNetworkDirection.Invoke(new()
        ///     {
        ///         InternalNetworks = new[]
        ///         {
        ///             "private",
        ///         },
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             networkDirection.Apply(getIngestProcessorNetworkDirectionResult =&gt; getIngestProcessorNetworkDirectionResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetIngestProcessorNetworkDirectionResult> InvokeAsync(GetIngestProcessorNetworkDirectionArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIngestProcessorNetworkDirectionResult>("elasticstack:index/getIngestProcessorNetworkDirection:getIngestProcessorNetworkDirection", args ?? new GetIngestProcessorNetworkDirectionArgs(), options.WithDefaults());

        /// <summary>
        /// Calculates the network direction given a source IP address, destination IP address, and a list of internal networks.
        /// 
        /// The network direction processor reads IP addresses from Elastic Common Schema (ECS) fields by default. If you use the ECS, only the `internal_networks` option must be specified.
        /// 
        /// 
        /// One of either `internal_networks` or `internal_networks_field` must be specified. If `internal_networks_field` is specified, it follows the behavior specified by `ignore_missing`.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var networkDirection = Elasticstack.GetIngestProcessorNetworkDirection.Invoke(new()
        ///     {
        ///         InternalNetworks = new[]
        ///         {
        ///             "private",
        ///         },
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             networkDirection.Apply(getIngestProcessorNetworkDirectionResult =&gt; getIngestProcessorNetworkDirectionResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetIngestProcessorNetworkDirectionResult> Invoke(GetIngestProcessorNetworkDirectionInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIngestProcessorNetworkDirectionResult>("elasticstack:index/getIngestProcessorNetworkDirection:getIngestProcessorNetworkDirection", args ?? new GetIngestProcessorNetworkDirectionInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetIngestProcessorNetworkDirectionArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public string? Description { get; set; }

        /// <summary>
        /// Field containing the destination IP address.
        /// </summary>
        [Input("destinationIp")]
        public string? DestinationIp { get; set; }

        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        [Input("if")]
        public string? If { get; set; }

        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        [Input("ignoreFailure")]
        public bool? IgnoreFailure { get; set; }

        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        [Input("ignoreMissing")]
        public bool? IgnoreMissing { get; set; }

        [Input("internalNetworks")]
        private List<string>? _internalNetworks;

        /// <summary>
        /// List of internal networks.
        /// </summary>
        public List<string> InternalNetworks
        {
            get => _internalNetworks ?? (_internalNetworks = new List<string>());
            set => _internalNetworks = value;
        }

        /// <summary>
        /// A field on the given document to read the internal_networks configuration from.
        /// </summary>
        [Input("internalNetworksField")]
        public string? InternalNetworksField { get; set; }

        [Input("onFailures")]
        private List<string>? _onFailures;

        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public List<string> OnFailures
        {
            get => _onFailures ?? (_onFailures = new List<string>());
            set => _onFailures = value;
        }

        /// <summary>
        /// Field containing the source IP address.
        /// </summary>
        [Input("sourceIp")]
        public string? SourceIp { get; set; }

        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public string? Tag { get; set; }

        /// <summary>
        /// Output field for the network direction.
        /// </summary>
        [Input("targetField")]
        public string? TargetField { get; set; }

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

    public sealed class GetIngestProcessorNetworkDirectionInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Field containing the destination IP address.
        /// </summary>
        [Input("destinationIp")]
        public Input<string>? DestinationIp { get; set; }

        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        [Input("if")]
        public Input<string>? If { get; set; }

        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        [Input("ignoreFailure")]
        public Input<bool>? IgnoreFailure { get; set; }

        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        [Input("ignoreMissing")]
        public Input<bool>? IgnoreMissing { get; set; }

        [Input("internalNetworks")]
        private InputList<string>? _internalNetworks;

        /// <summary>
        /// List of internal networks.
        /// </summary>
        public InputList<string> InternalNetworks
        {
            get => _internalNetworks ?? (_internalNetworks = new InputList<string>());
            set => _internalNetworks = value;
        }

        /// <summary>
        /// A field on the given document to read the internal_networks configuration from.
        /// </summary>
        [Input("internalNetworksField")]
        public Input<string>? InternalNetworksField { get; set; }

        [Input("onFailures")]
        private InputList<string>? _onFailures;

        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public InputList<string> OnFailures
        {
            get => _onFailures ?? (_onFailures = new InputList<string>());
            set => _onFailures = value;
        }

        /// <summary>
        /// Field containing the source IP address.
        /// </summary>
        [Input("sourceIp")]
        public Input<string>? SourceIp { get; set; }

        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public Input<string>? Tag { get; set; }

        /// <summary>
        /// Output field for the network direction.
        /// </summary>
        [Input("targetField")]
        public Input<string>? TargetField { get; set; }

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


    [OutputType]
    public sealed class GetIngestProcessorNetworkDirectionResult
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        public readonly string? Description;
        /// <summary>
        /// Field containing the destination IP address.
        /// </summary>
        public readonly string? DestinationIp;
        /// <summary>
        /// Internal identifier of the resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Conditionally execute the processor
        /// </summary>
        public readonly string? If;
        /// <summary>
        /// Ignore failures for the processor.
        /// </summary>
        public readonly bool? IgnoreFailure;
        /// <summary>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        public readonly bool? IgnoreMissing;
        /// <summary>
        /// List of internal networks.
        /// </summary>
        public readonly ImmutableArray<string> InternalNetworks;
        /// <summary>
        /// A field on the given document to read the internal_networks configuration from.
        /// </summary>
        public readonly string? InternalNetworksField;
        /// <summary>
        /// JSON representation of this data source.
        /// </summary>
        public readonly string Json;
        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public readonly ImmutableArray<string> OnFailures;
        /// <summary>
        /// Field containing the source IP address.
        /// </summary>
        public readonly string? SourceIp;
        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        public readonly string? Tag;
        /// <summary>
        /// Output field for the network direction.
        /// </summary>
        public readonly string? TargetField;

        [OutputConstructor]
        private GetIngestProcessorNetworkDirectionResult(
            string? description,

            string? destinationIp,

            string id,

            string? @if,

            bool? ignoreFailure,

            bool? ignoreMissing,

            ImmutableArray<string> internalNetworks,

            string? internalNetworksField,

            string json,

            ImmutableArray<string> onFailures,

            string? sourceIp,

            string? tag,

            string? targetField)
        {
            Description = description;
            DestinationIp = destinationIp;
            Id = id;
            If = @if;
            IgnoreFailure = ignoreFailure;
            IgnoreMissing = ignoreMissing;
            InternalNetworks = internalNetworks;
            InternalNetworksField = internalNetworksField;
            Json = json;
            OnFailures = onFailures;
            SourceIp = sourceIp;
            Tag = tag;
            TargetField = targetField;
        }
    }
}
