| | 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.Text.Json; |
| | 9 | | using Azure.Core; |
| | 10 | |
|
| | 11 | | namespace Azure.ResourceManager.Compute.Models |
| | 12 | | { |
| | 13 | | public partial class VirtualMachineScaleSetVMProfile : IUtf8JsonSerializable |
| | 14 | | { |
| | 15 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 16 | | { |
| 364 | 17 | | writer.WriteStartObject(); |
| 364 | 18 | | if (OsProfile != null) |
| | 19 | | { |
| 364 | 20 | | writer.WritePropertyName("osProfile"); |
| 364 | 21 | | writer.WriteObjectValue(OsProfile); |
| | 22 | | } |
| 364 | 23 | | if (StorageProfile != null) |
| | 24 | | { |
| 364 | 25 | | writer.WritePropertyName("storageProfile"); |
| 364 | 26 | | writer.WriteObjectValue(StorageProfile); |
| | 27 | | } |
| 364 | 28 | | if (NetworkProfile != null) |
| | 29 | | { |
| 364 | 30 | | writer.WritePropertyName("networkProfile"); |
| 364 | 31 | | writer.WriteObjectValue(NetworkProfile); |
| | 32 | | } |
| 364 | 33 | | if (DiagnosticsProfile != null) |
| | 34 | | { |
| 8 | 35 | | writer.WritePropertyName("diagnosticsProfile"); |
| 8 | 36 | | writer.WriteObjectValue(DiagnosticsProfile); |
| | 37 | | } |
| 364 | 38 | | if (ExtensionProfile != null) |
| | 39 | | { |
| 8 | 40 | | writer.WritePropertyName("extensionProfile"); |
| 8 | 41 | | writer.WriteObjectValue(ExtensionProfile); |
| | 42 | | } |
| 364 | 43 | | if (LicenseType != null) |
| | 44 | | { |
| 8 | 45 | | writer.WritePropertyName("licenseType"); |
| 8 | 46 | | writer.WriteStringValue(LicenseType); |
| | 47 | | } |
| 364 | 48 | | if (Priority != null) |
| | 49 | | { |
| 48 | 50 | | writer.WritePropertyName("priority"); |
| 48 | 51 | | writer.WriteStringValue(Priority.Value.ToString()); |
| | 52 | | } |
| 364 | 53 | | if (EvictionPolicy != null) |
| | 54 | | { |
| 8 | 55 | | writer.WritePropertyName("evictionPolicy"); |
| 8 | 56 | | writer.WriteStringValue(EvictionPolicy.Value.ToString()); |
| | 57 | | } |
| 364 | 58 | | if (BillingProfile != null) |
| | 59 | | { |
| 16 | 60 | | writer.WritePropertyName("billingProfile"); |
| 16 | 61 | | writer.WriteObjectValue(BillingProfile); |
| | 62 | | } |
| 364 | 63 | | if (ScheduledEventsProfile != null) |
| | 64 | | { |
| 8 | 65 | | writer.WritePropertyName("scheduledEventsProfile"); |
| 8 | 66 | | writer.WriteObjectValue(ScheduledEventsProfile); |
| | 67 | | } |
| 364 | 68 | | writer.WriteEndObject(); |
| 364 | 69 | | } |
| | 70 | |
|
| | 71 | | internal static VirtualMachineScaleSetVMProfile DeserializeVirtualMachineScaleSetVMProfile(JsonElement element) |
| | 72 | | { |
| 448 | 73 | | VirtualMachineScaleSetOSProfile osProfile = default; |
| 448 | 74 | | VirtualMachineScaleSetStorageProfile storageProfile = default; |
| 448 | 75 | | VirtualMachineScaleSetNetworkProfile networkProfile = default; |
| 448 | 76 | | DiagnosticsProfile diagnosticsProfile = default; |
| 448 | 77 | | VirtualMachineScaleSetExtensionProfile extensionProfile = default; |
| 448 | 78 | | string licenseType = default; |
| 448 | 79 | | VirtualMachinePriorityTypes? priority = default; |
| 448 | 80 | | VirtualMachineEvictionPolicyTypes? evictionPolicy = default; |
| 448 | 81 | | BillingProfile billingProfile = default; |
| 448 | 82 | | ScheduledEventsProfile scheduledEventsProfile = default; |
| 4936 | 83 | | foreach (var property in element.EnumerateObject()) |
| | 84 | | { |
| 2020 | 85 | | if (property.NameEquals("osProfile")) |
| | 86 | | { |
| 448 | 87 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 88 | | { |
| | 89 | | continue; |
| | 90 | | } |
| 448 | 91 | | osProfile = VirtualMachineScaleSetOSProfile.DeserializeVirtualMachineScaleSetOSProfile(property.Valu |
| 448 | 92 | | continue; |
| | 93 | | } |
| 1572 | 94 | | if (property.NameEquals("storageProfile")) |
| | 95 | | { |
| 448 | 96 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 97 | | { |
| | 98 | | continue; |
| | 99 | | } |
| 448 | 100 | | storageProfile = VirtualMachineScaleSetStorageProfile.DeserializeVirtualMachineScaleSetStorageProfil |
| 448 | 101 | | continue; |
| | 102 | | } |
| 1124 | 103 | | if (property.NameEquals("networkProfile")) |
| | 104 | | { |
| 448 | 105 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 106 | | { |
| | 107 | | continue; |
| | 108 | | } |
| 448 | 109 | | networkProfile = VirtualMachineScaleSetNetworkProfile.DeserializeVirtualMachineScaleSetNetworkProfil |
| 448 | 110 | | continue; |
| | 111 | | } |
| 676 | 112 | | if (property.NameEquals("diagnosticsProfile")) |
| | 113 | | { |
| 12 | 114 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 115 | | { |
| | 116 | | continue; |
| | 117 | | } |
| 12 | 118 | | diagnosticsProfile = DiagnosticsProfile.DeserializeDiagnosticsProfile(property.Value); |
| 12 | 119 | | continue; |
| | 120 | | } |
| 664 | 121 | | if (property.NameEquals("extensionProfile")) |
| | 122 | | { |
| 448 | 123 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 124 | | { |
| | 125 | | continue; |
| | 126 | | } |
| 448 | 127 | | extensionProfile = VirtualMachineScaleSetExtensionProfile.DeserializeVirtualMachineScaleSetExtension |
| 448 | 128 | | continue; |
| | 129 | | } |
| 216 | 130 | | if (property.NameEquals("licenseType")) |
| | 131 | | { |
| 12 | 132 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 133 | | { |
| | 134 | | continue; |
| | 135 | | } |
| 12 | 136 | | licenseType = property.Value.GetString(); |
| 12 | 137 | | continue; |
| | 138 | | } |
| 204 | 139 | | if (property.NameEquals("priority")) |
| | 140 | | { |
| 72 | 141 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 142 | | { |
| | 143 | | continue; |
| | 144 | | } |
| 72 | 145 | | priority = new VirtualMachinePriorityTypes(property.Value.GetString()); |
| 72 | 146 | | continue; |
| | 147 | | } |
| 132 | 148 | | if (property.NameEquals("evictionPolicy")) |
| | 149 | | { |
| 60 | 150 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 151 | | { |
| | 152 | | continue; |
| | 153 | | } |
| 60 | 154 | | evictionPolicy = new VirtualMachineEvictionPolicyTypes(property.Value.GetString()); |
| 60 | 155 | | continue; |
| | 156 | | } |
| 72 | 157 | | if (property.NameEquals("billingProfile")) |
| | 158 | | { |
| 60 | 159 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 160 | | { |
| | 161 | | continue; |
| | 162 | | } |
| 60 | 163 | | billingProfile = BillingProfile.DeserializeBillingProfile(property.Value); |
| 60 | 164 | | continue; |
| | 165 | | } |
| 12 | 166 | | if (property.NameEquals("scheduledEventsProfile")) |
| | 167 | | { |
| 12 | 168 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 169 | | { |
| | 170 | | continue; |
| | 171 | | } |
| 12 | 172 | | scheduledEventsProfile = ScheduledEventsProfile.DeserializeScheduledEventsProfile(property.Value); |
| | 173 | | continue; |
| | 174 | | } |
| | 175 | | } |
| 448 | 176 | | return new VirtualMachineScaleSetVMProfile(osProfile, storageProfile, networkProfile, diagnosticsProfile, ex |
| | 177 | | } |
| | 178 | | } |
| | 179 | | } |