<filename>sdk/dotnet/CloudStorageGateway/GetGateways.cs<gh_stars>0// *** 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 GetGateways
    {
        /// <summary>
        /// This data source provides the Cloud Storage Gateway Gateways of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.132.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        ///     {
        ///         StorageBundleName = "example_value",
        ///     });
        /// 
        ///     var nameRegex = AliCloud.CloudStorageGateway.GetGateways.Invoke(new()
        ///     {
        ///         StorageBundleId = example.Id,
        ///         NameRegex = "^my-Gateway",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cloudStorageGatewayGatewayId"] = nameRegex.Apply(getGatewaysResult =&gt; getGatewaysResult.Gateways[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetGatewaysResult> InvokeAsync(GetGatewaysArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetGatewaysResult>("alicloud:cloudstoragegateway/getGateways:getGateways", args ?? new GetGatewaysArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Cloud Storage Gateway Gateways of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.132.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = new AliCloud.CloudStorageGateway.StorageBundle("example", new()
        ///     {
        ///         StorageBundleName = "example_value",
        ///     });
        /// 
        ///     var nameRegex = AliCloud.CloudStorageGateway.GetGateways.Invoke(new()
        ///     {
        ///         StorageBundleId = example.Id,
        ///         NameRegex = "^my-Gateway",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["cloudStorageGatewayGatewayId"] = nameRegex.Apply(getGatewaysResult =&gt; getGatewaysResult.Gateways[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetGatewaysResult> Invoke(GetGatewaysInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetGatewaysResult>("alicloud:cloudstoragegateway/getGateways:getGateways", args ?? new GetGatewaysInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetGatewaysArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private List<string>? _ids;

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

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

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

        [Input("pageNumber")]
        public int? PageNumber { get; set; }

        [Input("pageSize")]
        public int? PageSize { get; set; }

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

        /// <summary>
        /// storage bundle id.
        /// </summary>
        [Input("storageBundleId", required: true)]
        public string StorageBundleId { get; set; } = null!;

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

    public sealed class GetGatewaysInvokeArgs : global::Pulumi.InvokeArgs
    {
        [Input("ids")]
        private InputList<string>? _ids;

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

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

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

        [Input("pageNumber")]
        public Input<int>? PageNumber { get; set; }

        [Input("pageSize")]
        public Input<int>? PageSize { get; set; }

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

        /// <summary>
        /// storage bundle id.
        /// </summary>
        [Input("storageBundleId", required: true)]
        public Input<string> StorageBundleId { get; set; } = null!;

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


    [OutputType]
    public sealed class GetGatewaysResult
    {
        public readonly ImmutableArray<Outputs.GetGatewaysGatewayResult> Gateways;
        /// <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 ImmutableArray<string> Names;
        public readonly string? OutputFile;
        public readonly int? PageNumber;
        public readonly int? PageSize;
        public readonly string? Status;
        public readonly string StorageBundleId;
        public readonly int TotalCount;

        [OutputConstructor]
        private GetGatewaysResult(
            ImmutableArray<Outputs.GetGatewaysGatewayResult> gateways,

            string id,

            ImmutableArray<string> ids,

            string? nameRegex,

            ImmutableArray<string> names,

            string? outputFile,

            int? pageNumber,

            int? pageSize,

            string? status,

            string storageBundleId,

            int totalCount)
        {
            Gateways = gateways;
            Id = id;
            Ids = ids;
            NameRegex = nameRegex;
            Names = names;
            OutputFile = outputFile;
            PageNumber = pageNumber;
            PageSize = pageSize;
            Status = status;
            StorageBundleId = storageBundleId;
            TotalCount = totalCount;
        }
    }
}
