// *** 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.Cam
{
    public static class GetRoles
    {
        /// <summary>
        /// Use this data source to query detailed information of CAM roles
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Cam.GetRoles.InvokeAsync(new Tencentcloud.Cam.GetRolesArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///         }));
        ///         var bar = Output.Create(Tencentcloud.Cam.GetRoles.InvokeAsync(new Tencentcloud.Cam.GetRolesArgs
        ///         {
        ///             Name = "cam-role-test",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetRolesResult> InvokeAsync(GetRolesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetRolesResult>("tencentcloud:Cam/getRoles:getRoles", args ?? new GetRolesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query detailed information of CAM roles
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Cam.GetRoles.InvokeAsync(new Tencentcloud.Cam.GetRolesArgs
        ///         {
        ///             RoleId = tencentcloud_cam_role.Foo.Id,
        ///         }));
        ///         var bar = Output.Create(Tencentcloud.Cam.GetRoles.InvokeAsync(new Tencentcloud.Cam.GetRolesArgs
        ///         {
        ///             Name = "cam-role-test",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetRolesResult> Invoke(GetRolesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetRolesResult>("tencentcloud:Cam/getRoles:getRoles", args ?? new GetRolesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetRolesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The description of the CAM role to be queried.
        /// </summary>
        [Input("description")]
        public string? Description { get; set; }

        /// <summary>
        /// Name of the CAM policy to be queried.
        /// </summary>
        [Input("name")]
        public string? Name { get; set; }

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

        /// <summary>
        /// ID of the CAM role to be queried.
        /// </summary>
        [Input("roleId")]
        public string? RoleId { get; set; }

        public GetRolesArgs()
        {
        }
    }

    public sealed class GetRolesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The description of the CAM role to be queried.
        /// </summary>
        [Input("description")]
        public Input<string>? Description { get; set; }

        /// <summary>
        /// Name of the CAM policy to be queried.
        /// </summary>
        [Input("name")]
        public Input<string>? Name { get; set; }

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

        /// <summary>
        /// ID of the CAM role to be queried.
        /// </summary>
        [Input("roleId")]
        public Input<string>? RoleId { get; set; }

        public GetRolesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetRolesResult
    {
        /// <summary>
        /// Description of CAM role.
        /// </summary>
        public readonly string? Description;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// Name of CAM role.
        /// </summary>
        public readonly string? Name;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// Id of CAM role.
        /// </summary>
        public readonly string? RoleId;
        /// <summary>
        /// A list of CAM roles. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetRolesRoleListResult> RoleLists;

        [OutputConstructor]
        private GetRolesResult(
            string? description,

            string id,

            string? name,

            string? resultOutputFile,

            string? roleId,

            ImmutableArray<Outputs.GetRolesRoleListResult> roleLists)
        {
            Description = description;
            Id = id;
            Name = name;
            ResultOutputFile = resultOutputFile;
            RoleId = roleId;
            RoleLists = roleLists;
        }
    }
}
