diff --git a/pkg/api/oas_client_gen.go b/pkg/api/oas_client_gen.go index 3ed6249..19a152a 100644 --- a/pkg/api/oas_client_gen.go +++ b/pkg/api/oas_client_gen.go @@ -139,10 +139,10 @@ type Invoker interface { ActionSubmissionValidated(ctx context.Context, params ActionSubmissionValidatedParams) error // CreateMapfix invokes createMapfix operation. // - // Create new mapfix. + // Trigger the validator to create a mapfix. // // POST /mapfixes - CreateMapfix(ctx context.Context, request *MapfixCreate) (*ID, error) + CreateMapfix(ctx context.Context, request *MapfixTriggerCreate) (*ID, error) // CreateScript invokes createScript operation. // // Create a new script. @@ -157,10 +157,10 @@ type Invoker interface { CreateScriptPolicy(ctx context.Context, request *ScriptPolicyCreate) (*ID, error) // CreateSubmission invokes createSubmission operation. // - // Create new submission. + // Trigger the validator to create a new submission. // // POST /submissions - CreateSubmission(ctx context.Context, request *SubmissionCreate) (*ID, error) + CreateSubmission(ctx context.Context, request *SubmissionTriggerCreate) (*ID, error) // DeleteScript invokes deleteScript operation. // // Delete the specified script by ID. @@ -2584,15 +2584,15 @@ func (c *Client) sendActionSubmissionValidated(ctx context.Context, params Actio // CreateMapfix invokes createMapfix operation. // -// Create new mapfix. +// Trigger the validator to create a mapfix. // // POST /mapfixes -func (c *Client) CreateMapfix(ctx context.Context, request *MapfixCreate) (*ID, error) { +func (c *Client) CreateMapfix(ctx context.Context, request *MapfixTriggerCreate) (*ID, error) { res, err := c.sendCreateMapfix(ctx, request) return res, err } -func (c *Client) sendCreateMapfix(ctx context.Context, request *MapfixCreate) (res *ID, err error) { +func (c *Client) sendCreateMapfix(ctx context.Context, request *MapfixTriggerCreate) (res *ID, err error) { otelAttrs := []attribute.KeyValue{ otelogen.OperationID("createMapfix"), semconv.HTTPRequestMethodKey.String("POST"), @@ -2908,15 +2908,15 @@ func (c *Client) sendCreateScriptPolicy(ctx context.Context, request *ScriptPoli // CreateSubmission invokes createSubmission operation. // -// Create new submission. +// Trigger the validator to create a new submission. // // POST /submissions -func (c *Client) CreateSubmission(ctx context.Context, request *SubmissionCreate) (*ID, error) { +func (c *Client) CreateSubmission(ctx context.Context, request *SubmissionTriggerCreate) (*ID, error) { res, err := c.sendCreateSubmission(ctx, request) return res, err } -func (c *Client) sendCreateSubmission(ctx context.Context, request *SubmissionCreate) (res *ID, err error) { +func (c *Client) sendCreateSubmission(ctx context.Context, request *SubmissionTriggerCreate) (res *ID, err error) { otelAttrs := []attribute.KeyValue{ otelogen.OperationID("createSubmission"), semconv.HTTPRequestMethodKey.String("POST"), diff --git a/pkg/api/oas_handlers_gen.go b/pkg/api/oas_handlers_gen.go index 6b2c786..622be0b 100644 --- a/pkg/api/oas_handlers_gen.go +++ b/pkg/api/oas_handlers_gen.go @@ -3542,7 +3542,7 @@ func (s *Server) handleActionSubmissionValidatedRequest(args [1]string, argsEsca // handleCreateMapfixRequest handles createMapfix operation. // -// Create new mapfix. +// Trigger the validator to create a mapfix. // // POST /mapfixes func (s *Server) handleCreateMapfixRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -3681,7 +3681,7 @@ func (s *Server) handleCreateMapfixRequest(args [0]string, argsEscaped bool, w h mreq := middleware.Request{ Context: ctx, OperationName: CreateMapfixOperation, - OperationSummary: "Create new mapfix", + OperationSummary: "Trigger the validator to create a mapfix", OperationID: "createMapfix", Body: request, Params: middleware.Parameters{}, @@ -3689,7 +3689,7 @@ func (s *Server) handleCreateMapfixRequest(args [0]string, argsEscaped bool, w h } type ( - Request = *MapfixCreate + Request = *MapfixTriggerCreate Params = struct{} Response = *ID ) @@ -4127,7 +4127,7 @@ func (s *Server) handleCreateScriptPolicyRequest(args [0]string, argsEscaped boo // handleCreateSubmissionRequest handles createSubmission operation. // -// Create new submission. +// Trigger the validator to create a new submission. // // POST /submissions func (s *Server) handleCreateSubmissionRequest(args [0]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) { @@ -4266,7 +4266,7 @@ func (s *Server) handleCreateSubmissionRequest(args [0]string, argsEscaped bool, mreq := middleware.Request{ Context: ctx, OperationName: CreateSubmissionOperation, - OperationSummary: "Create new submission", + OperationSummary: "Trigger the validator to create a new submission", OperationID: "createSubmission", Body: request, Params: middleware.Parameters{}, @@ -4274,7 +4274,7 @@ func (s *Server) handleCreateSubmissionRequest(args [0]string, argsEscaped bool, } type ( - Request = *SubmissionCreate + Request = *SubmissionTriggerCreate Params = struct{} Response = *ID ) diff --git a/pkg/api/oas_json_gen.go b/pkg/api/oas_json_gen.go index 4e0109b..aa3eb8e 100644 --- a/pkg/api/oas_json_gen.go +++ b/pkg/api/oas_json_gen.go @@ -688,96 +688,40 @@ func (s *Mapfix) UnmarshalJSON(data []byte) error { } // Encode implements json.Marshaler. -func (s *MapfixCreate) Encode(e *jx.Encoder) { +func (s *MapfixTriggerCreate) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *MapfixCreate) encodeFields(e *jx.Encoder) { - { - e.FieldStart("DisplayName") - e.Str(s.DisplayName) - } - { - e.FieldStart("Creator") - e.Str(s.Creator) - } - { - e.FieldStart("GameID") - e.Int32(s.GameID) - } +func (s *MapfixTriggerCreate) encodeFields(e *jx.Encoder) { { e.FieldStart("AssetID") e.Int64(s.AssetID) } - { - e.FieldStart("AssetVersion") - e.Int64(s.AssetVersion) - } { e.FieldStart("TargetAssetID") e.Int64(s.TargetAssetID) } } -var jsonFieldsNameOfMapfixCreate = [6]string{ - 0: "DisplayName", - 1: "Creator", - 2: "GameID", - 3: "AssetID", - 4: "AssetVersion", - 5: "TargetAssetID", +var jsonFieldsNameOfMapfixTriggerCreate = [2]string{ + 0: "AssetID", + 1: "TargetAssetID", } -// Decode decodes MapfixCreate from json. -func (s *MapfixCreate) Decode(d *jx.Decoder) error { +// Decode decodes MapfixTriggerCreate from json. +func (s *MapfixTriggerCreate) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode MapfixCreate to nil") + return errors.New("invalid: unable to decode MapfixTriggerCreate to nil") } var requiredBitSet [1]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "DisplayName": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.DisplayName = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"DisplayName\"") - } - case "Creator": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Creator = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"Creator\"") - } - case "GameID": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Int32() - s.GameID = int32(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"GameID\"") - } case "AssetID": - requiredBitSet[0] |= 1 << 3 + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Int64() s.AssetID = int64(v) @@ -788,20 +732,8 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"AssetID\"") } - case "AssetVersion": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Int64() - s.AssetVersion = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"AssetVersion\"") - } case "TargetAssetID": - requiredBitSet[0] |= 1 << 5 + requiredBitSet[0] |= 1 << 1 if err := func() error { v, err := d.Int64() s.TargetAssetID = int64(v) @@ -817,12 +749,12 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error { } return nil }); err != nil { - return errors.Wrap(err, "decode MapfixCreate") + return errors.Wrap(err, "decode MapfixTriggerCreate") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00111111, + 0b00000011, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -834,8 +766,8 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfMapfixCreate) { - name = jsonFieldsNameOfMapfixCreate[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfMapfixTriggerCreate) { + name = jsonFieldsNameOfMapfixTriggerCreate[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -856,14 +788,14 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *MapfixCreate) MarshalJSON() ([]byte, error) { +func (s *MapfixTriggerCreate) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *MapfixCreate) UnmarshalJSON(data []byte) error { +func (s *MapfixTriggerCreate) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } @@ -2615,91 +2547,35 @@ func (s *Submission) UnmarshalJSON(data []byte) error { } // Encode implements json.Marshaler. -func (s *SubmissionCreate) Encode(e *jx.Encoder) { +func (s *SubmissionTriggerCreate) Encode(e *jx.Encoder) { e.ObjStart() s.encodeFields(e) e.ObjEnd() } // encodeFields encodes fields. -func (s *SubmissionCreate) encodeFields(e *jx.Encoder) { - { - e.FieldStart("DisplayName") - e.Str(s.DisplayName) - } - { - e.FieldStart("Creator") - e.Str(s.Creator) - } - { - e.FieldStart("GameID") - e.Int32(s.GameID) - } +func (s *SubmissionTriggerCreate) encodeFields(e *jx.Encoder) { { e.FieldStart("AssetID") e.Int64(s.AssetID) } - { - e.FieldStart("AssetVersion") - e.Int64(s.AssetVersion) - } } -var jsonFieldsNameOfSubmissionCreate = [5]string{ - 0: "DisplayName", - 1: "Creator", - 2: "GameID", - 3: "AssetID", - 4: "AssetVersion", +var jsonFieldsNameOfSubmissionTriggerCreate = [1]string{ + 0: "AssetID", } -// Decode decodes SubmissionCreate from json. -func (s *SubmissionCreate) Decode(d *jx.Decoder) error { +// Decode decodes SubmissionTriggerCreate from json. +func (s *SubmissionTriggerCreate) Decode(d *jx.Decoder) error { if s == nil { - return errors.New("invalid: unable to decode SubmissionCreate to nil") + return errors.New("invalid: unable to decode SubmissionTriggerCreate to nil") } var requiredBitSet [1]uint8 if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error { switch string(k) { - case "DisplayName": - requiredBitSet[0] |= 1 << 0 - if err := func() error { - v, err := d.Str() - s.DisplayName = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"DisplayName\"") - } - case "Creator": - requiredBitSet[0] |= 1 << 1 - if err := func() error { - v, err := d.Str() - s.Creator = string(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"Creator\"") - } - case "GameID": - requiredBitSet[0] |= 1 << 2 - if err := func() error { - v, err := d.Int32() - s.GameID = int32(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"GameID\"") - } case "AssetID": - requiredBitSet[0] |= 1 << 3 + requiredBitSet[0] |= 1 << 0 if err := func() error { v, err := d.Int64() s.AssetID = int64(v) @@ -2710,29 +2586,17 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error { }(); err != nil { return errors.Wrap(err, "decode field \"AssetID\"") } - case "AssetVersion": - requiredBitSet[0] |= 1 << 4 - if err := func() error { - v, err := d.Int64() - s.AssetVersion = int64(v) - if err != nil { - return err - } - return nil - }(); err != nil { - return errors.Wrap(err, "decode field \"AssetVersion\"") - } default: return d.Skip() } return nil }); err != nil { - return errors.Wrap(err, "decode SubmissionCreate") + return errors.Wrap(err, "decode SubmissionTriggerCreate") } // Validate required fields. var failures []validate.FieldError for i, mask := range [1]uint8{ - 0b00011111, + 0b00000001, } { if result := (requiredBitSet[i] & mask) ^ mask; result != 0 { // Mask only required fields and check equality to mask using XOR. @@ -2744,8 +2608,8 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error { bitIdx := bits.TrailingZeros8(result) fieldIdx := i*8 + bitIdx var name string - if fieldIdx < len(jsonFieldsNameOfSubmissionCreate) { - name = jsonFieldsNameOfSubmissionCreate[fieldIdx] + if fieldIdx < len(jsonFieldsNameOfSubmissionTriggerCreate) { + name = jsonFieldsNameOfSubmissionTriggerCreate[fieldIdx] } else { name = strconv.Itoa(fieldIdx) } @@ -2766,14 +2630,14 @@ func (s *SubmissionCreate) Decode(d *jx.Decoder) error { } // MarshalJSON implements stdjson.Marshaler. -func (s *SubmissionCreate) MarshalJSON() ([]byte, error) { +func (s *SubmissionTriggerCreate) MarshalJSON() ([]byte, error) { e := jx.Encoder{} s.Encode(&e) return e.Bytes(), nil } // UnmarshalJSON implements stdjson.Unmarshaler. -func (s *SubmissionCreate) UnmarshalJSON(data []byte) error { +func (s *SubmissionTriggerCreate) UnmarshalJSON(data []byte) error { d := jx.DecodeBytes(data) return s.Decode(d) } diff --git a/pkg/api/oas_request_decoders_gen.go b/pkg/api/oas_request_decoders_gen.go index da76dc0..1fa2247 100644 --- a/pkg/api/oas_request_decoders_gen.go +++ b/pkg/api/oas_request_decoders_gen.go @@ -16,7 +16,7 @@ import ( ) func (s *Server) decodeCreateMapfixRequest(r *http.Request) ( - req *MapfixCreate, + req *MapfixTriggerCreate, close func() error, rerr error, ) { @@ -55,7 +55,7 @@ func (s *Server) decodeCreateMapfixRequest(r *http.Request) ( d := jx.DecodeBytes(buf) - var request MapfixCreate + var request MapfixTriggerCreate if err := func() error { if err := request.Decode(d); err != nil { return err @@ -72,14 +72,6 @@ func (s *Server) decodeCreateMapfixRequest(r *http.Request) ( } return req, close, err } - if err := func() error { - if err := request.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return req, close, errors.Wrap(err, "validate") - } return &request, close, nil default: return req, close, validate.InvalidContentType(ct) @@ -221,7 +213,7 @@ func (s *Server) decodeCreateScriptPolicyRequest(r *http.Request) ( } func (s *Server) decodeCreateSubmissionRequest(r *http.Request) ( - req *SubmissionCreate, + req *SubmissionTriggerCreate, close func() error, rerr error, ) { @@ -260,7 +252,7 @@ func (s *Server) decodeCreateSubmissionRequest(r *http.Request) ( d := jx.DecodeBytes(buf) - var request SubmissionCreate + var request SubmissionTriggerCreate if err := func() error { if err := request.Decode(d); err != nil { return err @@ -277,14 +269,6 @@ func (s *Server) decodeCreateSubmissionRequest(r *http.Request) ( } return req, close, err } - if err := func() error { - if err := request.Validate(); err != nil { - return err - } - return nil - }(); err != nil { - return req, close, errors.Wrap(err, "validate") - } return &request, close, nil default: return req, close, validate.InvalidContentType(ct) diff --git a/pkg/api/oas_request_encoders_gen.go b/pkg/api/oas_request_encoders_gen.go index b8686b0..52f1046 100644 --- a/pkg/api/oas_request_encoders_gen.go +++ b/pkg/api/oas_request_encoders_gen.go @@ -12,7 +12,7 @@ import ( ) func encodeCreateMapfixRequest( - req *MapfixCreate, + req *MapfixTriggerCreate, r *http.Request, ) error { const contentType = "application/json" @@ -54,7 +54,7 @@ func encodeCreateScriptPolicyRequest( } func encodeCreateSubmissionRequest( - req *SubmissionCreate, + req *SubmissionTriggerCreate, r *http.Request, ) error { const contentType = "application/json" diff --git a/pkg/api/oas_router_gen.go b/pkg/api/oas_router_gen.go index 46e8499..414d7e4 100644 --- a/pkg/api/oas_router_gen.go +++ b/pkg/api/oas_router_gen.go @@ -1264,7 +1264,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { return r, true case "POST": r.name = CreateMapfixOperation - r.summary = "Create new mapfix" + r.summary = "Trigger the validator to create a mapfix" r.operationID = "createMapfix" r.pathPattern = "/mapfixes" r.args = args @@ -2058,7 +2058,7 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) { return r, true case "POST": r.name = CreateSubmissionOperation - r.summary = "Create new submission" + r.summary = "Trigger the validator to create a new submission" r.operationID = "createSubmission" r.pathPattern = "/submissions" r.args = args diff --git a/pkg/api/oas_schemas_gen.go b/pkg/api/oas_schemas_gen.go index e9c86a7..708dcb9 100644 --- a/pkg/api/oas_schemas_gen.go +++ b/pkg/api/oas_schemas_gen.go @@ -359,73 +359,29 @@ func (s *Mapfix) SetStatusMessage(val string) { s.StatusMessage = val } -// Ref: #/components/schemas/MapfixCreate -type MapfixCreate struct { - DisplayName string `json:"DisplayName"` - Creator string `json:"Creator"` - GameID int32 `json:"GameID"` - AssetID int64 `json:"AssetID"` - AssetVersion int64 `json:"AssetVersion"` - TargetAssetID int64 `json:"TargetAssetID"` -} - -// GetDisplayName returns the value of DisplayName. -func (s *MapfixCreate) GetDisplayName() string { - return s.DisplayName -} - -// GetCreator returns the value of Creator. -func (s *MapfixCreate) GetCreator() string { - return s.Creator -} - -// GetGameID returns the value of GameID. -func (s *MapfixCreate) GetGameID() int32 { - return s.GameID +// Ref: #/components/schemas/MapfixTriggerCreate +type MapfixTriggerCreate struct { + AssetID int64 `json:"AssetID"` + TargetAssetID int64 `json:"TargetAssetID"` } // GetAssetID returns the value of AssetID. -func (s *MapfixCreate) GetAssetID() int64 { +func (s *MapfixTriggerCreate) GetAssetID() int64 { return s.AssetID } -// GetAssetVersion returns the value of AssetVersion. -func (s *MapfixCreate) GetAssetVersion() int64 { - return s.AssetVersion -} - // GetTargetAssetID returns the value of TargetAssetID. -func (s *MapfixCreate) GetTargetAssetID() int64 { +func (s *MapfixTriggerCreate) GetTargetAssetID() int64 { return s.TargetAssetID } -// SetDisplayName sets the value of DisplayName. -func (s *MapfixCreate) SetDisplayName(val string) { - s.DisplayName = val -} - -// SetCreator sets the value of Creator. -func (s *MapfixCreate) SetCreator(val string) { - s.Creator = val -} - -// SetGameID sets the value of GameID. -func (s *MapfixCreate) SetGameID(val int32) { - s.GameID = val -} - // SetAssetID sets the value of AssetID. -func (s *MapfixCreate) SetAssetID(val int64) { +func (s *MapfixTriggerCreate) SetAssetID(val int64) { s.AssetID = val } -// SetAssetVersion sets the value of AssetVersion. -func (s *MapfixCreate) SetAssetVersion(val int64) { - s.AssetVersion = val -} - // SetTargetAssetID sets the value of TargetAssetID. -func (s *MapfixCreate) SetTargetAssetID(val int64) { +func (s *MapfixTriggerCreate) SetTargetAssetID(val int64) { s.TargetAssetID = val } @@ -1166,65 +1122,21 @@ func (s *Submission) SetStatusMessage(val string) { s.StatusMessage = val } -// Ref: #/components/schemas/SubmissionCreate -type SubmissionCreate struct { - DisplayName string `json:"DisplayName"` - Creator string `json:"Creator"` - GameID int32 `json:"GameID"` - AssetID int64 `json:"AssetID"` - AssetVersion int64 `json:"AssetVersion"` -} - -// GetDisplayName returns the value of DisplayName. -func (s *SubmissionCreate) GetDisplayName() string { - return s.DisplayName -} - -// GetCreator returns the value of Creator. -func (s *SubmissionCreate) GetCreator() string { - return s.Creator -} - -// GetGameID returns the value of GameID. -func (s *SubmissionCreate) GetGameID() int32 { - return s.GameID +// Ref: #/components/schemas/SubmissionTriggerCreate +type SubmissionTriggerCreate struct { + AssetID int64 `json:"AssetID"` } // GetAssetID returns the value of AssetID. -func (s *SubmissionCreate) GetAssetID() int64 { +func (s *SubmissionTriggerCreate) GetAssetID() int64 { return s.AssetID } -// GetAssetVersion returns the value of AssetVersion. -func (s *SubmissionCreate) GetAssetVersion() int64 { - return s.AssetVersion -} - -// SetDisplayName sets the value of DisplayName. -func (s *SubmissionCreate) SetDisplayName(val string) { - s.DisplayName = val -} - -// SetCreator sets the value of Creator. -func (s *SubmissionCreate) SetCreator(val string) { - s.Creator = val -} - -// SetGameID sets the value of GameID. -func (s *SubmissionCreate) SetGameID(val int32) { - s.GameID = val -} - // SetAssetID sets the value of AssetID. -func (s *SubmissionCreate) SetAssetID(val int64) { +func (s *SubmissionTriggerCreate) SetAssetID(val int64) { s.AssetID = val } -// SetAssetVersion sets the value of AssetVersion. -func (s *SubmissionCreate) SetAssetVersion(val int64) { - s.AssetVersion = val -} - // UpdateMapfixModelNoContent is response for UpdateMapfixModel operation. type UpdateMapfixModelNoContent struct{} diff --git a/pkg/api/oas_server_gen.go b/pkg/api/oas_server_gen.go index 9a623ad..4d89ea2 100644 --- a/pkg/api/oas_server_gen.go +++ b/pkg/api/oas_server_gen.go @@ -118,10 +118,10 @@ type Handler interface { ActionSubmissionValidated(ctx context.Context, params ActionSubmissionValidatedParams) error // CreateMapfix implements createMapfix operation. // - // Create new mapfix. + // Trigger the validator to create a mapfix. // // POST /mapfixes - CreateMapfix(ctx context.Context, req *MapfixCreate) (*ID, error) + CreateMapfix(ctx context.Context, req *MapfixTriggerCreate) (*ID, error) // CreateScript implements createScript operation. // // Create a new script. @@ -136,10 +136,10 @@ type Handler interface { CreateScriptPolicy(ctx context.Context, req *ScriptPolicyCreate) (*ID, error) // CreateSubmission implements createSubmission operation. // - // Create new submission. + // Trigger the validator to create a new submission. // // POST /submissions - CreateSubmission(ctx context.Context, req *SubmissionCreate) (*ID, error) + CreateSubmission(ctx context.Context, req *SubmissionTriggerCreate) (*ID, error) // DeleteScript implements deleteScript operation. // // Delete the specified script by ID. diff --git a/pkg/api/oas_unimplemented_gen.go b/pkg/api/oas_unimplemented_gen.go index 6e9f4f3..7e93bc6 100644 --- a/pkg/api/oas_unimplemented_gen.go +++ b/pkg/api/oas_unimplemented_gen.go @@ -177,10 +177,10 @@ func (UnimplementedHandler) ActionSubmissionValidated(ctx context.Context, param // CreateMapfix implements createMapfix operation. // -// Create new mapfix. +// Trigger the validator to create a mapfix. // // POST /mapfixes -func (UnimplementedHandler) CreateMapfix(ctx context.Context, req *MapfixCreate) (r *ID, _ error) { +func (UnimplementedHandler) CreateMapfix(ctx context.Context, req *MapfixTriggerCreate) (r *ID, _ error) { return r, ht.ErrNotImplemented } @@ -204,10 +204,10 @@ func (UnimplementedHandler) CreateScriptPolicy(ctx context.Context, req *ScriptP // CreateSubmission implements createSubmission operation. // -// Create new submission. +// Trigger the validator to create a new submission. // // POST /submissions -func (UnimplementedHandler) CreateSubmission(ctx context.Context, req *SubmissionCreate) (r *ID, _ error) { +func (UnimplementedHandler) CreateSubmission(ctx context.Context, req *SubmissionTriggerCreate) (r *ID, _ error) { return r, ht.ErrNotImplemented } diff --git a/pkg/api/oas_validators_gen.go b/pkg/api/oas_validators_gen.go index 19344a1..006fce8 100644 --- a/pkg/api/oas_validators_gen.go +++ b/pkg/api/oas_validators_gen.go @@ -127,56 +127,6 @@ func (s *Mapfix) Validate() error { return nil } -func (s *MapfixCreate) Validate() error { - if s == nil { - return validate.ErrNilPointer - } - - var failures []validate.FieldError - if err := func() error { - if err := (validate.String{ - MinLength: 0, - MinLengthSet: false, - MaxLength: 128, - MaxLengthSet: true, - Email: false, - Hostname: false, - Regex: nil, - }).Validate(string(s.DisplayName)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "DisplayName", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 0, - MinLengthSet: false, - MaxLength: 128, - MaxLengthSet: true, - Email: false, - Hostname: false, - Regex: nil, - }).Validate(string(s.Creator)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "Creator", - Error: err, - }) - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - return nil -} - func (s *Operation) Validate() error { if s == nil { return validate.ErrNilPointer @@ -510,56 +460,6 @@ func (s *Submission) Validate() error { return nil } -func (s *SubmissionCreate) Validate() error { - if s == nil { - return validate.ErrNilPointer - } - - var failures []validate.FieldError - if err := func() error { - if err := (validate.String{ - MinLength: 0, - MinLengthSet: false, - MaxLength: 128, - MaxLengthSet: true, - Email: false, - Hostname: false, - Regex: nil, - }).Validate(string(s.DisplayName)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "DisplayName", - Error: err, - }) - } - if err := func() error { - if err := (validate.String{ - MinLength: 0, - MinLengthSet: false, - MaxLength: 128, - MaxLengthSet: true, - Email: false, - Hostname: false, - Regex: nil, - }).Validate(string(s.Creator)); err != nil { - return errors.Wrap(err, "string") - } - return nil - }(); err != nil { - failures = append(failures, validate.FieldError{ - Name: "Creator", - Error: err, - }) - } - if len(failures) > 0 { - return &validate.Error{Fields: failures} - } - return nil -} - func (s *User) Validate() error { if s == nil { return validate.ErrNilPointer