internal static VirtualMachineScaleSetNetworkConfiguration DeserializeVirtualMachineScaleSetNetworkConfiguration(JsonElement element) { string name = default; Optional <string> id = default; Optional <bool> primary = default; Optional <bool> enableAcceleratedNetworking = default; Optional <SubResource> networkSecurityGroup = default; Optional <VirtualMachineScaleSetNetworkConfigurationDnsSettings> dnsSettings = default; Optional <IList <VirtualMachineScaleSetIPConfiguration> > ipConfigurations = default; Optional <bool> enableIPForwarding = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("primary")) { primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("enableAcceleratedNetworking")) { enableAcceleratedNetworking = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("networkSecurityGroup")) { networkSecurityGroup = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("dnsSettings")) { dnsSettings = VirtualMachineScaleSetNetworkConfigurationDnsSettings.DeserializeVirtualMachineScaleSetNetworkConfigurationDnsSettings(property0.Value); continue; } if (property0.NameEquals("ipConfigurations")) { List <VirtualMachineScaleSetIPConfiguration> array = new List <VirtualMachineScaleSetIPConfiguration>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(VirtualMachineScaleSetIPConfiguration.DeserializeVirtualMachineScaleSetIPConfiguration(item)); } ipConfigurations = array; continue; } if (property0.NameEquals("enableIPForwarding")) { enableIPForwarding = property0.Value.GetBoolean(); continue; } } continue; } } return(new VirtualMachineScaleSetNetworkConfiguration(id.Value, name, Optional.ToNullable(primary), Optional.ToNullable(enableAcceleratedNetworking), networkSecurityGroup.Value, dnsSettings.Value, Optional.ToList(ipConfigurations), Optional.ToNullable(enableIPForwarding))); }
internal static VirtualMachineScaleSetNetworkConfiguration DeserializeVirtualMachineScaleSetNetworkConfiguration(JsonElement element) { string name = default; string id = default; bool? primary = default; bool? enableAcceleratedNetworking = default; SubResource networkSecurityGroup = default; VirtualMachineScaleSetNetworkConfigurationDnsSettings dnsSettings = default; IList <VirtualMachineScaleSetIPConfiguration> ipConfigurations = default; bool?enableIPForwarding = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("id")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } id = property.Value.GetString(); continue; } if (property.NameEquals("properties")) { foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("primary")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("enableAcceleratedNetworking")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableAcceleratedNetworking = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("networkSecurityGroup")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } networkSecurityGroup = DeserializeSubResource(property0.Value); continue; } if (property0.NameEquals("dnsSettings")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } dnsSettings = VirtualMachineScaleSetNetworkConfigurationDnsSettings.DeserializeVirtualMachineScaleSetNetworkConfigurationDnsSettings(property0.Value); continue; } if (property0.NameEquals("ipConfigurations")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <VirtualMachineScaleSetIPConfiguration> array = new List <VirtualMachineScaleSetIPConfiguration>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(VirtualMachineScaleSetIPConfiguration.DeserializeVirtualMachineScaleSetIPConfiguration(item)); } } ipConfigurations = array; continue; } if (property0.NameEquals("enableIPForwarding")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } enableIPForwarding = property0.Value.GetBoolean(); continue; } } continue; } } return(new VirtualMachineScaleSetNetworkConfiguration(id, name, primary, enableAcceleratedNetworking, networkSecurityGroup, dnsSettings, ipConfigurations, enableIPForwarding)); }