| | 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 VirtualMachineScaleSetInstanceView |
| | 15 | | { |
| | 16 | | internal static VirtualMachineScaleSetInstanceView DeserializeVirtualMachineScaleSetInstanceView(JsonElement ele |
| | 17 | | { |
| 60 | 18 | | VirtualMachineScaleSetInstanceViewStatusesSummary virtualMachine = default; |
| 60 | 19 | | IReadOnlyList<VirtualMachineScaleSetVMExtensionsSummary> extensions = default; |
| 60 | 20 | | IReadOnlyList<InstanceViewStatus> statuses = default; |
| 60 | 21 | | IReadOnlyList<OrchestrationServiceSummary> orchestrationServices = default; |
| 504 | 22 | | foreach (var property in element.EnumerateObject()) |
| | 23 | | { |
| 192 | 24 | | if (property.NameEquals("virtualMachine")) |
| | 25 | | { |
| 60 | 26 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 27 | | { |
| | 28 | | continue; |
| | 29 | | } |
| 60 | 30 | | virtualMachine = VirtualMachineScaleSetInstanceViewStatusesSummary.DeserializeVirtualMachineScaleSet |
| 60 | 31 | | continue; |
| | 32 | | } |
| 132 | 33 | | if (property.NameEquals("extensions")) |
| | 34 | | { |
| 60 | 35 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 36 | | { |
| | 37 | | continue; |
| | 38 | | } |
| 60 | 39 | | List<VirtualMachineScaleSetVMExtensionsSummary> array = new List<VirtualMachineScaleSetVMExtensionsS |
| 240 | 40 | | foreach (var item in property.Value.EnumerateArray()) |
| | 41 | | { |
| 60 | 42 | | if (item.ValueKind == JsonValueKind.Null) |
| | 43 | | { |
| 0 | 44 | | array.Add(null); |
| | 45 | | } |
| | 46 | | else |
| | 47 | | { |
| 60 | 48 | | array.Add(VirtualMachineScaleSetVMExtensionsSummary.DeserializeVirtualMachineScaleSetVMExten |
| | 49 | | } |
| | 50 | | } |
| 60 | 51 | | extensions = array; |
| 60 | 52 | | continue; |
| | 53 | | } |
| 72 | 54 | | if (property.NameEquals("statuses")) |
| | 55 | | { |
| 60 | 56 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 57 | | { |
| | 58 | | continue; |
| | 59 | | } |
| 60 | 60 | | List<InstanceViewStatus> array = new List<InstanceViewStatus>(); |
| 240 | 61 | | foreach (var item in property.Value.EnumerateArray()) |
| | 62 | | { |
| 60 | 63 | | if (item.ValueKind == JsonValueKind.Null) |
| | 64 | | { |
| 0 | 65 | | array.Add(null); |
| | 66 | | } |
| | 67 | | else |
| | 68 | | { |
| 60 | 69 | | array.Add(InstanceViewStatus.DeserializeInstanceViewStatus(item)); |
| | 70 | | } |
| | 71 | | } |
| 60 | 72 | | statuses = array; |
| 60 | 73 | | continue; |
| | 74 | | } |
| 12 | 75 | | if (property.NameEquals("orchestrationServices")) |
| | 76 | | { |
| 12 | 77 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 78 | | { |
| | 79 | | continue; |
| | 80 | | } |
| 12 | 81 | | List<OrchestrationServiceSummary> array = new List<OrchestrationServiceSummary>(); |
| 48 | 82 | | foreach (var item in property.Value.EnumerateArray()) |
| | 83 | | { |
| 12 | 84 | | if (item.ValueKind == JsonValueKind.Null) |
| | 85 | | { |
| 0 | 86 | | array.Add(null); |
| | 87 | | } |
| | 88 | | else |
| | 89 | | { |
| 12 | 90 | | array.Add(OrchestrationServiceSummary.DeserializeOrchestrationServiceSummary(item)); |
| | 91 | | } |
| | 92 | | } |
| 12 | 93 | | orchestrationServices = array; |
| | 94 | | continue; |
| | 95 | | } |
| | 96 | | } |
| 60 | 97 | | return new VirtualMachineScaleSetInstanceView(virtualMachine, extensions, statuses, orchestrationServices); |
| | 98 | | } |
| | 99 | | } |
| | 100 | | } |