// *** 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.AliCloud.FNF
{
    /// <summary>
    /// Provides a Serverless Workflow Schedule resource.
    /// 
    /// For information about Serverless Workflow Schedule and how to use it, see [What is Schedule](https://www.alibabacloud.com/help/en/doc-detail/168934.htm).
    /// 
    /// &gt; **NOTE:** Available in v1.105.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var exampleFlow = new AliCloud.FNF.Flow("exampleFlow", new()
    ///     {
    ///         Definition = @"  version: v1beta1
    ///   type: flow
    ///   steps:
    ///     - type: pass
    ///       name: helloworld
    /// ",
    ///         Description = "tf-testaccFnFFlow983041",
    ///         Type = "FDL",
    ///     });
    /// 
    ///     var exampleSchedule = new AliCloud.FNF.Schedule("exampleSchedule", new()
    ///     {
    ///         CronExpression = "30 9 * * * *",
    ///         Description = "tf-testaccFnFSchedule983041",
    ///         Enable = true,
    ///         FlowName = exampleFlow.Name,
    ///         Payload = "{\"tf-test\": \"test success\"}",
    ///         ScheduleName = "tf-testaccFnFSchedule983041",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// Serverless Workflow Schedule can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:fnf/schedule:Schedule example &lt;schedule_name&gt;:&lt;flow_name&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:fnf/schedule:Schedule")]
    public partial class Schedule : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The CRON expression of the time-based schedule to be created.
        /// </summary>
        [Output("cronExpression")]
        public Output<string> CronExpression { get; private set; } = null!;

        /// <summary>
        /// The description of the time-based schedule to be created.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        /// <summary>
        /// Specifies whether to enable the time-based schedule you want to create. Valid values: `false`, `true`.
        /// </summary>
        [Output("enable")]
        public Output<bool?> Enable { get; private set; } = null!;

        /// <summary>
        /// The name of the flow bound to the time-based schedule you want to create.
        /// </summary>
        [Output("flowName")]
        public Output<string> FlowName { get; private set; } = null!;

        /// <summary>
        /// The time when the time-based schedule was last updated.
        /// </summary>
        [Output("lastModifiedTime")]
        public Output<string> LastModifiedTime { get; private set; } = null!;

        /// <summary>
        /// The trigger message of the time-based schedule to be created. It must be in JSON object format.
        /// </summary>
        [Output("payload")]
        public Output<string?> Payload { get; private set; } = null!;

        /// <summary>
        /// The ID of the time-based schedule.
        /// </summary>
        [Output("scheduleId")]
        public Output<string> ScheduleId { get; private set; } = null!;

        /// <summary>
        /// The name of the time-based schedule to be created.
        /// </summary>
        [Output("scheduleName")]
        public Output<string> ScheduleName { get; private set; } = null!;


        /// <summary>
        /// Create a Schedule 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 Schedule(string name, ScheduleArgs args, CustomResourceOptions? options = null)
            : base("alicloud:fnf/schedule:Schedule", name, args ?? new ScheduleArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Schedule(string name, Input<string> id, ScheduleState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:fnf/schedule:Schedule", 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/rhysmdnz/pulumi-alicloud",
            };
            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 Schedule 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 Schedule Get(string name, Input<string> id, ScheduleState? state = null, CustomResourceOptions? options = null)
        {
            return new Schedule(name, id, state, options);
        }
    }

    public sealed class ScheduleArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The CRON expression of the time-based schedule to be created.
        /// </summary>
        [Input("cronExpression", required: true)]
        public Input<string> CronExpression { get; set; } = null!;

        /// <summary>
        /// The description of the time-based schedule to be created.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specifies whether to enable the time-based schedule you want to create. Valid values: `false`, `true`.
        /// </summary>
        [Input("enable")]
        public Input<bool>? Enable { get; set; }

        /// <summary>
        /// The name of the flow bound to the time-based schedule you want to create.
        /// </summary>
        [Input("flowName", required: true)]
        public Input<string> FlowName { get; set; } = null!;

        /// <summary>
        /// The trigger message of the time-based schedule to be created. It must be in JSON object format.
        /// </summary>
        [Input("payload")]
        public Input<string>? Payload { get; set; }

        /// <summary>
        /// The name of the time-based schedule to be created.
        /// </summary>
        [Input("scheduleName", required: true)]
        public Input<string> ScheduleName { get; set; } = null!;

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

    public sealed class ScheduleState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The CRON expression of the time-based schedule to be created.
        /// </summary>
        [Input("cronExpression")]
        public Input<string>? CronExpression { get; set; }

        /// <summary>
        /// The description of the time-based schedule to be created.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Specifies whether to enable the time-based schedule you want to create. Valid values: `false`, `true`.
        /// </summary>
        [Input("enable")]
        public Input<bool>? Enable { get; set; }

        /// <summary>
        /// The name of the flow bound to the time-based schedule you want to create.
        /// </summary>
        [Input("flowName")]
        public Input<string>? FlowName { get; set; }

        /// <summary>
        /// The time when the time-based schedule was last updated.
        /// </summary>
        [Input("lastModifiedTime")]
        public Input<string>? LastModifiedTime { get; set; }

        /// <summary>
        /// The trigger message of the time-based schedule to be created. It must be in JSON object format.
        /// </summary>
        [Input("payload")]
        public Input<string>? Payload { get; set; }

        /// <summary>
        /// The ID of the time-based schedule.
        /// </summary>
        [Input("scheduleId")]
        public Input<string>? ScheduleId { get; set; }

        /// <summary>
        /// The name of the time-based schedule to be created.
        /// </summary>
        [Input("scheduleName")]
        public Input<string>? ScheduleName { get; set; }

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