| | 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 VirtualMachineScaleSetNetworkConfiguration : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 364 | 18 | | writer.WriteStartObject(); |
| 364 | 19 | | writer.WritePropertyName("name"); |
| 364 | 20 | | writer.WriteStringValue(Name); |
| 364 | 21 | | if (Id != null) |
| | 22 | | { |
| 0 | 23 | | writer.WritePropertyName("id"); |
| 0 | 24 | | writer.WriteStringValue(Id); |
| | 25 | | } |
| 364 | 26 | | writer.WritePropertyName("properties"); |
| 364 | 27 | | writer.WriteStartObject(); |
| 364 | 28 | | if (Primary != null) |
| | 29 | | { |
| 364 | 30 | | writer.WritePropertyName("primary"); |
| 364 | 31 | | writer.WriteBooleanValue(Primary.Value); |
| | 32 | | } |
| 364 | 33 | | if (EnableAcceleratedNetworking != null) |
| | 34 | | { |
| 8 | 35 | | writer.WritePropertyName("enableAcceleratedNetworking"); |
| 8 | 36 | | writer.WriteBooleanValue(EnableAcceleratedNetworking.Value); |
| | 37 | | } |
| 364 | 38 | | if (NetworkSecurityGroup != null) |
| | 39 | | { |
| 8 | 40 | | writer.WritePropertyName("networkSecurityGroup"); |
| 8 | 41 | | writer.WriteObjectValue(NetworkSecurityGroup); |
| | 42 | | } |
| 364 | 43 | | if (DnsSettings != null) |
| | 44 | | { |
| 8 | 45 | | writer.WritePropertyName("dnsSettings"); |
| 8 | 46 | | writer.WriteObjectValue(DnsSettings); |
| | 47 | | } |
| 364 | 48 | | if (IpConfigurations != null) |
| | 49 | | { |
| 364 | 50 | | writer.WritePropertyName("ipConfigurations"); |
| 364 | 51 | | writer.WriteStartArray(); |
| 1488 | 52 | | foreach (var item in IpConfigurations) |
| | 53 | | { |
| 380 | 54 | | writer.WriteObjectValue(item); |
| | 55 | | } |
| 364 | 56 | | writer.WriteEndArray(); |
| | 57 | | } |
| 364 | 58 | | if (EnableIPForwarding != null) |
| | 59 | | { |
| 0 | 60 | | writer.WritePropertyName("enableIPForwarding"); |
| 0 | 61 | | writer.WriteBooleanValue(EnableIPForwarding.Value); |
| | 62 | | } |
| 364 | 63 | | writer.WriteEndObject(); |
| 364 | 64 | | writer.WriteEndObject(); |
| 364 | 65 | | } |
| | 66 | |
|
| | 67 | | internal static VirtualMachineScaleSetNetworkConfiguration DeserializeVirtualMachineScaleSetNetworkConfiguration |
| | 68 | | { |
| 536 | 69 | | string name = default; |
| 536 | 70 | | string id = default; |
| 536 | 71 | | bool? primary = default; |
| 536 | 72 | | bool? enableAcceleratedNetworking = default; |
| 536 | 73 | | SubResource networkSecurityGroup = default; |
| 536 | 74 | | VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default; |
| 536 | 75 | | IList<VirtualMachineScaleSetIPConfiguration> ipConfigurations = default; |
| 536 | 76 | | bool? enableIPForwarding = default; |
| 3216 | 77 | | foreach (var property in element.EnumerateObject()) |
| | 78 | | { |
| 1072 | 79 | | if (property.NameEquals("name")) |
| | 80 | | { |
| 536 | 81 | | name = property.Value.GetString(); |
| 536 | 82 | | continue; |
| | 83 | | } |
| 536 | 84 | | if (property.NameEquals("id")) |
| | 85 | | { |
| 0 | 86 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 87 | | { |
| | 88 | | continue; |
| | 89 | | } |
| 0 | 90 | | id = property.Value.GetString(); |
| 0 | 91 | | continue; |
| | 92 | | } |
| 536 | 93 | | if (property.NameEquals("properties")) |
| | 94 | | { |
| 6456 | 95 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 96 | | { |
| 2692 | 97 | | if (property0.NameEquals("primary")) |
| | 98 | | { |
| 536 | 99 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 100 | | { |
| | 101 | | continue; |
| | 102 | | } |
| 536 | 103 | | primary = property0.Value.GetBoolean(); |
| 536 | 104 | | continue; |
| | 105 | | } |
| 2156 | 106 | | if (property0.NameEquals("enableAcceleratedNetworking")) |
| | 107 | | { |
| 536 | 108 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 109 | | { |
| | 110 | | continue; |
| | 111 | | } |
| 536 | 112 | | enableAcceleratedNetworking = property0.Value.GetBoolean(); |
| 536 | 113 | | continue; |
| | 114 | | } |
| 1620 | 115 | | if (property0.NameEquals("networkSecurityGroup")) |
| | 116 | | { |
| 12 | 117 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 118 | | { |
| | 119 | | continue; |
| | 120 | | } |
| 12 | 121 | | networkSecurityGroup = DeserializeSubResource(property0.Value); |
| 12 | 122 | | continue; |
| | 123 | | } |
| 1608 | 124 | | if (property0.NameEquals("dnsSettings")) |
| | 125 | | { |
| 536 | 126 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 127 | | { |
| | 128 | | continue; |
| | 129 | | } |
| 536 | 130 | | dnsSettings = VirtualMachineScaleSetNetworkConfigurationDnsSettings.DeserializeVirtualMachin |
| 536 | 131 | | continue; |
| | 132 | | } |
| 1072 | 133 | | if (property0.NameEquals("ipConfigurations")) |
| | 134 | | { |
| 536 | 135 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 136 | | { |
| | 137 | | continue; |
| | 138 | | } |
| 536 | 139 | | List<VirtualMachineScaleSetIPConfiguration> array = new List<VirtualMachineScaleSetIPConfigu |
| 2192 | 140 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 141 | | { |
| 560 | 142 | | if (item.ValueKind == JsonValueKind.Null) |
| | 143 | | { |
| 0 | 144 | | array.Add(null); |
| | 145 | | } |
| | 146 | | else |
| | 147 | | { |
| 560 | 148 | | array.Add(VirtualMachineScaleSetIPConfiguration.DeserializeVirtualMachineScaleSetIPC |
| | 149 | | } |
| | 150 | | } |
| 536 | 151 | | ipConfigurations = array; |
| 536 | 152 | | continue; |
| | 153 | | } |
| 536 | 154 | | if (property0.NameEquals("enableIPForwarding")) |
| | 155 | | { |
| 536 | 156 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 157 | | { |
| | 158 | | continue; |
| | 159 | | } |
| 536 | 160 | | enableIPForwarding = property0.Value.GetBoolean(); |
| | 161 | | continue; |
| | 162 | | } |
| | 163 | | } |
| | 164 | | continue; |
| | 165 | | } |
| | 166 | | } |
| 536 | 167 | | return new VirtualMachineScaleSetNetworkConfiguration(id, name, primary, enableAcceleratedNetworking, networ |
| | 168 | | } |
| | 169 | | } |
| | 170 | | } |