// *** 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.Pts
{
    /// <summary>
    /// Provides a resource to create a pts cron_job
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using Pulumi;
    /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
    /// 
    /// class MyStack : Stack
    /// {
    ///     public MyStack()
    ///     {
    ///         var cronJob = new Tencentcloud.Pts.CronJob("cronJob", new Tencentcloud.Pts.CronJobArgs
    ///         {
    ///             CronExpression = "* 1 * * *",
    ///             FrequencyType = 2,
    ///             JobOwner = "userName",
    ///             Note = "desc",
    ///             NoticeId = "notice-vp6i38jt",
    ///             ProjectId = "project-7qkzxhea",
    ///             ScenarioId = "scenario-c22lqb1w",
    ///             ScenarioName = "pts-js(2022-11-10 21:53:53)",
    ///         });
    ///     }
    /// 
    /// }
    /// ```
    /// 
    /// ## Import
    /// 
    /// pts cron_job can be imported using the projectId#cronJobId, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import tencentcloud:Pts/cronJob:CronJob cron_job project-7qkzxhea#scenario-c22lqb1w
    /// ```
    /// </summary>
    [TencentcloudResourceType("tencentcloud:Pts/cronJob:CronJob")]
    public partial class CronJob : Pulumi.CustomResource
    {
        /// <summary>
        /// Reason for suspension.
        /// </summary>
        [Output("abortReason")]
        public Output<int> AbortReason { get; private set; } = null!;

        /// <summary>
        /// App ID.
        /// </summary>
        [Output("appId")]
        public Output<int> AppId { get; private set; } = null!;

        /// <summary>
        /// Creation time; type: Timestamp ISO8601.
        /// </summary>
        [Output("createdAt")]
        public Output<string> CreatedAt { get; private set; } = null!;

        /// <summary>
        /// Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
        /// </summary>
        [Output("cronExpression")]
        public Output<string> CronExpression { get; private set; } = null!;

        /// <summary>
        /// End Time; type: Timestamp ISO8601.
        /// </summary>
        [Output("endTime")]
        public Output<string?> EndTime { get; private set; } = null!;

        /// <summary>
        /// Execution frequency type, `1`: execute only once; `2`: daily granularity; `3`: weekly granularity; `4`: advanced.
        /// </summary>
        [Output("frequencyType")]
        public Output<int> FrequencyType { get; private set; } = null!;

        /// <summary>
        /// Job Owner.
        /// </summary>
        [Output("jobOwner")]
        public Output<string> JobOwner { get; private set; } = null!;

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

        /// <summary>
        /// Note.
        /// </summary>
        [Output("note")]
        public Output<string?> Note { get; private set; } = null!;

        /// <summary>
        /// Notice ID.
        /// </summary>
        [Output("noticeId")]
        public Output<string?> NoticeId { get; private set; } = null!;

        /// <summary>
        /// Project Id.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// Scenario Id.
        /// </summary>
        [Output("scenarioId")]
        public Output<string> ScenarioId { get; private set; } = null!;

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

        /// <summary>
        /// Scheduled task status.
        /// </summary>
        [Output("status")]
        public Output<int> Status { get; private set; } = null!;

        /// <summary>
        /// Sub-user ID.
        /// </summary>
        [Output("subAccountUin")]
        public Output<string> SubAccountUin { get; private set; } = null!;

        /// <summary>
        /// User ID.
        /// </summary>
        [Output("uin")]
        public Output<string> Uin { get; private set; } = null!;

        /// <summary>
        /// Update time; type: Timestamp ISO8601.
        /// </summary>
        [Output("updatedAt")]
        public Output<string> UpdatedAt { get; private set; } = null!;


        /// <summary>
        /// Create a CronJob 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 CronJob(string name, CronJobArgs args, CustomResourceOptions? options = null)
            : base("tencentcloud:Pts/cronJob:CronJob", name, args ?? new CronJobArgs(), MakeResourceOptions(options, ""))
        {
        }

        private CronJob(string name, Input<string> id, CronJobState? state = null, CustomResourceOptions? options = null)
            : base("tencentcloud:Pts/cronJob:CronJob", 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 CronJob 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 CronJob Get(string name, Input<string> id, CronJobState? state = null, CustomResourceOptions? options = null)
        {
            return new CronJob(name, id, state, options);
        }
    }

    public sealed class CronJobArgs : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
        /// </summary>
        [Input("cronExpression", required: true)]
        public Input<string> CronExpression { get; set; } = null!;

        /// <summary>
        /// End Time; type: Timestamp ISO8601.
        /// </summary>
        [Input("endTime")]
        public Input<string>? EndTime { get; set; }

        /// <summary>
        /// Execution frequency type, `1`: execute only once; `2`: daily granularity; `3`: weekly granularity; `4`: advanced.
        /// </summary>
        [Input("frequencyType", required: true)]
        public Input<int> FrequencyType { get; set; } = null!;

        /// <summary>
        /// Job Owner.
        /// </summary>
        [Input("jobOwner", required: true)]
        public Input<string> JobOwner { get; set; } = null!;

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

        /// <summary>
        /// Note.
        /// </summary>
        [Input("note")]
        public Input<string>? Note { get; set; }

        /// <summary>
        /// Notice ID.
        /// </summary>
        [Input("noticeId")]
        public Input<string>? NoticeId { get; set; }

        /// <summary>
        /// Project Id.
        /// </summary>
        [Input("projectId", required: true)]
        public Input<string> ProjectId { get; set; } = null!;

        /// <summary>
        /// Scenario Id.
        /// </summary>
        [Input("scenarioId", required: true)]
        public Input<string> ScenarioId { get; set; } = null!;

        /// <summary>
        /// Scenario Name.
        /// </summary>
        [Input("scenarioName", required: true)]
        public Input<string> ScenarioName { get; set; } = null!;

        public CronJobArgs()
        {
        }
    }

    public sealed class CronJobState : Pulumi.ResourceArgs
    {
        /// <summary>
        /// Reason for suspension.
        /// </summary>
        [Input("abortReason")]
        public Input<int>? AbortReason { get; set; }

        /// <summary>
        /// App ID.
        /// </summary>
        [Input("appId")]
        public Input<int>? AppId { get; set; }

        /// <summary>
        /// Creation time; type: Timestamp ISO8601.
        /// </summary>
        [Input("createdAt")]
        public Input<string>? CreatedAt { get; set; }

        /// <summary>
        /// Cron expression, When setting cron_expression at that time, frequency_type must be greater than 1.
        /// </summary>
        [Input("cronExpression")]
        public Input<string>? CronExpression { get; set; }

        /// <summary>
        /// End Time; type: Timestamp ISO8601.
        /// </summary>
        [Input("endTime")]
        public Input<string>? EndTime { get; set; }

        /// <summary>
        /// Execution frequency type, `1`: execute only once; `2`: daily granularity; `3`: weekly granularity; `4`: advanced.
        /// </summary>
        [Input("frequencyType")]
        public Input<int>? FrequencyType { get; set; }

        /// <summary>
        /// Job Owner.
        /// </summary>
        [Input("jobOwner")]
        public Input<string>? JobOwner { get; set; }

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

        /// <summary>
        /// Note.
        /// </summary>
        [Input("note")]
        public Input<string>? Note { get; set; }

        /// <summary>
        /// Notice ID.
        /// </summary>
        [Input("noticeId")]
        public Input<string>? NoticeId { get; set; }

        /// <summary>
        /// Project Id.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// Scenario Id.
        /// </summary>
        [Input("scenarioId")]
        public Input<string>? ScenarioId { get; set; }

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

        /// <summary>
        /// Scheduled task status.
        /// </summary>
        [Input("status")]
        public Input<int>? Status { get; set; }

        /// <summary>
        /// Sub-user ID.
        /// </summary>
        [Input("subAccountUin")]
        public Input<string>? SubAccountUin { get; set; }

        /// <summary>
        /// User ID.
        /// </summary>
        [Input("uin")]
        public Input<string>? Uin { get; set; }

        /// <summary>
        /// Update time; type: Timestamp ISO8601.
        /// </summary>
        [Input("updatedAt")]
        public Input<string>? UpdatedAt { get; set; }

        public CronJobState()
        {
        }
    }
}
