// *** 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.Ddos
{
    public static class GetDdosCooPorts
    {
        /// <summary>
        /// This data source provides the Ddoscoo Ports of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.123.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Ddos.GetDdosCooPorts.Invoke(new()
        ///     {
        ///         InstanceId = "ddoscoo-cn-6ja1rl4j****",
        ///         Ids = new[]
        ///         {
        ///             "ddoscoo-cn-6ja1rl4j****:7001:tcp",
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstDdoscooPortId"] = example.Apply(getDdosCooPortsResult =&gt; getDdosCooPortsResult.Ports[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetDdosCooPortsResult> InvokeAsync(GetDdosCooPortsArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetDdosCooPortsResult>("alicloud:ddos/getDdosCooPorts:getDdosCooPorts", args ?? new GetDdosCooPortsArgs(), options.WithDefaults());

        /// <summary>
        /// This data source provides the Ddoscoo Ports of the current Alibaba Cloud user.
        /// 
        /// &gt; **NOTE:** Available in v1.123.0+.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// Basic Usage
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using AliCloud = Pulumi.AliCloud;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var example = AliCloud.Ddos.GetDdosCooPorts.Invoke(new()
        ///     {
        ///         InstanceId = "ddoscoo-cn-6ja1rl4j****",
        ///         Ids = new[]
        ///         {
        ///             "ddoscoo-cn-6ja1rl4j****:7001:tcp",
        ///         },
        ///     });
        /// 
        ///     return new Dictionary&lt;string, object?&gt;
        ///     {
        ///         ["firstDdoscooPortId"] = example.Apply(getDdosCooPortsResult =&gt; getDdosCooPortsResult.Ports[0]?.Id),
        ///     };
        /// });
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetDdosCooPortsResult> Invoke(GetDdosCooPortsInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetDdosCooPortsResult>("alicloud:ddos/getDdosCooPorts:getDdosCooPorts", args ?? new GetDdosCooPortsInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetDdosCooPortsArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The forwarding port.
        /// </summary>
        [Input("frontendPort")]
        public string? FrontendPort { get; set; }

        /// <summary>
        /// The forwarding protocol.
        /// </summary>
        [Input("frontendProtocol")]
        public string? FrontendProtocol { get; set; }

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

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

        /// <summary>
        /// The Ddoscoo instance ID.
        /// </summary>
        [Input("instanceId", required: true)]
        public string InstanceId { get; set; } = null!;

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

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

    public sealed class GetDdosCooPortsInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// The forwarding port.
        /// </summary>
        [Input("frontendPort")]
        public Input<string>? FrontendPort { get; set; }

        /// <summary>
        /// The forwarding protocol.
        /// </summary>
        [Input("frontendProtocol")]
        public Input<string>? FrontendProtocol { get; set; }

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

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

        /// <summary>
        /// The Ddoscoo instance ID.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

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

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


    [OutputType]
    public sealed class GetDdosCooPortsResult
    {
        public readonly string? FrontendPort;
        public readonly string? FrontendProtocol;
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly ImmutableArray<string> Ids;
        public readonly string InstanceId;
        public readonly string? OutputFile;
        public readonly ImmutableArray<Outputs.GetDdosCooPortsPortResult> Ports;

        [OutputConstructor]
        private GetDdosCooPortsResult(
            string? frontendPort,

            string? frontendProtocol,

            string id,

            ImmutableArray<string> ids,

            string instanceId,

            string? outputFile,

            ImmutableArray<Outputs.GetDdosCooPortsPortResult> ports)
        {
            FrontendPort = frontendPort;
            FrontendProtocol = frontendProtocol;
            Id = id;
            Ids = ids;
            InstanceId = instanceId;
            OutputFile = outputFile;
            Ports = ports;
        }
    }
}
