-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathasset_form.go
55 lines (41 loc) · 1020 Bytes
/
asset_form.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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/swag"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
/*AssetForm asset form
swagger:model assetForm
*/
type AssetForm struct {
/* fields
*/
Fields map[string]string `json:"fields,omitempty"`
/* url
*/
URL string `json:"url,omitempty"`
}
// Validate validates this asset form
func (m *AssetForm) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateFields(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *AssetForm) validateFields(formats strfmt.Registry) error {
if swag.IsZero(m.Fields) { // not required
return nil
}
if err := validate.Required("fields", "body", m.Fields); err != nil {
return err
}
return nil
}