mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Initial work on async functions
This commit is contained in:
50
api/models/task_wrapper.go
Normal file
50
api/models/task_wrapper.go
Normal file
@@ -0,0 +1,50 @@
|
||||
package models
|
||||
|
||||
// This file was generated by the swagger tool.
|
||||
// Editing this file might prove futile when you re-run the swagger generate command
|
||||
|
||||
import (
|
||||
strfmt "github.com/go-openapi/strfmt"
|
||||
|
||||
"github.com/go-openapi/errors"
|
||||
)
|
||||
|
||||
/*TaskWrapper task wrapper
|
||||
|
||||
swagger:model TaskWrapper
|
||||
*/
|
||||
type TaskWrapper struct {
|
||||
|
||||
/* task
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Task *Task `json:"task"`
|
||||
}
|
||||
|
||||
// Validate validates this task wrapper
|
||||
func (m *TaskWrapper) Validate(formats strfmt.Registry) error {
|
||||
var res []error
|
||||
|
||||
if err := m.validateTask(formats); err != nil {
|
||||
// prop
|
||||
res = append(res, err)
|
||||
}
|
||||
|
||||
if len(res) > 0 {
|
||||
return errors.CompositeValidationError(res...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *TaskWrapper) validateTask(formats strfmt.Registry) error {
|
||||
|
||||
if m.Task != nil {
|
||||
|
||||
if err := m.Task.Validate(formats); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user