// *** 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 GetIngestProcessorAppend
    {
        /// <summary>
        /// Helper data source to which can be used to create a processor to append one or more values to an existing array if the field already exists and it is an array.
        /// Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var tags = Elasticstack.GetIngestProcessorAppend.Invoke(new()
        ///     {
        ///         Field = "tags",
        ///         Values = new[]
        ///         {
        ///             "production",
        ///             "{{{app}}}",
        ///             "{{{owner}}}",
        ///         },
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             tags.Apply(getIngestProcessorAppendResult =&gt; getIngestProcessorAppendResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetIngestProcessorAppendResult> InvokeAsync(GetIngestProcessorAppendArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIngestProcessorAppendResult>("elasticstack:index/getIngestProcessorAppend:getIngestProcessorAppend", args ?? new GetIngestProcessorAppendArgs(), options.WithDefaults());

        /// <summary>
        /// Helper data source to which can be used to create a processor to append one or more values to an existing array if the field already exists and it is an array.
        /// Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/append-processor.html
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var tags = Elasticstack.GetIngestProcessorAppend.Invoke(new()
        ///     {
        ///         Field = "tags",
        ///         Values = new[]
        ///         {
        ///             "production",
        ///             "{{{app}}}",
        ///             "{{{owner}}}",
        ///         },
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             tags.Apply(getIngestProcessorAppendResult =&gt; getIngestProcessorAppendResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetIngestProcessorAppendResult> Invoke(GetIngestProcessorAppendInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIngestProcessorAppendResult>("elasticstack:index/getIngestProcessorAppend:getIngestProcessorAppend", args ?? new GetIngestProcessorAppendInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetIngestProcessorAppendArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// If `false`, the processor does not append values already present in the field.
        /// </summary>
        [Input("allowDuplicates")]
        public bool? AllowDuplicates { get; set; }

        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public string? Description { get; set; }

        /// <summary>
        /// The field to be appended to.
        /// </summary>
        [Input("field", required: true)]
        public string Field { get; set; } = null!;

        /// <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>
        /// The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. Supported only from Elasticsearch version **7.15**.
        /// </summary>
        [Input("mediaType")]
        public string? MediaType { 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>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public string? Tag { get; set; }

        [Input("values", required: true)]
        private List<string>? _values;

        /// <summary>
        /// The value to be appended.
        /// </summary>
        public List<string> Values
        {
            get => _values ?? (_values = new List<string>());
            set => _values = value;
        }

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

    public sealed class GetIngestProcessorAppendInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// If `false`, the processor does not append values already present in the field.
        /// </summary>
        [Input("allowDuplicates")]
        public Input<bool>? AllowDuplicates { get; set; }

        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The field to be appended to.
        /// </summary>
        [Input("field", required: true)]
        public Input<string> Field { get; set; } = null!;

        /// <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>
        /// The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. Supported only from Elasticsearch version **7.15**.
        /// </summary>
        [Input("mediaType")]
        public Input<string>? MediaType { 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>
        /// Identifier for the processor.
        /// </summary>
        [Input("tag")]
        public Input<string>? Tag { get; set; }

        [Input("values", required: true)]
        private InputList<string>? _values;

        /// <summary>
        /// The value to be appended.
        /// </summary>
        public InputList<string> Values
        {
            get => _values ?? (_values = new InputList<string>());
            set => _values = value;
        }

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


    [OutputType]
    public sealed class GetIngestProcessorAppendResult
    {
        /// <summary>
        /// If `false`, the processor does not append values already present in the field.
        /// </summary>
        public readonly bool? AllowDuplicates;
        /// <summary>
        /// Description of the processor.
        /// </summary>
        public readonly string? Description;
        /// <summary>
        /// The field to be appended to.
        /// </summary>
        public readonly string Field;
        /// <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>
        /// JSON representation of this data source.
        /// </summary>
        public readonly string Json;
        /// <summary>
        /// The media type for encoding value. Applies only when value is a template snippet. Must be one of `application/json`, `text/plain`, or `application/x-www-form-urlencoded`. Supported only from Elasticsearch version **7.15**.
        /// </summary>
        public readonly string? MediaType;
        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public readonly ImmutableArray<string> OnFailures;
        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        public readonly string? Tag;
        /// <summary>
        /// The value to be appended.
        /// </summary>
        public readonly ImmutableArray<string> Values;

        [OutputConstructor]
        private GetIngestProcessorAppendResult(
            bool? allowDuplicates,

            string? description,

            string field,

            string id,

            string? @if,

            bool? ignoreFailure,

            string json,

            string? mediaType,

            ImmutableArray<string> onFailures,

            string? tag,

            ImmutableArray<string> values)
        {
            AllowDuplicates = allowDuplicates;
            Description = description;
            Field = field;
            Id = id;
            If = @if;
            IgnoreFailure = ignoreFailure;
            Json = json;
            MediaType = mediaType;
            OnFailures = onFailures;
            Tag = tag;
            Values = values;
        }
    }
}
