github.com/kubearmor/cilium@v1.6.12/api/v1/models/daemon_configuration.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 // DaemonConfiguration Response to a daemon configuration request. 16 // 17 // swagger:model DaemonConfiguration 18 type DaemonConfiguration struct { 19 20 // Changeable configuration 21 Spec *DaemonConfigurationSpec `json:"spec,omitempty"` 22 23 // Current daemon configuration related status.Contains the addressing 24 // information, k8s, node monitor and immutable and mutable 25 // configuration settings. 26 // 27 Status *DaemonConfigurationStatus `json:"status,omitempty"` 28 } 29 30 // Validate validates this daemon configuration 31 func (m *DaemonConfiguration) Validate(formats strfmt.Registry) error { 32 var res []error 33 34 if err := m.validateSpec(formats); err != nil { 35 res = append(res, err) 36 } 37 38 if err := m.validateStatus(formats); err != nil { 39 res = append(res, err) 40 } 41 42 if len(res) > 0 { 43 return errors.CompositeValidationError(res...) 44 } 45 return nil 46 } 47 48 func (m *DaemonConfiguration) validateSpec(formats strfmt.Registry) error { 49 50 if swag.IsZero(m.Spec) { // not required 51 return nil 52 } 53 54 if m.Spec != nil { 55 if err := m.Spec.Validate(formats); err != nil { 56 if ve, ok := err.(*errors.Validation); ok { 57 return ve.ValidateName("spec") 58 } 59 return err 60 } 61 } 62 63 return nil 64 } 65 66 func (m *DaemonConfiguration) validateStatus(formats strfmt.Registry) error { 67 68 if swag.IsZero(m.Status) { // not required 69 return nil 70 } 71 72 if m.Status != nil { 73 if err := m.Status.Validate(formats); err != nil { 74 if ve, ok := err.(*errors.Validation); ok { 75 return ve.ValidateName("status") 76 } 77 return err 78 } 79 } 80 81 return nil 82 } 83 84 // MarshalBinary interface implementation 85 func (m *DaemonConfiguration) MarshalBinary() ([]byte, error) { 86 if m == nil { 87 return nil, nil 88 } 89 return swag.WriteJSON(m) 90 } 91 92 // UnmarshalBinary interface implementation 93 func (m *DaemonConfiguration) UnmarshalBinary(b []byte) error { 94 var res DaemonConfiguration 95 if err := swag.ReadJSON(b, &res); err != nil { 96 return err 97 } 98 *m = res 99 return nil 100 }