| | 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.ResourceManager.Compute.Models |
| | 13 | | { |
| | 14 | | public partial class VirtualMachineScaleSetExtensionProfile : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 8 | 18 | | writer.WriteStartObject(); |
| 8 | 19 | | if (Extensions != null) |
| | 20 | | { |
| 8 | 21 | | writer.WritePropertyName("extensions"); |
| 8 | 22 | | writer.WriteStartArray(); |
| 48 | 23 | | foreach (var item in Extensions) |
| | 24 | | { |
| 16 | 25 | | writer.WriteObjectValue(item); |
| | 26 | | } |
| 8 | 27 | | writer.WriteEndArray(); |
| | 28 | | } |
| 8 | 29 | | writer.WriteEndObject(); |
| 8 | 30 | | } |
| | 31 | |
|
| | 32 | | internal static VirtualMachineScaleSetExtensionProfile DeserializeVirtualMachineScaleSetExtensionProfile(JsonEle |
| | 33 | | { |
| 448 | 34 | | IList<VirtualMachineScaleSetExtension> extensions = default; |
| 1792 | 35 | | foreach (var property in element.EnumerateObject()) |
| | 36 | | { |
| 448 | 37 | | if (property.NameEquals("extensions")) |
| | 38 | | { |
| 448 | 39 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 40 | | { |
| | 41 | | continue; |
| | 42 | | } |
| 448 | 43 | | List<VirtualMachineScaleSetExtension> array = new List<VirtualMachineScaleSetExtension>(); |
| 1808 | 44 | | foreach (var item in property.Value.EnumerateArray()) |
| | 45 | | { |
| 456 | 46 | | if (item.ValueKind == JsonValueKind.Null) |
| | 47 | | { |
| 0 | 48 | | array.Add(null); |
| | 49 | | } |
| | 50 | | else |
| | 51 | | { |
| 456 | 52 | | array.Add(VirtualMachineScaleSetExtension.DeserializeVirtualMachineScaleSetExtension(item)); |
| | 53 | | } |
| | 54 | | } |
| 448 | 55 | | extensions = array; |
| | 56 | | continue; |
| | 57 | | } |
| | 58 | | } |
| 448 | 59 | | return new VirtualMachineScaleSetExtensionProfile(extensions); |
| | 60 | | } |
| | 61 | | } |
| | 62 | | } |