<reponame>rhysmdnz/pulumi-alicloud-rhys-hacks// *** 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.Kms
{
    public static class GetSecretVersions
    {
        /// <summary>
        /// This data source provides a list of KMS Secret Versions in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.88.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var kmsSecretVersionsDs = AliCloud.Kms.GetSecretVersions.Invoke(new()
        ///     {
        ///         EnableDetails = true,
        ///         SecretName = "secret_name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstSecretData"] = kmsSecretVersionsDs.Apply(getSecretVersionsResult =&gt; getSecretVersionsResult.Versions[0]?.SecretData),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetSecretVersionsResult> InvokeAsync(GetSecretVersionsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetSecretVersionsResult>("alicloud:kms/getSecretVersions:getSecretVersions", args ?? new GetSecretVersionsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides a list of KMS Secret Versions in an Alibaba Cloud account according to the specified filters.
        ///  
        /// &gt; **NOTE:** Available in v1.88.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var kmsSecretVersionsDs = AliCloud.Kms.GetSecretVersions.Invoke(new()
        ///     {
        ///         EnableDetails = true,
        ///         SecretName = "secret_name",
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstSecretData"] = kmsSecretVersionsDs.Apply(getSecretVersionsResult =&gt; getSecretVersionsResult.Versions[0]?.SecretData),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetSecretVersionsResult> Invoke(GetSecretVersionsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetSecretVersionsResult>("alicloud:kms/getSecretVersions:getSecretVersions", args ?? new GetSecretVersionsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetSecretVersionsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Default to false and only output `secret_name`, `version_id`, `version_stages`. Set it to true can output more details.
        /// </summary>
        [Input("enableDetails")]
        public bool? EnableDetails { get; set; }

        [Input("ids")]
        private List<string>? _ids;

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

        /// <summary>
        /// Specifies whether to return deprecated secret versions. Default to `false`.
        /// </summary>
        [Input("includeDeprecated")]
        public string? IncludeDeprecated { get; set; }

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

        /// <summary>
        /// The name of the secret.
        /// </summary>
        [Input("secretName", required: true)]
        public string SecretName { get; set; } = null!;

        /// <summary>
        /// The stage of the secret version.
        /// </summary>
        [Input("versionStage")]
        public string? VersionStage { get; set; }

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

    public sealed class GetSecretVersionsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Default to false and only output `secret_name`, `version_id`, `version_stages`. Set it to true can output more details.
        /// </summary>
        [Input("enableDetails")]
        public Input<bool>? EnableDetails { get; set; }

        [Input("ids")]
        private InputList<string>? _ids;

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

        /// <summary>
        /// Specifies whether to return deprecated secret versions. Default to `false`.
        /// </summary>
        [Input("includeDeprecated")]
        public Input<string>? IncludeDeprecated { get; set; }

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

        /// <summary>
        /// The name of the secret.
        /// </summary>
        [Input("secretName", required: true)]
        public Input<string> SecretName { get; set; } = null!;

        /// <summary>
        /// The stage of the secret version.
        /// </summary>
        [Input("versionStage")]
        public Input<string>? VersionStage { get; set; }

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


    [OutputType]
    public sealed class GetSecretVersionsResult
    {
        public readonly bool? EnableDetails;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of Kms Secret Version ids.
        /// </summary>
        public readonly ImmutableArray<string> Ids;
        public readonly string? IncludeDeprecated;
        public readonly string? OutputFile;
        /// <summary>
        /// The name of the secret.
        /// </summary>
        public readonly string SecretName;
        public readonly string? VersionStage;
        /// <summary>
        /// A list of KMS Secret Versions. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetSecretVersionsVersionResult> Versions;

        [OutputConstructor]
        private GetSecretVersionsResult(
            bool? enableDetails,

            string id,

            ImmutableArray<string> ids,

            string? includeDeprecated,

            string? outputFile,

            string secretName,

            string? versionStage,

            ImmutableArray<Outputs.GetSecretVersionsVersionResult> versions)
        {
            EnableDetails = enableDetails;
            Id = id;
            Ids = ids;
            IncludeDeprecated = includeDeprecated;
            OutputFile = outputFile;
            SecretName = secretName;
            VersionStage = versionStage;
            Versions = versions;
        }
    }
}
