maps-service/pkg/api/oas_server_gen.go

115 lines
4.3 KiB
Go
Raw Normal View History

2024-11-26 01:22:45 +00:00
// Code generated by ogen, DO NOT EDIT.
package api
import (
"context"
)
// Handler handles operations described by OpenAPI v3 specification.
type Handler interface {
// ActionSubmissionPublish implements actionSubmissionPublish operation.
//
// Role Validator changes status from Publishing -> Published.
//
// PATCH /submissions/{SubmissionID}/status/publish
ActionSubmissionPublish(ctx context.Context, params ActionSubmissionPublishParams) error
// ActionSubmissionReject implements actionSubmissionReject operation.
//
// Role Reviewer changes status from Submitted -> Rejected.
//
// PATCH /submissions/{SubmissionID}/status/reject
ActionSubmissionReject(ctx context.Context, params ActionSubmissionRejectParams) error
// ActionSubmissionRequestChanges implements actionSubmissionRequestChanges operation.
//
// Role Reviewer changes status from Validated|Accepted|Submitted -> ChangesRequested.
//
// PATCH /submissions/{SubmissionID}/status/request-changes
ActionSubmissionRequestChanges(ctx context.Context, params ActionSubmissionRequestChangesParams) error
// ActionSubmissionRevoke implements actionSubmissionRevoke operation.
//
// Role Submitter changes status from Submitted|ChangesRequested -> UnderConstruction.
//
// PATCH /submissions/{SubmissionID}/status/revoke
ActionSubmissionRevoke(ctx context.Context, params ActionSubmissionRevokeParams) error
// ActionSubmissionSubmit implements actionSubmissionSubmit operation.
//
// Role Submitter changes status from UnderConstruction|ChangesRequested -> Submitted.
//
// PATCH /submissions/{SubmissionID}/status/submit
ActionSubmissionSubmit(ctx context.Context, params ActionSubmissionSubmitParams) error
// ActionSubmissionTriggerPublish implements actionSubmissionTriggerPublish operation.
//
// Role Admin changes status from Validated -> Publishing.
//
// PATCH /submissions/{SubmissionID}/status/trigger-publish
ActionSubmissionTriggerPublish(ctx context.Context, params ActionSubmissionTriggerPublishParams) error
// ActionSubmissionTriggerValidate implements actionSubmissionTriggerValidate operation.
//
// Role Reviewer triggers validation and changes status from Submitted|Accepted -> Validating.
//
// PATCH /submissions/{SubmissionID}/status/trigger-validate
ActionSubmissionTriggerValidate(ctx context.Context, params ActionSubmissionTriggerValidateParams) error
// ActionSubmissionValidate implements actionSubmissionValidate operation.
//
// Role Validator changes status from Validating -> Validated.
//
// PATCH /submissions/{SubmissionID}/status/validate
ActionSubmissionValidate(ctx context.Context, params ActionSubmissionValidateParams) error
2024-11-26 20:39:10 +00:00
// CreateSubmission implements createSubmission operation.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// Create new submission.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// POST /submissions
2024-11-27 23:38:17 +00:00
CreateSubmission(ctx context.Context, req OptSubmissionCreate) (*ID, error)
2024-11-26 20:39:10 +00:00
// GetSubmission implements getSubmission operation.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// Retrieve map with ID.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// GET /submissions/{SubmissionID}
GetSubmission(ctx context.Context, params GetSubmissionParams) (*Submission, error)
// ListSubmissions implements listSubmissions operation.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// Get list of submissions.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// GET /submissions
ListSubmissions(ctx context.Context, params ListSubmissionsParams) ([]Submission, error)
// PatchSubmissionCompleted implements patchSubmissionCompleted operation.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// Retrieve map with ID.
2024-11-26 01:22:45 +00:00
//
2024-11-26 20:39:10 +00:00
// 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
2024-11-26 01:22:45 +00:00
// 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 {
2024-11-29 22:33:48 +00:00
h Handler
sec SecurityHandler
2024-11-26 01:22:45 +00:00
baseServer
}
// NewServer creates new Server.
2024-11-29 22:33:48 +00:00
func NewServer(h Handler, sec SecurityHandler, opts ...ServerOption) (*Server, error) {
2024-11-26 01:22:45 +00:00
s, err := newServerConfig(opts...).baseServer()
if err != nil {
return nil, err
}
return &Server{
h: h,
2024-11-29 22:33:48 +00:00
sec: sec,
2024-11-26 01:22:45 +00:00
baseServer: s,
}, nil
}