mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
35 lines
603 B
Go
35 lines
603 B
Go
package models
|
|
|
|
import (
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/validate"
|
|
|
|
"github.com/go-openapi/errors"
|
|
)
|
|
|
|
type AppsWrapper struct {
|
|
Apps []*App `json:"apps"`
|
|
}
|
|
|
|
func (m *AppsWrapper) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateApps(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *AppsWrapper) validateApps(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("apps", "body", m.Apps); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|