// *** 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.Reserved
{
    public static class GetInstances
    {
        /// <summary>
        /// Use this data source to query reserved instances.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var instances = Output.Create(Tencentcloud.Reserved.GetInstances.InvokeAsync(new Tencentcloud.Reserved.GetInstancesArgs
        ///         {
        ///             AvailabilityZone = "na-siliconvalley-1",
        ///             InstanceType = "S2.MEDIUM8",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetInstancesResult>("tencentcloud:Reserved/getInstances:getInstances", args ?? new GetInstancesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query reserved instances.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var instances = Output.Create(Tencentcloud.Reserved.GetInstances.InvokeAsync(new Tencentcloud.Reserved.GetInstancesArgs
        ///         {
        ///             AvailabilityZone = "na-siliconvalley-1",
        ///             InstanceType = "S2.MEDIUM8",
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetInstancesResult>("tencentcloud:Reserved/getInstances:getInstances", args ?? new GetInstancesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetInstancesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the reserved instance locates at.
        /// </summary>
        [Input("availabilityZone")]
        public string? AvailabilityZone { get; set; }

        /// <summary>
        /// The type of reserved instance.
        /// </summary>
        [Input("instanceType")]
        public string? InstanceType { get; set; }

        /// <summary>
        /// ID of the reserved instance to be query.
        /// </summary>
        [Input("reservedInstanceId")]
        public string? ReservedInstanceId { get; set; }

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

        public GetInstancesArgs()
        {
        }
    }

    public sealed class GetInstancesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the reserved instance locates at.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// The type of reserved instance.
        /// </summary>
        [Input("instanceType")]
        public Input<string>? InstanceType { get; set; }

        /// <summary>
        /// ID of the reserved instance to be query.
        /// </summary>
        [Input("reservedInstanceId")]
        public Input<string>? ReservedInstanceId { get; set; }

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

        public GetInstancesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetInstancesResult
    {
        /// <summary>
        /// Availability zone of the reserved instance.
        /// </summary>
        public readonly string? AvailabilityZone;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// The type of reserved instance.
        /// </summary>
        public readonly string? InstanceType;
        /// <summary>
        /// ID of the reserved instance.
        /// </summary>
        public readonly string? ReservedInstanceId;
        /// <summary>
        /// An information list of reserved instance. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetInstancesReservedInstanceListResult> ReservedInstanceLists;
        public readonly string? ResultOutputFile;

        [OutputConstructor]
        private GetInstancesResult(
            string? availabilityZone,

            string id,

            string? instanceType,

            string? reservedInstanceId,

            ImmutableArray<Outputs.GetInstancesReservedInstanceListResult> reservedInstanceLists,

            string? resultOutputFile)
        {
            AvailabilityZone = availabilityZone;
            Id = id;
            InstanceType = instanceType;
            ReservedInstanceId = reservedInstanceId;
            ReservedInstanceLists = reservedInstanceLists;
            ResultOutputFile = resultOutputFile;
        }
    }
}
