internal static NetworkProfile DeserializeNetworkProfile(JsonElement element) { IList <NetworkInterfaceReference> networkInterfaces = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("networkInterfaces")) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } List <NetworkInterfaceReference> array = new List <NetworkInterfaceReference>(); foreach (var item in property.Value.EnumerateArray()) { if (item.ValueKind == JsonValueKind.Null) { array.Add(null); } else { array.Add(NetworkInterfaceReference.DeserializeNetworkInterfaceReference(item)); } } networkInterfaces = array; continue; } } return(new NetworkProfile(networkInterfaces)); }
internal static NetworkProfile DeserializeNetworkProfile(JsonElement element) { Optional <IList <NetworkInterfaceReference> > networkInterfaces = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("networkInterfaces")) { List <NetworkInterfaceReference> array = new List <NetworkInterfaceReference>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(NetworkInterfaceReference.DeserializeNetworkInterfaceReference(item)); } networkInterfaces = array; continue; } } return(new NetworkProfile(Optional.ToList(networkInterfaces))); }