openapi: generate
This commit is contained in:
parent
47129e2d1f
commit
d77bf02185
@ -76,12 +76,12 @@ type Invoker interface {
|
|||||||
//
|
//
|
||||||
// GET /scripts
|
// GET /scripts
|
||||||
ListScripts(ctx context.Context, params ListScriptsParams) ([]Script, error)
|
ListScripts(ctx context.Context, params ListScriptsParams) ([]Script, error)
|
||||||
// UpdateSubmissionModel invokes updateSubmissionModel operation.
|
// UpdateSubmissionValidatedModel invokes updateSubmissionValidatedModel operation.
|
||||||
//
|
//
|
||||||
// Update model following role restrictions.
|
// Update validated model.
|
||||||
//
|
//
|
||||||
// POST /submissions/{SubmissionID}/model
|
// POST /submissions/{SubmissionID}/validated-model
|
||||||
UpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) error
|
UpdateSubmissionValidatedModel(ctx context.Context, params UpdateSubmissionValidatedModelParams) error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client implements OAS client.
|
// Client implements OAS client.
|
||||||
@ -992,21 +992,21 @@ func (c *Client) sendListScripts(ctx context.Context, params ListScriptsParams)
|
|||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSubmissionModel invokes updateSubmissionModel operation.
|
// UpdateSubmissionValidatedModel invokes updateSubmissionValidatedModel operation.
|
||||||
//
|
//
|
||||||
// Update model following role restrictions.
|
// Update validated model.
|
||||||
//
|
//
|
||||||
// POST /submissions/{SubmissionID}/model
|
// POST /submissions/{SubmissionID}/validated-model
|
||||||
func (c *Client) UpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) error {
|
func (c *Client) UpdateSubmissionValidatedModel(ctx context.Context, params UpdateSubmissionValidatedModelParams) error {
|
||||||
_, err := c.sendUpdateSubmissionModel(ctx, params)
|
_, err := c.sendUpdateSubmissionValidatedModel(ctx, params)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) sendUpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) (res *UpdateSubmissionModelNoContent, err error) {
|
func (c *Client) sendUpdateSubmissionValidatedModel(ctx context.Context, params UpdateSubmissionValidatedModelParams) (res *UpdateSubmissionValidatedModelNoContent, err error) {
|
||||||
otelAttrs := []attribute.KeyValue{
|
otelAttrs := []attribute.KeyValue{
|
||||||
otelogen.OperationID("updateSubmissionModel"),
|
otelogen.OperationID("updateSubmissionValidatedModel"),
|
||||||
semconv.HTTPRequestMethodKey.String("POST"),
|
semconv.HTTPRequestMethodKey.String("POST"),
|
||||||
semconv.HTTPRouteKey.String("/submissions/{SubmissionID}/model"),
|
semconv.HTTPRouteKey.String("/submissions/{SubmissionID}/validated-model"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run stopwatch.
|
// Run stopwatch.
|
||||||
@ -1021,7 +1021,7 @@ func (c *Client) sendUpdateSubmissionModel(ctx context.Context, params UpdateSub
|
|||||||
c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...))
|
c.requests.Add(ctx, 1, metric.WithAttributes(otelAttrs...))
|
||||||
|
|
||||||
// Start a span for this request.
|
// Start a span for this request.
|
||||||
ctx, span := c.cfg.Tracer.Start(ctx, UpdateSubmissionModelOperation,
|
ctx, span := c.cfg.Tracer.Start(ctx, UpdateSubmissionValidatedModelOperation,
|
||||||
trace.WithAttributes(otelAttrs...),
|
trace.WithAttributes(otelAttrs...),
|
||||||
clientSpanKind,
|
clientSpanKind,
|
||||||
)
|
)
|
||||||
@ -1058,21 +1058,21 @@ func (c *Client) sendUpdateSubmissionModel(ctx context.Context, params UpdateSub
|
|||||||
}
|
}
|
||||||
pathParts[1] = encoded
|
pathParts[1] = encoded
|
||||||
}
|
}
|
||||||
pathParts[2] = "/model"
|
pathParts[2] = "/validated-model"
|
||||||
uri.AddPathParts(u, pathParts[:]...)
|
uri.AddPathParts(u, pathParts[:]...)
|
||||||
|
|
||||||
stage = "EncodeQueryParams"
|
stage = "EncodeQueryParams"
|
||||||
q := uri.NewQueryEncoder()
|
q := uri.NewQueryEncoder()
|
||||||
{
|
{
|
||||||
// Encode "ModelID" parameter.
|
// Encode "ValidatedModelID" parameter.
|
||||||
cfg := uri.QueryParameterEncodingConfig{
|
cfg := uri.QueryParameterEncodingConfig{
|
||||||
Name: "ModelID",
|
Name: "ValidatedModelID",
|
||||||
Style: uri.QueryStyleForm,
|
Style: uri.QueryStyleForm,
|
||||||
Explode: true,
|
Explode: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := q.EncodeParam(cfg, func(e uri.Encoder) error {
|
if err := q.EncodeParam(cfg, func(e uri.Encoder) error {
|
||||||
return e.EncodeValue(conv.Int64ToString(params.ModelID))
|
return e.EncodeValue(conv.Int64ToString(params.ValidatedModelID))
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return res, errors.Wrap(err, "encode query")
|
return res, errors.Wrap(err, "encode query")
|
||||||
}
|
}
|
||||||
@ -1107,7 +1107,7 @@ func (c *Client) sendUpdateSubmissionModel(ctx context.Context, params UpdateSub
|
|||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
|
|
||||||
stage = "DecodeResponse"
|
stage = "DecodeResponse"
|
||||||
result, err := decodeUpdateSubmissionModelResponse(resp)
|
result, err := decodeUpdateSubmissionValidatedModelResponse(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, errors.Wrap(err, "decode response")
|
return res, errors.Wrap(err, "decode response")
|
||||||
}
|
}
|
||||||
|
@ -1262,22 +1262,22 @@ func (s *Server) handleListScriptsRequest(args [0]string, argsEscaped bool, w ht
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleUpdateSubmissionModelRequest handles updateSubmissionModel operation.
|
// handleUpdateSubmissionValidatedModelRequest handles updateSubmissionValidatedModel operation.
|
||||||
//
|
//
|
||||||
// Update model following role restrictions.
|
// Update validated model.
|
||||||
//
|
//
|
||||||
// POST /submissions/{SubmissionID}/model
|
// POST /submissions/{SubmissionID}/validated-model
|
||||||
func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) {
|
func (s *Server) handleUpdateSubmissionValidatedModelRequest(args [1]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) {
|
||||||
statusWriter := &codeRecorder{ResponseWriter: w}
|
statusWriter := &codeRecorder{ResponseWriter: w}
|
||||||
w = statusWriter
|
w = statusWriter
|
||||||
otelAttrs := []attribute.KeyValue{
|
otelAttrs := []attribute.KeyValue{
|
||||||
otelogen.OperationID("updateSubmissionModel"),
|
otelogen.OperationID("updateSubmissionValidatedModel"),
|
||||||
semconv.HTTPRequestMethodKey.String("POST"),
|
semconv.HTTPRequestMethodKey.String("POST"),
|
||||||
semconv.HTTPRouteKey.String("/submissions/{SubmissionID}/model"),
|
semconv.HTTPRouteKey.String("/submissions/{SubmissionID}/validated-model"),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start a span for this request.
|
// Start a span for this request.
|
||||||
ctx, span := s.cfg.Tracer.Start(r.Context(), UpdateSubmissionModelOperation,
|
ctx, span := s.cfg.Tracer.Start(r.Context(), UpdateSubmissionValidatedModelOperation,
|
||||||
trace.WithAttributes(otelAttrs...),
|
trace.WithAttributes(otelAttrs...),
|
||||||
serverSpanKind,
|
serverSpanKind,
|
||||||
)
|
)
|
||||||
@ -1332,11 +1332,11 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
}
|
}
|
||||||
err error
|
err error
|
||||||
opErrContext = ogenerrors.OperationContext{
|
opErrContext = ogenerrors.OperationContext{
|
||||||
Name: UpdateSubmissionModelOperation,
|
Name: UpdateSubmissionValidatedModelOperation,
|
||||||
ID: "updateSubmissionModel",
|
ID: "updateSubmissionValidatedModel",
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
params, err := decodeUpdateSubmissionModelParams(args, argsEscaped, r)
|
params, err := decodeUpdateSubmissionValidatedModelParams(args, argsEscaped, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = &ogenerrors.DecodeParamsError{
|
err = &ogenerrors.DecodeParamsError{
|
||||||
OperationContext: opErrContext,
|
OperationContext: opErrContext,
|
||||||
@ -1347,13 +1347,13 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var response *UpdateSubmissionModelNoContent
|
var response *UpdateSubmissionValidatedModelNoContent
|
||||||
if m := s.cfg.Middleware; m != nil {
|
if m := s.cfg.Middleware; m != nil {
|
||||||
mreq := middleware.Request{
|
mreq := middleware.Request{
|
||||||
Context: ctx,
|
Context: ctx,
|
||||||
OperationName: UpdateSubmissionModelOperation,
|
OperationName: UpdateSubmissionValidatedModelOperation,
|
||||||
OperationSummary: "Update model following role restrictions",
|
OperationSummary: "Update validated model",
|
||||||
OperationID: "updateSubmissionModel",
|
OperationID: "updateSubmissionValidatedModel",
|
||||||
Body: nil,
|
Body: nil,
|
||||||
Params: middleware.Parameters{
|
Params: middleware.Parameters{
|
||||||
{
|
{
|
||||||
@ -1361,9 +1361,9 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
In: "path",
|
In: "path",
|
||||||
}: params.SubmissionID,
|
}: params.SubmissionID,
|
||||||
{
|
{
|
||||||
Name: "ModelID",
|
Name: "ValidatedModelID",
|
||||||
In: "query",
|
In: "query",
|
||||||
}: params.ModelID,
|
}: params.ValidatedModelID,
|
||||||
{
|
{
|
||||||
Name: "VersionID",
|
Name: "VersionID",
|
||||||
In: "query",
|
In: "query",
|
||||||
@ -1374,8 +1374,8 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
|
|
||||||
type (
|
type (
|
||||||
Request = struct{}
|
Request = struct{}
|
||||||
Params = UpdateSubmissionModelParams
|
Params = UpdateSubmissionValidatedModelParams
|
||||||
Response = *UpdateSubmissionModelNoContent
|
Response = *UpdateSubmissionValidatedModelNoContent
|
||||||
)
|
)
|
||||||
response, err = middleware.HookMiddleware[
|
response, err = middleware.HookMiddleware[
|
||||||
Request,
|
Request,
|
||||||
@ -1384,14 +1384,14 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
](
|
](
|
||||||
m,
|
m,
|
||||||
mreq,
|
mreq,
|
||||||
unpackUpdateSubmissionModelParams,
|
unpackUpdateSubmissionValidatedModelParams,
|
||||||
func(ctx context.Context, request Request, params Params) (response Response, err error) {
|
func(ctx context.Context, request Request, params Params) (response Response, err error) {
|
||||||
err = s.h.UpdateSubmissionModel(ctx, params)
|
err = s.h.UpdateSubmissionValidatedModel(ctx, params)
|
||||||
return response, err
|
return response, err
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
err = s.h.UpdateSubmissionModel(ctx, params)
|
err = s.h.UpdateSubmissionValidatedModel(ctx, params)
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errRes, ok := errors.Into[*ErrorStatusCode](err); ok {
|
if errRes, ok := errors.Into[*ErrorStatusCode](err); ok {
|
||||||
@ -1410,7 +1410,7 @@ func (s *Server) handleUpdateSubmissionModelRequest(args [1]string, argsEscaped
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := encodeUpdateSubmissionModelResponse(response, w, span); err != nil {
|
if err := encodeUpdateSubmissionValidatedModelResponse(response, w, span); err != nil {
|
||||||
defer recordError("EncodeResponse", err)
|
defer recordError("EncodeResponse", err)
|
||||||
if !errors.Is(err, ht.ErrInternalServerErrorResponse) {
|
if !errors.Is(err, ht.ErrInternalServerErrorResponse) {
|
||||||
s.cfg.ErrorHandler(ctx, w, r, err)
|
s.cfg.ErrorHandler(ctx, w, r, err)
|
||||||
|
@ -6,13 +6,13 @@ package api
|
|||||||
type OperationName = string
|
type OperationName = string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ActionSubmissionAcceptedOperation OperationName = "ActionSubmissionAccepted"
|
ActionSubmissionAcceptedOperation OperationName = "ActionSubmissionAccepted"
|
||||||
ActionSubmissionUploadedOperation OperationName = "ActionSubmissionUploaded"
|
ActionSubmissionUploadedOperation OperationName = "ActionSubmissionUploaded"
|
||||||
ActionSubmissionValidatedOperation OperationName = "ActionSubmissionValidated"
|
ActionSubmissionValidatedOperation OperationName = "ActionSubmissionValidated"
|
||||||
CreateScriptOperation OperationName = "CreateScript"
|
CreateScriptOperation OperationName = "CreateScript"
|
||||||
CreateScriptPolicyOperation OperationName = "CreateScriptPolicy"
|
CreateScriptPolicyOperation OperationName = "CreateScriptPolicy"
|
||||||
GetScriptOperation OperationName = "GetScript"
|
GetScriptOperation OperationName = "GetScript"
|
||||||
ListScriptPolicyOperation OperationName = "ListScriptPolicy"
|
ListScriptPolicyOperation OperationName = "ListScriptPolicy"
|
||||||
ListScriptsOperation OperationName = "ListScripts"
|
ListScriptsOperation OperationName = "ListScripts"
|
||||||
UpdateSubmissionModelOperation OperationName = "UpdateSubmissionModel"
|
UpdateSubmissionValidatedModelOperation OperationName = "UpdateSubmissionValidatedModel"
|
||||||
)
|
)
|
||||||
|
@ -1050,15 +1050,15 @@ func decodeListScriptsParams(args [0]string, argsEscaped bool, r *http.Request)
|
|||||||
return params, nil
|
return params, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSubmissionModelParams is parameters of updateSubmissionModel operation.
|
// UpdateSubmissionValidatedModelParams is parameters of updateSubmissionValidatedModel operation.
|
||||||
type UpdateSubmissionModelParams struct {
|
type UpdateSubmissionValidatedModelParams struct {
|
||||||
// The unique identifier for a submission.
|
// The unique identifier for a submission.
|
||||||
SubmissionID int64
|
SubmissionID int64
|
||||||
ModelID int64
|
ValidatedModelID int64
|
||||||
VersionID int64
|
VersionID int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func unpackUpdateSubmissionModelParams(packed middleware.Parameters) (params UpdateSubmissionModelParams) {
|
func unpackUpdateSubmissionValidatedModelParams(packed middleware.Parameters) (params UpdateSubmissionValidatedModelParams) {
|
||||||
{
|
{
|
||||||
key := middleware.ParameterKey{
|
key := middleware.ParameterKey{
|
||||||
Name: "SubmissionID",
|
Name: "SubmissionID",
|
||||||
@ -1068,10 +1068,10 @@ func unpackUpdateSubmissionModelParams(packed middleware.Parameters) (params Upd
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
key := middleware.ParameterKey{
|
key := middleware.ParameterKey{
|
||||||
Name: "ModelID",
|
Name: "ValidatedModelID",
|
||||||
In: "query",
|
In: "query",
|
||||||
}
|
}
|
||||||
params.ModelID = packed[key].(int64)
|
params.ValidatedModelID = packed[key].(int64)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key := middleware.ParameterKey{
|
key := middleware.ParameterKey{
|
||||||
@ -1083,7 +1083,7 @@ func unpackUpdateSubmissionModelParams(packed middleware.Parameters) (params Upd
|
|||||||
return params
|
return params
|
||||||
}
|
}
|
||||||
|
|
||||||
func decodeUpdateSubmissionModelParams(args [1]string, argsEscaped bool, r *http.Request) (params UpdateSubmissionModelParams, _ error) {
|
func decodeUpdateSubmissionValidatedModelParams(args [1]string, argsEscaped bool, r *http.Request) (params UpdateSubmissionValidatedModelParams, _ error) {
|
||||||
q := uri.NewQueryDecoder(r.URL.Query())
|
q := uri.NewQueryDecoder(r.URL.Query())
|
||||||
// Decode path: SubmissionID.
|
// Decode path: SubmissionID.
|
||||||
if err := func() error {
|
if err := func() error {
|
||||||
@ -1130,10 +1130,10 @@ func decodeUpdateSubmissionModelParams(args [1]string, argsEscaped bool, r *http
|
|||||||
Err: err,
|
Err: err,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Decode query: ModelID.
|
// Decode query: ValidatedModelID.
|
||||||
if err := func() error {
|
if err := func() error {
|
||||||
cfg := uri.QueryParameterDecodingConfig{
|
cfg := uri.QueryParameterDecodingConfig{
|
||||||
Name: "ModelID",
|
Name: "ValidatedModelID",
|
||||||
Style: uri.QueryStyleForm,
|
Style: uri.QueryStyleForm,
|
||||||
Explode: true,
|
Explode: true,
|
||||||
}
|
}
|
||||||
@ -1150,7 +1150,7 @@ func decodeUpdateSubmissionModelParams(args [1]string, argsEscaped bool, r *http
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
params.ModelID = c
|
params.ValidatedModelID = c
|
||||||
return nil
|
return nil
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -1161,7 +1161,7 @@ func decodeUpdateSubmissionModelParams(args [1]string, argsEscaped bool, r *http
|
|||||||
return nil
|
return nil
|
||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return params, &ogenerrors.DecodeParamError{
|
return params, &ogenerrors.DecodeParamError{
|
||||||
Name: "ModelID",
|
Name: "ValidatedModelID",
|
||||||
In: "query",
|
In: "query",
|
||||||
Err: err,
|
Err: err,
|
||||||
}
|
}
|
||||||
|
@ -660,11 +660,11 @@ func decodeListScriptsResponse(resp *http.Response) (res []Script, _ error) {
|
|||||||
return res, errors.Wrap(defRes, "error")
|
return res, errors.Wrap(defRes, "error")
|
||||||
}
|
}
|
||||||
|
|
||||||
func decodeUpdateSubmissionModelResponse(resp *http.Response) (res *UpdateSubmissionModelNoContent, _ error) {
|
func decodeUpdateSubmissionValidatedModelResponse(resp *http.Response) (res *UpdateSubmissionValidatedModelNoContent, _ error) {
|
||||||
switch resp.StatusCode {
|
switch resp.StatusCode {
|
||||||
case 204:
|
case 204:
|
||||||
// Code 204.
|
// Code 204.
|
||||||
return &UpdateSubmissionModelNoContent{}, nil
|
return &UpdateSubmissionValidatedModelNoContent{}, nil
|
||||||
}
|
}
|
||||||
// Convenient error response.
|
// Convenient error response.
|
||||||
defRes, err := func() (res *ErrorStatusCode, err error) {
|
defRes, err := func() (res *ErrorStatusCode, err error) {
|
||||||
|
@ -112,7 +112,7 @@ func encodeListScriptsResponse(response []Script, w http.ResponseWriter, span tr
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func encodeUpdateSubmissionModelResponse(response *UpdateSubmissionModelNoContent, w http.ResponseWriter, span trace.Span) error {
|
func encodeUpdateSubmissionValidatedModelResponse(response *UpdateSubmissionValidatedModelNoContent, w http.ResponseWriter, span trace.Span) error {
|
||||||
w.WriteHeader(204)
|
w.WriteHeader(204)
|
||||||
span.SetStatus(codes.Ok, http.StatusText(204))
|
span.SetStatus(codes.Ok, http.StatusText(204))
|
||||||
|
|
||||||
|
@ -184,28 +184,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
switch elem[0] {
|
switch elem[0] {
|
||||||
case 'm': // Prefix: "model"
|
|
||||||
|
|
||||||
if l := len("model"); len(elem) >= l && elem[0:l] == "model" {
|
|
||||||
elem = elem[l:]
|
|
||||||
} else {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(elem) == 0 {
|
|
||||||
// Leaf node.
|
|
||||||
switch r.Method {
|
|
||||||
case "POST":
|
|
||||||
s.handleUpdateSubmissionModelRequest([1]string{
|
|
||||||
args[0],
|
|
||||||
}, elemIsEscaped, w, r)
|
|
||||||
default:
|
|
||||||
s.notAllowed(w, r, "POST")
|
|
||||||
}
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
case 's': // Prefix: "status/validator-"
|
case 's': // Prefix: "status/validator-"
|
||||||
|
|
||||||
if l := len("status/validator-"); len(elem) >= l && elem[0:l] == "status/validator-" {
|
if l := len("status/validator-"); len(elem) >= l && elem[0:l] == "status/validator-" {
|
||||||
@ -286,6 +264,28 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'v': // Prefix: "validated-model"
|
||||||
|
|
||||||
|
if l := len("validated-model"); len(elem) >= l && elem[0:l] == "validated-model" {
|
||||||
|
elem = elem[l:]
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(elem) == 0 {
|
||||||
|
// Leaf node.
|
||||||
|
switch r.Method {
|
||||||
|
case "POST":
|
||||||
|
s.handleUpdateSubmissionValidatedModelRequest([1]string{
|
||||||
|
args[0],
|
||||||
|
}, elemIsEscaped, w, r)
|
||||||
|
default:
|
||||||
|
s.notAllowed(w, r, "POST")
|
||||||
|
}
|
||||||
|
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -529,30 +529,6 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
switch elem[0] {
|
switch elem[0] {
|
||||||
case 'm': // Prefix: "model"
|
|
||||||
|
|
||||||
if l := len("model"); len(elem) >= l && elem[0:l] == "model" {
|
|
||||||
elem = elem[l:]
|
|
||||||
} else {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
if len(elem) == 0 {
|
|
||||||
// Leaf node.
|
|
||||||
switch method {
|
|
||||||
case "POST":
|
|
||||||
r.name = UpdateSubmissionModelOperation
|
|
||||||
r.summary = "Update model following role restrictions"
|
|
||||||
r.operationID = "updateSubmissionModel"
|
|
||||||
r.pathPattern = "/submissions/{SubmissionID}/model"
|
|
||||||
r.args = args
|
|
||||||
r.count = 1
|
|
||||||
return r, true
|
|
||||||
default:
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case 's': // Prefix: "status/validator-"
|
case 's': // Prefix: "status/validator-"
|
||||||
|
|
||||||
if l := len("status/validator-"); len(elem) >= l && elem[0:l] == "status/validator-" {
|
if l := len("status/validator-"); len(elem) >= l && elem[0:l] == "status/validator-" {
|
||||||
@ -639,6 +615,30 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'v': // Prefix: "validated-model"
|
||||||
|
|
||||||
|
if l := len("validated-model"); len(elem) >= l && elem[0:l] == "validated-model" {
|
||||||
|
elem = elem[l:]
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(elem) == 0 {
|
||||||
|
// Leaf node.
|
||||||
|
switch method {
|
||||||
|
case "POST":
|
||||||
|
r.name = UpdateSubmissionValidatedModelOperation
|
||||||
|
r.summary = "Update validated model"
|
||||||
|
r.operationID = "updateSubmissionValidatedModel"
|
||||||
|
r.pathPattern = "/submissions/{SubmissionID}/validated-model"
|
||||||
|
r.args = args
|
||||||
|
r.count = 1
|
||||||
|
return r, true
|
||||||
|
default:
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -406,5 +406,5 @@ func (s *ScriptPolicyCreate) SetPolicy(val int32) {
|
|||||||
s.Policy = val
|
s.Policy = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSubmissionModelNoContent is response for UpdateSubmissionModel operation.
|
// UpdateSubmissionValidatedModelNoContent is response for UpdateSubmissionValidatedModel operation.
|
||||||
type UpdateSubmissionModelNoContent struct{}
|
type UpdateSubmissionValidatedModelNoContent struct{}
|
||||||
|
@ -56,12 +56,12 @@ type Handler interface {
|
|||||||
//
|
//
|
||||||
// GET /scripts
|
// GET /scripts
|
||||||
ListScripts(ctx context.Context, params ListScriptsParams) ([]Script, error)
|
ListScripts(ctx context.Context, params ListScriptsParams) ([]Script, error)
|
||||||
// UpdateSubmissionModel implements updateSubmissionModel operation.
|
// UpdateSubmissionValidatedModel implements updateSubmissionValidatedModel operation.
|
||||||
//
|
//
|
||||||
// Update model following role restrictions.
|
// Update validated model.
|
||||||
//
|
//
|
||||||
// POST /submissions/{SubmissionID}/model
|
// POST /submissions/{SubmissionID}/validated-model
|
||||||
UpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) error
|
UpdateSubmissionValidatedModel(ctx context.Context, params UpdateSubmissionValidatedModelParams) error
|
||||||
// NewError creates *ErrorStatusCode from error returned by handler.
|
// NewError creates *ErrorStatusCode from error returned by handler.
|
||||||
//
|
//
|
||||||
// Used for common default response.
|
// Used for common default response.
|
||||||
|
@ -85,12 +85,12 @@ func (UnimplementedHandler) ListScripts(ctx context.Context, params ListScriptsP
|
|||||||
return r, ht.ErrNotImplemented
|
return r, ht.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateSubmissionModel implements updateSubmissionModel operation.
|
// UpdateSubmissionValidatedModel implements updateSubmissionValidatedModel operation.
|
||||||
//
|
//
|
||||||
// Update model following role restrictions.
|
// Update validated model.
|
||||||
//
|
//
|
||||||
// POST /submissions/{SubmissionID}/model
|
// POST /submissions/{SubmissionID}/validated-model
|
||||||
func (UnimplementedHandler) UpdateSubmissionModel(ctx context.Context, params UpdateSubmissionModelParams) error {
|
func (UnimplementedHandler) UpdateSubmissionValidatedModel(ctx context.Context, params UpdateSubmissionValidatedModelParams) error {
|
||||||
return ht.ErrNotImplemented
|
return ht.ErrNotImplemented
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user