// *** 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.Sts
{
    public static class GetCallerIdentity
    {
        /// <summary>
        /// Use this data source to query detailed information of sts callerIdentity
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var callerIdentity = Output.Create(Tencentcloud.Sts.GetCallerIdentity.InvokeAsync());
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetCallerIdentityResult> InvokeAsync(GetCallerIdentityArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetCallerIdentityResult>("tencentcloud:Sts/getCallerIdentity:getCallerIdentity", args ?? new GetCallerIdentityArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of sts callerIdentity
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var callerIdentity = Output.Create(Tencentcloud.Sts.GetCallerIdentity.InvokeAsync());
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetCallerIdentityResult> Invoke(GetCallerIdentityInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetCallerIdentityResult>("tencentcloud:Sts/getCallerIdentity:getCallerIdentity", args ?? new GetCallerIdentityInvokeArgs(), options.WithDefaults());
    }


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

        public GetCallerIdentityArgs()
        {
        }
    }

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

        public GetCallerIdentityInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetCallerIdentityResult
    {
        /// <summary>
        /// The primary account Uin to which the current caller belongs.
        /// </summary>
        public readonly string AccountId;
        /// <summary>
        /// Current caller ARN.
        /// </summary>
        public readonly string Arn;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Account Uin to which the key belongs:- The caller is a cloud account, and the returned current account Uin- The caller is a role, and the returned account Uin that applies for the role key.
        /// </summary>
        public readonly string PrincipalId;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// Identity type.
        /// </summary>
        public readonly string Type;
        /// <summary>
        /// Identity:- When the caller is a cloud account, the current account `Uin` is returned.- When the caller is a role, it returns `roleId:roleSessionName`- When the caller is a federated identity, it returns `uin:federatedUserName`.
        /// </summary>
        public readonly string UserId;

        [OutputConstructor]
        private GetCallerIdentityResult(
            string accountId,

            string arn,

            string id,

            string principalId,

            string? resultOutputFile,

            string type,

            string userId)
        {
            AccountId = accountId;
            Arn = arn;
            Id = id;
            PrincipalId = principalId;
            ResultOutputFile = resultOutputFile;
            Type = type;
            UserId = userId;
        }
    }
}
