<filename>sdk/dotnet/Tencentcloud/Cos/GetBuckets.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;
using Pulumi;

namespace TencentCloudIAC.PulumiPackage.Tencentcloud.Cos
{
    public static class GetBuckets
    {
        /// <summary>
        /// Use this data source to query the COS buckets of the current Tencent Cloud user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var cosBuckets = Output.Create(Tencentcloud.Cos.GetBuckets.InvokeAsync(new Tencentcloud.Cos.GetBucketsArgs
        ///         {
        ///             BucketPrefix = "tf-bucket-",
        ///             ResultOutputFile = "mytestpath",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetBucketsResult> InvokeAsync(GetBucketsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetBucketsResult>("tencentcloud:Cos/getBuckets:getBuckets", args ?? new GetBucketsArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query the COS buckets of the current Tencent Cloud user.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var cosBuckets = Output.Create(Tencentcloud.Cos.GetBuckets.InvokeAsync(new Tencentcloud.Cos.GetBucketsArgs
        ///         {
        ///             BucketPrefix = "tf-bucket-",
        ///             ResultOutputFile = "mytestpath",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetBucketsResult> Invoke(GetBucketsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetBucketsResult>("tencentcloud:Cos/getBuckets:getBuckets", args ?? new GetBucketsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetBucketsArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// A prefix string to filter results by bucket name.
        /// </summary>
        [Input("bucketPrefix")]
        public string? BucketPrefix { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public string? ResultOutputFile { get; set; }

        [Input("tags")]
        private Dictionary<string, object>? _tags;

        /// <summary>
        /// Tags to filter bucket.
        /// </summary>
        public Dictionary<string, object> Tags
        {
            get => _tags ?? (_tags = new Dictionary<string, object>());
            set => _tags = value;
        }

        public GetBucketsArgs()
        {
        }
    }

    public sealed class GetBucketsInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// A prefix string to filter results by bucket name.
        /// </summary>
        [Input("bucketPrefix")]
        public Input<string>? BucketPrefix { get; set; }

        /// <summary>
        /// Used to save results.
        /// </summary>
        [Input("resultOutputFile")]
        public Input<string>? ResultOutputFile { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// Tags to filter bucket.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

        public GetBucketsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetBucketsResult
    {
        /// <summary>
        /// A list of bucket. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetBucketsBucketListResult> BucketLists;
        public readonly string? BucketPrefix;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// The tags of a bucket.
        /// </summary>
        public readonly ImmutableDictionary<string, object>? Tags;

        [OutputConstructor]
        private GetBucketsResult(
            ImmutableArray<Outputs.GetBucketsBucketListResult> bucketLists,

            string? bucketPrefix,

            string id,

            string? resultOutputFile,

            ImmutableDictionary<string, object>? tags)
        {
            BucketLists = bucketLists;
            BucketPrefix = bucketPrefix;
            Id = id;
            ResultOutputFile = resultOutputFile;
            Tags = tags;
        }
    }
}
