<filename>sdk/dotnet/Dts/SubscriptionJob.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;

namespace Pulumi.AliCloud.Dts
{
    /// <summary>
    /// Provides a DTS Subscription Job resource.
    /// 
    /// For information about DTS Subscription Job and how to use it, see [What is Subscription Job](https://help.aliyun.com/document_detail/254791.html).
    /// 
    /// &gt; **NOTE:** Available in v1.138.0+.
    /// 
    /// ## Example Usage
    /// 
    /// Basic Usage
    /// 
    /// ```csharp
    /// using System.Collections.Generic;
    /// using System.Linq;
    /// using Pulumi;
    /// using AliCloud = Pulumi.AliCloud;
    /// 
    /// return await Deployment.RunAsync(() =&gt; 
    /// {
    ///     var config = new Config();
    ///     var name = config.Get("name") ?? "dtsSubscriptionJob";
    ///     var creation = config.Get("creation") ?? "Rds";
    ///     var defaultZones = AliCloud.GetZones.Invoke(new()
    ///     {
    ///         AvailableResourceCreation = creation,
    ///     });
    /// 
    ///     var defaultNetwork = new AliCloud.Vpc.Network("defaultNetwork", new()
    ///     {
    ///         VpcName = name,
    ///         CidrBlock = "172.16.0.0/16",
    ///     });
    /// 
    ///     var defaultSwitch = new AliCloud.Vpc.Switch("defaultSwitch", new()
    ///     {
    ///         VpcId = defaultNetwork.Id,
    ///         CidrBlock = "172.16.0.0/24",
    ///         ZoneId = defaultZones.Apply(getZonesResult =&gt; getZonesResult.Zones[0]?.Id),
    ///         VswitchName = name,
    ///     });
    /// 
    ///     var instance = new AliCloud.Rds.Instance("instance", new()
    ///     {
    ///         Engine = "MySQL",
    ///         EngineVersion = "5.6",
    ///         InstanceType = "rds.mysql.s1.small",
    ///         InstanceStorage = 10,
    ///         VswitchId = defaultSwitch.Id,
    ///         InstanceName = name,
    ///     });
    /// 
    ///     var db = new List&lt;AliCloud.Rds.Database&gt;();
    ///     for (var rangeIndex = 0; rangeIndex &lt; 2; rangeIndex++)
    ///     {
    ///         var range = new { Value = rangeIndex };
    ///         db.Add(new AliCloud.Rds.Database($"db-{range.Value}", new()
    ///         {
    ///             InstanceId = instance.Id,
    ///             Description = "from terraform",
    ///         }));
    ///     }
    ///     var account = new AliCloud.Rds.Account("account", new()
    ///     {
    ///         InstanceId = instance.Id,
    ///         Password = "Test12345",
    ///         Description = "from terraform",
    ///     });
    /// 
    ///     var privilege = new AliCloud.Rds.AccountPrivilege("privilege", new()
    ///     {
    ///         InstanceId = instance.Id,
    ///         AccountName = account.Name,
    ///         Privilege = "ReadWrite",
    ///         DbNames = db.Select(__item =&gt; __item.Name).ToList(),
    ///     });
    /// 
    ///     var default1Networks = AliCloud.Vpc.GetNetworks.Invoke(new()
    ///     {
    ///         NameRegex = "default-NODELETING",
    ///     });
    /// 
    ///     var default1Switches = AliCloud.Vpc.GetSwitches.Invoke(new()
    ///     {
    ///         VpcId = data.Alicloud_vpcs.Default.Ids[0],
    ///     });
    /// 
    ///     var defaultSubscriptionJob = new AliCloud.Dts.SubscriptionJob("defaultSubscriptionJob", new()
    ///     {
    ///         DtsJobName = name,
    ///         PaymentType = "PayAsYouGo",
    ///         SourceEndpointEngineName = "MySQL",
    ///         SourceEndpointRegion = "cn-hangzhou",
    ///         SourceEndpointInstanceType = "RDS",
    ///         SourceEndpointInstanceId = instance.Id,
    ///         SourceEndpointDatabaseName = "tfaccountpri_0",
    ///         SourceEndpointUserName = "tftestprivilege",
    ///         SourceEndpointPassword = "Test12345",
    ///         DbList = @"        {""dtstestdata"": {""name"": ""tfaccountpri_0"", ""all"": true}}
    /// ",
    ///         SubscriptionInstanceNetworkType = "vpc",
    ///         SubscriptionInstanceVpcId = default1Networks.Apply(getNetworksResult =&gt; getNetworksResult.Ids[0]),
    ///         SubscriptionInstanceVswitchId = default1Switches.Apply(getSwitchesResult =&gt; getSwitchesResult.Ids[0]),
    ///         Status = "Normal",
    ///     });
    /// 
    /// });
    /// ```
    /// 
    /// ## Import
    /// 
    /// DTS Subscription Job can be imported using the id, e.g.
    /// 
    /// ```sh
    ///  $ pulumi import alicloud:dts/subscriptionJob:SubscriptionJob example &lt;id&gt;
    /// ```
    /// </summary>
    [AliCloudResourceType("alicloud:dts/subscriptionJob:SubscriptionJob")]
    public partial class SubscriptionJob : global::Pulumi.CustomResource
    {
        /// <summary>
        /// Subscription start time in Unix timestamp format.
        /// </summary>
        [Output("checkpoint")]
        public Output<string> Checkpoint { get; private set; } = null!;

        /// <summary>
        /// [ETL specifications](https://help.aliyun.com/document_detail/212324.html). The unit is the computing unit ComputeUnit (CU), 1CU=1vCPU+4 GB memory. The value range is an integer greater than or equal to 2.
        /// </summary>
        [Output("computeUnit")]
        public Output<int?> ComputeUnit { get; private set; } = null!;

        /// <summary>
        /// The number of private customized RDS instances under PolarDB-X. The default value is 1. This parameter needs to be passed only when `source_endpoint_engine_name` equals `drds`.
        /// </summary>
        [Output("databaseCount")]
        public Output<int?> DatabaseCount { get; private set; } = null!;

        /// <summary>
        /// Subscription object, in the format of JSON strings. For detailed definitions, please refer to the description of migration, synchronization or subscription objects [document](https://help.aliyun.com/document_detail/209545.html).
        /// </summary>
        [Output("dbList")]
        public Output<string?> DbList { get; private set; } = null!;

        /// <summary>
        /// This parameter decides whether to monitor the delay status. Valid values: `true`, `false`.
        /// </summary>
        [Output("delayNotice")]
        public Output<bool?> DelayNotice { get; private set; } = null!;

        /// <summary>
        /// The mobile phone number of the contact who delayed the alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Output("delayPhone")]
        public Output<string?> DelayPhone { get; private set; } = null!;

        /// <summary>
        /// When `delay_notice` is set to `true`, this parameter must be passed in. The threshold for triggering the delay alarm. The unit is second and needs to be an integer. The threshold can be set according to business needs. It is recommended to set it above 10 seconds to avoid delay fluctuations caused by network and database load.
        /// </summary>
        [Output("delayRuleTime")]
        public Output<string?> DelayRuleTime { get; private set; } = null!;

        /// <summary>
        /// The destination endpoint engine name. Valid values: `ADS`, `DB2`, `DRDS`, `DataHub`, `Greenplum`, `MSSQL`, `MySQL`, `PolarDB`, `PostgreSQL`, `Redis`, `Tablestore`, `as400`, `clickhouse`, `kafka`, `mongodb`, `odps`, `oracle`, `polardb_o`, `polardb_pg`, `tidb`.
        /// </summary>
        [Output("destinationEndpointEngineName")]
        public Output<string?> DestinationEndpointEngineName { get; private set; } = null!;

        /// <summary>
        /// The destination region. List of [supported regions](https://help.aliyun.com/document_detail/141033.html).
        /// </summary>
        [Output("destinationRegion")]
        public Output<string?> DestinationRegion { get; private set; } = null!;

        /// <summary>
        /// The ID of subscription instance.
        /// </summary>
        [Output("dtsInstanceId")]
        public Output<string> DtsInstanceId { get; private set; } = null!;

        /// <summary>
        /// The name of subscription task.
        /// </summary>
        [Output("dtsJobName")]
        public Output<string?> DtsJobName { get; private set; } = null!;

        /// <summary>
        /// This parameter decides whether to monitor abnormal status. Valid values: `true`, `false`.
        /// </summary>
        [Output("errorNotice")]
        public Output<bool?> ErrorNotice { get; private set; } = null!;

        /// <summary>
        /// The mobile phone number of the contact for abnormal alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Output("errorPhone")]
        public Output<string?> ErrorPhone { get; private set; } = null!;

        /// <summary>
        /// The instance class. Valid values: `large`, `medium`, `micro`, `small`, `xlarge`, `xxlarge`.
        /// </summary>
        [Output("instanceClass")]
        public Output<string?> InstanceClass { get; private set; } = null!;

        /// <summary>
        /// The duration of prepaid instance purchase. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Output("paymentDuration")]
        public Output<int?> PaymentDuration { get; private set; } = null!;

        /// <summary>
        /// The payment duration unit. Valid values: `Month`, `Year`. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Output("paymentDurationUnit")]
        public Output<string?> PaymentDurationUnit { get; private set; } = null!;

        /// <summary>
        /// The payment type of the resource. Valid values: `Subscription`, `PayAsYouGo`.
        /// </summary>
        [Output("paymentType")]
        public Output<string> PaymentType { get; private set; } = null!;

        /// <summary>
        /// DTS reserves parameters, the format is a JSON string, you can pass in this parameter to complete the source and target database information (such as the data storage format of the target Kafka database, the instance ID of the cloud enterprise network CEN). For more information, please refer to the parameter description of the [Reserve parameter](https://help.aliyun.com/document_detail/176470.html).
        /// </summary>
        [Output("reserve")]
        public Output<string?> Reserve { get; private set; } = null!;

        /// <summary>
        /// To subscribe to the name of the database.
        /// </summary>
        [Output("sourceEndpointDatabaseName")]
        public Output<string?> SourceEndpointDatabaseName { get; private set; } = null!;

        /// <summary>
        /// The source database type value is MySQL or Oracle. Valid values: `MySQL`, `Oracle`.
        /// </summary>
        [Output("sourceEndpointEngineName")]
        public Output<string> SourceEndpointEngineName { get; private set; } = null!;

        /// <summary>
        /// The ID of source instance. Only when the type of source database instance was RDS MySQL, PolarDB-X 1.0, PolarDB MySQL, this parameter can be available and must be set.
        /// </summary>
        [Output("sourceEndpointInstanceId")]
        public Output<string?> SourceEndpointInstanceId { get; private set; } = null!;

        /// <summary>
        /// The type of source instance. Valid values: `RDS`, `PolarDB`, `DRDS`, `LocalInstance`, `ECS`, `Express`, `CEN`, `dg`.
        /// </summary>
        [Output("sourceEndpointInstanceType")]
        public Output<string> SourceEndpointInstanceType { get; private set; } = null!;

        /// <summary>
        /// The IP of source endpoint.
        /// </summary>
        [Output("sourceEndpointIp")]
        public Output<string?> SourceEndpointIp { get; private set; } = null!;

        /// <summary>
        /// The SID of Oracle Database. When the source database is self-built Oracle and the Oracle database is a non-RAC instance, this parameter is available and must be passed in.
        /// </summary>
        [Output("sourceEndpointOracleSid")]
        public Output<string?> SourceEndpointOracleSid { get; private set; } = null!;

        /// <summary>
        /// The Alibaba Cloud account ID to which the source instance belongs. This parameter is only available when configuring data subscriptions across Alibaba Cloud accounts and must be passed in.
        /// </summary>
        [Output("sourceEndpointOwnerId")]
        public Output<string?> SourceEndpointOwnerId { get; private set; } = null!;

        /// <summary>
        /// The password of source database instance account.
        /// </summary>
        [Output("sourceEndpointPassword")]
        public Output<string?> SourceEndpointPassword { get; private set; } = null!;

        /// <summary>
        /// The port of source database.
        /// </summary>
        [Output("sourceEndpointPort")]
        public Output<string?> SourceEndpointPort { get; private set; } = null!;

        /// <summary>
        /// The region of source database.
        /// </summary>
        [Output("sourceEndpointRegion")]
        public Output<string> SourceEndpointRegion { get; private set; } = null!;

        /// <summary>
        /// Both the authorization roles. When the source instance and configure subscriptions task of the Alibaba Cloud account is not the same as the need to pass the parameter, to specify the source of the authorization roles, to allow configuration subscription task of the Alibaba Cloud account to access the source of the source instance information.
        /// </summary>
        [Output("sourceEndpointRole")]
        public Output<string?> SourceEndpointRole { get; private set; } = null!;

        /// <summary>
        /// The username of source database instance account.
        /// </summary>
        [Output("sourceEndpointUserName")]
        public Output<string?> SourceEndpointUserName { get; private set; } = null!;

        /// <summary>
        /// The status of the task. Valid values: `Normal`, `Abnormal`. When a task created, it is in this state of `NotStarted`. You can specify this state to `Normal` to start the job, and specify this state of `Abnormal` to stop the job. **Note: We treat the state `Starting` as the state of `Normal`, and consider the two states to be consistent on the user side.**
        /// </summary>
        [Output("status")]
        public Output<string> Status { get; private set; } = null!;

        /// <summary>
        /// Whether to subscribe the DDL type of data. Valid values: `true`, `false`.
        /// </summary>
        [Output("subscriptionDataTypeDdl")]
        public Output<bool> SubscriptionDataTypeDdl { get; private set; } = null!;

        /// <summary>
        /// Whether to subscribe the DML type of data. Valid values: `true`, `false`.
        /// </summary>
        [Output("subscriptionDataTypeDml")]
        public Output<bool> SubscriptionDataTypeDml { get; private set; } = null!;

        /// <summary>
        /// Subscription task type of network value: classic: classic Network. Virtual Private Cloud (vpc): a vpc. Valid values: `classic`, `vpc`.
        /// </summary>
        [Output("subscriptionInstanceNetworkType")]
        public Output<string?> SubscriptionInstanceNetworkType { get; private set; } = null!;

        /// <summary>
        /// The ID of subscription vpc instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Output("subscriptionInstanceVpcId")]
        public Output<string?> SubscriptionInstanceVpcId { get; private set; } = null!;

        /// <summary>
        /// The ID of subscription VSwitch instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Output("subscriptionInstanceVswitchId")]
        public Output<string?> SubscriptionInstanceVswitchId { get; private set; } = null!;

        /// <summary>
        /// The sync architecture. Valid values: `bidirectional`, `oneway`.
        /// </summary>
        [Output("syncArchitecture")]
        public Output<string?> SyncArchitecture { get; private set; } = null!;

        /// <summary>
        /// The synchronization direction. Valid values: `Forward`, `Reverse`. When the topology type of the data synchronization instance is bidirectional, it can be passed in to reverse to start the reverse synchronization link.
        /// </summary>
        [Output("synchronizationDirection")]
        public Output<string?> SynchronizationDirection { get; private set; } = null!;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        [Output("tags")]
        public Output<ImmutableDictionary<string, object>?> Tags { get; private set; } = null!;


        /// <summary>
        /// Create a SubscriptionJob resource with the given unique name, arguments, and options.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resource</param>
        /// <param name="args">The arguments used to populate this resource's properties</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public SubscriptionJob(string name, SubscriptionJobArgs args, CustomResourceOptions? options = null)
            : base("alicloud:dts/subscriptionJob:SubscriptionJob", name, args ?? new SubscriptionJobArgs(), MakeResourceOptions(options, ""))
        {
        }

        private SubscriptionJob(string name, Input<string> id, SubscriptionJobState? state = null, CustomResourceOptions? options = null)
            : base("alicloud:dts/subscriptionJob:SubscriptionJob", name, state, MakeResourceOptions(options, id))
        {
        }

        private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
        {
            var defaultOptions = new CustomResourceOptions
            {
                Version = Utilities.Version,
                PluginDownloadURL = "github://api.github.com/rhysmdnz/pulumi-alicloud",
            };
            var merged = CustomResourceOptions.Merge(defaultOptions, options);
            // Override the ID if one was specified for consistency with other language SDKs.
            merged.Id = id ?? merged.Id;
            return merged;
        }
        /// <summary>
        /// Get an existing SubscriptionJob resource's state with the given name, ID, and optional extra
        /// properties used to qualify the lookup.
        /// </summary>
        ///
        /// <param name="name">The unique name of the resulting resource.</param>
        /// <param name="id">The unique provider ID of the resource to lookup.</param>
        /// <param name="state">Any extra arguments used during the lookup.</param>
        /// <param name="options">A bag of options that control this resource's behavior</param>
        public static SubscriptionJob Get(string name, Input<string> id, SubscriptionJobState? state = null, CustomResourceOptions? options = null)
        {
            return new SubscriptionJob(name, id, state, options);
        }
    }

    public sealed class SubscriptionJobArgs : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Subscription start time in Unix timestamp format.
        /// </summary>
        [Input("checkpoint")]
        public Input<string>? Checkpoint { get; set; }

        /// <summary>
        /// [ETL specifications](https://help.aliyun.com/document_detail/212324.html). The unit is the computing unit ComputeUnit (CU), 1CU=1vCPU+4 GB memory. The value range is an integer greater than or equal to 2.
        /// </summary>
        [Input("computeUnit")]
        public Input<int>? ComputeUnit { get; set; }

        /// <summary>
        /// The number of private customized RDS instances under PolarDB-X. The default value is 1. This parameter needs to be passed only when `source_endpoint_engine_name` equals `drds`.
        /// </summary>
        [Input("databaseCount")]
        public Input<int>? DatabaseCount { get; set; }

        /// <summary>
        /// Subscription object, in the format of JSON strings. For detailed definitions, please refer to the description of migration, synchronization or subscription objects [document](https://help.aliyun.com/document_detail/209545.html).
        /// </summary>
        [Input("dbList")]
        public Input<string>? DbList { get; set; }

        /// <summary>
        /// This parameter decides whether to monitor the delay status. Valid values: `true`, `false`.
        /// </summary>
        [Input("delayNotice")]
        public Input<bool>? DelayNotice { get; set; }

        /// <summary>
        /// The mobile phone number of the contact who delayed the alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Input("delayPhone")]
        public Input<string>? DelayPhone { get; set; }

        /// <summary>
        /// When `delay_notice` is set to `true`, this parameter must be passed in. The threshold for triggering the delay alarm. The unit is second and needs to be an integer. The threshold can be set according to business needs. It is recommended to set it above 10 seconds to avoid delay fluctuations caused by network and database load.
        /// </summary>
        [Input("delayRuleTime")]
        public Input<string>? DelayRuleTime { get; set; }

        /// <summary>
        /// The destination endpoint engine name. Valid values: `ADS`, `DB2`, `DRDS`, `DataHub`, `Greenplum`, `MSSQL`, `MySQL`, `PolarDB`, `PostgreSQL`, `Redis`, `Tablestore`, `as400`, `clickhouse`, `kafka`, `mongodb`, `odps`, `oracle`, `polardb_o`, `polardb_pg`, `tidb`.
        /// </summary>
        [Input("destinationEndpointEngineName")]
        public Input<string>? DestinationEndpointEngineName { get; set; }

        /// <summary>
        /// The destination region. List of [supported regions](https://help.aliyun.com/document_detail/141033.html).
        /// </summary>
        [Input("destinationRegion")]
        public Input<string>? DestinationRegion { get; set; }

        /// <summary>
        /// The ID of subscription instance.
        /// </summary>
        [Input("dtsInstanceId")]
        public Input<string>? DtsInstanceId { get; set; }

        /// <summary>
        /// The name of subscription task.
        /// </summary>
        [Input("dtsJobName")]
        public Input<string>? DtsJobName { get; set; }

        /// <summary>
        /// This parameter decides whether to monitor abnormal status. Valid values: `true`, `false`.
        /// </summary>
        [Input("errorNotice")]
        public Input<bool>? ErrorNotice { get; set; }

        /// <summary>
        /// The mobile phone number of the contact for abnormal alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Input("errorPhone")]
        public Input<string>? ErrorPhone { get; set; }

        /// <summary>
        /// The instance class. Valid values: `large`, `medium`, `micro`, `small`, `xlarge`, `xxlarge`.
        /// </summary>
        [Input("instanceClass")]
        public Input<string>? InstanceClass { get; set; }

        /// <summary>
        /// The duration of prepaid instance purchase. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Input("paymentDuration")]
        public Input<int>? PaymentDuration { get; set; }

        /// <summary>
        /// The payment duration unit. Valid values: `Month`, `Year`. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Input("paymentDurationUnit")]
        public Input<string>? PaymentDurationUnit { get; set; }

        /// <summary>
        /// The payment type of the resource. Valid values: `Subscription`, `PayAsYouGo`.
        /// </summary>
        [Input("paymentType", required: true)]
        public Input<string> PaymentType { get; set; } = null!;

        /// <summary>
        /// DTS reserves parameters, the format is a JSON string, you can pass in this parameter to complete the source and target database information (such as the data storage format of the target Kafka database, the instance ID of the cloud enterprise network CEN). For more information, please refer to the parameter description of the [Reserve parameter](https://help.aliyun.com/document_detail/176470.html).
        /// </summary>
        [Input("reserve")]
        public Input<string>? Reserve { get; set; }

        /// <summary>
        /// To subscribe to the name of the database.
        /// </summary>
        [Input("sourceEndpointDatabaseName")]
        public Input<string>? SourceEndpointDatabaseName { get; set; }

        /// <summary>
        /// The source database type value is MySQL or Oracle. Valid values: `MySQL`, `Oracle`.
        /// </summary>
        [Input("sourceEndpointEngineName", required: true)]
        public Input<string> SourceEndpointEngineName { get; set; } = null!;

        /// <summary>
        /// The ID of source instance. Only when the type of source database instance was RDS MySQL, PolarDB-X 1.0, PolarDB MySQL, this parameter can be available and must be set.
        /// </summary>
        [Input("sourceEndpointInstanceId")]
        public Input<string>? SourceEndpointInstanceId { get; set; }

        /// <summary>
        /// The type of source instance. Valid values: `RDS`, `PolarDB`, `DRDS`, `LocalInstance`, `ECS`, `Express`, `CEN`, `dg`.
        /// </summary>
        [Input("sourceEndpointInstanceType", required: true)]
        public Input<string> SourceEndpointInstanceType { get; set; } = null!;

        /// <summary>
        /// The IP of source endpoint.
        /// </summary>
        [Input("sourceEndpointIp")]
        public Input<string>? SourceEndpointIp { get; set; }

        /// <summary>
        /// The SID of Oracle Database. When the source database is self-built Oracle and the Oracle database is a non-RAC instance, this parameter is available and must be passed in.
        /// </summary>
        [Input("sourceEndpointOracleSid")]
        public Input<string>? SourceEndpointOracleSid { get; set; }

        /// <summary>
        /// The Alibaba Cloud account ID to which the source instance belongs. This parameter is only available when configuring data subscriptions across Alibaba Cloud accounts and must be passed in.
        /// </summary>
        [Input("sourceEndpointOwnerId")]
        public Input<string>? SourceEndpointOwnerId { get; set; }

        /// <summary>
        /// The password of source database instance account.
        /// </summary>
        [Input("sourceEndpointPassword")]
        public Input<string>? SourceEndpointPassword { get; set; }

        /// <summary>
        /// The port of source database.
        /// </summary>
        [Input("sourceEndpointPort")]
        public Input<string>? SourceEndpointPort { get; set; }

        /// <summary>
        /// The region of source database.
        /// </summary>
        [Input("sourceEndpointRegion", required: true)]
        public Input<string> SourceEndpointRegion { get; set; } = null!;

        /// <summary>
        /// Both the authorization roles. When the source instance and configure subscriptions task of the Alibaba Cloud account is not the same as the need to pass the parameter, to specify the source of the authorization roles, to allow configuration subscription task of the Alibaba Cloud account to access the source of the source instance information.
        /// </summary>
        [Input("sourceEndpointRole")]
        public Input<string>? SourceEndpointRole { get; set; }

        /// <summary>
        /// The username of source database instance account.
        /// </summary>
        [Input("sourceEndpointUserName")]
        public Input<string>? SourceEndpointUserName { get; set; }

        /// <summary>
        /// The status of the task. Valid values: `Normal`, `Abnormal`. When a task created, it is in this state of `NotStarted`. You can specify this state to `Normal` to start the job, and specify this state of `Abnormal` to stop the job. **Note: We treat the state `Starting` as the state of `Normal`, and consider the two states to be consistent on the user side.**
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Whether to subscribe the DDL type of data. Valid values: `true`, `false`.
        /// </summary>
        [Input("subscriptionDataTypeDdl")]
        public Input<bool>? SubscriptionDataTypeDdl { get; set; }

        /// <summary>
        /// Whether to subscribe the DML type of data. Valid values: `true`, `false`.
        /// </summary>
        [Input("subscriptionDataTypeDml")]
        public Input<bool>? SubscriptionDataTypeDml { get; set; }

        /// <summary>
        /// Subscription task type of network value: classic: classic Network. Virtual Private Cloud (vpc): a vpc. Valid values: `classic`, `vpc`.
        /// </summary>
        [Input("subscriptionInstanceNetworkType")]
        public Input<string>? SubscriptionInstanceNetworkType { get; set; }

        /// <summary>
        /// The ID of subscription vpc instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Input("subscriptionInstanceVpcId")]
        public Input<string>? SubscriptionInstanceVpcId { get; set; }

        /// <summary>
        /// The ID of subscription VSwitch instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Input("subscriptionInstanceVswitchId")]
        public Input<string>? SubscriptionInstanceVswitchId { get; set; }

        /// <summary>
        /// The sync architecture. Valid values: `bidirectional`, `oneway`.
        /// </summary>
        [Input("syncArchitecture")]
        public Input<string>? SyncArchitecture { get; set; }

        /// <summary>
        /// The synchronization direction. Valid values: `Forward`, `Reverse`. When the topology type of the data synchronization instance is bidirectional, it can be passed in to reverse to start the reverse synchronization link.
        /// </summary>
        [Input("synchronizationDirection")]
        public Input<string>? SynchronizationDirection { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

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

    public sealed class SubscriptionJobState : global::Pulumi.ResourceArgs
    {
        /// <summary>
        /// Subscription start time in Unix timestamp format.
        /// </summary>
        [Input("checkpoint")]
        public Input<string>? Checkpoint { get; set; }

        /// <summary>
        /// [ETL specifications](https://help.aliyun.com/document_detail/212324.html). The unit is the computing unit ComputeUnit (CU), 1CU=1vCPU+4 GB memory. The value range is an integer greater than or equal to 2.
        /// </summary>
        [Input("computeUnit")]
        public Input<int>? ComputeUnit { get; set; }

        /// <summary>
        /// The number of private customized RDS instances under PolarDB-X. The default value is 1. This parameter needs to be passed only when `source_endpoint_engine_name` equals `drds`.
        /// </summary>
        [Input("databaseCount")]
        public Input<int>? DatabaseCount { get; set; }

        /// <summary>
        /// Subscription object, in the format of JSON strings. For detailed definitions, please refer to the description of migration, synchronization or subscription objects [document](https://help.aliyun.com/document_detail/209545.html).
        /// </summary>
        [Input("dbList")]
        public Input<string>? DbList { get; set; }

        /// <summary>
        /// This parameter decides whether to monitor the delay status. Valid values: `true`, `false`.
        /// </summary>
        [Input("delayNotice")]
        public Input<bool>? DelayNotice { get; set; }

        /// <summary>
        /// The mobile phone number of the contact who delayed the alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Input("delayPhone")]
        public Input<string>? DelayPhone { get; set; }

        /// <summary>
        /// When `delay_notice` is set to `true`, this parameter must be passed in. The threshold for triggering the delay alarm. The unit is second and needs to be an integer. The threshold can be set according to business needs. It is recommended to set it above 10 seconds to avoid delay fluctuations caused by network and database load.
        /// </summary>
        [Input("delayRuleTime")]
        public Input<string>? DelayRuleTime { get; set; }

        /// <summary>
        /// The destination endpoint engine name. Valid values: `ADS`, `DB2`, `DRDS`, `DataHub`, `Greenplum`, `MSSQL`, `MySQL`, `PolarDB`, `PostgreSQL`, `Redis`, `Tablestore`, `as400`, `clickhouse`, `kafka`, `mongodb`, `odps`, `oracle`, `polardb_o`, `polardb_pg`, `tidb`.
        /// </summary>
        [Input("destinationEndpointEngineName")]
        public Input<string>? DestinationEndpointEngineName { get; set; }

        /// <summary>
        /// The destination region. List of [supported regions](https://help.aliyun.com/document_detail/141033.html).
        /// </summary>
        [Input("destinationRegion")]
        public Input<string>? DestinationRegion { get; set; }

        /// <summary>
        /// The ID of subscription instance.
        /// </summary>
        [Input("dtsInstanceId")]
        public Input<string>? DtsInstanceId { get; set; }

        /// <summary>
        /// The name of subscription task.
        /// </summary>
        [Input("dtsJobName")]
        public Input<string>? DtsJobName { get; set; }

        /// <summary>
        /// This parameter decides whether to monitor abnormal status. Valid values: `true`, `false`.
        /// </summary>
        [Input("errorNotice")]
        public Input<bool>? ErrorNotice { get; set; }

        /// <summary>
        /// The mobile phone number of the contact for abnormal alarm. Multiple mobile phone numbers separated by English commas `,`. This parameter currently only supports China stations, and only supports mainland mobile phone numbers, and up to 10 mobile phone numbers can be passed in.
        /// </summary>
        [Input("errorPhone")]
        public Input<string>? ErrorPhone { get; set; }

        /// <summary>
        /// The instance class. Valid values: `large`, `medium`, `micro`, `small`, `xlarge`, `xxlarge`.
        /// </summary>
        [Input("instanceClass")]
        public Input<string>? InstanceClass { get; set; }

        /// <summary>
        /// The duration of prepaid instance purchase. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Input("paymentDuration")]
        public Input<int>? PaymentDuration { get; set; }

        /// <summary>
        /// The payment duration unit. Valid values: `Month`, `Year`. When `payment_type` is `Subscription`, this parameter is valid and must be passed in.
        /// </summary>
        [Input("paymentDurationUnit")]
        public Input<string>? PaymentDurationUnit { get; set; }

        /// <summary>
        /// The payment type of the resource. Valid values: `Subscription`, `PayAsYouGo`.
        /// </summary>
        [Input("paymentType")]
        public Input<string>? PaymentType { get; set; }

        /// <summary>
        /// DTS reserves parameters, the format is a JSON string, you can pass in this parameter to complete the source and target database information (such as the data storage format of the target Kafka database, the instance ID of the cloud enterprise network CEN). For more information, please refer to the parameter description of the [Reserve parameter](https://help.aliyun.com/document_detail/176470.html).
        /// </summary>
        [Input("reserve")]
        public Input<string>? Reserve { get; set; }

        /// <summary>
        /// To subscribe to the name of the database.
        /// </summary>
        [Input("sourceEndpointDatabaseName")]
        public Input<string>? SourceEndpointDatabaseName { get; set; }

        /// <summary>
        /// The source database type value is MySQL or Oracle. Valid values: `MySQL`, `Oracle`.
        /// </summary>
        [Input("sourceEndpointEngineName")]
        public Input<string>? SourceEndpointEngineName { get; set; }

        /// <summary>
        /// The ID of source instance. Only when the type of source database instance was RDS MySQL, PolarDB-X 1.0, PolarDB MySQL, this parameter can be available and must be set.
        /// </summary>
        [Input("sourceEndpointInstanceId")]
        public Input<string>? SourceEndpointInstanceId { get; set; }

        /// <summary>
        /// The type of source instance. Valid values: `RDS`, `PolarDB`, `DRDS`, `LocalInstance`, `ECS`, `Express`, `CEN`, `dg`.
        /// </summary>
        [Input("sourceEndpointInstanceType")]
        public Input<string>? SourceEndpointInstanceType { get; set; }

        /// <summary>
        /// The IP of source endpoint.
        /// </summary>
        [Input("sourceEndpointIp")]
        public Input<string>? SourceEndpointIp { get; set; }

        /// <summary>
        /// The SID of Oracle Database. When the source database is self-built Oracle and the Oracle database is a non-RAC instance, this parameter is available and must be passed in.
        /// </summary>
        [Input("sourceEndpointOracleSid")]
        public Input<string>? SourceEndpointOracleSid { get; set; }

        /// <summary>
        /// The Alibaba Cloud account ID to which the source instance belongs. This parameter is only available when configuring data subscriptions across Alibaba Cloud accounts and must be passed in.
        /// </summary>
        [Input("sourceEndpointOwnerId")]
        public Input<string>? SourceEndpointOwnerId { get; set; }

        /// <summary>
        /// The password of source database instance account.
        /// </summary>
        [Input("sourceEndpointPassword")]
        public Input<string>? SourceEndpointPassword { get; set; }

        /// <summary>
        /// The port of source database.
        /// </summary>
        [Input("sourceEndpointPort")]
        public Input<string>? SourceEndpointPort { get; set; }

        /// <summary>
        /// The region of source database.
        /// </summary>
        [Input("sourceEndpointRegion")]
        public Input<string>? SourceEndpointRegion { get; set; }

        /// <summary>
        /// Both the authorization roles. When the source instance and configure subscriptions task of the Alibaba Cloud account is not the same as the need to pass the parameter, to specify the source of the authorization roles, to allow configuration subscription task of the Alibaba Cloud account to access the source of the source instance information.
        /// </summary>
        [Input("sourceEndpointRole")]
        public Input<string>? SourceEndpointRole { get; set; }

        /// <summary>
        /// The username of source database instance account.
        /// </summary>
        [Input("sourceEndpointUserName")]
        public Input<string>? SourceEndpointUserName { get; set; }

        /// <summary>
        /// The status of the task. Valid values: `Normal`, `Abnormal`. When a task created, it is in this state of `NotStarted`. You can specify this state to `Normal` to start the job, and specify this state of `Abnormal` to stop the job. **Note: We treat the state `Starting` as the state of `Normal`, and consider the two states to be consistent on the user side.**
        /// </summary>
        [Input("status")]
        public Input<string>? Status { get; set; }

        /// <summary>
        /// Whether to subscribe the DDL type of data. Valid values: `true`, `false`.
        /// </summary>
        [Input("subscriptionDataTypeDdl")]
        public Input<bool>? SubscriptionDataTypeDdl { get; set; }

        /// <summary>
        /// Whether to subscribe the DML type of data. Valid values: `true`, `false`.
        /// </summary>
        [Input("subscriptionDataTypeDml")]
        public Input<bool>? SubscriptionDataTypeDml { get; set; }

        /// <summary>
        /// Subscription task type of network value: classic: classic Network. Virtual Private Cloud (vpc): a vpc. Valid values: `classic`, `vpc`.
        /// </summary>
        [Input("subscriptionInstanceNetworkType")]
        public Input<string>? SubscriptionInstanceNetworkType { get; set; }

        /// <summary>
        /// The ID of subscription vpc instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Input("subscriptionInstanceVpcId")]
        public Input<string>? SubscriptionInstanceVpcId { get; set; }

        /// <summary>
        /// The ID of subscription VSwitch instance. When the value of `subscription_instance_network_type` is vpc, this parameter is available and must be passed in.
        /// </summary>
        [Input("subscriptionInstanceVswitchId")]
        public Input<string>? SubscriptionInstanceVswitchId { get; set; }

        /// <summary>
        /// The sync architecture. Valid values: `bidirectional`, `oneway`.
        /// </summary>
        [Input("syncArchitecture")]
        public Input<string>? SyncArchitecture { get; set; }

        /// <summary>
        /// The synchronization direction. Valid values: `Forward`, `Reverse`. When the topology type of the data synchronization instance is bidirectional, it can be passed in to reverse to start the reverse synchronization link.
        /// </summary>
        [Input("synchronizationDirection")]
        public Input<string>? SynchronizationDirection { get; set; }

        [Input("tags")]
        private InputMap<object>? _tags;

        /// <summary>
        /// A mapping of tags to assign to the resource.
        /// </summary>
        public InputMap<object> Tags
        {
            get => _tags ?? (_tags = new InputMap<object>());
            set => _tags = value;
        }

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