internal GalleryImageVersion(string id, string name, string type, string location, IDictionary <string, string> tags, GalleryImageVersionPublishingProfile publishingProfile, GalleryImageVersionPropertiesProvisioningState?provisioningState, GalleryImageVersionStorageProfile storageProfile, ReplicationStatus replicationStatus) : base(id, name, type, location, tags) { PublishingProfile = publishingProfile; ProvisioningState = provisioningState; StorageProfile = storageProfile; ReplicationStatus = replicationStatus; }
internal static GalleryImageVersion DeserializeGalleryImageVersion(JsonElement element) { Optional <string> id = default; Optional <string> name = default; Optional <string> type = default; string location = default; Optional <IDictionary <string, string> > tags = default; Optional <GalleryImageVersionPublishingProfile> publishingProfile = default; Optional <GalleryImageVersionPropertiesProvisioningState> provisioningState = default; Optional <GalleryImageVersionStorageProfile> storageProfile = default; Optional <ReplicationStatus> replicationStatus = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id")) { id = property.Value.GetString(); continue; } if (property.NameEquals("name")) { name = property.Value.GetString(); continue; } if (property.NameEquals("type")) { type = property.Value.GetString(); continue; } if (property.NameEquals("location")) { location = property.Value.GetString(); continue; } if (property.NameEquals("tags")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } Dictionary <string, string> dictionary = new Dictionary <string, string>(); foreach (var property0 in property.Value.EnumerateObject()) { dictionary.Add(property0.Name, property0.Value.GetString()); } tags = dictionary; continue; } if (property.NameEquals("properties")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } foreach (var property0 in property.Value.EnumerateObject()) { if (property0.NameEquals("publishingProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } publishingProfile = GalleryImageVersionPublishingProfile.DeserializeGalleryImageVersionPublishingProfile(property0.Value); continue; } if (property0.NameEquals("provisioningState")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } provisioningState = new GalleryImageVersionPropertiesProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("storageProfile")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } storageProfile = GalleryImageVersionStorageProfile.DeserializeGalleryImageVersionStorageProfile(property0.Value); continue; } if (property0.NameEquals("replicationStatus")) { if (property0.Value.ValueKind == JsonValueKind.Null) { property0.ThrowNonNullablePropertyIsNull(); continue; } replicationStatus = ReplicationStatus.DeserializeReplicationStatus(property0.Value); continue; } } continue; } } return(new GalleryImageVersion(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags), publishingProfile.Value, Optional.ToNullable(provisioningState), storageProfile.Value, replicationStatus.Value)); }