<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.Key
{
    public static class GetPairs
    {
        /// <summary>
        /// Use this data source to query key pairs.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Key.GetPairs.InvokeAsync(new Tencentcloud.Key.GetPairsArgs
        ///         {
        ///             KeyId = "skey-ie97i3ml",
        ///         }));
        ///         var name = Output.Create(Tencentcloud.Key.GetPairs.InvokeAsync(new Tencentcloud.Key.GetPairsArgs
        ///         {
        ///             KeyName = "^test$",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetPairsResult> InvokeAsync(GetPairsArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetPairsResult>("tencentcloud:Key/getPairs:getPairs", args ?? new GetPairsArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query key pairs.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Key.GetPairs.InvokeAsync(new Tencentcloud.Key.GetPairsArgs
        ///         {
        ///             KeyId = "skey-ie97i3ml",
        ///         }));
        ///         var name = Output.Create(Tencentcloud.Key.GetPairs.InvokeAsync(new Tencentcloud.Key.GetPairsArgs
        ///         {
        ///             KeyName = "^test$",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetPairsResult> Invoke(GetPairsInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetPairsResult>("tencentcloud:Key/getPairs:getPairs", args ?? new GetPairsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetPairsArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the key pair to be queried.
        /// </summary>
        [Input("keyId")]
        public string? KeyId { get; set; }

        /// <summary>
        /// Name of the key pair to be queried. Support regular expression search, only `^` and `$` are supported.
        /// </summary>
        [Input("keyName")]
        public string? KeyName { get; set; }

        /// <summary>
        /// Project ID of the key pair to be queried.
        /// </summary>
        [Input("projectId")]
        public int? ProjectId { get; set; }

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

        public GetPairsArgs()
        {
        }
    }

    public sealed class GetPairsInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the key pair to be queried.
        /// </summary>
        [Input("keyId")]
        public Input<string>? KeyId { get; set; }

        /// <summary>
        /// Name of the key pair to be queried. Support regular expression search, only `^` and `$` are supported.
        /// </summary>
        [Input("keyName")]
        public Input<string>? KeyName { get; set; }

        /// <summary>
        /// Project ID of the key pair to be queried.
        /// </summary>
        [Input("projectId")]
        public Input<int>? ProjectId { get; set; }

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

        public GetPairsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetPairsResult
    {
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// ID of the key pair.
        /// </summary>
        public readonly string? KeyId;
        /// <summary>
        /// Name of the key pair.
        /// </summary>
        public readonly string? KeyName;
        /// <summary>
        /// An information list of key pair. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetPairsKeyPairListResult> KeyPairLists;
        /// <summary>
        /// Project ID of the key pair.
        /// </summary>
        public readonly int? ProjectId;
        public readonly string? ResultOutputFile;

        [OutputConstructor]
        private GetPairsResult(
            string id,

            string? keyId,

            string? keyName,

            ImmutableArray<Outputs.GetPairsKeyPairListResult> keyPairLists,

            int? projectId,

            string? resultOutputFile)
        {
            Id = id;
            KeyId = keyId;
            KeyName = keyName;
            KeyPairLists = keyPairLists;
            ProjectId = projectId;
            ResultOutputFile = resultOutputFile;
        }
    }
}
