// *** 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 TencentCloudIAC.PulumiPackage.Tencentcloud.Tat
{
    /// <summary>
    /// Provides a resource to create a tat invoker
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var invoker = new Tencentcloud.Tat.Invoker("invoker", new Tencentcloud.Tat.InvokerArgs
    ///         {
    ///             CommandId = "cmd-6fydo27j",
    ///             InstanceIds = 
    ///             {
    ///                 "ins-3c7q2ebs",
    ///             },
    ///             ScheduleSettings = new Tencentcloud.Tat.Inputs.InvokerScheduleSettingsArgs
    ///             {
    ///                 InvokeTime = "2099-11-17T16:00:00Z",
    ///                 Policy = "ONCE",
    ///             },
    ///             Type = "SCHEDULE",
    ///             Username = "root",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// tat invoker can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Tat/invoker:Invoker invoker ivk-gwb4ztk5
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Tat/invoker:Invoker")]
    public partial class Invoker : Pulumi.CustomResource
    {
        /// <summary>
        /// Remote command ID.
        /// </summary>
        [Output("commandId")]
        public Output<string> CommandId { get; private set; } = null!;

        /// <summary>
        /// Creation time.
        /// </summary>
        [Output("createdTime")]
        public Output<string> CreatedTime { get; private set; } = null!;

        /// <summary>
        /// Whether to enable the invoker.
        /// </summary>
        [Output("enable")]
        public Output<bool> Enable { get; private set; } = null!;

        /// <summary>
        /// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
        /// </summary>
        [Output("instanceIds")]
        public Output<ImmutableArray<string>> InstanceIds { get; private set; } = null!;

        /// <summary>
        /// Invoker ID.
        /// </summary>
        [Output("invokerId")]
        public Output<string> InvokerId { get; private set; } = null!;

        /// <summary>
        /// Invoker name.
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// Custom parameters of the command.
        /// </summary>
        [Output("parameters")]
        public Output<string?> Parameters { get; private set; } = null!;

        /// <summary>
        /// Settings required for a recurring invoker.
        /// </summary>
        [Output("scheduleSettings")]
        public Output<Outputs.InvokerScheduleSettings?> ScheduleSettings { get; private set; } = null!;

        /// <summary>
        /// Invoker type. It can only be `SCHEDULE` (recurring invokers).
        /// </summary>
        [Output("type")]
        public Output<string> Type { get; private set; } = null!;

        /// <summary>
        /// Modification time.
        /// </summary>
        [Output("updatedTime")]
        public Output<string> UpdatedTime { get; private set; } = null!;

        /// <summary>
        /// The user who executes the command.
        /// </summary>
        [Output("username")]
        public Output<string?> Username { get; private set; } = null!;


        /// <summary>
        /// Create a Invoker resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public Invoker(string name, InvokerArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Tat/invoker:Invoker", name, args ?? new InvokerArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Invoker(string name, Input<string> id, InvokerState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Tat/invoker:Invoker", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/tencentcloudstack",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing Invoker resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static Invoker Get(string name, Input<string> id, InvokerState? state = null, CustomResourceOptions? options = null)
        {
            return new Invoker(name, id, state, options);
        }
    }

    public sealed class InvokerArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Remote command ID.
        /// </summary>
        [Input("commandId", required: true)]
        public Input<string> CommandId { get; set; } = null!;

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

        /// <summary>
        /// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
        /// </summary>
        public InputList<string> InstanceIds
        {
            get => _instanceIds ?? (_instanceIds = new InputList<string>());
            set => _instanceIds = value;
        }

        /// <summary>
        /// Invoker name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Custom parameters of the command.
        /// </summary>
        [Input("parameters")]
        public Input<string>? Parameters { get; set; }

        /// <summary>
        /// Settings required for a recurring invoker.
        /// </summary>
        [Input("scheduleSettings")]
        public Input<Inputs.InvokerScheduleSettingsArgs>? ScheduleSettings { get; set; }

        /// <summary>
        /// Invoker type. It can only be `SCHEDULE` (recurring invokers).
        /// </summary>
        [Input("type", required: true)]
        public Input<string> Type { get; set; } = null!;

        /// <summary>
        /// The user who executes the command.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

        public InvokerArgs()
        {
        }
    }

    public sealed class InvokerState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Remote command ID.
        /// </summary>
        [Input("commandId")]
        public Input<string>? CommandId { get; set; }

        /// <summary>
        /// Creation time.
        /// </summary>
        [Input("createdTime")]
        public Input<string>? CreatedTime { get; set; }

        /// <summary>
        /// Whether to enable the invoker.
        /// </summary>
        [Input("enable")]
        public Input<bool>? Enable { get; set; }

        [Input("instanceIds")]
        private InputList<string>? _instanceIds;

        /// <summary>
        /// ID of the instance bound to the trigger. Up to 100 IDs are allowed.
        /// </summary>
        public InputList<string> InstanceIds
        {
            get => _instanceIds ?? (_instanceIds = new InputList<string>());
            set => _instanceIds = value;
        }

        /// <summary>
        /// Invoker ID.
        /// </summary>
        [Input("invokerId")]
        public Input<string>? InvokerId { get; set; }

        /// <summary>
        /// Invoker name.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// Custom parameters of the command.
        /// </summary>
        [Input("parameters")]
        public Input<string>? Parameters { get; set; }

        /// <summary>
        /// Settings required for a recurring invoker.
        /// </summary>
        [Input("scheduleSettings")]
        public Input<Inputs.InvokerScheduleSettingsGetArgs>? ScheduleSettings { get; set; }

        /// <summary>
        /// Invoker type. It can only be `SCHEDULE` (recurring invokers).
        /// </summary>
        [Input("type")]
        public Input<string>? Type { get; set; }

        /// <summary>
        /// Modification time.
        /// </summary>
        [Input("updatedTime")]
        public Input<string>? UpdatedTime { get; set; }

        /// <summary>
        /// The user who executes the command.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

        public InvokerState()
        {
        }
    }
}
