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)));
        }
Beispiel #2
0
        internal static VirtualMachineScaleSetVMNetworkProfileConfiguration DeserializeVirtualMachineScaleSetVMNetworkProfileConfiguration(JsonElement element)
        {
            IList <VirtualMachineScaleSetNetworkConfiguration> networkInterfaceConfigurations = default;

            foreach (var property in element.EnumerateObject())
            {
                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 VirtualMachineScaleSetVMNetworkProfileConfiguration(networkInterfaceConfigurations));
        }
        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 VirtualMachineScaleSetVmNetworkProfileConfiguration DeserializeVirtualMachineScaleSetVmNetworkProfileConfiguration(JsonElement element)
        {
            Optional <IList <VirtualMachineScaleSetNetworkConfiguration> > networkInterfaceConfigurations = default;

            foreach (var property in element.EnumerateObject())
            {
                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;
                }
            }
            return(new VirtualMachineScaleSetVmNetworkProfileConfiguration(Optional.ToList(networkInterfaceConfigurations)));
        }