maps-service/pkg/api/oas_server_gen.go

163 lines
5.8 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 {
// ActionSubmissionReject implements actionSubmissionReject operation.
//
// Role Reviewer changes status from Submitted -> Rejected.
//
2024-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/status/reject
ActionSubmissionReject(ctx context.Context, params ActionSubmissionRejectParams) error
// ActionSubmissionRequestChanges implements actionSubmissionRequestChanges operation.
//
// Role Reviewer changes status from Validated|Accepted|Submitted -> ChangesRequested.
//
2024-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/status/request-changes
ActionSubmissionRequestChanges(ctx context.Context, params ActionSubmissionRequestChangesParams) error
// ActionSubmissionRevoke implements actionSubmissionRevoke operation.
//
// Role Submitter changes status from Submitted|ChangesRequested -> UnderConstruction.
//
2024-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/status/revoke
ActionSubmissionRevoke(ctx context.Context, params ActionSubmissionRevokeParams) error
// ActionSubmissionSubmit implements actionSubmissionSubmit operation.
//
// Role Submitter changes status from UnderConstruction|ChangesRequested -> Submitted.
//
2024-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/status/submit
ActionSubmissionSubmit(ctx context.Context, params ActionSubmissionSubmitParams) error
2024-12-14 19:55:56 +00:00
// ActionSubmissionTriggerUpload implements actionSubmissionTriggerUpload operation.
//
2024-12-14 19:55:56 +00:00
// Role Admin changes status from Validated -> Uploading.
//
2024-12-14 19:55:56 +00:00
// POST /submissions/{SubmissionID}/status/trigger-upload
ActionSubmissionTriggerUpload(ctx context.Context, params ActionSubmissionTriggerUploadParams) error
// ActionSubmissionTriggerValidate implements actionSubmissionTriggerValidate operation.
//
// Role Reviewer triggers validation and changes status from Submitted|Accepted -> Validating.
//
2024-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/status/trigger-validate
ActionSubmissionTriggerValidate(ctx context.Context, params ActionSubmissionTriggerValidateParams) error
2024-12-06 00:36:15 +00:00
// CreateScript implements createScript operation.
//
// Create a new script.
//
// POST /scripts
2024-12-06 02:48:26 +00:00
CreateScript(ctx context.Context, req *ScriptCreate) (*ID, error)
2024-12-06 00:36:15 +00:00
// CreateScriptPolicy implements createScriptPolicy operation.
//
// Create a new script policy.
//
// POST /script-policy
2024-12-06 02:48:26 +00:00
CreateScriptPolicy(ctx context.Context, req *ScriptPolicyCreate) (*ID, 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-12-06 02:48:26 +00:00
CreateSubmission(ctx context.Context, req *SubmissionCreate) (*ID, error)
2024-12-06 00:36:15 +00:00
// DeleteScript implements deleteScript operation.
//
// Delete the specified script by ID.
//
// DELETE /scripts/{ScriptID}
DeleteScript(ctx context.Context, params DeleteScriptParams) error
// DeleteScriptPolicy implements deleteScriptPolicy operation.
//
// Delete the specified script policy by ID.
//
2024-12-18 23:06:39 +00:00
// DELETE /script-policy/{ScriptPolicyID}
2024-12-06 00:36:15 +00:00
DeleteScriptPolicy(ctx context.Context, params DeleteScriptPolicyParams) error
// GetScript implements getScript operation.
//
// Get the specified script by ID.
//
// GET /scripts/{ScriptID}
GetScript(ctx context.Context, params GetScriptParams) (*Script, error)
// GetScriptPolicy implements getScriptPolicy operation.
//
// Get the specified script policy by ID.
//
2024-12-18 23:06:39 +00:00
// GET /script-policy/{ScriptPolicyID}
2024-12-06 00:36:15 +00:00
GetScriptPolicy(ctx context.Context, params GetScriptPolicyParams) (*ScriptPolicy, 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)
// ListScriptPolicy implements listScriptPolicy operation.
//
// Get list of script policies.
//
// GET /script-policy
2024-12-18 05:36:40 +00:00
ListScriptPolicy(ctx context.Context, params ListScriptPolicyParams) ([]ScriptPolicy, error)
2024-12-18 23:06:39 +00:00
// ListScripts implements listScripts operation.
//
// Get list of scripts.
//
// GET /scripts
ListScripts(ctx context.Context, params ListScriptsParams) ([]Script, error)
2024-11-26 20:39:10 +00:00
// 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
2024-12-18 05:36:40 +00:00
ListSubmissions(ctx context.Context, params ListSubmissionsParams) ([]Submission, error)
2024-12-10 06:06:33 +00:00
// SetSubmissionCompleted implements setSubmissionCompleted 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-12-10 06:06:33 +00:00
// POST /submissions/{SubmissionID}/completed
SetSubmissionCompleted(ctx context.Context, params SetSubmissionCompletedParams) error
2024-12-06 00:36:15 +00:00
// UpdateScript implements updateScript operation.
//
// Update the specified script by ID.
//
2024-12-10 06:06:33 +00:00
// POST /scripts/{ScriptID}
2024-12-06 02:48:26 +00:00
UpdateScript(ctx context.Context, req *ScriptUpdate, params UpdateScriptParams) error
2024-12-06 00:36:15 +00:00
// UpdateScriptPolicy implements updateScriptPolicy operation.
//
// Update the specified script policy by ID.
//
2024-12-18 23:06:39 +00:00
// POST /script-policy/{ScriptPolicyID}
2024-12-06 02:48:26 +00:00
UpdateScriptPolicy(ctx context.Context, req *ScriptPolicyUpdate, params UpdateScriptPolicyParams) error
2024-12-10 06:06:33 +00:00
// UpdateSubmissionModel implements updateSubmissionModel operation.
//
// Update model following role restrictions.
//
// POST /submissions/{SubmissionID}/model
UpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) 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
}