def METHOD_NAME(
    self, doc_integration: DocIntegration, validated_data: MutableMapping[str, Any]
) -> DocIntegration:
    if validated_data.get("features"):
        features = validated_data.pop("features")
        IntegrationFeature.objects.clean_update(
            incoming_features=features,
            target=doc_integration,
            target_type=IntegrationTypes.DOC_INTEGRATION,
        )
    # If we're publishing...
    if not validated_data.get("is_draft", True):
        if not doc_integration.avatar.exists():
            raise serializers.ValidationError({"avatar": "A logo is required for publishing."})
    # Update the DocIntegration
    for key, value in validated_data.items():
        setattr(doc_integration, key, value)
    doc_integration.save()
    return doc_integration