github.com/kubearmor/cilium@v1.6.12/api/v1/health/models/path_status.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 strfmt "github.com/go-openapi/strfmt" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/swag" 13 ) 14 15 // PathStatus Connectivity status via different paths, for example using different 16 // policies or service redirection 17 // 18 // swagger:model PathStatus 19 type PathStatus struct { 20 21 // Connectivity status without policy applied 22 HTTP *ConnectivityStatus `json:"http,omitempty"` 23 24 // Basic ping connectivity status to node IP 25 Icmp *ConnectivityStatus `json:"icmp,omitempty"` 26 27 // IP address queried for the connectivity status 28 IP string `json:"ip,omitempty"` 29 } 30 31 // Validate validates this path status 32 func (m *PathStatus) Validate(formats strfmt.Registry) error { 33 var res []error 34 35 if err := m.validateHTTP(formats); err != nil { 36 res = append(res, err) 37 } 38 39 if err := m.validateIcmp(formats); err != nil { 40 res = append(res, err) 41 } 42 43 if len(res) > 0 { 44 return errors.CompositeValidationError(res...) 45 } 46 return nil 47 } 48 49 func (m *PathStatus) validateHTTP(formats strfmt.Registry) error { 50 51 if swag.IsZero(m.HTTP) { // not required 52 return nil 53 } 54 55 if m.HTTP != nil { 56 if err := m.HTTP.Validate(formats); err != nil { 57 if ve, ok := err.(*errors.Validation); ok { 58 return ve.ValidateName("http") 59 } 60 return err 61 } 62 } 63 64 return nil 65 } 66 67 func (m *PathStatus) validateIcmp(formats strfmt.Registry) error { 68 69 if swag.IsZero(m.Icmp) { // not required 70 return nil 71 } 72 73 if m.Icmp != nil { 74 if err := m.Icmp.Validate(formats); err != nil { 75 if ve, ok := err.(*errors.Validation); ok { 76 return ve.ValidateName("icmp") 77 } 78 return err 79 } 80 } 81 82 return nil 83 } 84 85 // MarshalBinary interface implementation 86 func (m *PathStatus) MarshalBinary() ([]byte, error) { 87 if m == nil { 88 return nil, nil 89 } 90 return swag.WriteJSON(m) 91 } 92 93 // UnmarshalBinary interface implementation 94 func (m *PathStatus) UnmarshalBinary(b []byte) error { 95 var res PathStatus 96 if err := swag.ReadJSON(b, &res); err != nil { 97 return err 98 } 99 *m = res 100 return nil 101 }