<gh_stars>0// *** 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 GetIngestProcessorScript
    {
        /// <summary>
        /// Runs an inline or stored script on incoming documents. The script runs in the ingest context.
        /// 
        /// The script processor uses the script cache to avoid recompiling the script for each incoming document. To improve performance, ensure the script cache is properly sized before using a script processor in production.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html
        /// </summary>
        public static Task<GetIngestProcessorScriptResult> InvokeAsync(GetIngestProcessorScriptArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.InvokeAsync<GetIngestProcessorScriptResult>("elasticstack:index/getIngestProcessorScript:getIngestProcessorScript", args ?? new GetIngestProcessorScriptArgs(), options.WithDefaults());

        /// <summary>
        /// Runs an inline or stored script on incoming documents. The script runs in the ingest context.
        /// 
        /// The script processor uses the script cache to avoid recompiling the script for each incoming document. To improve performance, ensure the script cache is properly sized before using a script processor in production.
        /// 
        /// See: https://www.elastic.co/guide/en/elasticsearch/reference/current/script-processor.html
        /// </summary>
        public static Output<GetIngestProcessorScriptResult> Invoke(GetIngestProcessorScriptInvokeArgs? args = null, InvokeOptions? options = null)
            => global::Pulumi.Deployment.Instance.Invoke<GetIngestProcessorScriptResult>("elasticstack:index/getIngestProcessorScript:getIngestProcessorScript", args ?? new GetIngestProcessorScriptInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetIngestProcessorScriptArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public string? Description { 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>
        /// Script language.
        /// </summary>
        [Input("lang")]
        public string? Lang { 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>
        /// Object containing parameters for the script.
        /// </summary>
        [Input("params")]
        public string? Params { get; set; }

        /// <summary>
        /// ID of a stored script. If no `source` is specified, this parameter is required.
        /// </summary>
        [Input("scriptId")]
        public string? ScriptId { get; set; }

        /// <summary>
        /// Inline script. If no id is specified, this parameter is required.
        /// </summary>
        [Input("source")]
        public string? Source { get; set; }

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

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

    public sealed class GetIngestProcessorScriptInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { 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>
        /// Script language.
        /// </summary>
        [Input("lang")]
        public Input<string>? Lang { 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>
        /// Object containing parameters for the script.
        /// </summary>
        [Input("params")]
        public Input<string>? Params { get; set; }

        /// <summary>
        /// ID of a stored script. If no `source` is specified, this parameter is required.
        /// </summary>
        [Input("scriptId")]
        public Input<string>? ScriptId { get; set; }

        /// <summary>
        /// Inline script. If no id is specified, this parameter is required.
        /// </summary>
        [Input("source")]
        public Input<string>? Source { get; set; }

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

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


    [OutputType]
    public sealed class GetIngestProcessorScriptResult
    {
        /// <summary>
        /// Description of the processor.
        /// </summary>
        public readonly string? Description;
        /// <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>
        /// Script language.
        /// </summary>
        public readonly string? Lang;
        /// <summary>
        /// Handle failures for the processor.
        /// </summary>
        public readonly ImmutableArray<string> OnFailures;
        /// <summary>
        /// Object containing parameters for the script.
        /// </summary>
        public readonly string? Params;
        /// <summary>
        /// ID of a stored script. If no `source` is specified, this parameter is required.
        /// </summary>
        public readonly string? ScriptId;
        /// <summary>
        /// Inline script. If no id is specified, this parameter is required.
        /// </summary>
        public readonly string? Source;
        /// <summary>
        /// Identifier for the processor.
        /// </summary>
        public readonly string? Tag;

        [OutputConstructor]
        private GetIngestProcessorScriptResult(
            string? description,

            string id,

            string? @if,

            bool? ignoreFailure,

            string json,

            string? lang,

            ImmutableArray<string> onFailures,

            string? @params,

            string? scriptId,

            string? source,

            string? tag)
        {
            Description = description;
            Id = id;
            If = @if;
            IgnoreFailure = ignoreFailure;
            Json = json;
            Lang = lang;
            OnFailures = onFailures;
            Params = @params;
            ScriptId = scriptId;
            Source = source;
            Tag = tag;
        }
    }
}
