<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.Sqlserver
{
    public static class GetPublishSubscribes
    {
        /// <summary>
        /// Use this data source to query Publish Subscribe resources for the specific SQL Server instance.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var example = new Tencentcloud.Sqlserver.PublishSubscribe("example", new Tencentcloud.Sqlserver.PublishSubscribeArgs
        ///         {
        ///             PublishInstanceId = tencentcloud_sqlserver_instance.Publish_instance.Id,
        ///             SubscribeInstanceId = tencentcloud_sqlserver_instance.Subscribe_instance.Id,
        ///             PublishSubscribeName = "example",
        ///             DeleteSubscribeDb = false,
        ///             DatabaseTuples = 
        ///             {
        ///                 new Tencentcloud.Sqlserver.Inputs.PublishSubscribeDatabaseTupleArgs
        ///                 {
        ///                     PublishDatabase = tencentcloud_sqlserver_db.Test_publish_subscribe.Name,
        ///                 },
        ///             },
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetPublishSubscribesResult> InvokeAsync(GetPublishSubscribesArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetPublishSubscribesResult>("tencentcloud:Sqlserver/getPublishSubscribes:getPublishSubscribes", args ?? new GetPublishSubscribesArgs(), options.WithDefaults());

        /// <summary>
        /// Use this data source to query Publish Subscribe resources for the specific SQL Server instance.
        /// 
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// 
        /// ```csharp
        /// using Pulumi;
        /// using Tencentcloud = TencentCloudIAC.PulumiPackage.Tencentcloud;
        /// 
        /// class MyStack : Stack
        /// {
        ///     public MyStack()
        ///     {
        ///         var example = new Tencentcloud.Sqlserver.PublishSubscribe("example", new Tencentcloud.Sqlserver.PublishSubscribeArgs
        ///         {
        ///             PublishInstanceId = tencentcloud_sqlserver_instance.Publish_instance.Id,
        ///             SubscribeInstanceId = tencentcloud_sqlserver_instance.Subscribe_instance.Id,
        ///             PublishSubscribeName = "example",
        ///             DeleteSubscribeDb = false,
        ///             DatabaseTuples = 
        ///             {
        ///                 new Tencentcloud.Sqlserver.Inputs.PublishSubscribeDatabaseTupleArgs
        ///                 {
        ///                     PublishDatabase = tencentcloud_sqlserver_db.Test_publish_subscribe.Name,
        ///                 },
        ///             },
        ///         });
        ///     }
        /// 
        /// }
        /// ```
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetPublishSubscribesResult> Invoke(GetPublishSubscribesInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetPublishSubscribesResult>("tencentcloud:Sqlserver/getPublishSubscribes:getPublishSubscribes", args ?? new GetPublishSubscribesInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetPublishSubscribesArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the SQL Server instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public string InstanceId { get; set; } = null!;

        /// <summary>
        /// The subscribe/publish instance ID. It is related to whether the `instance_id` is a publish instance or a subscribe instance. when `instance_id` is a publish instance, this field is filtered according to the subscribe instance ID; when `instance_id` is a subscribe instance, this field is filtering according to the publish instance ID.
        /// </summary>
        [Input("pubOrSubInstanceId")]
        public string? PubOrSubInstanceId { get; set; }

        /// <summary>
        /// The intranet IP of the subscribe/publish instance. It is related to whether the `instance_id` is a publish instance or a subscribe instance. when `instance_id` is a publish instance, this field is filtered according to the intranet IP of the subscribe instance; when `instance_id` is a subscribe instance, this field is based on the publish instance intranet IP filter.
        /// </summary>
        [Input("pubOrSubInstanceIp")]
        public string? PubOrSubInstanceIp { get; set; }

        /// <summary>
        /// Name of publish database.
        /// </summary>
        [Input("publishDatabase")]
        public string? PublishDatabase { get; set; }

        /// <summary>
        /// The id of the Publish and Subscribe.
        /// </summary>
        [Input("publishSubscribeId")]
        public int? PublishSubscribeId { get; set; }

        /// <summary>
        /// The name of the Publish and Subscribe.
        /// </summary>
        [Input("publishSubscribeName")]
        public string? PublishSubscribeName { get; set; }

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

        /// <summary>
        /// Name of subscribe database.
        /// </summary>
        [Input("subscribeDatabase")]
        public string? SubscribeDatabase { get; set; }

        public GetPublishSubscribesArgs()
        {
        }
    }

    public sealed class GetPublishSubscribesInvokeArgs : Pulumi.InvokeArgs
    {
        /// <summary>
        /// ID of the SQL Server instance.
        /// </summary>
        [Input("instanceId", required: true)]
        public Input<string> InstanceId { get; set; } = null!;

        /// <summary>
        /// The subscribe/publish instance ID. It is related to whether the `instance_id` is a publish instance or a subscribe instance. when `instance_id` is a publish instance, this field is filtered according to the subscribe instance ID; when `instance_id` is a subscribe instance, this field is filtering according to the publish instance ID.
        /// </summary>
        [Input("pubOrSubInstanceId")]
        public Input<string>? PubOrSubInstanceId { get; set; }

        /// <summary>
        /// The intranet IP of the subscribe/publish instance. It is related to whether the `instance_id` is a publish instance or a subscribe instance. when `instance_id` is a publish instance, this field is filtered according to the intranet IP of the subscribe instance; when `instance_id` is a subscribe instance, this field is based on the publish instance intranet IP filter.
        /// </summary>
        [Input("pubOrSubInstanceIp")]
        public Input<string>? PubOrSubInstanceIp { get; set; }

        /// <summary>
        /// Name of publish database.
        /// </summary>
        [Input("publishDatabase")]
        public Input<string>? PublishDatabase { get; set; }

        /// <summary>
        /// The id of the Publish and Subscribe.
        /// </summary>
        [Input("publishSubscribeId")]
        public Input<int>? PublishSubscribeId { get; set; }

        /// <summary>
        /// The name of the Publish and Subscribe.
        /// </summary>
        [Input("publishSubscribeName")]
        public Input<string>? PublishSubscribeName { get; set; }

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

        /// <summary>
        /// Name of subscribe database.
        /// </summary>
        [Input("subscribeDatabase")]
        public Input<string>? SubscribeDatabase { get; set; }

        public GetPublishSubscribesInvokeArgs()
        {
        }
    }


    [OutputType]
    public sealed class GetPublishSubscribesResult
    {
        /// <summary>
        /// The provider-assigned unique ID for this managed resource.
        /// </summary>
        public readonly string Id;
        public readonly string InstanceId;
        public readonly string? PubOrSubInstanceId;
        public readonly string? PubOrSubInstanceIp;
        /// <summary>
        /// Name of the publish SQL Server instance.
        /// </summary>
        public readonly string? PublishDatabase;
        /// <summary>
        /// The id of the Publish and Subscribe.
        /// </summary>
        public readonly int? PublishSubscribeId;
        /// <summary>
        /// Publish and subscribe list. Each element contains the following attributes.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetPublishSubscribesPublishSubscribeListResult> PublishSubscribeLists;
        /// <summary>
        /// The name of the Publish and Subscribe.
        /// </summary>
        public readonly string? PublishSubscribeName;
        public readonly string? ResultOutputFile;
        /// <summary>
        /// Name of the subscribe SQL Server instance.
        /// </summary>
        public readonly string? SubscribeDatabase;

        [OutputConstructor]
        private GetPublishSubscribesResult(
            string id,

            string instanceId,

            string? pubOrSubInstanceId,

            string? pubOrSubInstanceIp,

            string? publishDatabase,

            int? publishSubscribeId,

            ImmutableArray<Outputs.GetPublishSubscribesPublishSubscribeListResult> publishSubscribeLists,

            string? publishSubscribeName,

            string? resultOutputFile,

            string? subscribeDatabase)
        {
            Id = id;
            InstanceId = instanceId;
            PubOrSubInstanceId = pubOrSubInstanceId;
            PubOrSubInstanceIp = pubOrSubInstanceIp;
            PublishDatabase = publishDatabase;
            PublishSubscribeId = publishSubscribeId;
            PublishSubscribeLists = publishSubscribeLists;
            PublishSubscribeName = publishSubscribeName;
            ResultOutputFile = resultOutputFile;
            SubscribeDatabase = subscribeDatabase;
        }
    }
}
