<filename>sdk/dotnet/Tencentcloud/Instance/GetTypes.cs// *** 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.Instance
{
    public static class GetTypes
    {
        /// <summary>
        /// Use this data source to query instances type.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Instance.GetTypes.InvokeAsync(new Tencentcloud.Instance.GetTypesArgs
        ///         {
        ///             AvailabilityZone = "ap-guangzhou-2",
        ///             CpuCoreCount = 2,
        ///             MemorySize = 4,
        ///         }));
        ///         var t1c1g = Output.Create(Tencentcloud.Instance.GetTypes.InvokeAsync(new Tencentcloud.Instance.GetTypesArgs
        ///         {
        ///             CpuCoreCount = 1,
        ///             ExcludeSoldOut = true,
        ///             Filters = 
        ///             {
        ///                 new Tencentcloud.Instance.Inputs.GetTypesFilterArgs
        ///                 {
        ///                     Name = "instance-charge-type",
        ///                     Values = 
        ///                     {
        ///                         "POSTPAID_BY_HOUR",
        ///                     },
        ///                 },
        ///                 new Tencentcloud.Instance.Inputs.GetTypesFilterArgs
        ///                 {
        ///                     Name = "zone",
        ///                     Values = 
        ///                     {
        ///                         "ap-shanghai-2",
        ///                     },
        ///                 },
        ///             },
        ///             MemorySize = 1,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetTypesResult> InvokeAsync(GetTypesArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetTypesResult>("tencentcloud:Instance/getTypes:getTypes", args ?? new GetTypesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query instances type.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var foo = Output.Create(Tencentcloud.Instance.GetTypes.InvokeAsync(new Tencentcloud.Instance.GetTypesArgs
        ///         {
        ///             AvailabilityZone = "ap-guangzhou-2",
        ///             CpuCoreCount = 2,
        ///             MemorySize = 4,
        ///         }));
        ///         var t1c1g = Output.Create(Tencentcloud.Instance.GetTypes.InvokeAsync(new Tencentcloud.Instance.GetTypesArgs
        ///         {
        ///             CpuCoreCount = 1,
        ///             ExcludeSoldOut = true,
        ///             Filters = 
        ///             {
        ///                 new Tencentcloud.Instance.Inputs.GetTypesFilterArgs
        ///                 {
        ///                     Name = "instance-charge-type",
        ///                     Values = 
        ///                     {
        ///                         "POSTPAID_BY_HOUR",
        ///                     },
        ///                 },
        ///                 new Tencentcloud.Instance.Inputs.GetTypesFilterArgs
        ///                 {
        ///                     Name = "zone",
        ///                     Values = 
        ///                     {
        ///                         "ap-shanghai-2",
        ///                     },
        ///                 },
        ///             },
        ///             MemorySize = 1,
        ///         }));
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetTypesResult> Invoke(GetTypesInvokeArgs? args = null, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetTypesResult>("tencentcloud:Instance/getTypes:getTypes", args ?? new GetTypesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetTypesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the CVM instance locates at. This field is conflict with `filter`.
        /// </summary>
        [Input("availabilityZone")]
        public string? AvailabilityZone { get; set; }

        /// <summary>
        /// The number of CPU cores of the instance.
        /// </summary>
        [Input("cpuCoreCount")]
        public int? CpuCoreCount { get; set; }

        /// <summary>
        /// Indicate to filter instances types that is sold out or not, default is false.
        /// </summary>
        [Input("excludeSoldOut")]
        public bool? ExcludeSoldOut { get; set; }

        [Input("filters")]
        private List<Inputs.GetTypesFilterArgs>? _filters;

        /// <summary>
        /// One or more name/value pairs to filter. This field is conflict with `availability_zone`.
        /// </summary>
        public List<Inputs.GetTypesFilterArgs> Filters
        {
            get => _filters ?? (_filters = new List<Inputs.GetTypesFilterArgs>());
            set => _filters = value;
        }

        /// <summary>
        /// The number of GPU cores of the instance.
        /// </summary>
        [Input("gpuCoreCount")]
        public int? GpuCoreCount { get; set; }

        /// <summary>
        /// Instance memory capacity, unit in GB.
        /// </summary>
        [Input("memorySize")]
        public int? MemorySize { get; set; }

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

        public GetTypesArgs()
        {
        }
    }

    public sealed class GetTypesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// The available zone that the CVM instance locates at. This field is conflict with `filter`.
        /// </summary>
        [Input("availabilityZone")]
        public Input<string>? AvailabilityZone { get; set; }

        /// <summary>
        /// The number of CPU cores of the instance.
        /// </summary>
        [Input("cpuCoreCount")]
        public Input<int>? CpuCoreCount { get; set; }

        /// <summary>
        /// Indicate to filter instances types that is sold out or not, default is false.
        /// </summary>
        [Input("excludeSoldOut")]
        public Input<bool>? ExcludeSoldOut { get; set; }

        [Input("filters")]
        private InputList<Inputs.GetTypesFilterInputArgs>? _filters;

        /// <summary>
        /// One or more name/value pairs to filter. This field is conflict with `availability_zone`.
        /// </summary>
        public InputList<Inputs.GetTypesFilterInputArgs> Filters
        {
            get => _filters ?? (_filters = new InputList<Inputs.GetTypesFilterInputArgs>());
            set => _filters = value;
        }

        /// <summary>
        /// The number of GPU cores of the instance.
        /// </summary>
        [Input("gpuCoreCount")]
        public Input<int>? GpuCoreCount { get; set; }

        /// <summary>
        /// Instance memory capacity, unit in GB.
        /// </summary>
        [Input("memorySize")]
        public Input<int>? MemorySize { get; set; }

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

        public GetTypesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetTypesResult
    {
        /// <summary>
        /// The available zone that the CVM instance locates at.
        /// </summary>
        public readonly string? AvailabilityZone;
        /// <summary>
        /// The number of CPU cores of the instance.
        /// </summary>
        public readonly int? CpuCoreCount;
        public readonly bool? ExcludeSoldOut;
        public readonly ImmutableArray<Outputs.GetTypesFilterResult> Filters;
        /// <summary>
        /// The number of GPU cores of the instance.
        /// </summary>
        public readonly int? GpuCoreCount;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// An information list of cvm instance. Each element contains the following attributes:
        /// </summary>
        public readonly ImmutableArray<Outputs.GetTypesInstanceTypeResult> InstanceTypes;
        /// <summary>
        /// Instance memory capacity, unit in GB.
        /// </summary>
        public readonly int? MemorySize;
        public readonly string? ResultOutputFile;

        [OutputConstructor]
        private GetTypesResult(
            string? availabilityZone,

            int? cpuCoreCount,

            bool? excludeSoldOut,

            ImmutableArray<Outputs.GetTypesFilterResult> filters,

            int? gpuCoreCount,

            string id,

            ImmutableArray<Outputs.GetTypesInstanceTypeResult> instanceTypes,

            int? memorySize,

            string? resultOutputFile)
        {
            AvailabilityZone = availabilityZone;
            CpuCoreCount = cpuCoreCount;
            ExcludeSoldOut = excludeSoldOut;
            Filters = filters;
            GpuCoreCount = gpuCoreCount;
            Id = id;
            InstanceTypes = instanceTypes;
            MemorySize = memorySize;
            ResultOutputFile = resultOutputFile;
        }
    }
}
