internal static VirtualMachineScaleSetNetworkProfile DeserializeVirtualMachineScaleSetNetworkProfile(JsonElement element) { Optional <ApiEntityReference> healthProbe = default; Optional <IList <VirtualMachineScaleSetNetworkConfiguration> > networkInterfaceConfigurations = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("healthProbe")) { healthProbe = ApiEntityReference.DeserializeApiEntityReference(property.Value); continue; } if (property.NameEquals("networkInterfaceConfigurations")) { List <VirtualMachineScaleSetNetworkConfiguration> array = new List <VirtualMachineScaleSetNetworkConfiguration>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(VirtualMachineScaleSetNetworkConfiguration.DeserializeVirtualMachineScaleSetNetworkConfiguration(item)); } networkInterfaceConfigurations = array; continue; } } return(new VirtualMachineScaleSetNetworkProfile(healthProbe.Value, Optional.ToList(networkInterfaceConfigurations))); }
internal VirtualMachineScaleSetIPConfiguration(string id, string name, ApiEntityReference subnet, bool?primary, VirtualMachineScaleSetPublicIPAddressConfiguration publicIPAddressConfiguration, IPVersion?privateIPAddressVersion, IList <SubResource> applicationGatewayBackendAddressPools, IList <SubResource> applicationSecurityGroups, IList <SubResource> loadBalancerBackendAddressPools, IList <SubResource> loadBalancerInboundNatPools) : base(id) { Name = name; Subnet = subnet; Primary = primary; PublicIPAddressConfiguration = publicIPAddressConfiguration; PrivateIPAddressVersion = privateIPAddressVersion; ApplicationGatewayBackendAddressPools = applicationGatewayBackendAddressPools; ApplicationSecurityGroups = applicationSecurityGroups; LoadBalancerBackendAddressPools = loadBalancerBackendAddressPools; LoadBalancerInboundNatPools = loadBalancerInboundNatPools; }
internal static VirtualMachineScaleSetNetworkProfile DeserializeVirtualMachineScaleSetNetworkProfile(JsonElement element) { Optional <ApiEntityReference> healthProbe = default; Optional <IList <VirtualMachineScaleSetNetworkConfiguration> > networkInterfaceConfigurations = default; Optional <NetworkApiVersion> networkApiVersion = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("healthProbe")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } healthProbe = ApiEntityReference.DeserializeApiEntityReference(property.Value); continue; } if (property.NameEquals("networkInterfaceConfigurations")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <VirtualMachineScaleSetNetworkConfiguration> array = new List <VirtualMachineScaleSetNetworkConfiguration>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(VirtualMachineScaleSetNetworkConfiguration.DeserializeVirtualMachineScaleSetNetworkConfiguration(item)); } networkInterfaceConfigurations = array; continue; } if (property.NameEquals("networkApiVersion")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } networkApiVersion = new NetworkApiVersion(property.Value.GetString()); continue; } } return(new VirtualMachineScaleSetNetworkProfile(healthProbe.Value, Optional.ToList(networkInterfaceConfigurations), Optional.ToNullable(networkApiVersion))); }
internal static VirtualMachineScaleSetNetworkProfile DeserializeVirtualMachineScaleSetNetworkProfile(JsonElement element) { ApiEntityReference healthProbe = default; IList <VirtualMachineScaleSetNetworkConfiguration> networkInterfaceConfigurations = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("healthProbe")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } healthProbe = ApiEntityReference.DeserializeApiEntityReference(property.Value); continue; } if (property.NameEquals("networkInterfaceConfigurations")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <VirtualMachineScaleSetNetworkConfiguration> array = new List <VirtualMachineScaleSetNetworkConfiguration>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(VirtualMachineScaleSetNetworkConfiguration.DeserializeVirtualMachineScaleSetNetworkConfiguration(item)); } } networkInterfaceConfigurations = array; continue; } } return(new VirtualMachineScaleSetNetworkProfile(healthProbe, networkInterfaceConfigurations)); }
internal VirtualMachineScaleSetNetworkProfile(ApiEntityReference healthProbe, IList <VirtualMachineScaleSetNetworkConfiguration> networkInterfaceConfigurations) { HealthProbe = healthProbe; NetworkInterfaceConfigurations = networkInterfaceConfigurations; }
internal static VirtualMachineScaleSetUpdateIPConfiguration DeserializeVirtualMachineScaleSetUpdateIPConfiguration(JsonElement element) { Optional <string> name = default; Optional <string> id = default; Optional <ApiEntityReference> subnet = default; Optional <bool> primary = default; Optional <VirtualMachineScaleSetUpdatePublicIPAddressConfiguration> publicIPAddressConfiguration = default; Optional <IPVersion> privateIPAddressVersion = default; Optional <IList <SubResource> > applicationGatewayBackendAddressPools = default; Optional <IList <SubResource> > applicationSecurityGroups = default; Optional <IList <SubResource> > loadBalancerBackendAddressPools = default; Optional <IList <SubResource> > loadBalancerInboundNatPools = 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("subnet")) { subnet = ApiEntityReference.DeserializeApiEntityReference(property0.Value); continue; } if (property0.NameEquals("primary")) { primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("publicIPAddressConfiguration")) { publicIPAddressConfiguration = VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.DeserializeVirtualMachineScaleSetUpdatePublicIPAddressConfiguration(property0.Value); continue; } if (property0.NameEquals("privateIPAddressVersion")) { privateIPAddressVersion = new IPVersion(property0.Value.GetString()); continue; } if (property0.NameEquals("applicationGatewayBackendAddressPools")) { List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(DeserializeSubResource(item)); } applicationGatewayBackendAddressPools = array; continue; } if (property0.NameEquals("applicationSecurityGroups")) { List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(DeserializeSubResource(item)); } applicationSecurityGroups = array; continue; } if (property0.NameEquals("loadBalancerBackendAddressPools")) { List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(DeserializeSubResource(item)); } loadBalancerBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerInboundNatPools")) { List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { array.Add(DeserializeSubResource(item)); } loadBalancerInboundNatPools = array; continue; } } continue; } } return(new VirtualMachineScaleSetUpdateIPConfiguration(id.Value, name.Value, subnet.Value, Optional.ToNullable(primary), publicIPAddressConfiguration.Value, Optional.ToNullable(privateIPAddressVersion), Optional.ToList(applicationGatewayBackendAddressPools), Optional.ToList(applicationSecurityGroups), Optional.ToList(loadBalancerBackendAddressPools), Optional.ToList(loadBalancerInboundNatPools))); }
internal static RestorePointSourceVMDataDisk DeserializeRestorePointSourceVMDataDisk(JsonElement element) { Optional <int> lun = default; Optional <string> name = default; Optional <CachingTypes> caching = default; Optional <int> diskSizeGB = default; Optional <ManagedDiskParameters> managedDisk = default; Optional <ApiEntityReference> diskRestorePoint = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("lun")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } lun = property.Value.GetInt32(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("caching")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } caching = property.Value.GetString().ToCachingTypes(); continue; } if (property.NameEquals("diskSizeGB")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } diskSizeGB = property.Value.GetInt32(); continue; } if (property.NameEquals("managedDisk")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } managedDisk = ManagedDiskParameters.DeserializeManagedDiskParameters(property.Value); continue; } if (property.NameEquals("diskRestorePoint")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } diskRestorePoint = ApiEntityReference.DeserializeApiEntityReference(property.Value); continue; } } return(new RestorePointSourceVMDataDisk(Optional.ToNullable(lun), name.Value, Optional.ToNullable(caching), Optional.ToNullable(diskSizeGB), managedDisk.Value, diskRestorePoint.Value)); }
internal static VirtualMachineScaleSetUpdateIPConfiguration DeserializeVirtualMachineScaleSetUpdateIPConfiguration(JsonElement element) { string name = default; string id = default; ApiEntityReference subnet = default; bool?primary = default; VirtualMachineScaleSetUpdatePublicIPAddressConfiguration publicIPAddressConfiguration = default; IPVersion? privateIPAddressVersion = default; IList <SubResource> applicationGatewayBackendAddressPools = default; IList <SubResource> applicationSecurityGroups = default; IList <SubResource> loadBalancerBackendAddressPools = default; IList <SubResource> loadBalancerInboundNatPools = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("name")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } 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("subnet")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } subnet = ApiEntityReference.DeserializeApiEntityReference(property0.Value); continue; } if (property0.NameEquals("primary")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } primary = property0.Value.GetBoolean(); continue; } if (property0.NameEquals("publicIPAddressConfiguration")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } publicIPAddressConfiguration = VirtualMachineScaleSetUpdatePublicIPAddressConfiguration.DeserializeVirtualMachineScaleSetUpdatePublicIPAddressConfiguration(property0.Value); continue; } if (property0.NameEquals("privateIPAddressVersion")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } privateIPAddressVersion = new IPVersion(property0.Value.GetString()); continue; } if (property0.NameEquals("applicationGatewayBackendAddressPools")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(DeserializeSubResource(item)); } } applicationGatewayBackendAddressPools = array; continue; } if (property0.NameEquals("applicationSecurityGroups")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(DeserializeSubResource(item)); } } applicationSecurityGroups = array; continue; } if (property0.NameEquals("loadBalancerBackendAddressPools")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(DeserializeSubResource(item)); } } loadBalancerBackendAddressPools = array; continue; } if (property0.NameEquals("loadBalancerInboundNatPools")) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } List <SubResource> array = new List <SubResource>(); foreach (var item in property0.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(DeserializeSubResource(item)); } } loadBalancerInboundNatPools = array; continue; } } continue; } } return(new VirtualMachineScaleSetUpdateIPConfiguration(id, name, subnet, primary, publicIPAddressConfiguration, privateIPAddressVersion, applicationGatewayBackendAddressPools, applicationSecurityGroups, loadBalancerBackendAddressPools, loadBalancerInboundNatPools)); }