<gh_stars>0// *** 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.ApiGateway
{
    public static class GetUsagePlanEnvironments
    {
        /// <summary>
        /// Used to query the environment list bound by the plan.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var plan = new Tencentcloud.ApiGateway.UsagePlan("plan", new Tencentcloud.ApiGateway.UsagePlanArgs
        ///         {
        ///             UsagePlanName = "my_plan",
        ///             UsagePlanDesc = "nice plan",
        ///             MaxRequestNum = 100,
        ///             MaxRequestNumPreSec = 10,
        ///         });
        ///         var service = new Tencentcloud.ApiGateway.Service("service", new Tencentcloud.ApiGateway.ServiceArgs
        ///         {
        ///             ServiceName = "niceservice",
        ///             Protocol = "http&amp;https",
        ///             ServiceDesc = "your nice service",
        ///             NetTypes = 
        ///             {
        ///                 "INNER",
        ///                 "OUTER",
        ///             },
        ///             IpVersion = "IPv4",
        ///         });
        ///         var attachService = new Tencentcloud.ApiGateway.UsagePlanAttachment("attachService", new Tencentcloud.ApiGateway.UsagePlanAttachmentArgs
        ///         {
        ///             UsagePlanId = plan.Id,
        ///             ServiceId = service.Id,
        ///             Environment = "test",
        ///             BindType = "SERVICE",
        ///         });
        ///         var environmentTest = Tencentcloud.ApiGateway.GetUsagePlanEnvironments.Invoke(new Tencentcloud.ApiGateway.GetUsagePlanEnvironmentsInvokeArgs
        ///         {
        ///             UsagePlanId = attachService.UsagePlanId,
        ///             BindType = "SERVICE",
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetUsagePlanEnvironmentsResult> InvokeAsync(GetUsagePlanEnvironmentsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetUsagePlanEnvironmentsResult>("tencentcloud:ApiGateway/getUsagePlanEnvironments:getUsagePlanEnvironments", args ?? new GetUsagePlanEnvironmentsArgs(), options.WithDefaults());

        /// <summary>
        /// Used to query the environment list bound by the plan.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = Pulumi.Tencentcloud;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var plan = new Tencentcloud.ApiGateway.UsagePlan("plan", new Tencentcloud.ApiGateway.UsagePlanArgs
        ///         {
        ///             UsagePlanName = "my_plan",
        ///             UsagePlanDesc = "nice plan",
        ///             MaxRequestNum = 100,
        ///             MaxRequestNumPreSec = 10,
        ///         });
        ///         var service = new Tencentcloud.ApiGateway.Service("service", new Tencentcloud.ApiGateway.ServiceArgs
        ///         {
        ///             ServiceName = "niceservice",
        ///             Protocol = "http&amp;https",
        ///             ServiceDesc = "your nice service",
        ///             NetTypes = 
        ///             {
        ///                 "INNER",
        ///                 "OUTER",
        ///             },
        ///             IpVersion = "IPv4",
        ///         });
        ///         var attachService = new Tencentcloud.ApiGateway.UsagePlanAttachment("attachService", new Tencentcloud.ApiGateway.UsagePlanAttachmentArgs
        ///         {
        ///             UsagePlanId = plan.Id,
        ///             ServiceId = service.Id,
        ///             Environment = "test",
        ///             BindType = "SERVICE",
        ///         });
        ///         var environmentTest = Tencentcloud.ApiGateway.GetUsagePlanEnvironments.Invoke(new Tencentcloud.ApiGateway.GetUsagePlanEnvironmentsInvokeArgs
        ///         {
        ///             UsagePlanId = attachService.UsagePlanId,
        ///             BindType = "SERVICE",
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetUsagePlanEnvironmentsResult> Invoke(GetUsagePlanEnvironmentsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetUsagePlanEnvironmentsResult>("tencentcloud:ApiGateway/getUsagePlanEnvironments:getUsagePlanEnvironments", args ?? new GetUsagePlanEnvironmentsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetUsagePlanEnvironmentsArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Binding type. Valid values: `API`, `SERVICE`. Default value: `SERVICE`.
        /// </summary>
        [Input("bindType")]
        public string? BindType { get; set; }

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

        /// <summary>
        /// ID of the usage plan to be queried.
        /// </summary>
        [Input("usagePlanId", required: true)]
        public string UsagePlanId { get; set; } = null!;

        public GetUsagePlanEnvironmentsArgs()
        {
        }
    }

    public sealed class GetUsagePlanEnvironmentsInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// Binding type. Valid values: `API`, `SERVICE`. Default value: `SERVICE`.
        /// </summary>
        [Input("bindType")]
        public Input<string>? BindType { get; set; }

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

        /// <summary>
        /// ID of the usage plan to be queried.
        /// </summary>
        [Input("usagePlanId", required: true)]
        public Input<string> UsagePlanId { get; set; } = null!;

        public GetUsagePlanEnvironmentsInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetUsagePlanEnvironmentsResult
    {
        public readonly string? BindType;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// A list of usage plan binding details.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetUsagePlanEnvironmentsListResult> Lists;
        public readonly string? ResultOutputFile;
        public readonly string UsagePlanId;

        [OutputConstructor]
        private GetUsagePlanEnvironmentsResult(
            string? bindType,

            string id,

            ImmutableArray<Outputs.GetUsagePlanEnvironmentsListResult> lists,

            string? resultOutputFile,

            string usagePlanId)
        {
            BindType = bindType;
            Id = id;
            Lists = lists;
            ResultOutputFile = resultOutputFile;
            UsagePlanId = usagePlanId;
        }
    }
}
