github.com/kubearmor/cilium@v1.6.12/api/v1/models/b_p_f_map_list.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 strfmt "github.com/go-openapi/strfmt" 12 13 "github.com/go-openapi/errors" 14 "github.com/go-openapi/swag" 15 ) 16 17 // BPFMapList List of BPF Maps 18 // swagger:model BPFMapList 19 type BPFMapList struct { 20 21 // Array of open BPF map lists 22 Maps []*BPFMap `json:"maps"` 23 } 24 25 // Validate validates this b p f map list 26 func (m *BPFMapList) Validate(formats strfmt.Registry) error { 27 var res []error 28 29 if err := m.validateMaps(formats); err != nil { 30 res = append(res, err) 31 } 32 33 if len(res) > 0 { 34 return errors.CompositeValidationError(res...) 35 } 36 return nil 37 } 38 39 func (m *BPFMapList) validateMaps(formats strfmt.Registry) error { 40 41 if swag.IsZero(m.Maps) { // not required 42 return nil 43 } 44 45 for i := 0; i < len(m.Maps); i++ { 46 if swag.IsZero(m.Maps[i]) { // not required 47 continue 48 } 49 50 if m.Maps[i] != nil { 51 if err := m.Maps[i].Validate(formats); err != nil { 52 if ve, ok := err.(*errors.Validation); ok { 53 return ve.ValidateName("maps" + "." + strconv.Itoa(i)) 54 } 55 return err 56 } 57 } 58 59 } 60 61 return nil 62 } 63 64 // MarshalBinary interface implementation 65 func (m *BPFMapList) MarshalBinary() ([]byte, error) { 66 if m == nil { 67 return nil, nil 68 } 69 return swag.WriteJSON(m) 70 } 71 72 // UnmarshalBinary interface implementation 73 func (m *BPFMapList) UnmarshalBinary(b []byte) error { 74 var res BPFMapList 75 if err := swag.ReadJSON(b, &res); err != nil { 76 return err 77 } 78 *m = res 79 return nil 80 }