| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
|
|
| package models |
|
|
| |
| |
|
|
| import ( |
| "context" |
|
|
| "github.com/go-openapi/errors" |
| "github.com/go-openapi/strfmt" |
| "github.com/go-openapi/swag" |
| "github.com/go-openapi/validate" |
| ) |
|
|
| |
| |
| |
| type DistributedTask struct { |
|
|
| |
| Error string `json:"error,omitempty"` |
|
|
| |
| |
| FinishedAt strfmt.DateTime `json:"finishedAt,omitempty"` |
|
|
| |
| FinishedNodes []string `json:"finishedNodes"` |
|
|
| |
| ID string `json:"id,omitempty"` |
|
|
| |
| Payload interface{} `json:"payload,omitempty"` |
|
|
| |
| |
| StartedAt strfmt.DateTime `json:"startedAt,omitempty"` |
|
|
| |
| Status string `json:"status,omitempty"` |
|
|
| |
| Version int64 `json:"version,omitempty"` |
| } |
|
|
| |
| func (m *DistributedTask) Validate(formats strfmt.Registry) error { |
| var res []error |
|
|
| if err := m.validateFinishedAt(formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if err := m.validateStartedAt(formats); err != nil { |
| res = append(res, err) |
| } |
|
|
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
|
|
| func (m *DistributedTask) validateFinishedAt(formats strfmt.Registry) error { |
| if swag.IsZero(m.FinishedAt) { |
| return nil |
| } |
|
|
| if err := validate.FormatOf("finishedAt", "body", "date-time", m.FinishedAt.String(), formats); err != nil { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| func (m *DistributedTask) validateStartedAt(formats strfmt.Registry) error { |
| if swag.IsZero(m.StartedAt) { |
| return nil |
| } |
|
|
| if err := validate.FormatOf("startedAt", "body", "date-time", m.StartedAt.String(), formats); err != nil { |
| return err |
| } |
|
|
| return nil |
| } |
|
|
| |
| func (m *DistributedTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error { |
| return nil |
| } |
|
|
| |
| func (m *DistributedTask) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
|
|
| |
| func (m *DistributedTask) UnmarshalBinary(b []byte) error { |
| var res DistributedTask |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |
|
|