// *** 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;

namespace Pulumi.AliCloud.BastionHost
{
    public static class GetUsers
    {
        /// <summary>
        /// This data source provides the Bastionhost Users of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.133.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.BastionHost.GetUsers.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "1",
        ///             "10",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.BastionHost.GetUsers.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         NameRegex = "^my-User",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["bastionhostUserId1"] = ids.Apply(getUsersResult =&gt; getUsersResult.Users[0]?.Id),
        ///         ["bastionhostUserId2"] = nameRegex.Apply(getUsersResult =&gt; getUsersResult.Users[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetUsersResult>("alicloud:bastionhost/getUsers:getUsers", args ?? new GetUsersArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Bastionhost Users of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.133.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var ids = AliCloud.BastionHost.GetUsers.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         Ids = new[]
        ///         {
        ///             "1",
        ///             "10",
        ///         },
        ///     });
        /// 
        ///     var nameRegex = AliCloud.BastionHost.GetUsers.Invoke(new()
        ///     {
        ///         InstanceId = "example_value",
        ///         NameRegex = "^my-User",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["bastionhostUserId1"] = ids.Apply(getUsersResult =&gt; getUsersResult.Users[0]?.Id),
        ///         ["bastionhostUserId2"] = nameRegex.Apply(getUsersResult =&gt; getUsersResult.Users[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetUsersResult>("alicloud:bastionhost/getUsers:getUsers", args ?? new GetUsersInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetUsersArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Specify the New Created the User's Display Name. Supports up to 128 Characters.
        /// </summary>
        [Input("displayName")]
        public string? DisplayName { get; set; }

        [Input("ids")]
        private List<string>? _ids;

        /// <summary>
        /// A list of User IDs.
        /// </summary>
        public List<string> Ids
        {
            get => _ids ?? (_ids = new List<string>());
            set => _ids = value;
        }

        /// <summary>
        /// You Want to Query the User the Bastion Host ID of.
        /// </summary>
        [Input("instanceId", required: true)]
        public string InstanceId { get; set; } = null!;

        /// <summary>
        /// Specify the New of the User That Created a Different Mobile Phone Number from Your.
        /// </summary>
        [Input("mobile")]
        public string? Mobile { get; set; }

        /// <summary>
        /// A regex string to filter results by User name.
        /// </summary>
        [Input("nameRegex")]
        public string? NameRegex { get; set; }

        [Input("outputFile")]
        public string? OutputFile { get; set; }

        /// <summary>
        /// Specify the New of the User That Created the Source. Valid Values: Local: Local User RAM: Ram User.
        /// </summary>
        [Input("source")]
        public string? Source { get; set; }

        /// <summary>
        /// Specify the Newly Created User Is Uniquely Identified. Indicates That the Parameter Is a Bastion Host Corresponding to the User with the Ram User's Unique Identifier. The Newly Created User Source Grant Permission to a RAM User (That Is, Source Used as a Ram), this Parameter Is Required. You Can Call Access Control of Listusers Interface from the Return Data Userid to Obtain the Parameters.
        /// </summary>
        [Input("sourceUserId")]
        public string? SourceUserId { get; set; }

        /// <summary>
        /// The status of the resource.
        /// </summary>
        [Input("status")]
        public string? Status { get; set; }

        /// <summary>
        /// Specify the New User Name. This Parameter Is Only by Letters, Lowercase Letters, Numbers, and Underscores (_), Supports up to 128 Characters.
        /// </summary>
        [Input("userName")]
        public string? UserName { get; set; }

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

    public sealed class GetUsersInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Specify the New Created the User's Display Name. Supports up to 128 Characters.
        /// </summary>
        [Input("displayName")]
        public Input<string>? DisplayName { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

        /// <summary>
        /// A list of User IDs.
        /// </summary>
        public InputList<string> Ids
        {
            get => _ids ?? (_ids = new InputList<string>());
            set => _ids = value;
        }

        /// <summary>
        /// You Want to Query the User the Bastion Host ID of.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// Specify the New of the User That Created a Different Mobile Phone Number from Your.
        /// </summary>
        [Input("mobile")]
        public Input<string>? Mobile { get; set; }

        /// <summary>
        /// A regex string to filter results by User name.
        /// </summary>
        [Input("nameRegex")]
        public Input<string>? NameRegex { get; set; }

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

        /// <summary>
        /// Specify the New of the User That Created the Source. Valid Values: Local: Local User RAM: Ram User.
        /// </summary>
        [Input("source")]
        public Input<string>? Source { get; set; }

        /// <summary>
        /// Specify the Newly Created User Is Uniquely Identified. Indicates That the Parameter Is a Bastion Host Corresponding to the User with the Ram User's Unique Identifier. The Newly Created User Source Grant Permission to a RAM User (That Is, Source Used as a Ram), this Parameter Is Required. You Can Call Access Control of Listusers Interface from the Return Data Userid to Obtain the Parameters.
        /// </summary>
        [Input("sourceUserId")]
        public Input<string>? SourceUserId { get; set; }

        /// <summary>
        /// The status of the resource.
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Specify the New User Name. This Parameter Is Only by Letters, Lowercase Letters, Numbers, and Underscores (_), Supports up to 128 Characters.
        /// </summary>
        [Input("userName")]
        public Input<string>? UserName { get; set; }

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


    [OutputType]
    public sealed class GetUsersResult
    {
        public readonly string? DisplayName;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string InstanceId;
        public readonly string? Mobile;
        public readonly string? NameRegex;
        public readonly ImmutableArray<string> Names;
        public readonly string? OutputFile;
        public readonly string? Source;
        public readonly string? SourceUserId;
        public readonly string? Status;
        public readonly string? UserName;
        public readonly ImmutableArray<Outputs.GetUsersUserResult> Users;

        [OutputConstructor]
        private GetUsersResult(
            string? displayName,

            string id,

            ImmutableArray<string> ids,

            string instanceId,

            string? mobile,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            string? source,

            string? sourceUserId,

            string? status,

            string? userName,

            ImmutableArray<Outputs.GetUsersUserResult> users)
        {
            DisplayName = displayName;
            Id = id;
            Ids = ids;
            InstanceId = instanceId;
            Mobile = mobile;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            Source = source;
            SourceUserId = sourceUserId;
            Status = status;
            UserName = userName;
            Users = users;
        }
    }
}
