// *** 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.Airflow
{
    /// <summary>
    /// Provides an Airflow DAG.
    /// 
    /// &gt; Note this resource adpots an existing DAG and does not create a one, Also on delete the resource by default. A DAG is only deleted from state and not acutally deleted.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Airflow = Pulumi.Airflow;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new Airflow.Dag("example", new()
    ///     {
    ///         DagId = "example",
    ///         IsPaused = false,
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// DAGs can be imported using the DAG Id. terraform
    /// 
    /// ```sh
    ///  $ pulumi import airflow:index/dag:Dag default example
    /// ```
    /// </summary>
    [AirflowResourceType("airflow:index/dag:Dag")]
    public partial class Dag : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The ID of the DAG.
        /// </summary>
        [Output("dagId")]
        public Output<string> DagId { get; private set; } = null!;

        [Output("deleteDag")]
        public Output<bool?> DeleteDag { get; private set; } = null!;

        /// <summary>
        /// User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents.
        /// </summary>
        [Output("description")]
        public Output<string> Description { get; private set; } = null!;

        /// <summary>
        /// The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file.
        /// </summary>
        [Output("fileToken")]
        public Output<string> FileToken { get; private set; } = null!;

        /// <summary>
        /// The absolute path to the file.
        /// </summary>
        [Output("fileloc")]
        public Output<string> Fileloc { get; private set; } = null!;

        /// <summary>
        /// Whether the DAG is currently seen by the scheduler(s).
        /// </summary>
        [Output("isActive")]
        public Output<bool> IsActive { get; private set; } = null!;

        /// <summary>
        /// Whether the DAG is paused.
        /// </summary>
        [Output("isPaused")]
        public Output<bool> IsPaused { get; private set; } = null!;

        /// <summary>
        /// Whether the DAG is SubDAG.
        /// </summary>
        [Output("isSubdag")]
        public Output<bool> IsSubdag { get; private set; } = null!;

        /// <summary>
        /// If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null.
        /// </summary>
        [Output("rootDagId")]
        public Output<string> RootDagId { get; private set; } = null!;


        /// <summary>
        /// Create a Dag 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 Dag(string name, DagArgs args, CustomResourceOptions? options = null)
            : base("airflow:index/dag:Dag", name, args ?? new DagArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Dag(string name, Input<string> id, DagState? state = null, CustomResourceOptions? options = null)
            : base("airflow:index/dag:Dag", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
            };
            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 Dag 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 Dag Get(string name, Input<string> id, DagState? state = null, CustomResourceOptions? options = null)
        {
            return new Dag(name, id, state, options);
        }
    }

    public sealed class DagArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the DAG.
        /// </summary>
        [Input("dagId", required: true)]
        public Input<string> DagId { get; set; } = null!;

        [Input("deleteDag")]
        public Input<bool>? DeleteDag { get; set; }

        /// <summary>
        /// Whether the DAG is paused.
        /// </summary>
        [Input("isPaused", required: true)]
        public Input<bool> IsPaused { get; set; } = null!;

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

    public sealed class DagState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The ID of the DAG.
        /// </summary>
        [Input("dagId")]
        public Input<string>? DagId { get; set; }

        [Input("deleteDag")]
        public Input<bool>? DeleteDag { get; set; }

        /// <summary>
        /// User-provided DAG description, which can consist of several sentences or paragraphs that describe DAG contents.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// The key containing the encrypted path to the file. Encryption and decryption take place only on the server. This prevents the client from reading an non-DAG file.
        /// </summary>
        [Input("fileToken")]
        public Input<string>? FileToken { get; set; }

        /// <summary>
        /// The absolute path to the file.
        /// </summary>
        [Input("fileloc")]
        public Input<string>? Fileloc { get; set; }

        /// <summary>
        /// Whether the DAG is currently seen by the scheduler(s).
        /// </summary>
        [Input("isActive")]
        public Input<bool>? IsActive { get; set; }

        /// <summary>
        /// Whether the DAG is paused.
        /// </summary>
        [Input("isPaused")]
        public Input<bool>? IsPaused { get; set; }

        /// <summary>
        /// Whether the DAG is SubDAG.
        /// </summary>
        [Input("isSubdag")]
        public Input<bool>? IsSubdag { get; set; }

        /// <summary>
        /// If the DAG is SubDAG then it is the top level DAG identifier. Otherwise, null.
        /// </summary>
        [Input("rootDagId")]
        public Input<string>? RootDagId { get; set; }

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