| | 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.Network.Models |
| | 13 | | { |
| | 14 | | public partial class NetworkInterfaceIPConfiguration : IUtf8JsonSerializable |
| | 15 | | { |
| | 16 | | void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) |
| | 17 | | { |
| 216 | 18 | | writer.WriteStartObject(); |
| 216 | 19 | | if (Name != null) |
| | 20 | | { |
| 216 | 21 | | writer.WritePropertyName("name"); |
| 216 | 22 | | writer.WriteStringValue(Name); |
| | 23 | | } |
| 216 | 24 | | if (Etag != null) |
| | 25 | | { |
| 56 | 26 | | writer.WritePropertyName("etag"); |
| 56 | 27 | | writer.WriteStringValue(Etag); |
| | 28 | | } |
| 216 | 29 | | if (Id != null) |
| | 30 | | { |
| 56 | 31 | | writer.WritePropertyName("id"); |
| 56 | 32 | | writer.WriteStringValue(Id); |
| | 33 | | } |
| 216 | 34 | | writer.WritePropertyName("properties"); |
| 216 | 35 | | writer.WriteStartObject(); |
| 216 | 36 | | if (VirtualNetworkTaps != null) |
| | 37 | | { |
| 0 | 38 | | writer.WritePropertyName("virtualNetworkTaps"); |
| 0 | 39 | | writer.WriteStartArray(); |
| 0 | 40 | | foreach (var item in VirtualNetworkTaps) |
| | 41 | | { |
| 0 | 42 | | writer.WriteObjectValue(item); |
| | 43 | | } |
| 0 | 44 | | writer.WriteEndArray(); |
| | 45 | | } |
| 216 | 46 | | if (ApplicationGatewayBackendAddressPools != null) |
| | 47 | | { |
| 0 | 48 | | writer.WritePropertyName("applicationGatewayBackendAddressPools"); |
| 0 | 49 | | writer.WriteStartArray(); |
| 0 | 50 | | foreach (var item in ApplicationGatewayBackendAddressPools) |
| | 51 | | { |
| 0 | 52 | | writer.WriteObjectValue(item); |
| | 53 | | } |
| 0 | 54 | | writer.WriteEndArray(); |
| | 55 | | } |
| 216 | 56 | | if (LoadBalancerBackendAddressPools != null) |
| | 57 | | { |
| 32 | 58 | | writer.WritePropertyName("loadBalancerBackendAddressPools"); |
| 32 | 59 | | writer.WriteStartArray(); |
| 128 | 60 | | foreach (var item in LoadBalancerBackendAddressPools) |
| | 61 | | { |
| 32 | 62 | | writer.WriteObjectValue(item); |
| | 63 | | } |
| 32 | 64 | | writer.WriteEndArray(); |
| | 65 | | } |
| 216 | 66 | | if (LoadBalancerInboundNatRules != null) |
| | 67 | | { |
| 32 | 68 | | writer.WritePropertyName("loadBalancerInboundNatRules"); |
| 32 | 69 | | writer.WriteStartArray(); |
| 128 | 70 | | foreach (var item in LoadBalancerInboundNatRules) |
| | 71 | | { |
| 32 | 72 | | writer.WriteObjectValue(item); |
| | 73 | | } |
| 32 | 74 | | writer.WriteEndArray(); |
| | 75 | | } |
| 216 | 76 | | if (PrivateIPAddress != null) |
| | 77 | | { |
| 72 | 78 | | writer.WritePropertyName("privateIPAddress"); |
| 72 | 79 | | writer.WriteStringValue(PrivateIPAddress); |
| | 80 | | } |
| 216 | 81 | | if (PrivateIPAllocationMethod != null) |
| | 82 | | { |
| 216 | 83 | | writer.WritePropertyName("privateIPAllocationMethod"); |
| 216 | 84 | | writer.WriteStringValue(PrivateIPAllocationMethod.Value.ToString()); |
| | 85 | | } |
| 216 | 86 | | if (PrivateIPAddressVersion != null) |
| | 87 | | { |
| 88 | 88 | | writer.WritePropertyName("privateIPAddressVersion"); |
| 88 | 89 | | writer.WriteStringValue(PrivateIPAddressVersion.Value.ToString()); |
| | 90 | | } |
| 216 | 91 | | if (Subnet != null) |
| | 92 | | { |
| 208 | 93 | | writer.WritePropertyName("subnet"); |
| 208 | 94 | | writer.WriteObjectValue(Subnet); |
| | 95 | | } |
| 216 | 96 | | if (Primary != null) |
| | 97 | | { |
| 96 | 98 | | writer.WritePropertyName("primary"); |
| 96 | 99 | | writer.WriteBooleanValue(Primary.Value); |
| | 100 | | } |
| 216 | 101 | | if (PublicIPAddress != null) |
| | 102 | | { |
| 16 | 103 | | writer.WritePropertyName("publicIPAddress"); |
| 16 | 104 | | writer.WriteObjectValue(PublicIPAddress); |
| | 105 | | } |
| 216 | 106 | | if (ApplicationSecurityGroups != null) |
| | 107 | | { |
| 0 | 108 | | writer.WritePropertyName("applicationSecurityGroups"); |
| 0 | 109 | | writer.WriteStartArray(); |
| 0 | 110 | | foreach (var item in ApplicationSecurityGroups) |
| | 111 | | { |
| 0 | 112 | | writer.WriteObjectValue(item); |
| | 113 | | } |
| 0 | 114 | | writer.WriteEndArray(); |
| | 115 | | } |
| 216 | 116 | | if (ProvisioningState != null) |
| | 117 | | { |
| 56 | 118 | | writer.WritePropertyName("provisioningState"); |
| 56 | 119 | | writer.WriteStringValue(ProvisioningState.Value.ToString()); |
| | 120 | | } |
| 216 | 121 | | if (PrivateLinkConnectionProperties != null) |
| | 122 | | { |
| 0 | 123 | | writer.WritePropertyName("privateLinkConnectionProperties"); |
| 0 | 124 | | writer.WriteObjectValue(PrivateLinkConnectionProperties); |
| | 125 | | } |
| 216 | 126 | | writer.WriteEndObject(); |
| 216 | 127 | | writer.WriteEndObject(); |
| 216 | 128 | | } |
| | 129 | |
|
| | 130 | | internal static NetworkInterfaceIPConfiguration DeserializeNetworkInterfaceIPConfiguration(JsonElement element) |
| | 131 | | { |
| 372 | 132 | | string name = default; |
| 372 | 133 | | string etag = default; |
| 372 | 134 | | string id = default; |
| 372 | 135 | | IList<VirtualNetworkTap> virtualNetworkTaps = default; |
| 372 | 136 | | IList<ApplicationGatewayBackendAddressPool> applicationGatewayBackendAddressPools = default; |
| 372 | 137 | | IList<BackendAddressPool> loadBalancerBackendAddressPools = default; |
| 372 | 138 | | IList<InboundNatRule> loadBalancerInboundNatRules = default; |
| 372 | 139 | | string privateIPAddress = default; |
| 372 | 140 | | IPAllocationMethod? privateIPAllocationMethod = default; |
| 372 | 141 | | IPVersion? privateIPAddressVersion = default; |
| 372 | 142 | | Subnet subnet = default; |
| 372 | 143 | | bool? primary = default; |
| 372 | 144 | | PublicIPAddress publicIPAddress = default; |
| 372 | 145 | | IList<ApplicationSecurityGroup> applicationSecurityGroups = default; |
| 372 | 146 | | ProvisioningState? provisioningState = default; |
| 372 | 147 | | NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties privateLinkConnectionProperties = default; |
| 4032 | 148 | | foreach (var property in element.EnumerateObject()) |
| | 149 | | { |
| 1644 | 150 | | if (property.NameEquals("name")) |
| | 151 | | { |
| 324 | 152 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 153 | | { |
| | 154 | | continue; |
| | 155 | | } |
| 324 | 156 | | name = property.Value.GetString(); |
| 324 | 157 | | continue; |
| | 158 | | } |
| 1320 | 159 | | if (property.NameEquals("etag")) |
| | 160 | | { |
| 324 | 161 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 162 | | { |
| | 163 | | continue; |
| | 164 | | } |
| 324 | 165 | | etag = property.Value.GetString(); |
| 324 | 166 | | continue; |
| | 167 | | } |
| 996 | 168 | | if (property.NameEquals("id")) |
| | 169 | | { |
| 372 | 170 | | if (property.Value.ValueKind == JsonValueKind.Null) |
| | 171 | | { |
| | 172 | | continue; |
| | 173 | | } |
| 372 | 174 | | id = property.Value.GetString(); |
| 372 | 175 | | continue; |
| | 176 | | } |
| 624 | 177 | | if (property.NameEquals("properties")) |
| | 178 | | { |
| 4896 | 179 | | foreach (var property0 in property.Value.EnumerateObject()) |
| | 180 | | { |
| 2124 | 181 | | if (property0.NameEquals("virtualNetworkTaps")) |
| | 182 | | { |
| 0 | 183 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 184 | | { |
| | 185 | | continue; |
| | 186 | | } |
| 0 | 187 | | List<VirtualNetworkTap> array = new List<VirtualNetworkTap>(); |
| 0 | 188 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 189 | | { |
| 0 | 190 | | if (item.ValueKind == JsonValueKind.Null) |
| | 191 | | { |
| 0 | 192 | | array.Add(null); |
| | 193 | | } |
| | 194 | | else |
| | 195 | | { |
| 0 | 196 | | array.Add(VirtualNetworkTap.DeserializeVirtualNetworkTap(item)); |
| | 197 | | } |
| | 198 | | } |
| 0 | 199 | | virtualNetworkTaps = array; |
| 0 | 200 | | continue; |
| | 201 | | } |
| 2124 | 202 | | if (property0.NameEquals("applicationGatewayBackendAddressPools")) |
| | 203 | | { |
| 0 | 204 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 205 | | { |
| | 206 | | continue; |
| | 207 | | } |
| 0 | 208 | | List<ApplicationGatewayBackendAddressPool> array = new List<ApplicationGatewayBackendAddress |
| 0 | 209 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 210 | | { |
| 0 | 211 | | if (item.ValueKind == JsonValueKind.Null) |
| | 212 | | { |
| 0 | 213 | | array.Add(null); |
| | 214 | | } |
| | 215 | | else |
| | 216 | | { |
| 0 | 217 | | array.Add(ApplicationGatewayBackendAddressPool.DeserializeApplicationGatewayBackendA |
| | 218 | | } |
| | 219 | | } |
| 0 | 220 | | applicationGatewayBackendAddressPools = array; |
| 0 | 221 | | continue; |
| | 222 | | } |
| 2124 | 223 | | if (property0.NameEquals("loadBalancerBackendAddressPools")) |
| | 224 | | { |
| 80 | 225 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 226 | | { |
| | 227 | | continue; |
| | 228 | | } |
| 80 | 229 | | List<BackendAddressPool> array = new List<BackendAddressPool>(); |
| 320 | 230 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 231 | | { |
| 80 | 232 | | if (item.ValueKind == JsonValueKind.Null) |
| | 233 | | { |
| 0 | 234 | | array.Add(null); |
| | 235 | | } |
| | 236 | | else |
| | 237 | | { |
| 80 | 238 | | array.Add(BackendAddressPool.DeserializeBackendAddressPool(item)); |
| | 239 | | } |
| | 240 | | } |
| 80 | 241 | | loadBalancerBackendAddressPools = array; |
| 80 | 242 | | continue; |
| | 243 | | } |
| 2044 | 244 | | if (property0.NameEquals("loadBalancerInboundNatRules")) |
| | 245 | | { |
| 80 | 246 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 247 | | { |
| | 248 | | continue; |
| | 249 | | } |
| 80 | 250 | | List<InboundNatRule> array = new List<InboundNatRule>(); |
| 320 | 251 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 252 | | { |
| 80 | 253 | | if (item.ValueKind == JsonValueKind.Null) |
| | 254 | | { |
| 0 | 255 | | array.Add(null); |
| | 256 | | } |
| | 257 | | else |
| | 258 | | { |
| 80 | 259 | | array.Add(InboundNatRule.DeserializeInboundNatRule(item)); |
| | 260 | | } |
| | 261 | | } |
| 80 | 262 | | loadBalancerInboundNatRules = array; |
| 80 | 263 | | continue; |
| | 264 | | } |
| 1964 | 265 | | if (property0.NameEquals("privateIPAddress")) |
| | 266 | | { |
| 308 | 267 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 268 | | { |
| | 269 | | continue; |
| | 270 | | } |
| 308 | 271 | | privateIPAddress = property0.Value.GetString(); |
| 308 | 272 | | continue; |
| | 273 | | } |
| 1656 | 274 | | if (property0.NameEquals("privateIPAllocationMethod")) |
| | 275 | | { |
| 324 | 276 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 277 | | { |
| | 278 | | continue; |
| | 279 | | } |
| 324 | 280 | | privateIPAllocationMethod = new IPAllocationMethod(property0.Value.GetString()); |
| 324 | 281 | | continue; |
| | 282 | | } |
| 1332 | 283 | | if (property0.NameEquals("privateIPAddressVersion")) |
| | 284 | | { |
| 324 | 285 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 286 | | { |
| | 287 | | continue; |
| | 288 | | } |
| 324 | 289 | | privateIPAddressVersion = new IPVersion(property0.Value.GetString()); |
| 324 | 290 | | continue; |
| | 291 | | } |
| 1008 | 292 | | if (property0.NameEquals("subnet")) |
| | 293 | | { |
| 308 | 294 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 295 | | { |
| | 296 | | continue; |
| | 297 | | } |
| 308 | 298 | | subnet = Subnet.DeserializeSubnet(property0.Value); |
| 308 | 299 | | continue; |
| | 300 | | } |
| 700 | 301 | | if (property0.NameEquals("primary")) |
| | 302 | | { |
| 308 | 303 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 304 | | { |
| | 305 | | continue; |
| | 306 | | } |
| 308 | 307 | | primary = property0.Value.GetBoolean(); |
| 308 | 308 | | continue; |
| | 309 | | } |
| 392 | 310 | | if (property0.NameEquals("publicIPAddress")) |
| | 311 | | { |
| 68 | 312 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 313 | | { |
| | 314 | | continue; |
| | 315 | | } |
| 68 | 316 | | publicIPAddress = PublicIPAddress.DeserializePublicIPAddress(property0.Value); |
| 68 | 317 | | continue; |
| | 318 | | } |
| 324 | 319 | | if (property0.NameEquals("applicationSecurityGroups")) |
| | 320 | | { |
| 0 | 321 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 322 | | { |
| | 323 | | continue; |
| | 324 | | } |
| 0 | 325 | | List<ApplicationSecurityGroup> array = new List<ApplicationSecurityGroup>(); |
| 0 | 326 | | foreach (var item in property0.Value.EnumerateArray()) |
| | 327 | | { |
| 0 | 328 | | if (item.ValueKind == JsonValueKind.Null) |
| | 329 | | { |
| 0 | 330 | | array.Add(null); |
| | 331 | | } |
| | 332 | | else |
| | 333 | | { |
| 0 | 334 | | array.Add(ApplicationSecurityGroup.DeserializeApplicationSecurityGroup(item)); |
| | 335 | | } |
| | 336 | | } |
| 0 | 337 | | applicationSecurityGroups = array; |
| 0 | 338 | | continue; |
| | 339 | | } |
| 324 | 340 | | if (property0.NameEquals("provisioningState")) |
| | 341 | | { |
| 324 | 342 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 343 | | { |
| | 344 | | continue; |
| | 345 | | } |
| 324 | 346 | | provisioningState = new ProvisioningState(property0.Value.GetString()); |
| 324 | 347 | | continue; |
| | 348 | | } |
| 0 | 349 | | if (property0.NameEquals("privateLinkConnectionProperties")) |
| | 350 | | { |
| 0 | 351 | | if (property0.Value.ValueKind == JsonValueKind.Null) |
| | 352 | | { |
| | 353 | | continue; |
| | 354 | | } |
| 0 | 355 | | privateLinkConnectionProperties = NetworkInterfaceIPConfigurationPrivateLinkConnectionProper |
| | 356 | | continue; |
| | 357 | | } |
| | 358 | | } |
| | 359 | | continue; |
| | 360 | | } |
| | 361 | | } |
| 372 | 362 | | return new NetworkInterfaceIPConfiguration(id, name, etag, virtualNetworkTaps, applicationGatewayBackendAddr |
| | 363 | | } |
| | 364 | | } |
| | 365 | | } |