// Code generated by ogen, DO NOT EDIT. package api import ( "context" ) // Handler handles operations described by OpenAPI v3 specification. type Handler interface { // CreateSubmission implements createSubmission operation. // // Create new submission. // // POST /submissions CreateSubmission(ctx context.Context, req OptSubmissionCreate) (*ID, error) // GetSubmission implements getSubmission operation. // // Retrieve map with ID. // // GET /submissions/{SubmissionID} GetSubmission(ctx context.Context, params GetSubmissionParams) (*Submission, error) // ListSubmissions implements listSubmissions operation. // // Get list of submissions. // // GET /submissions ListSubmissions(ctx context.Context, params ListSubmissionsParams) ([]Submission, error) // PatchSubmissionCompleted implements patchSubmissionCompleted operation. // // Retrieve map with ID. // // PATCH /submissions/{SubmissionID}/completed PatchSubmissionCompleted(ctx context.Context, params PatchSubmissionCompletedParams) error // PatchSubmissionModel implements patchSubmissionModel operation. // // Update model following role restrictions. // // PATCH /submissions/{SubmissionID}/model PatchSubmissionModel(ctx context.Context, params PatchSubmissionModelParams) error // PatchSubmissionStatus implements patchSubmissionStatus operation. // // Update status following role restrictions. // // PATCH /submissions/{SubmissionID}/status PatchSubmissionStatus(ctx context.Context, params PatchSubmissionStatusParams) error // NewError creates *ErrorStatusCode from error returned by handler. // // Used for common default response. NewError(ctx context.Context, err error) *ErrorStatusCode } // Server implements http server based on OpenAPI v3 specification and // calls Handler to handle requests. type Server struct { h Handler baseServer } // NewServer creates new Server. func NewServer(h Handler, opts ...ServerOption) (*Server, error) { s, err := newServerConfig(opts...).baseServer() if err != nil { return nil, err } return &Server{ h: h, baseServer: s, }, nil }