bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/models/add_alerts_request.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "strconv" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/strfmt" 13 "github.com/go-openapi/swag" 14 ) 15 16 // AddAlertsRequest AddAlertsRequest 17 // 18 // swagger:model AddAlertsRequest 19 type AddAlertsRequest []*Alert 20 21 // Validate validates this add alerts request 22 func (m AddAlertsRequest) Validate(formats strfmt.Registry) error { 23 var res []error 24 25 for i := 0; i < len(m); i++ { 26 if swag.IsZero(m[i]) { // not required 27 continue 28 } 29 30 if m[i] != nil { 31 if err := m[i].Validate(formats); err != nil { 32 if ve, ok := err.(*errors.Validation); ok { 33 return ve.ValidateName(strconv.Itoa(i)) 34 } 35 return err 36 } 37 } 38 39 } 40 41 if len(res) > 0 { 42 return errors.CompositeValidationError(res...) 43 } 44 return nil 45 }