<reponame>zlepper/pulumi-elasticstack<filename>sdk/dotnet/GetIngestProcessorGsub.cs// *** 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 GetIngestProcessorGsub
    {
        /// <summary>
        /// Converts a string field by applying a regular expression and a replacement. If the field is an array of string, all members of the array will be converted. If any non-string values are encountered, the processor will throw an exception.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/gsub-processor.html
        /// 
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var gsub = Elasticstack.GetIngestProcessorGsub.Invoke(new()
        ///     {
        ///         Field = "field1",
        ///         Pattern = "\\.",
        ///         Replacement = "-",
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             gsub.Apply(getIngestProcessorGsubResult =&gt; getIngestProcessorGsubResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetIngestProcessorGsubResult> InvokeAsync(GetIngestProcessorGsubArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIngestProcessorGsubResult>("elasticstack:index/getIngestProcessorGsub:getIngestProcessorGsub", args ?? new GetIngestProcessorGsubArgs(), options.WithDefaults());

        /// <summary>
        /// Converts a string field by applying a regular expression and a replacement. If the field is an array of string, all members of the array will be converted. If any non-string values are encountered, the processor will throw an exception.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/gsub-processor.html
        /// 
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Elasticstack = Pulumi.Elasticstack;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var gsub = Elasticstack.GetIngestProcessorGsub.Invoke(new()
        ///     {
        ///         Field = "field1",
        ///         Pattern = "\\.",
        ///         Replacement = "-",
        ///     });
        /// 
        ///     var myIngestPipeline = new Elasticstack.IngestPipeline("myIngestPipeline", new()
        ///     {
        ///         Processors = new[]
        ///         {
        ///             gsub.Apply(getIngestProcessorGsubResult =&gt; getIngestProcessorGsubResult.Json),
        ///         },
        ///     });
        /// 
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetIngestProcessorGsubResult> Invoke(GetIngestProcessorGsubInvokeArgs args, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIngestProcessorGsubResult>("elasticstack:index/getIngestProcessorGsub:getIngestProcessorGsub", args ?? new GetIngestProcessorGsubInvokeArgs(), options.WithDefaults());
    }


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

        /// <summary>
        /// The field to apply the replacement 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>
        /// 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("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>
        /// The pattern to be replaced.
        /// </summary>
        [Input("pattern", required: true)]
        public string Pattern { get; set; } = null!;

        /// <summary>
        /// The string to replace the matching patterns with.
        /// </summary>
        [Input("replacement", required: true)]
        public string Replacement { get; set; } = null!;

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

        /// <summary>
        /// The field to assign the converted value to, by default `field` is updated in-place.
        /// </summary>
        [Input("targetField")]
        public string? TargetField { get; set; }

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

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

        /// <summary>
        /// The field to apply the replacement 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>
        /// 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("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>
        /// The pattern to be replaced.
        /// </summary>
        [Input("pattern", required: true)]
        public Input<string> Pattern { get; set; } = null!;

        /// <summary>
        /// The string to replace the matching patterns with.
        /// </summary>
        [Input("replacement", required: true)]
        public Input<string> Replacement { get; set; } = null!;

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

        /// <summary>
        /// The field to assign the converted value to, by default `field` is updated in-place.
        /// </summary>
        [Input("targetField")]
        public Input<string>? TargetField { get; set; }

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


    [OutputType]
    public sealed class GetIngestProcessorGsubResult
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        public readonly string? Description;
        /// <summary>
        /// The field to apply the replacement 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>
        /// If `true` and `field` does not exist or is `null`, the processor quietly exits without modifying the document.
        /// </summary>
        public readonly bool? IgnoreMissing;
        /// <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>
        /// The pattern to be replaced.
        /// </summary>
        public readonly string Pattern;
        /// <summary>
        /// The string to replace the matching patterns with.
        /// </summary>
        public readonly string Replacement;
        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        public readonly string? Tag;
        /// <summary>
        /// The field to assign the converted value to, by default `field` is updated in-place.
        /// </summary>
        public readonly string? TargetField;

        [OutputConstructor]
        private GetIngestProcessorGsubResult(
            string? description,

            string field,

            string id,

            string? @if,

            bool? ignoreFailure,

            bool? ignoreMissing,

            string json,

            ImmutableArray<string> onFailures,

            string pattern,

            string replacement,

            string? tag,

            string? targetField)
        {
            Description = description;
            Field = field;
            Id = id;
            If = @if;
            IgnoreFailure = ignoreFailure;
            IgnoreMissing = ignoreMissing;
            Json = json;
            OnFailures = onFailures;
            Pattern = pattern;
            Replacement = replacement;
            Tag = tag;
            TargetField = targetField;
        }
    }
}
