Exemplo n.º 1
0
 internal CommonDataServiceForAppsSink(string type, object writeBatchSize, object writeBatchTimeout, object sinkRetryCount, object sinkRetryWait, object maxConcurrentConnections, IDictionary <string, object> additionalProperties, DynamicsSinkWriteBehavior writeBehavior, object ignoreNullValues, object alternateKeyName) : base(type, writeBatchSize, writeBatchTimeout, sinkRetryCount, sinkRetryWait, maxConcurrentConnections, additionalProperties)
 {
     WriteBehavior    = writeBehavior;
     IgnoreNullValues = ignoreNullValues;
     AlternateKeyName = alternateKeyName;
     Type             = type ?? "CommonDataServiceForAppsSink";
 }
Exemplo n.º 2
0
        internal static DynamicsCrmSink DeserializeDynamicsCrmSink(JsonElement element)
        {
            DynamicsSinkWriteBehavior writeBehavior                     = default;
            Optional <object>         ignoreNullValues                  = default;
            Optional <object>         alternateKeyName                  = 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("writeBehavior"))
                {
                    writeBehavior = new DynamicsSinkWriteBehavior(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("ignoreNullValues"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    ignoreNullValues = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("alternateKeyName"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    alternateKeyName = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("writeBatchSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    writeBatchSize = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("writeBatchTimeout"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    writeBatchTimeout = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("sinkRetryCount"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sinkRetryCount = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("sinkRetryWait"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sinkRetryWait = property.Value.GetObject();
                    continue;
                }
                if (property.NameEquals("maxConcurrentConnections"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    maxConcurrentConnections = property.Value.GetObject();
                    continue;
                }
                additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject());
            }
            additionalProperties = additionalPropertiesDictionary;
            return(new DynamicsCrmSink(type, writeBatchSize.Value, writeBatchTimeout.Value, sinkRetryCount.Value, sinkRetryWait.Value, maxConcurrentConnections.Value, additionalProperties, writeBehavior, ignoreNullValues.Value, alternateKeyName.Value));
        }
Exemplo n.º 3
0
 public CommonDataServiceForAppsSink(DynamicsSinkWriteBehavior writeBehavior)
 {
     WriteBehavior = writeBehavior;
     Type          = "CommonDataServiceForAppsSink";
 }
 public DynamicsCrmSink(DynamicsSinkWriteBehavior writeBehavior)
 {
     WriteBehavior = writeBehavior;
     Type          = "DynamicsCrmSink";
 }