internal RerunTriggerResource(string id, string name, string type, string etag, RerunTumblingWindowTrigger properties) : base(id, name, type, etag) { Properties = properties; }
internal static Trigger DeserializeTrigger(JsonElement element) { if (element.TryGetProperty("type", out JsonElement discriminator)) { switch (discriminator.GetString()) { case "BlobEventsTrigger": return(BlobEventsTrigger.DeserializeBlobEventsTrigger(element)); case "BlobTrigger": return(BlobTrigger.DeserializeBlobTrigger(element)); case "ChainingTrigger": return(ChainingTrigger.DeserializeChainingTrigger(element)); case "CustomEventsTrigger": return(CustomEventsTrigger.DeserializeCustomEventsTrigger(element)); case "MultiplePipelineTrigger": return(MultiplePipelineTrigger.DeserializeMultiplePipelineTrigger(element)); case "RerunTumblingWindowTrigger": return(RerunTumblingWindowTrigger.DeserializeRerunTumblingWindowTrigger(element)); case "ScheduleTrigger": return(ScheduleTrigger.DeserializeScheduleTrigger(element)); case "TumblingWindowTrigger": return(TumblingWindowTrigger.DeserializeTumblingWindowTrigger(element)); } } string type = default; Optional <string> description = default; Optional <TriggerRuntimeState> runtimeState = default; Optional <IList <object> > annotations = default; IDictionary <string, object> additionalProperties = default; Dictionary <string, object> additionalPropertiesDictionary = new Dictionary <string, object>(); foreach (var property in element.EnumerateObject()) { 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; } additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); } additionalProperties = additionalPropertiesDictionary; return(new Trigger(type, description.Value, Optional.ToNullable(runtimeState), Optional.ToList(annotations), additionalProperties)); }