internal TumblingWindowTrigger(string type, string description, TriggerRuntimeState?runtimeState, IList <object> annotations, IDictionary <string, object> additionalProperties, TriggerPipelineReference pipeline, TumblingWindowFrequency frequency, int interval, DateTimeOffset startTime, DateTimeOffset?endTime, object delay, int maxConcurrency, RetryPolicy retryPolicy, IList <DependencyReference> dependsOn) : base(type, description, runtimeState, annotations, additionalProperties) { Pipeline = pipeline; Frequency = frequency; Interval = interval; StartTime = startTime; EndTime = endTime; Delay = delay; MaxConcurrency = maxConcurrency; RetryPolicy = retryPolicy; DependsOn = dependsOn; Type = type ?? "TumblingWindowTrigger"; }
public TumblingWindowTrigger(TriggerPipelineReference pipeline, TumblingWindowFrequency frequency, int interval, DateTimeOffset startTime, int maxConcurrency) { if (pipeline == null) { throw new ArgumentNullException(nameof(pipeline)); } Pipeline = pipeline; Frequency = frequency; Interval = interval; StartTime = startTime; MaxConcurrency = maxConcurrency; DependsOn = new ChangeTrackingList <DependencyReference>(); Type = "TumblingWindowTrigger"; }
internal static TumblingWindowTrigger DeserializeTumblingWindowTrigger(JsonElement element) { TriggerPipelineReference pipeline = default; string type = default; Optional<string> description = default; Optional<TriggerRuntimeState> runtimeState = default; Optional<IList<object>> annotations = default; TumblingWindowFrequency frequency = default; int interval = default; DateTimeOffset startTime = default; Optional<DateTimeOffset> endTime = default; Optional<object> delay = default; int maxConcurrency = default; Optional<RetryPolicy> retryPolicy = default; Optional<IList<DependencyReference>> dependsOn = default; IDictionary<string, object> additionalProperties = default; Dictionary<string, object> additionalPropertiesDictionary = new Dictionary<string, object>(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("pipeline")) { pipeline = TriggerPipelineReference.DeserializeTriggerPipelineReference(property.Value); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("description")) { description = property.Value.GetString(); continue; } if (property.NameEquals("runtimeState")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } runtimeState = new TriggerRuntimeState(property.Value.GetString()); continue; } if (property.NameEquals("annotations")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List<object> array = new List<object>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(item.GetObject()); } annotations = array; continue; } if (property.NameEquals("typeProperties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("frequency")) { frequency = new TumblingWindowFrequency(property0.Value.GetString()); continue; } if (property0.NameEquals("interval")) { interval = property0.Value.GetInt32(); continue; } if (property0.NameEquals("startTime")) { startTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("endTime")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } endTime = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("delay")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } delay = property0.Value.GetObject(); continue; } if (property0.NameEquals("maxConcurrency")) { maxConcurrency = property0.Value.GetInt32(); continue; } if (property0.NameEquals("retryPolicy")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } retryPolicy = RetryPolicy.DeserializeRetryPolicy(property0.Value); continue; } if (property0.NameEquals("dependsOn")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } List<DependencyReference> array = new List<DependencyReference>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(DependencyReference.DeserializeDependencyReference(item)); } dependsOn = array; continue; } } continue; } additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); } additionalProperties = additionalPropertiesDictionary; return new TumblingWindowTrigger(type, description.Value, Optional.ToNullable(runtimeState), Optional.ToList(annotations), additionalProperties, pipeline, frequency, interval, startTime, Optional.ToNullable(endTime), delay.Value, maxConcurrency, retryPolicy.Value, Optional.ToList(dependsOn)); }