| | 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 HDInsightStreamingActivity : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 0 | 18 | | writer.WriteStartObject(); |
| 0 | 19 | | if (Optional.IsDefined(LinkedServiceName)) |
| | 20 | | { |
| 0 | 21 | | writer.WritePropertyName("linkedServiceName"); |
| 0 | 22 | | writer.WriteObjectValue(LinkedServiceName); |
| | 23 | | } |
| 0 | 24 | | if (Optional.IsDefined(Policy)) |
| | 25 | | { |
| 0 | 26 | | writer.WritePropertyName("policy"); |
| 0 | 27 | | writer.WriteObjectValue(Policy); |
| | 28 | | } |
| 0 | 29 | | writer.WritePropertyName("name"); |
| 0 | 30 | | writer.WriteStringValue(Name); |
| 0 | 31 | | writer.WritePropertyName("type"); |
| 0 | 32 | | writer.WriteStringValue(Type); |
| 0 | 33 | | if (Optional.IsDefined(Description)) |
| | 34 | | { |
| 0 | 35 | | writer.WritePropertyName("description"); |
| 0 | 36 | | writer.WriteStringValue(Description); |
| | 37 | | } |
| 0 | 38 | | if (Optional.IsCollectionDefined(DependsOn)) |
| | 39 | | { |
| 0 | 40 | | writer.WritePropertyName("dependsOn"); |
| 0 | 41 | | writer.WriteStartArray(); |
| 0 | 42 | | foreach (var item in DependsOn) |
| | 43 | | { |
| 0 | 44 | | writer.WriteObjectValue(item); |
| | 45 | | } |
| 0 | 46 | | writer.WriteEndArray(); |
| | 47 | | } |
| 0 | 48 | | if (Optional.IsCollectionDefined(UserProperties)) |
| | 49 | | { |
| 0 | 50 | | writer.WritePropertyName("userProperties"); |
| 0 | 51 | | writer.WriteStartArray(); |
| 0 | 52 | | foreach (var item in UserProperties) |
| | 53 | | { |
| 0 | 54 | | writer.WriteObjectValue(item); |
| | 55 | | } |
| 0 | 56 | | writer.WriteEndArray(); |
| | 57 | | } |
| 0 | 58 | | writer.WritePropertyName("typeProperties"); |
| 0 | 59 | | writer.WriteStartObject(); |
| 0 | 60 | | if (Optional.IsCollectionDefined(StorageLinkedServices)) |
| | 61 | | { |
| 0 | 62 | | writer.WritePropertyName("storageLinkedServices"); |
| 0 | 63 | | writer.WriteStartArray(); |
| 0 | 64 | | foreach (var item in StorageLinkedServices) |
| | 65 | | { |
| 0 | 66 | | writer.WriteObjectValue(item); |
| | 67 | | } |
| 0 | 68 | | writer.WriteEndArray(); |
| | 69 | | } |
| 0 | 70 | | if (Optional.IsCollectionDefined(Arguments)) |
| | 71 | | { |
| 0 | 72 | | writer.WritePropertyName("arguments"); |
| 0 | 73 | | writer.WriteStartArray(); |
| 0 | 74 | | foreach (var item in Arguments) |
| | 75 | | { |
| 0 | 76 | | writer.WriteObjectValue(item); |
| | 77 | | } |
| 0 | 78 | | writer.WriteEndArray(); |
| | 79 | | } |
| 0 | 80 | | if (Optional.IsDefined(GetDebugInfo)) |
| | 81 | | { |
| 0 | 82 | | writer.WritePropertyName("getDebugInfo"); |
| 0 | 83 | | writer.WriteStringValue(GetDebugInfo.Value.ToString()); |
| | 84 | | } |
| 0 | 85 | | writer.WritePropertyName("mapper"); |
| 0 | 86 | | writer.WriteObjectValue(Mapper); |
| 0 | 87 | | writer.WritePropertyName("reducer"); |
| 0 | 88 | | writer.WriteObjectValue(Reducer); |
| 0 | 89 | | writer.WritePropertyName("input"); |
| 0 | 90 | | writer.WriteObjectValue(Input); |
| 0 | 91 | | writer.WritePropertyName("output"); |
| 0 | 92 | | writer.WriteObjectValue(Output); |
| 0 | 93 | | writer.WritePropertyName("filePaths"); |
| 0 | 94 | | writer.WriteStartArray(); |
| 0 | 95 | | foreach (var item in FilePaths) |
| | 96 | | { |
| 0 | 97 | | writer.WriteObjectValue(item); |
| | 98 | | } |
| 0 | 99 | | writer.WriteEndArray(); |
| 0 | 100 | | if (Optional.IsDefined(FileLinkedService)) |
| | 101 | | { |
| 0 | 102 | | writer.WritePropertyName("fileLinkedService"); |
| 0 | 103 | | writer.WriteObjectValue(FileLinkedService); |
| | 104 | | } |
| 0 | 105 | | if (Optional.IsDefined(Combiner)) |
| | 106 | | { |
| 0 | 107 | | writer.WritePropertyName("combiner"); |
| 0 | 108 | | writer.WriteObjectValue(Combiner); |
| | 109 | | } |
| 0 | 110 | | if (Optional.IsCollectionDefined(CommandEnvironment)) |
| | 111 | | { |
| 0 | 112 | | writer.WritePropertyName("commandEnvironment"); |
| 0 | 113 | | writer.WriteStartArray(); |
| 0 | 114 | | foreach (var item in CommandEnvironment) |
| | 115 | | { |
| 0 | 116 | | writer.WriteObjectValue(item); |
| | 117 | | } |
| 0 | 118 | | writer.WriteEndArray(); |
| | 119 | | } |
| 0 | 120 | | if (Optional.IsCollectionDefined(Defines)) |
| | 121 | | { |
| 0 | 122 | | writer.WritePropertyName("defines"); |
| 0 | 123 | | writer.WriteStartObject(); |
| 0 | 124 | | foreach (var item in Defines) |
| | 125 | | { |
| 0 | 126 | | writer.WritePropertyName(item.Key); |
| 0 | 127 | | writer.WriteObjectValue(item.Value); |
| | 128 | | } |
| 0 | 129 | | writer.WriteEndObject(); |
| | 130 | | } |
| 0 | 131 | | writer.WriteEndObject(); |
| 0 | 132 | | foreach (var item in AdditionalProperties) |
| | 133 | | { |
| 0 | 134 | | writer.WritePropertyName(item.Key); |
| 0 | 135 | | writer.WriteObjectValue(item.Value); |
| | 136 | | } |
| 0 | 137 | | writer.WriteEndObject(); |
| 0 | 138 | | } |
| | 139 | |
|
| | 140 | | internal static HDInsightStreamingActivity DeserializeHDInsightStreamingActivity(JsonElement element) |
| | 141 | | { |
| 0 | 142 | | Optional<LinkedServiceReference> linkedServiceName = default; |
| 0 | 143 | | Optional<ActivityPolicy> policy = default; |
| 0 | 144 | | string name = default; |
| 0 | 145 | | string type = default; |
| 0 | 146 | | Optional<string> description = default; |
| 0 | 147 | | Optional<IList<ActivityDependency>> dependsOn = default; |
| 0 | 148 | | Optional<IList<UserProperty>> userProperties = default; |
| 0 | 149 | | Optional<IList<LinkedServiceReference>> storageLinkedServices = default; |
| 0 | 150 | | Optional<IList<object>> arguments = default; |
| 0 | 151 | | Optional<HDInsightActivityDebugInfoOption> getDebugInfo = default; |
| 0 | 152 | | object mapper = default; |
| 0 | 153 | | object reducer = default; |
| 0 | 154 | | object input = default; |
| 0 | 155 | | object output = default; |
| 0 | 156 | | IList<object> filePaths = default; |
| 0 | 157 | | Optional<LinkedServiceReference> fileLinkedService = default; |
| 0 | 158 | | Optional<object> combiner = default; |
| 0 | 159 | | Optional<IList<object>> commandEnvironment = default; |
| 0 | 160 | | Optional<IDictionary<string, object>> defines = default; |
| 0 | 161 | | IDictionary<string, object> additionalProperties = default; |
| 0 | 162 | | Dictionary<string, object> additionalPropertiesDictionary = default; |
| 0 | 163 | | foreach (var property in element.EnumerateObject()) |
| | 164 | | { |
| 0 | 165 | | if (property.NameEquals("linkedServiceName")) |
| | 166 | | { |
| 0 | 167 | | linkedServiceName = LinkedServiceReference.DeserializeLinkedServiceReference(property.Value); |
| 0 | 168 | | continue; |
| | 169 | | } |
| 0 | 170 | | if (property.NameEquals("policy")) |
| | 171 | | { |
| 0 | 172 | | policy = ActivityPolicy.DeserializeActivityPolicy(property.Value); |
| 0 | 173 | | continue; |
| | 174 | | } |
| 0 | 175 | | if (property.NameEquals("name")) |
| | 176 | | { |
| 0 | 177 | | name = property.Value.GetString(); |
| 0 | 178 | | continue; |
| | 179 | | } |
| 0 | 180 | | if (property.NameEquals("type")) |
| | 181 | | { |
| 0 | 182 | | type = property.Value.GetString(); |
| 0 | 183 | | continue; |
| | 184 | | } |
| 0 | 185 | | if (property.NameEquals("description")) |
| | 186 | | { |
| 0 | 187 | | description = property.Value.GetString(); |
| 0 | 188 | | continue; |
| | 189 | | } |
| 0 | 190 | | if (property.NameEquals("dependsOn")) |
| | 191 | | { |
| 0 | 192 | | List<ActivityDependency> array = new List<ActivityDependency>(); |
| 0 | 193 | | foreach (var item in property.Value.EnumerateArray()) |
| | 194 | | { |
| 0 | 195 | | array.Add(ActivityDependency.DeserializeActivityDependency(item)); |
| | 196 | | } |
| 0 | 197 | | dependsOn = array; |
| 0 | 198 | | continue; |
| | 199 | | } |
| 0 | 200 | | if (property.NameEquals("userProperties")) |
| | 201 | | { |
| 0 | 202 | | List<UserProperty> array = new List<UserProperty>(); |
| 0 | 203 | | foreach (var item in property.Value.EnumerateArray()) |
| | 204 | | { |
| 0 | 205 | | array.Add(UserProperty.DeserializeUserProperty(item)); |
| | 206 | | } |
| 0 | 207 | | userProperties = array; |
| 0 | 208 | | continue; |
| | 209 | | } |
| 0 | 210 | | if (property.NameEquals("typeProperties")) |
| | 211 | | { |
| 0 | 212 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 213 | | { |
| 0 | 214 | | if (property0.NameEquals("storageLinkedServices")) |
| | 215 | | { |
| 0 | 216 | | List<LinkedServiceReference> array = new List<LinkedServiceReference>(); |
| 0 | 217 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 218 | | { |
| 0 | 219 | | array.Add(LinkedServiceReference.DeserializeLinkedServiceReference(item)); |
| | 220 | | } |
| 0 | 221 | | storageLinkedServices = array; |
| 0 | 222 | | continue; |
| | 223 | | } |
| 0 | 224 | | if (property0.NameEquals("arguments")) |
| | 225 | | { |
| 0 | 226 | | List<object> array = new List<object>(); |
| 0 | 227 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 228 | | { |
| 0 | 229 | | array.Add(item.GetObject()); |
| | 230 | | } |
| 0 | 231 | | arguments = array; |
| 0 | 232 | | continue; |
| | 233 | | } |
| 0 | 234 | | if (property0.NameEquals("getDebugInfo")) |
| | 235 | | { |
| 0 | 236 | | getDebugInfo = new HDInsightActivityDebugInfoOption(property0.Value.GetString()); |
| 0 | 237 | | continue; |
| | 238 | | } |
| 0 | 239 | | if (property0.NameEquals("mapper")) |
| | 240 | | { |
| 0 | 241 | | mapper = property0.Value.GetObject(); |
| 0 | 242 | | continue; |
| | 243 | | } |
| 0 | 244 | | if (property0.NameEquals("reducer")) |
| | 245 | | { |
| 0 | 246 | | reducer = property0.Value.GetObject(); |
| 0 | 247 | | continue; |
| | 248 | | } |
| 0 | 249 | | if (property0.NameEquals("input")) |
| | 250 | | { |
| 0 | 251 | | input = property0.Value.GetObject(); |
| 0 | 252 | | continue; |
| | 253 | | } |
| 0 | 254 | | if (property0.NameEquals("output")) |
| | 255 | | { |
| 0 | 256 | | output = property0.Value.GetObject(); |
| 0 | 257 | | continue; |
| | 258 | | } |
| 0 | 259 | | if (property0.NameEquals("filePaths")) |
| | 260 | | { |
| 0 | 261 | | List<object> array = new List<object>(); |
| 0 | 262 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 263 | | { |
| 0 | 264 | | array.Add(item.GetObject()); |
| | 265 | | } |
| 0 | 266 | | filePaths = array; |
| 0 | 267 | | continue; |
| | 268 | | } |
| 0 | 269 | | if (property0.NameEquals("fileLinkedService")) |
| | 270 | | { |
| 0 | 271 | | fileLinkedService = LinkedServiceReference.DeserializeLinkedServiceReference(property0.Value |
| 0 | 272 | | continue; |
| | 273 | | } |
| 0 | 274 | | if (property0.NameEquals("combiner")) |
| | 275 | | { |
| 0 | 276 | | combiner = property0.Value.GetObject(); |
| 0 | 277 | | continue; |
| | 278 | | } |
| 0 | 279 | | if (property0.NameEquals("commandEnvironment")) |
| | 280 | | { |
| 0 | 281 | | List<object> array = new List<object>(); |
| 0 | 282 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 283 | | { |
| 0 | 284 | | array.Add(item.GetObject()); |
| | 285 | | } |
| 0 | 286 | | commandEnvironment = array; |
| 0 | 287 | | continue; |
| | 288 | | } |
| 0 | 289 | | if (property0.NameEquals("defines")) |
| | 290 | | { |
| 0 | 291 | | Dictionary<string, object> dictionary = new Dictionary<string, object>(); |
| 0 | 292 | | foreach (var property1 in property0.Value.EnumerateObject()) |
| | 293 | | { |
| 0 | 294 | | dictionary.Add(property1.Name, property1.Value.GetObject()); |
| | 295 | | } |
| 0 | 296 | | defines = dictionary; |
| | 297 | | continue; |
| | 298 | | } |
| | 299 | | } |
| | 300 | | continue; |
| | 301 | | } |
| 0 | 302 | | additionalPropertiesDictionary ??= new Dictionary<string, object>(); |
| 0 | 303 | | additionalPropertiesDictionary.Add(property.Name, property.Value.GetObject()); |
| | 304 | | } |
| 0 | 305 | | additionalProperties = additionalPropertiesDictionary; |
| 0 | 306 | | return new HDInsightStreamingActivity(name, type, description.Value, Optional.ToList(dependsOn), Optional.To |
| | 307 | | } |
| | 308 | | } |
| | 309 | | } |