| | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 2 | | // Licensed under the MIT License. |
| | 3 | |
|
| | 4 | | // <auto-generated/> |
| | 5 | |
|
| | 6 | | #nullable disable |
| | 7 | |
|
| | 8 | | using System; |
| | 9 | | using System.Collections.Generic; |
| | 10 | | using System.Text.Json; |
| | 11 | | using Azure.Core; |
| | 12 | |
|
| | 13 | | namespace Azure.Analytics.Synapse.Artifacts.Models |
| | 14 | | { |
| | 15 | | public partial class RerunTumblingWindowTrigger : IUtf8JsonSerializable |
| | 16 | | { |
| | 17 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 18 | | { |
| 0 | 19 | | writer.WriteStartObject(); |
| 0 | 20 | | writer.WritePropertyName("type"); |
| 0 | 21 | | writer.WriteStringValue(Type); |
| 0 | 22 | | if (Optional.IsDefined(Description)) |
| | 23 | | { |
| 0 | 24 | | writer.WritePropertyName("description"); |
| 0 | 25 | | writer.WriteStringValue(Description); |
| | 26 | | } |
| 0 | 27 | | if (Optional.IsCollectionDefined(Annotations)) |
| | 28 | | { |
| 0 | 29 | | writer.WritePropertyName("annotations"); |
| 0 | 30 | | writer.WriteStartArray(); |
| 0 | 31 | | foreach (var item in Annotations) |
| | 32 | | { |
| 0 | 33 | | writer.WriteObjectValue(item); |
| | 34 | | } |
| 0 | 35 | | writer.WriteEndArray(); |
| | 36 | | } |
| 0 | 37 | | writer.WritePropertyName("typeProperties"); |
| 0 | 38 | | writer.WriteStartObject(); |
| 0 | 39 | | if (Optional.IsDefined(ParentTrigger)) |
| | 40 | | { |
| 0 | 41 | | writer.WritePropertyName("parentTrigger"); |
| 0 | 42 | | writer.WriteObjectValue(ParentTrigger); |
| | 43 | | } |
| 0 | 44 | | writer.WritePropertyName("requestedStartTime"); |
| 0 | 45 | | writer.WriteStringValue(RequestedStartTime, "O"); |
| 0 | 46 | | writer.WritePropertyName("requestedEndTime"); |
| 0 | 47 | | writer.WriteStringValue(RequestedEndTime, "O"); |
| 0 | 48 | | writer.WritePropertyName("maxConcurrency"); |
| 0 | 49 | | writer.WriteNumberValue(MaxConcurrency); |
| 0 | 50 | | writer.WriteEndObject(); |
| 0 | 51 | | foreach (var item in AdditionalProperties) |
| | 52 | | { |
| 0 | 53 | | writer.WritePropertyName(item.Key); |
| 0 | 54 | | writer.WriteObjectValue(item.Value); |
| | 55 | | } |
| 0 | 56 | | writer.WriteEndObject(); |
| 0 | 57 | | } |
| | 58 | |
|
| | 59 | | internal static RerunTumblingWindowTrigger DeserializeRerunTumblingWindowTrigger(JsonElement element) |
| | 60 | | { |
| 0 | 61 | | string type = default; |
| 0 | 62 | | Optional<string> description = default; |
| 0 | 63 | | Optional<TriggerRuntimeState> runtimeState = default; |
| 0 | 64 | | Optional<IList<object>> annotations = default; |
| 0 | 65 | | Optional<object> parentTrigger = default; |
| 0 | 66 | | DateTimeOffset requestedStartTime = default; |
| 0 | 67 | | DateTimeOffset requestedEndTime = default; |
| 0 | 68 | | int maxConcurrency = default; |
| 0 | 69 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 70 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 71 | | foreach (var property in element.EnumerateObject()) |
| | 72 | | { |
| 0 | 73 | | if (property.NameEquals("type")) |
| | 74 | | { |
| 0 | 75 | | type = property.Value.GetString(); |
| 0 | 76 | | continue; |
| | 77 | | } |
| 0 | 78 | | if (property.NameEquals("description")) |
| | 79 | | { |
| 0 | 80 | | description = property.Value.GetString(); |
| 0 | 81 | | continue; |
| | 82 | | } |
| 0 | 83 | | if (property.NameEquals("runtimeState")) |
| | 84 | | { |
| 0 | 85 | | runtimeState = new TriggerRuntimeState(property.Value.GetString()); |
| 0 | 86 | | continue; |
| | 87 | | } |
| 0 | 88 | | if (property.NameEquals("annotations")) |
| | 89 | | { |
| 0 | 90 | | List<object> array = new List<object>(); |
| 0 | 91 | | foreach (var item in property.Value.EnumerateArray()) |
| | 92 | | { |
| 0 | 93 | | array.Add(item.GetObject()); |
| | 94 | | } |
| 0 | 95 | | annotations = array; |
| 0 | 96 | | continue; |
| | 97 | | } |
| 0 | 98 | | if (property.NameEquals("typeProperties")) |
| | 99 | | { |
| 0 | 100 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 101 | | { |
| 0 | 102 | | if (property0.NameEquals("parentTrigger")) |
| | 103 | | { |
| 0 | 104 | | parentTrigger = property0.Value.GetObject(); |
| 0 | 105 | | continue; |
| | 106 | | } |
| 0 | 107 | | if (property0.NameEquals("requestedStartTime")) |
| | 108 | | { |
| 0 | 109 | | requestedStartTime = property0.Value.GetDateTimeOffset("O"); |
| 0 | 110 | | continue; |
| | 111 | | } |
| 0 | 112 | | if (property0.NameEquals("requestedEndTime")) |
| | 113 | | { |
| 0 | 114 | | requestedEndTime = property0.Value.GetDateTimeOffset("O"); |
| 0 | 115 | | continue; |
| | 116 | | } |
| 0 | 117 | | if (property0.NameEquals("maxConcurrency")) |
| | 118 | | { |
| 0 | 119 | | maxConcurrency = property0.Value.GetInt32(); |
| | 120 | | continue; |
| | 121 | | } |
| | 122 | | } |
| | 123 | | continue; |
| | 124 | | } |
| 0 | 125 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 126 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 127 | | } |
| 0 | 128 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 129 | | return new RerunTumblingWindowTrigger(type, description.Value, Optional.ToNullable(runtimeState), Optional.T |
| | 130 | | } |
| | 131 | | } |
| | 132 | | } |