<filename>sdk/dotnet/Zia/AdminUsers/AdminUsers.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 zscaler.PulumiPackage.Zia.AdminUsers
{
    /// <summary>
    /// The **zia_admin_users** resource allows the creation and management of ZIA admin user account created in the Zscaler Internet Access cloud or via the API.
    /// 
    /// ## Example Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using Pulumi;
    /// using Zia = Pulumi.Zia;
    /// using Zia = zscaler.PulumiPackage.Zia;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var superAdmin = Zia.AdminRoles.GetAdminRoles.Invoke(new()
    ///     {
    ///         Name = "Super Admin",
    ///     });
    /// 
    ///     var engineering = Zia.Departments.GetDepartmentManagement.Invoke(new()
    ///     {
    ///         Name = "Engineering",
    ///     });
    /// 
    ///     var johnSmith = new Zia.AdminUsers.AdminUsers("johnSmith", new()
    ///     {
    ///         LoginName = "nnheo@example.com",
    ///         UserName = "John Smith",
    ///         Email = "nnheo@example.com",
    ///         IsPasswordLoginAllowed = true,
    ///         Password = "AeQ9E5w8B$",
    ///         IsSecurityReportCommEnabled = true,
    ///         IsServiceUpdateCommEnabled = true,
    ///         IsProductUpdateCommEnabled = true,
    ///         Comments = "Administrator User",
    ///         Roles = new[]
    ///         {
    ///             new Zia.AdminUsers.Inputs.AdminUsersRoleArgs
    ///             {
    ///                 Id = superAdmin.Apply(getAdminRolesResult =&gt; getAdminRolesResult.Id),
    ///             },
    ///         },
    ///         AdminScopes = new[]
    ///         {
    ///             new Zia.AdminUsers.Inputs.AdminUsersAdminScopeArgs
    ///             {
    ///                 Type = "DEPARTMENT",
    ///                 ScopeEntities = new Zia.AdminUsers.Inputs.AdminUsersAdminScopeScopeEntitiesArgs
    ///                 {
    ///                     Ids = new[]
    ///                     {
    ///                         engineering.Apply(getDepartmentManagementResult =&gt; getDepartmentManagementResult.Id),
    ///                     },
    ///                 },
    ///             },
    ///         },
    ///     });
    /// 
    /// });
    /// ```
    /// </summary>
    [ZiaResourceType("zia:AdminUsers/adminUsers:AdminUsers")]
    public partial class AdminUsers : global::Pulumi.CustomResource
    {
        [Output("adminId")]
        public Output<int> AdminId { get; private set; } = null!;

        /// <summary>
        /// The admin's scope. A scope is required for admins, but not applicable to auditors. This attribute is subject to change.
        /// </summary>
        [Output("adminScopes")]
        public Output<ImmutableArray<Outputs.AdminUsersAdminScope>> AdminScopes { get; private set; } = null!;

        /// <summary>
        /// Additional information about the admin or auditor.
        /// </summary>
        [Output("comments")]
        public Output<string?> Comments { get; private set; } = null!;

        /// <summary>
        /// Indicates whether or not the admin account is disabled.
        /// </summary>
        [Output("disabled")]
        public Output<bool> Disabled { get; private set; } = null!;

        /// <summary>
        /// Admin or auditor's email address.
        /// </summary>
        [Output("email")]
        public Output<string> Email { get; private set; } = null!;

        /// <summary>
        /// Indicates whether the user is an auditor. This attribute is subject to change.
        /// </summary>
        [Output("isAuditor")]
        public Output<bool> IsAuditor { get; private set; } = null!;

        /// <summary>
        /// Indicates whether or not Executive Insights App access is enabled for the admin.
        /// </summary>
        [Output("isExecMobileAppEnabled")]
        public Output<bool> IsExecMobileAppEnabled { get; private set; } = null!;

        /// <summary>
        /// Indicates whether or not the admin can be edited or deleted.
        /// </summary>
        [Output("isNonEditable")]
        public Output<bool> IsNonEditable { get; private set; } = null!;

        /// <summary>
        /// Indicates whether or not an admin's password has expired.
        /// </summary>
        [Output("isPasswordExpired")]
        public Output<bool> IsPasswordExpired { get; private set; } = null!;

        /// <summary>
        /// The default is true when SAML Authentication is disabled. When SAML Authentication is enabled, this can be set to false in order to force the admin to login via SSO only.
        /// </summary>
        [Output("isPasswordLoginAllowed")]
        public Output<bool> IsPasswordLoginAllowed { get; private set; } = null!;

        /// <summary>
        /// Communication setting for Product Update.
        /// </summary>
        [Output("isProductUpdateCommEnabled")]
        public Output<bool> IsProductUpdateCommEnabled { get; private set; } = null!;

        /// <summary>
        /// Communication for Security Report is enabled.
        /// </summary>
        [Output("isSecurityReportCommEnabled")]
        public Output<bool> IsSecurityReportCommEnabled { get; private set; } = null!;

        /// <summary>
        /// Communication setting for Service Update.
        /// </summary>
        [Output("isServiceUpdateCommEnabled")]
        public Output<bool> IsServiceUpdateCommEnabled { get; private set; } = null!;

        /// <summary>
        /// The email address of the admin user to be exported.
        /// </summary>
        [Output("loginName")]
        public Output<string> LoginName { get; private set; } = null!;

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        [Output("password")]
        public Output<string?> Password { get; private set; } = null!;

        /// <summary>
        /// Role of the admin. This is not required for an auditor.
        /// </summary>
        [Output("roles")]
        public Output<ImmutableArray<Outputs.AdminUsersRole>> Roles { get; private set; } = null!;

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        [Output("username")]
        public Output<string> Username { get; private set; } = null!;


        /// <summary>
        /// Create a AdminUsers 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 AdminUsers(string name, AdminUsersArgs args, CustomResourceOptions? options = null)
            : base("zia:AdminUsers/adminUsers:AdminUsers", name, args ?? new AdminUsersArgs(), MakeResourceOptions(options, ""))
        {
        }

        private AdminUsers(string name, Input<string> id, AdminUsersState? state = null, CustomResourceOptions? options = null)
            : base("zia:AdminUsers/adminUsers:AdminUsers", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/zscaler",
                AdditionalSecretOutputs =
                {
                    "password",
                },
            };
            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 AdminUsers 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 AdminUsers Get(string name, Input<string> id, AdminUsersState? state = null, CustomResourceOptions? options = null)
        {
            return new AdminUsers(name, id, state, options);
        }
    }

    public sealed class AdminUsersArgs : global::Pulumi.ResourceArgs
    {
        [Input("adminScopes")]
        private InputList<Inputs.AdminUsersAdminScopeArgs>? _adminScopes;

        /// <summary>
        /// The admin's scope. A scope is required for admins, but not applicable to auditors. This attribute is subject to change.
        /// </summary>
        public InputList<Inputs.AdminUsersAdminScopeArgs> AdminScopes
        {
            get => _adminScopes ?? (_adminScopes = new InputList<Inputs.AdminUsersAdminScopeArgs>());
            set => _adminScopes = value;
        }

        /// <summary>
        /// Additional information about the admin or auditor.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        /// <summary>
        /// Indicates whether or not the admin account is disabled.
        /// </summary>
        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// Admin or auditor's email address.
        /// </summary>
        [Input("email", required: true)]
        public Input<string> Email { get; set; } = null!;

        /// <summary>
        /// Indicates whether the user is an auditor. This attribute is subject to change.
        /// </summary>
        [Input("isAuditor")]
        public Input<bool>? IsAuditor { get; set; }

        /// <summary>
        /// Indicates whether or not Executive Insights App access is enabled for the admin.
        /// </summary>
        [Input("isExecMobileAppEnabled")]
        public Input<bool>? IsExecMobileAppEnabled { get; set; }

        /// <summary>
        /// Indicates whether or not the admin can be edited or deleted.
        /// </summary>
        [Input("isNonEditable")]
        public Input<bool>? IsNonEditable { get; set; }

        /// <summary>
        /// Indicates whether or not an admin's password has expired.
        /// </summary>
        [Input("isPasswordExpired")]
        public Input<bool>? IsPasswordExpired { get; set; }

        /// <summary>
        /// The default is true when SAML Authentication is disabled. When SAML Authentication is enabled, this can be set to false in order to force the admin to login via SSO only.
        /// </summary>
        [Input("isPasswordLoginAllowed")]
        public Input<bool>? IsPasswordLoginAllowed { get; set; }

        /// <summary>
        /// Communication setting for Product Update.
        /// </summary>
        [Input("isProductUpdateCommEnabled")]
        public Input<bool>? IsProductUpdateCommEnabled { get; set; }

        /// <summary>
        /// Communication for Security Report is enabled.
        /// </summary>
        [Input("isSecurityReportCommEnabled")]
        public Input<bool>? IsSecurityReportCommEnabled { get; set; }

        /// <summary>
        /// Communication setting for Service Update.
        /// </summary>
        [Input("isServiceUpdateCommEnabled")]
        public Input<bool>? IsServiceUpdateCommEnabled { get; set; }

        /// <summary>
        /// The email address of the admin user to be exported.
        /// </summary>
        [Input("loginName", required: true)]
        public Input<string> LoginName { get; set; } = null!;

        [Input("password")]
        private Input<string>? _password;

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        public Input<string>? Password
        {
            get => _password;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        [Input("roles")]
        private InputList<Inputs.AdminUsersRoleArgs>? _roles;

        /// <summary>
        /// Role of the admin. This is not required for an auditor.
        /// </summary>
        public InputList<Inputs.AdminUsersRoleArgs> Roles
        {
            get => _roles ?? (_roles = new InputList<Inputs.AdminUsersRoleArgs>());
            set => _roles = value;
        }

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        [Input("username", required: true)]
        public Input<string> Username { get; set; } = null!;

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

    public sealed class AdminUsersState : global::Pulumi.ResourceArgs
    {
        [Input("adminId")]
        public Input<int>? AdminId { get; set; }

        [Input("adminScopes")]
        private InputList<Inputs.AdminUsersAdminScopeGetArgs>? _adminScopes;

        /// <summary>
        /// The admin's scope. A scope is required for admins, but not applicable to auditors. This attribute is subject to change.
        /// </summary>
        public InputList<Inputs.AdminUsersAdminScopeGetArgs> AdminScopes
        {
            get => _adminScopes ?? (_adminScopes = new InputList<Inputs.AdminUsersAdminScopeGetArgs>());
            set => _adminScopes = value;
        }

        /// <summary>
        /// Additional information about the admin or auditor.
        /// </summary>
        [Input("comments")]
        public Input<string>? Comments { get; set; }

        /// <summary>
        /// Indicates whether or not the admin account is disabled.
        /// </summary>
        [Input("disabled")]
        public Input<bool>? Disabled { get; set; }

        /// <summary>
        /// Admin or auditor's email address.
        /// </summary>
        [Input("email")]
        public Input<string>? Email { get; set; }

        /// <summary>
        /// Indicates whether the user is an auditor. This attribute is subject to change.
        /// </summary>
        [Input("isAuditor")]
        public Input<bool>? IsAuditor { get; set; }

        /// <summary>
        /// Indicates whether or not Executive Insights App access is enabled for the admin.
        /// </summary>
        [Input("isExecMobileAppEnabled")]
        public Input<bool>? IsExecMobileAppEnabled { get; set; }

        /// <summary>
        /// Indicates whether or not the admin can be edited or deleted.
        /// </summary>
        [Input("isNonEditable")]
        public Input<bool>? IsNonEditable { get; set; }

        /// <summary>
        /// Indicates whether or not an admin's password has expired.
        /// </summary>
        [Input("isPasswordExpired")]
        public Input<bool>? IsPasswordExpired { get; set; }

        /// <summary>
        /// The default is true when SAML Authentication is disabled. When SAML Authentication is enabled, this can be set to false in order to force the admin to login via SSO only.
        /// </summary>
        [Input("isPasswordLoginAllowed")]
        public Input<bool>? IsPasswordLoginAllowed { get; set; }

        /// <summary>
        /// Communication setting for Product Update.
        /// </summary>
        [Input("isProductUpdateCommEnabled")]
        public Input<bool>? IsProductUpdateCommEnabled { get; set; }

        /// <summary>
        /// Communication for Security Report is enabled.
        /// </summary>
        [Input("isSecurityReportCommEnabled")]
        public Input<bool>? IsSecurityReportCommEnabled { get; set; }

        /// <summary>
        /// Communication setting for Service Update.
        /// </summary>
        [Input("isServiceUpdateCommEnabled")]
        public Input<bool>? IsServiceUpdateCommEnabled { get; set; }

        /// <summary>
        /// The email address of the admin user to be exported.
        /// </summary>
        [Input("loginName")]
        public Input<string>? LoginName { get; set; }

        [Input("password")]
        private Input<string>? _password;

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        public Input<string>? Password
        {
            get => _password;
            set
            {
                var emptySecret = Output.CreateSecret(0);
                _password = Output.Tuple<Input<string>?, int>(value, emptySecret).Apply(t => t.Item1);
            }
        }

        [Input("roles")]
        private InputList<Inputs.AdminUsersRoleGetArgs>? _roles;

        /// <summary>
        /// Role of the admin. This is not required for an auditor.
        /// </summary>
        public InputList<Inputs.AdminUsersRoleGetArgs> Roles
        {
            get => _roles ?? (_roles = new InputList<Inputs.AdminUsersRoleGetArgs>());
            set => _roles = value;
        }

        /// <summary>
        /// The username of the admin user to be exported.
        /// </summary>
        [Input("username")]
        public Input<string>? Username { get; set; }

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