| 66 | } |
| 67 | |
| 68 | func (m *BaseMetrics) validateMetrics(formats strfmt.Registry) error { |
| 69 | if swag.IsZero(m.Metrics) { // not required |
| 70 | return nil |
| 71 | } |
| 72 | |
| 73 | for i := 0; i < len(m.Metrics); i++ { |
| 74 | if swag.IsZero(m.Metrics[i]) { // not required |
| 75 | continue |
| 76 | } |
| 77 | |
| 78 | if m.Metrics[i] != nil { |
| 79 | if err := m.Metrics[i].Validate(formats); err != nil { |
| 80 | if ve, ok := err.(*errors.Validation); ok { |
| 81 | return ve.ValidateName("metrics" + "." + strconv.Itoa(i)) |
| 82 | } else if ce, ok := err.(*errors.CompositeError); ok { |
| 83 | return ce.ValidateName("metrics" + "." + strconv.Itoa(i)) |
| 84 | } |
| 85 | return err |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | } |
| 90 | |
| 91 | return nil |
| 92 | } |
| 93 | |
| 94 | func (m *BaseMetrics) validateOs(formats strfmt.Registry) error { |
| 95 | if swag.IsZero(m.Os) { // not required |