def METHOD_NAME(self, request: Request, sentry_app) -> Response:
    owner_context = organization_service.get_organization_by_id(
        id=sentry_app.owner_id, user_id=None
    )
    if (
        owner_context
        and self._has_hook_events(request)
        and not features.has(
            "organizations:integrations-event-hooks",
            owner_context.organization,
            actor=request.user,
        )
    ):
        return Response(
            {
                "non_field_errors": [
                    "Your organization does not have access to the 'error' resource subscription."
                ]
            },
            status=403,
        )
    # isInternal is not field of our model but it is a field of the serializer
    data = request.data.copy()
    data["isInternal"] = sentry_app.status == SentryAppStatus.INTERNAL
    serializer = SentryAppSerializer(sentry_app, data=data, partial=True, access=request.access)
    if serializer.is_valid():
        result = serializer.validated_data
        updated_app = SentryAppUpdater(
            sentry_app=sentry_app,
            name=result.get("name"),
            author=result.get("author"),
            features=result.get("features"),
            status=result.get("status"),
            webhook_url=result.get("webhookUrl"),
            redirect_url=result.get("redirectUrl"),
            is_alertable=result.get("isAlertable"),
            verify_install=result.get("verifyInstall"),
            scopes=result.get("scopes"),
            events=result.get("events"),
            schema=result.get("schema"),
            overview=result.get("overview"),
            allowed_origins=result.get("allowedOrigins"),
            popularity=result.get("popularity"),
        ).run(user=request.user)
        return Response(serialize(updated_app, request.user, access=request.access))
    # log any errors with schema
    if "schema" in serializer.errors:
        for error_message in serializer.errors["schema"]:
            name = "sentry_app.schema_validation_error"
            log_info = {
                "schema": json.dumps(request.data["schema"]),
                "user_id": request.user.id,
                "sentry_app_id": sentry_app.id,
                "sentry_app_name": sentry_app.name,
                "organization_id": sentry_app.owner_id,
                "error_message": error_message,
            }
            logger.info(name, extra=log_info)
            analytics.record(name, **log_info)
    return Response(serializer.errors, status=400)