internal static ArtifactManifestPlatform DeserializeArtifactManifestPlatform(JsonElement element)
        {
            string digest = default;
            Optional <ArtifactArchitecture>    architecture = default;
            Optional <ArtifactOperatingSystem> os           = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("digest"))
                {
                    digest = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("architecture"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    architecture = new ArtifactArchitecture(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("os"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    os = new ArtifactOperatingSystem(property.Value.GetString());
                    continue;
                }
            }
            return(new ArtifactManifestPlatform(digest, Optional.ToNullable(architecture), Optional.ToNullable(os)));
        }
        internal static ManifestAttributesBase DeserializeManifestAttributesBase(JsonElement element)
        {
            string          digest         = default;
            Optional <long> imageSize      = default;
            DateTimeOffset  createdTime    = default;
            DateTimeOffset  lastUpdateTime = default;
            Optional <ArtifactArchitecture?>    architecture = default;
            Optional <ArtifactOperatingSystem?> os           = default;
            Optional <string> mediaType = default;
            Optional <IReadOnlyList <ArtifactManifestPlatform> > references = default;
            Optional <IReadOnlyList <string> > tags = default;
            Optional <bool>   deleteEnabled         = default;
            Optional <bool>   writeEnabled          = default;
            Optional <bool>   listEnabled           = default;
            Optional <bool>   readEnabled           = default;
            Optional <string> quarantineState       = default;
            Optional <string> quarantineDetails     = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("digest"))
                {
                    digest = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("imageSize"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    imageSize = property.Value.GetInt64();
                    continue;
                }
                if (property.NameEquals("createdTime"))
                {
                    createdTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("lastUpdateTime"))
                {
                    lastUpdateTime = property.Value.GetDateTimeOffset("O");
                    continue;
                }
                if (property.NameEquals("architecture"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        architecture = null;
                        continue;
                    }
                    architecture = new ArtifactArchitecture(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("os"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        os = null;
                        continue;
                    }
                    os = new ArtifactOperatingSystem(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("mediaType"))
                {
                    mediaType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("references"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <ArtifactManifestPlatform> array = new List <ArtifactManifestPlatform>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ArtifactManifestPlatform.DeserializeArtifactManifestPlatform(item));
                    }
                    references = array;
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <string> array = new List <string>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(item.GetString());
                    }
                    tags = array;
                    continue;
                }
                if (property.NameEquals("changeableAttributes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("deleteEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            deleteEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("writeEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            writeEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("listEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            listEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("readEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            readEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("quarantineState"))
                        {
                            quarantineState = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("quarantineDetails"))
                        {
                            quarantineDetails = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ManifestAttributesBase(digest, Optional.ToNullable(imageSize), createdTime, lastUpdateTime, Optional.ToNullable(architecture), Optional.ToNullable(os), mediaType.Value, Optional.ToList(references), Optional.ToList(tags), Optional.ToNullable(deleteEnabled), Optional.ToNullable(writeEnabled), Optional.ToNullable(listEnabled), Optional.ToNullable(readEnabled), quarantineState.Value, quarantineDetails.Value));
        }