示例#1
0
 internal SqlDWSink(string type, object writeBatchSize, object writeBatchTimeout, object sinkRetryCount, object sinkRetryWait, object maxConcurrentConnections, IDictionary <string, object> additionalProperties, object preCopyScript, object allowPolyBase, PolybaseSettings polyBaseSettings, object allowCopyCommand, DWCopyCommandSettings copyCommandSettings, object tableOption) : base(type, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, additionalProperties)
 {
     PreCopyScript       = preCopyScript;
     AllowPolyBase       = allowPolyBase;
     PolyBaseSettings    = polyBaseSettings;
     AllowCopyCommand    = allowCopyCommand;
     CopyCommandSettings = copyCommandSettings;
     TableOption         = tableOption;
     Type = type ?? "SqlDWSink";
 }
示例#2
0
        internal static SqlDWSink DeserializeSqlDWSink(JsonElement element)
        {
            Optional <object>                preCopyScript       = default;
            Optional <object>                allowPolyBase       = default;
            Optional <PolybaseSettings>      polyBaseSettings    = default;
            Optional <object>                allowCopyCommand    = default;
            Optional <DWCopyCommandSettings> copyCommandSettings = default;
            Optional <object>                tableOption         = default;
            string                       type                           = default;
            Optional <object>            writeBatchSize                 = default;
            Optional <object>            writeBatchTimeout              = default;
            Optional <object>            sinkRetryCount                 = default;
            Optional <object>            sinkRetryWait                  = default;
            Optional <object>            maxConcurrentConnections       = default;
            IDictionary <string, object> additionalProperties           = default;
            Dictionary <string, object>  additionalPropertiesDictionary = new Dictionary <string, object>();

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("preCopyScript"))
                {
                    preCopyScript = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("allowPolyBase"))
                {
                    allowPolyBase = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("polyBaseSettings"))
                {
                    polyBaseSettings = PolybaseSettings.DeserializePolybaseSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("allowCopyCommand"))
                {
                    allowCopyCommand = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("copyCommandSettings"))
                {
                    copyCommandSettings = DWCopyCommandSettings.DeserializeDWCopyCommandSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("tableOption"))
                {
                    tableOption = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("writeBatchSize"))
                {
                    writeBatchSize = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("writeBatchTimeout"))
                {
                    writeBatchTimeout = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("sinkRetryCount"))
                {
                    sinkRetryCount = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("sinkRetryWait"))
                {
                    sinkRetryWait = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("maxConcurrentConnections"))
                {
                    maxConcurrentConnections = property.Value.GetObject();
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new SqlDWSink(type, writeBatchSize.Value, writeBatchTimeout.Value, sinkRetryCount.Value, sinkRetryWait.Value, maxConcurrentConnections.Value, additionalProperties, preCopyScript.Value, allowPolyBase.Value, polyBaseSettings.Value, allowCopyCommand.Value, copyCommandSettings.Value, tableOption.Value));
        }