// *** 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>
    /// ## # Step-types Resource
    /// 
    /// The Step-types resource allows to create your own typed step and manage all it's published versions.
    /// The resource allows to handle the life-cycle of the version by allowing specifying multiple blocks `version` where the user provides a version number and the yaml file representing the plugin.
    /// More about custom steps in the [official documentation](https://codefresh.io/docs/docs/codefresh-yaml/steps/#creating-a-typed-codefresh-plugin).
    /// 
    /// ## Known limitations and disclaimers
    /// 
    /// ### Version and name in yaml Metadata are ignored.
    /// The version and name of the step declared in the yaml files are superseeded by the attributes specified at resource level:
    /// - `name` : at top level
    /// - `version_numer`: specified in the `version` block
    ///   The above are added/replaced at runtime time.
    /// 
    /// ### Number of API requests
    /// This resource makes a lot of additional API calls to validate the steps and retrieve all the version available.
    /// Caution is recommended on the amount of versions maintained and the number of resources defined in a single project.
    /// </summary>
    [CodefreshResourceType("codefresh:index/stepTypes:StepTypes")]
    public partial class StepTypes : global::Pulumi.CustomResource
    {
        /// <summary>
        /// The name for the step-type
        /// </summary>
        [Output("name")]
        public Output<string> Name { get; private set; } = null!;

        /// <summary>
        /// A collection of `version` blocks as documented below.
        /// </summary>
        [Output("versions")]
        public Output<ImmutableArray<Outputs.StepTypesVersion>> Versions { get; private set; } = null!;


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

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

    public sealed class StepTypesArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name for the step-type
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("versions", required: true)]
        private InputList<Inputs.StepTypesVersionArgs>? _versions;

        /// <summary>
        /// A collection of `version` blocks as documented below.
        /// </summary>
        public InputList<Inputs.StepTypesVersionArgs> Versions
        {
            get => _versions ?? (_versions = new InputList<Inputs.StepTypesVersionArgs>());
            set => _versions = value;
        }

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

    public sealed class StepTypesState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// The name for the step-type
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        [Input("versions")]
        private InputList<Inputs.StepTypesVersionGetArgs>? _versions;

        /// <summary>
        /// A collection of `version` blocks as documented below.
        /// </summary>
        public InputList<Inputs.StepTypesVersionGetArgs> Versions
        {
            get => _versions ?? (_versions = new InputList<Inputs.StepTypesVersionGetArgs>());
            set => _versions = value;
        }

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