// *** 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>
    /// This resource manages user roles in Octopus Deploy.
    /// 
    /// ## 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.UserRole("example", new()
    ///     {
    ///         CanBeDeleted = true,
    ///         Description = "Responsible for all development-related operations.",
    ///         GrantedSpacePermissions = new[]
    ///         {
    ///             "DeploymentCreate",
    ///             "DeploymentDelete",
    ///             "DeploymentView",
    ///         },
    ///         GrantedSystemPermissions = new[]
    ///         {
    ///             "SpaceCreate",
    ///         },
    ///         SpacePermissionDescriptions = new[]
    ///         {
    ///             "Delete deployments (restrictable to Environments, Projects, Tenants)",
    ///             "Deploy releases to target environments (restrictable to Environments, Projects, Tenants)",
    ///             "View deployments (restrictable to Environments, Projects, Tenants)",
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// ```sh
    ///  $ pulumi import octopusdeploy:index/userRole:UserRole [options] octopusdeploy_user_role.&lt;name&gt; &lt;user-role-id&gt;
    /// ```
    /// </summary>
    [OctopusdeployResourceType("octopusdeploy:index/userRole:UserRole")]
    public partial class UserRole : global::Pulumi.CustomResource
    {
        [Output("canBeDeleted")]
        public Output<bool> CanBeDeleted { get; private set; } = null!;

        /// <summary>
        /// The description of this user role.
        /// </summary>
        [Output("description")]
        public Output<string?> Description { get; private set; } = null!;

        [Output("grantedSpacePermissions")]
        public Output<ImmutableArray<string>> GrantedSpacePermissions { get; private set; } = null!;

        [Output("grantedSystemPermissions")]
        public Output<ImmutableArray<string>> GrantedSystemPermissions { get; private set; } = null!;

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

        [Output("spacePermissionDescriptions")]
        public Output<ImmutableArray<string>> SpacePermissionDescriptions { get; private set; } = null!;

        [Output("supportedRestrictions")]
        public Output<ImmutableArray<string>> SupportedRestrictions { get; private set; } = null!;

        [Output("systemPermissionDescriptions")]
        public Output<ImmutableArray<string>> SystemPermissionDescriptions { get; private set; } = null!;


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

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

    public sealed class UserRoleArgs : global::Pulumi.ResourceArgs
    {
        [Input("canBeDeleted")]
        public Input<bool>? CanBeDeleted { get; set; }

        /// <summary>
        /// The description of this user role.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("grantedSpacePermissions")]
        private InputList<string>? _grantedSpacePermissions;
        public InputList<string> GrantedSpacePermissions
        {
            get => _grantedSpacePermissions ?? (_grantedSpacePermissions = new InputList<string>());
            set => _grantedSpacePermissions = value;
        }

        [Input("grantedSystemPermissions")]
        private InputList<string>? _grantedSystemPermissions;
        public InputList<string> GrantedSystemPermissions
        {
            get => _grantedSystemPermissions ?? (_grantedSystemPermissions = new InputList<string>());
            set => _grantedSystemPermissions = value;
        }

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

        [Input("spacePermissionDescriptions")]
        private InputList<string>? _spacePermissionDescriptions;
        public InputList<string> SpacePermissionDescriptions
        {
            get => _spacePermissionDescriptions ?? (_spacePermissionDescriptions = new InputList<string>());
            set => _spacePermissionDescriptions = value;
        }

        [Input("supportedRestrictions")]
        private InputList<string>? _supportedRestrictions;
        public InputList<string> SupportedRestrictions
        {
            get => _supportedRestrictions ?? (_supportedRestrictions = new InputList<string>());
            set => _supportedRestrictions = value;
        }

        [Input("systemPermissionDescriptions")]
        private InputList<string>? _systemPermissionDescriptions;
        public InputList<string> SystemPermissionDescriptions
        {
            get => _systemPermissionDescriptions ?? (_systemPermissionDescriptions = new InputList<string>());
            set => _systemPermissionDescriptions = value;
        }

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

    public sealed class UserRoleState : global::Pulumi.ResourceArgs
    {
        [Input("canBeDeleted")]
        public Input<bool>? CanBeDeleted { get; set; }

        /// <summary>
        /// The description of this user role.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        [Input("grantedSpacePermissions")]
        private InputList<string>? _grantedSpacePermissions;
        public InputList<string> GrantedSpacePermissions
        {
            get => _grantedSpacePermissions ?? (_grantedSpacePermissions = new InputList<string>());
            set => _grantedSpacePermissions = value;
        }

        [Input("grantedSystemPermissions")]
        private InputList<string>? _grantedSystemPermissions;
        public InputList<string> GrantedSystemPermissions
        {
            get => _grantedSystemPermissions ?? (_grantedSystemPermissions = new InputList<string>());
            set => _grantedSystemPermissions = value;
        }

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

        [Input("spacePermissionDescriptions")]
        private InputList<string>? _spacePermissionDescriptions;
        public InputList<string> SpacePermissionDescriptions
        {
            get => _spacePermissionDescriptions ?? (_spacePermissionDescriptions = new InputList<string>());
            set => _spacePermissionDescriptions = value;
        }

        [Input("supportedRestrictions")]
        private InputList<string>? _supportedRestrictions;
        public InputList<string> SupportedRestrictions
        {
            get => _supportedRestrictions ?? (_supportedRestrictions = new InputList<string>());
            set => _supportedRestrictions = value;
        }

        [Input("systemPermissionDescriptions")]
        private InputList<string>? _systemPermissionDescriptions;
        public InputList<string> SystemPermissionDescriptions
        {
            get => _systemPermissionDescriptions ?? (_systemPermissionDescriptions = new InputList<string>());
            set => _systemPermissionDescriptions = value;
        }

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