|  |  | 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.Collections.Generic; | 
|  |  | 9 |  | using System.Text.Json; | 
|  |  | 10 |  | using Azure.Core; | 
|  |  | 11 |  |  | 
|  |  | 12 |  | namespace Azure.Analytics.Synapse.Artifacts.Models | 
|  |  | 13 |  | { | 
|  |  | 14 |  |     public partial class ValidationActivity : IUtf8JsonSerializable | 
|  |  | 15 |  |     { | 
|  |  | 16 |  |         void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) | 
|  |  | 17 |  |         { | 
|  | 0 | 18 |  |             writer.WriteStartObject(); | 
|  | 0 | 19 |  |             writer.WritePropertyName("name"); | 
|  | 0 | 20 |  |             writer.WriteStringValue(Name); | 
|  | 0 | 21 |  |             writer.WritePropertyName("type"); | 
|  | 0 | 22 |  |             writer.WriteStringValue(Type); | 
|  | 0 | 23 |  |             if (Optional.IsDefined(Description)) | 
|  |  | 24 |  |             { | 
|  | 0 | 25 |  |                 writer.WritePropertyName("description"); | 
|  | 0 | 26 |  |                 writer.WriteStringValue(Description); | 
|  |  | 27 |  |             } | 
|  | 0 | 28 |  |             if (Optional.IsCollectionDefined(DependsOn)) | 
|  |  | 29 |  |             { | 
|  | 0 | 30 |  |                 writer.WritePropertyName("dependsOn"); | 
|  | 0 | 31 |  |                 writer.WriteStartArray(); | 
|  | 0 | 32 |  |                 foreach (var item in DependsOn) | 
|  |  | 33 |  |                 { | 
|  | 0 | 34 |  |                     writer.WriteObjectValue(item); | 
|  |  | 35 |  |                 } | 
|  | 0 | 36 |  |                 writer.WriteEndArray(); | 
|  |  | 37 |  |             } | 
|  | 0 | 38 |  |             if (Optional.IsCollectionDefined(UserProperties)) | 
|  |  | 39 |  |             { | 
|  | 0 | 40 |  |                 writer.WritePropertyName("userProperties"); | 
|  | 0 | 41 |  |                 writer.WriteStartArray(); | 
|  | 0 | 42 |  |                 foreach (var item in UserProperties) | 
|  |  | 43 |  |                 { | 
|  | 0 | 44 |  |                     writer.WriteObjectValue(item); | 
|  |  | 45 |  |                 } | 
|  | 0 | 46 |  |                 writer.WriteEndArray(); | 
|  |  | 47 |  |             } | 
|  | 0 | 48 |  |             writer.WritePropertyName("typeProperties"); | 
|  | 0 | 49 |  |             writer.WriteStartObject(); | 
|  | 0 | 50 |  |             if (Optional.IsDefined(Timeout)) | 
|  |  | 51 |  |             { | 
|  | 0 | 52 |  |                 writer.WritePropertyName("timeout"); | 
|  | 0 | 53 |  |                 writer.WriteObjectValue(Timeout); | 
|  |  | 54 |  |             } | 
|  | 0 | 55 |  |             if (Optional.IsDefined(Sleep)) | 
|  |  | 56 |  |             { | 
|  | 0 | 57 |  |                 writer.WritePropertyName("sleep"); | 
|  | 0 | 58 |  |                 writer.WriteObjectValue(Sleep); | 
|  |  | 59 |  |             } | 
|  | 0 | 60 |  |             if (Optional.IsDefined(MinimumSize)) | 
|  |  | 61 |  |             { | 
|  | 0 | 62 |  |                 writer.WritePropertyName("minimumSize"); | 
|  | 0 | 63 |  |                 writer.WriteObjectValue(MinimumSize); | 
|  |  | 64 |  |             } | 
|  | 0 | 65 |  |             if (Optional.IsDefined(ChildItems)) | 
|  |  | 66 |  |             { | 
|  | 0 | 67 |  |                 writer.WritePropertyName("childItems"); | 
|  | 0 | 68 |  |                 writer.WriteObjectValue(ChildItems); | 
|  |  | 69 |  |             } | 
|  | 0 | 70 |  |             writer.WritePropertyName("dataset"); | 
|  | 0 | 71 |  |             writer.WriteObjectValue(Dataset); | 
|  | 0 | 72 |  |             writer.WriteEndObject(); | 
|  | 0 | 73 |  |             foreach (var item in AdditionalProperties) | 
|  |  | 74 |  |             { | 
|  | 0 | 75 |  |                 writer.WritePropertyName(item.Key); | 
|  | 0 | 76 |  |                 writer.WriteObjectValue(item.Value); | 
|  |  | 77 |  |             } | 
|  | 0 | 78 |  |             writer.WriteEndObject(); | 
|  | 0 | 79 |  |         } | 
|  |  | 80 |  |  | 
|  |  | 81 |  |         internal static ValidationActivity DeserializeValidationActivity(JsonElement element) | 
|  |  | 82 |  |         { | 
|  | 0 | 83 |  |             string name = default; | 
|  | 0 | 84 |  |             string type = default; | 
|  | 0 | 85 |  |             Optional<string> description = default; | 
|  | 0 | 86 |  |             Optional<IList<ActivityDependency>> dependsOn = default; | 
|  | 0 | 87 |  |             Optional<IList<UserProperty>> userProperties = default; | 
|  | 0 | 88 |  |             Optional<object> timeout = default; | 
|  | 0 | 89 |  |             Optional<object> sleep = default; | 
|  | 0 | 90 |  |             Optional<object> minimumSize = default; | 
|  | 0 | 91 |  |             Optional<object> childItems = default; | 
|  | 0 | 92 |  |             DatasetReference dataset = default; | 
|  | 0 | 93 |  |             IDictionary<string, object> additionalProperties = default; | 
|  | 0 | 94 |  |             Dictionary<string, object> additionalPropertiesDictionary = default; | 
|  | 0 | 95 |  |             foreach (var property in element.EnumerateObject()) | 
|  |  | 96 |  |             { | 
|  | 0 | 97 |  |                 if (property.NameEquals("name")) | 
|  |  | 98 |  |                 { | 
|  | 0 | 99 |  |                     name = property.Value.GetString(); | 
|  | 0 | 100 |  |                     continue; | 
|  |  | 101 |  |                 } | 
|  | 0 | 102 |  |                 if (property.NameEquals("type")) | 
|  |  | 103 |  |                 { | 
|  | 0 | 104 |  |                     type = property.Value.GetString(); | 
|  | 0 | 105 |  |                     continue; | 
|  |  | 106 |  |                 } | 
|  | 0 | 107 |  |                 if (property.NameEquals("description")) | 
|  |  | 108 |  |                 { | 
|  | 0 | 109 |  |                     description = property.Value.GetString(); | 
|  | 0 | 110 |  |                     continue; | 
|  |  | 111 |  |                 } | 
|  | 0 | 112 |  |                 if (property.NameEquals("dependsOn")) | 
|  |  | 113 |  |                 { | 
|  | 0 | 114 |  |                     List<ActivityDependency> array = new List<ActivityDependency>(); | 
|  | 0 | 115 |  |                     foreach (var item in property.Value.EnumerateArray()) | 
|  |  | 116 |  |                     { | 
|  | 0 | 117 |  |                         array.Add(ActivityDependency.DeserializeActivityDependency(item)); | 
|  |  | 118 |  |                     } | 
|  | 0 | 119 |  |                     dependsOn = array; | 
|  | 0 | 120 |  |                     continue; | 
|  |  | 121 |  |                 } | 
|  | 0 | 122 |  |                 if (property.NameEquals("userProperties")) | 
|  |  | 123 |  |                 { | 
|  | 0 | 124 |  |                     List<UserProperty> array = new List<UserProperty>(); | 
|  | 0 | 125 |  |                     foreach (var item in property.Value.EnumerateArray()) | 
|  |  | 126 |  |                     { | 
|  | 0 | 127 |  |                         array.Add(UserProperty.DeserializeUserProperty(item)); | 
|  |  | 128 |  |                     } | 
|  | 0 | 129 |  |                     userProperties = array; | 
|  | 0 | 130 |  |                     continue; | 
|  |  | 131 |  |                 } | 
|  | 0 | 132 |  |                 if (property.NameEquals("typeProperties")) | 
|  |  | 133 |  |                 { | 
|  | 0 | 134 |  |                     foreach (var property0 in property.Value.EnumerateObject()) | 
|  |  | 135 |  |                     { | 
|  | 0 | 136 |  |                         if (property0.NameEquals("timeout")) | 
|  |  | 137 |  |                         { | 
|  | 0 | 138 |  |                             timeout = property0.Value.GetObject(); | 
|  | 0 | 139 |  |                             continue; | 
|  |  | 140 |  |                         } | 
|  | 0 | 141 |  |                         if (property0.NameEquals("sleep")) | 
|  |  | 142 |  |                         { | 
|  | 0 | 143 |  |                             sleep = property0.Value.GetObject(); | 
|  | 0 | 144 |  |                             continue; | 
|  |  | 145 |  |                         } | 
|  | 0 | 146 |  |                         if (property0.NameEquals("minimumSize")) | 
|  |  | 147 |  |                         { | 
|  | 0 | 148 |  |                             minimumSize = property0.Value.GetObject(); | 
|  | 0 | 149 |  |                             continue; | 
|  |  | 150 |  |                         } | 
|  | 0 | 151 |  |                         if (property0.NameEquals("childItems")) | 
|  |  | 152 |  |                         { | 
|  | 0 | 153 |  |                             childItems = property0.Value.GetObject(); | 
|  | 0 | 154 |  |                             continue; | 
|  |  | 155 |  |                         } | 
|  | 0 | 156 |  |                         if (property0.NameEquals("dataset")) | 
|  |  | 157 |  |                         { | 
|  | 0 | 158 |  |                             dataset = DatasetReference.DeserializeDatasetReference(property0.Value); | 
|  |  | 159 |  |                             continue; | 
|  |  | 160 |  |                         } | 
|  |  | 161 |  |                     } | 
|  |  | 162 |  |                     continue; | 
|  |  | 163 |  |                 } | 
|  | 0 | 164 |  |                 additionalPropertiesDictionary ??= new Dictionary<string, object>(); | 
|  | 0 | 165 |  |                 additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); | 
|  |  | 166 |  |             } | 
|  | 0 | 167 |  |             additionalProperties = additionalPropertiesDictionary; | 
|  | 0 | 168 |  |             return new ValidationActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.ToList(use | 
|  |  | 169 |  |         } | 
|  |  | 170 |  |     } | 
|  |  | 171 |  | } |