<reponame>pierskarsenbarg/pulumi-codefresh// *** 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 PiersKarsenbarg.Codefresh
{
    /// <summary>
    /// ## # Pipeline Resource
    /// 
    /// The central component of the Codefresh Platform. Pipelines are workflows that contain individual steps. Each step is responsible for a specific action in the process.
    /// See the [documentation](https://codefresh.io/docs/docs/configure-ci-cd-pipeline/introduction-to-codefresh-pipelines/) for the details.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Codefresh = PiersKarsenbarg.Codefresh;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var testProject = new Codefresh.Project("testProject");
    /// 
    ///     var testPipeline = new Codefresh.Pipeline("testPipeline", new()
    ///     {
    ///         Tags = new[]
    ///         {
    ///             "production",
    ///             "docker",
    ///         },
    ///         Spec = new Codefresh.Inputs.PipelineSpecArgs
    ///         {
    ///             Concurrency = 1,
    ///             BranchConcurrency = 1,
    ///             TriggerConcurrency = 1,
    ///             Priority = 5,
    ///             SpecTemplates = new[]
    ///             {
    ///                 new Codefresh.Inputs.PipelineSpecSpecTemplateArgs
    ///                 {
    ///                     Repo = "codefresh-contrib/react-sample-app",
    ///                     Path = "./codefresh.yml",
    ///                     Revision = "master",
    ///                     Context = "git",
    ///                 },
    ///             },
    ///             Contexts = new[]
    ///             {
    ///                 "context1-name",
    ///                 "context2-name",
    ///             },
    ///             Triggers = new[]
    ///             {
    ///                 new Codefresh.Inputs.PipelineSpecTriggerArgs
    ///                 {
    ///                     BranchRegex = "/.*/gi",
    ///                     Context = "git",
    ///                     Description = "Trigger for commits",
    ///                     Disabled = false,
    ///                     Events = new[]
    ///                     {
    ///                         "push.heads",
    ///                     },
    ///                     ModifiedFilesGlob = "",
    ///                     Name = "commits",
    ///                     Provider = "github",
    ///                     Repo = "codefresh-contrib/react-sample-app",
    ///                     Type = "git",
    ///                 },
    ///                 new Codefresh.Inputs.PipelineSpecTriggerArgs
    ///                 {
    ///                     BranchRegex = "/.*/gi",
    ///                     Context = "git",
    ///                     Description = "Trigger for tags",
    ///                     Disabled = false,
    ///                     Events = new[]
    ///                     {
    ///                         "push.tags",
    ///                     },
    ///                     ModifiedFilesGlob = "",
    ///                     CommitStatusTitle = "tags-trigger",
    ///                     Name = "tags",
    ///                     Provider = "github",
    ///                     Repo = "codefresh-contrib/react-sample-app",
    ///                     Type = "git",
    ///                 },
    ///             },
    ///             Variables = 
    ///             {
    ///                 { "MY_PIP_VAR", "value" },
    ///                 { "ANOTHER_PIP_VAR", "another_value" },
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import codefresh:index/pipeline:Pipeline test xxxxxxxxxxxxxxxxxxx
    /// ```
    /// </summary>
    [CodefreshResourceType("codefresh:index/pipeline:Pipeline")]
    public partial class Pipeline : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Boolean that specifies if the build logs are publicly accessible. Default: false
        /// </summary>
        [Output("isPublic")]
        public Output<bool?> IsPublic { get; private set; } = null!;

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

        /// <summary>
        /// A string with original yaml pipeline.
        /// - `original_yaml_string = "version: \"1.0\"\nsteps:\n  test:\n    image: alpine:latest\n    commands:\n      - echo \"ACC tests\""`
        /// - or `original_yaml_string = file("/path/to/my/codefresh.yml")`
        /// </summary>
        [Output("originalYamlString")]
        public Output<string?> OriginalYamlString { get; private set; } = null!;

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

        /// <summary>
        /// The pipeline's revision. Should be added to the **lifecycle/ignore_changes** or incremented mannually each update.
        /// </summary>
        [Output("revision")]
        public Output<int> Revision { get; private set; } = null!;

        /// <summary>
        /// A collection of `spec` blocks as documented below.
        /// </summary>
        [Output("spec")]
        public Output<Outputs.PipelineSpec?> Spec { get; private set; } = null!;

        /// <summary>
        /// A list of tags to mark a project for easy management and access control.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableArray<string>> Tags { get; private set; } = null!;


        /// <summary>
        /// Create a Pipeline 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 Pipeline(string name, PipelineArgs? args = null, CustomResourceOptions? options = null)
            : base("codefresh:index/pipeline:Pipeline", name, args ?? new PipelineArgs(), MakeResourceOptions(options, ""))
        {
        }

        private Pipeline(string name, Input<string> id, PipelineState? state = null, CustomResourceOptions? options = null)
            : base("codefresh:index/pipeline:Pipeline", 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 Pipeline 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 Pipeline Get(string name, Input<string> id, PipelineState? state = null, CustomResourceOptions? options = null)
        {
            return new Pipeline(name, id, state, options);
        }
    }

    public sealed class PipelineArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Boolean that specifies if the build logs are publicly accessible. Default: false
        /// </summary>
        [Input("isPublic")]
        public Input<bool>? IsPublic { get; set; }

        /// <summary>
        /// The display name for the pipeline.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// A string with original yaml pipeline.
        /// - `original_yaml_string = "version: \"1.0\"\nsteps:\n  test:\n    image: alpine:latest\n    commands:\n      - echo \"ACC tests\""`
        /// - or `original_yaml_string = file("/path/to/my/codefresh.yml")`
        /// </summary>
        [Input("originalYamlString")]
        public Input<string>? OriginalYamlString { get; set; }

        /// <summary>
        /// A collection of `spec` blocks as documented below.
        /// </summary>
        [Input("spec")]
        public Input<Inputs.PipelineSpecArgs>? Spec { get; set; }

        [Input("tags")]
        private InputList<string>? _tags;

        /// <summary>
        /// A list of tags to mark a project for easy management and access control.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

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

    public sealed class PipelineState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Boolean that specifies if the build logs are publicly accessible. Default: false
        /// </summary>
        [Input("isPublic")]
        public Input<bool>? IsPublic { get; set; }

        /// <summary>
        /// The display name for the pipeline.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// A string with original yaml pipeline.
        /// - `original_yaml_string = "version: \"1.0\"\nsteps:\n  test:\n    image: alpine:latest\n    commands:\n      - echo \"ACC tests\""`
        /// - or `original_yaml_string = file("/path/to/my/codefresh.yml")`
        /// </summary>
        [Input("originalYamlString")]
        public Input<string>? OriginalYamlString { get; set; }

        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        /// <summary>
        /// The pipeline's revision. Should be added to the **lifecycle/ignore_changes** or incremented mannually each update.
        /// </summary>
        [Input("revision")]
        public Input<int>? Revision { get; set; }

        /// <summary>
        /// A collection of `spec` blocks as documented below.
        /// </summary>
        [Input("spec")]
        public Input<Inputs.PipelineSpecGetArgs>? Spec { get; set; }

        [Input("tags")]
        private InputList<string>? _tags;

        /// <summary>
        /// A list of tags to mark a project for easy management and access control.
        /// </summary>
        public InputList<string> Tags
        {
            get => _tags ?? (_tags = new InputList<string>());
            set => _tags = value;
        }

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