<filename>sdk/dotnet/ProjectDeploymentTargetTrigger.cs// *** 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.Octopusdeploy
{
    /// <summary>
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using Octopusdeploy = PiersKarsenbarg.Octopusdeploy;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var example = new Octopusdeploy.ProjectDeploymentTargetTrigger("example", new()
    ///     {
    ///         EventCategories = new[]
    ///         {
    ///             "MachineUnhealthy",
    ///         },
    ///         ProjectId = "Projects-123",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import octopusdeploy:index/projectDeploymentTargetTrigger:ProjectDeploymentTargetTrigger [options] octopusdeploy_project_deployment_target_trigger.&lt;name&gt; &lt;project_deployment_target_trigger-id&gt;
    /// ```
    /// </summary>
    [OctopusdeployResourceType("octopusdeploy:index/projectDeploymentTargetTrigger:ProjectDeploymentTargetTrigger")]
    public partial class ProjectDeploymentTargetTrigger : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Apply environment id filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        [Output("environmentIds")]
        public Output<ImmutableArray<string>> EnvironmentIds { get; private set; } = null!;

        /// <summary>
        /// Apply event category filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        [Output("eventCategories")]
        public Output<ImmutableArray<string>> EventCategories { get; private set; } = null!;

        /// <summary>
        /// Apply event group filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        [Output("eventGroups")]
        public Output<ImmutableArray<string>> EventGroups { get; private set; } = null!;

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

        /// <summary>
        /// The ID of the project to attach the trigger.
        /// </summary>
        [Output("projectId")]
        public Output<string> ProjectId { get; private set; } = null!;

        /// <summary>
        /// Apply event role filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        [Output("roles")]
        public Output<ImmutableArray<string>> Roles { get; private set; } = null!;

        /// <summary>
        /// Enable to re-deploy to the deployment targets even if they are already up-to-date with the current deployment.
        /// </summary>
        [Output("shouldRedeploy")]
        public Output<bool?> ShouldRedeploy { get; private set; } = null!;


        /// <summary>
        /// Create a ProjectDeploymentTargetTrigger 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 ProjectDeploymentTargetTrigger(string name, ProjectDeploymentTargetTriggerArgs args, CustomResourceOptions? options = null)
            : base("octopusdeploy:index/projectDeploymentTargetTrigger:ProjectDeploymentTargetTrigger", name, args ?? new ProjectDeploymentTargetTriggerArgs(), MakeResourceOptions(options, ""))
        {
        }

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

    public sealed class ProjectDeploymentTargetTriggerArgs : global::Pulumi.ResourceArgs
    {
        [Input("environmentIds")]
        private InputList<string>? _environmentIds;

        /// <summary>
        /// Apply environment id filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EnvironmentIds
        {
            get => _environmentIds ?? (_environmentIds = new InputList<string>());
            set => _environmentIds = value;
        }

        [Input("eventCategories")]
        private InputList<string>? _eventCategories;

        /// <summary>
        /// Apply event category filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EventCategories
        {
            get => _eventCategories ?? (_eventCategories = new InputList<string>());
            set => _eventCategories = value;
        }

        [Input("eventGroups")]
        private InputList<string>? _eventGroups;

        /// <summary>
        /// Apply event group filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EventGroups
        {
            get => _eventGroups ?? (_eventGroups = new InputList<string>());
            set => _eventGroups = value;
        }

        /// <summary>
        /// The name of this resource.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The ID of the project to attach the trigger.
        /// </summary>
        [Input("projectId", required: true)]
        public Input<string> ProjectId { get; set; } = null!;

        [Input("roles")]
        private InputList<string>? _roles;

        /// <summary>
        /// Apply event role filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> Roles
        {
            get => _roles ?? (_roles = new InputList<string>());
            set => _roles = value;
        }

        /// <summary>
        /// Enable to re-deploy to the deployment targets even if they are already up-to-date with the current deployment.
        /// </summary>
        [Input("shouldRedeploy")]
        public Input<bool>? ShouldRedeploy { get; set; }

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

    public sealed class ProjectDeploymentTargetTriggerState : global::Pulumi.ResourceArgs
    {
        [Input("environmentIds")]
        private InputList<string>? _environmentIds;

        /// <summary>
        /// Apply environment id filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EnvironmentIds
        {
            get => _environmentIds ?? (_environmentIds = new InputList<string>());
            set => _environmentIds = value;
        }

        [Input("eventCategories")]
        private InputList<string>? _eventCategories;

        /// <summary>
        /// Apply event category filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EventCategories
        {
            get => _eventCategories ?? (_eventCategories = new InputList<string>());
            set => _eventCategories = value;
        }

        [Input("eventGroups")]
        private InputList<string>? _eventGroups;

        /// <summary>
        /// Apply event group filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> EventGroups
        {
            get => _eventGroups ?? (_eventGroups = new InputList<string>());
            set => _eventGroups = value;
        }

        /// <summary>
        /// The name of this resource.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

        /// <summary>
        /// The ID of the project to attach the trigger.
        /// </summary>
        [Input("projectId")]
        public Input<string>? ProjectId { get; set; }

        [Input("roles")]
        private InputList<string>? _roles;

        /// <summary>
        /// Apply event role filters to restrict which deployment targets will actually cause the trigger to fire, and consequently, which deployment targets will be automatically deployed to.
        /// </summary>
        public InputList<string> Roles
        {
            get => _roles ?? (_roles = new InputList<string>());
            set => _roles = value;
        }

        /// <summary>
        /// Enable to re-deploy to the deployment targets even if they are already up-to-date with the current deployment.
        /// </summary>
        [Input("shouldRedeploy")]
        public Input<bool>? ShouldRedeploy { get; set; }

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