internal static SharedGalleryImageVersionStorageProfile DeserializeSharedGalleryImageVersionStorageProfile(JsonElement element) { Optional <SharedGalleryOSDiskImage> osDiskImage = default; Optional <IReadOnlyList <SharedGalleryDataDiskImage> > dataDiskImages = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("osDiskImage")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } osDiskImage = SharedGalleryOSDiskImage.DeserializeSharedGalleryOSDiskImage(property.Value); continue; } if (property.NameEquals("dataDiskImages")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <SharedGalleryDataDiskImage> array = new List <SharedGalleryDataDiskImage>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(SharedGalleryDataDiskImage.DeserializeSharedGalleryDataDiskImage(item)); } dataDiskImages = array; continue; } } return(new SharedGalleryImageVersionStorageProfile(osDiskImage.Value, Optional.ToList(dataDiskImages))); }
internal SharedGalleryImageVersionStorageProfile(SharedGalleryOSDiskImage osDiskImage, IReadOnlyList <SharedGalleryDataDiskImage> dataDiskImages) { OSDiskImage = osDiskImage; DataDiskImages = dataDiskImages; }