influxdb/models/sources.go

65 lines
1.1 KiB
Go

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"
)
/*Sources sources
swagger:model Sources
*/
type Sources struct {
/* sources
Required: true
*/
Sources []*Source `json:"sources"`
}
// Validate validates this sources
func (m *Sources) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateSources(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Sources) validateSources(formats strfmt.Registry) error {
if err := validate.Required("sources", "body", m.Sources); err != nil {
return err
}
for i := 0; i < len(m.Sources); i++ {
if swag.IsZero(m.Sources[i]) { // not required
continue
}
if m.Sources[i] != nil {
if err := m.Sources[i].Validate(formats); err != nil {
return err
}
}
}
return nil
}