// *** 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.CloudStorageGateway
{
    public static class GetGatewaySmbUsers
    {
        /// <summary>
        /// This data source provides the Cloud Storage Gateway Gateway SMB Users of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
        ///     {
        ///         NameRegex = "default-NODELETING",
        ///     });
        /// 
        ///     var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
        ///     {
        ///         VpcId = defaultNetworks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
        ///     });
        /// 
        ///     var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        ///     {
        ///         StorageBundleName = "example_value",
        ///     });
        /// 
        ///     var defaultGateway = new AliCloud.CloudStorageGateway.Gateway("defaultGateway", new()
        ///     {
        ///         Description = "tf-acctestDesalone",
        ///         GatewayClass = "Standard",
        ///         Type = "File",
        ///         PaymentType = "PayAsYouGo",
        ///         VswitchId = defaultSwitches.Apply(getSwitchesResult =&gt; getSwitchesResult.Ids[0]),
        ///         ReleaseAfterExpiration = false,
        ///         PublicNetworkBandwidth = 40,
        ///         StorageBundleId = example.Id,
        ///         Location = "Cloud",
        ///         GatewayName = "example_value",
        ///     });
        /// 
        ///     var defaultGatewaySmbUser = new AliCloud.CloudStorageGateway.GatewaySmbUser("defaultGatewaySmbUser", new()
        ///     {
        ///         Username = "your_username",
        ///         Password = "password",
        ///         GatewayId = defaultGateway.Id,
        ///     });
        /// 
        ///     var ids = AliCloud.CloudStorageGateway.GetGatewaySmbUsers.Invoke(new()
        ///     {
        ///         GatewayId = defaultGateway.Id,
        ///         Ids = new[]
        ///         {
        ///             defaultGatewaySmbUser.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cloudStorageGatewayGatewaySmbUserId1"] = ids.Apply(getGatewaySmbUsersResult =&gt; getGatewaySmbUsersResult.Users[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetGatewaySmbUsersResult> InvokeAsync(GetGatewaySmbUsersArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetGatewaySmbUsersResult>("alicloud:cloudstoragegateway/getGatewaySmbUsers:getGatewaySmbUsers", args ?? new GetGatewaySmbUsersArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Cloud Storage Gateway Gateway SMB Users of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.142.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var defaultNetworks = AliCloud.Vpc.GetNetworks.Invoke(new()
        ///     {
        ///         NameRegex = "default-NODELETING",
        ///     });
        /// 
        ///     var defaultSwitches = AliCloud.Vpc.GetSwitches.Invoke(new()
        ///     {
        ///         VpcId = defaultNetworks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
        ///     });
        /// 
        ///     var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        ///     {
        ///         StorageBundleName = "example_value",
        ///     });
        /// 
        ///     var defaultGateway = new AliCloud.CloudStorageGateway.Gateway("defaultGateway", new()
        ///     {
        ///         Description = "tf-acctestDesalone",
        ///         GatewayClass = "Standard",
        ///         Type = "File",
        ///         PaymentType = "PayAsYouGo",
        ///         VswitchId = defaultSwitches.Apply(getSwitchesResult =&gt; getSwitchesResult.Ids[0]),
        ///         ReleaseAfterExpiration = false,
        ///         PublicNetworkBandwidth = 40,
        ///         StorageBundleId = example.Id,
        ///         Location = "Cloud",
        ///         GatewayName = "example_value",
        ///     });
        /// 
        ///     var defaultGatewaySmbUser = new AliCloud.CloudStorageGateway.GatewaySmbUser("defaultGatewaySmbUser", new()
        ///     {
        ///         Username = "your_username",
        ///         Password = "password",
        ///         GatewayId = defaultGateway.Id,
        ///     });
        /// 
        ///     var ids = AliCloud.CloudStorageGateway.GetGatewaySmbUsers.Invoke(new()
        ///     {
        ///         GatewayId = defaultGateway.Id,
        ///         Ids = new[]
        ///         {
        ///             defaultGatewaySmbUser.Id,
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cloudStorageGatewayGatewaySmbUserId1"] = ids.Apply(getGatewaySmbUsersResult =&gt; getGatewaySmbUsersResult.Users[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetGatewaySmbUsersResult> Invoke(GetGatewaySmbUsersInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetGatewaySmbUsersResult>("alicloud:cloudstoragegateway/getGatewaySmbUsers:getGatewaySmbUsers", args ?? new GetGatewaySmbUsersInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetGatewaySmbUsersArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The Gateway ID.
        /// </summary>
        [Input("gatewayId", required: true)]
        public string GatewayId { get; set; } = null!;

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

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

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

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

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

    public sealed class GetGatewaySmbUsersInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The Gateway ID.
        /// </summary>
        [Input("gatewayId", required: true)]
        public Input<string> GatewayId { get; set; } = null!;

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

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

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

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

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


    [OutputType]
    public sealed class GetGatewaySmbUsersResult
    {
        public readonly string GatewayId;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string? NameRegex;
        public readonly string? OutputFile;
        public readonly ImmutableArray<Outputs.GetGatewaySmbUsersUserResult> Users;

        [OutputConstructor]
        private GetGatewaySmbUsersResult(
            string gatewayId,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            string? outputFile,

            ImmutableArray<Outputs.GetGatewaySmbUsersUserResult> users)
        {
            GatewayId = gatewayId;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            OutputFile = outputFile;
            Users = users;
        }
    }
}
