flip_api.model_services.save_model ================================== .. py:module:: flip_api.model_services.save_model Attributes ---------- .. autoapisummary:: flip_api.model_services.save_model.router Functions --------- .. autoapisummary:: flip_api.model_services.save_model.save_model Module Contents --------------- .. py:data:: router .. py:function:: save_model(request: fastapi.Request, payload: flip_api.domain.interfaces.model.ISaveModel, db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) -> flip_api.domain.interfaces.shared.IId Create a model for a specific project. :param request: The incoming HTTP request. :type request: Request :param payload: The model data to be saved, including name, description, and project ID. :type payload: ISaveModel :param db: Database session. :type db: Session :param user_id: User ID from authentication. :type user_id: UUID :returns: An object containing the ID of the created model. :rtype: IId :raises HTTPException: If the user is not allowed to modify the project, if the project does not exist, if the project is not approved, if there are no approved trusts for the project, or there is a database error.