def METHOD_NAME(
    db_session: DbSession,
    entity_type_id: PrimaryKey,
    entity_type_in: EntityTypeUpdate,
):
    """Update an entity."""
    entity_type = get(db_session=db_session, entity_type_id=entity_type_id)
    if not entity_type:
        raise HTTPException(
            status_code=status.HTTP_404_NOT_FOUND,
            detail=[{"msg": "A entity with this id does not exist."}],
        )
    try:
        entity_type = update(
            db_session=db_session, entity_type=entity_type, entity_type_in=entity_type_in
        )
    except IntegrityError:
        raise ValidationError(
            [
                ErrorWrapper(
                    ExistsError(msg="A entity type with this name already exists."), loc="name"
                )
            ],
            model=EntityTypeUpdate,
        ) from None
    return entity_type