github.com/kubearmor/cilium@v1.6.12/api/v1/models/ip_a_m_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 // IPAMStatus Status of IP address management 16 // swagger:model IPAMStatus 17 // +k8s:deepcopy-gen=true 18 type IPAMStatus struct { 19 20 // allocations 21 Allocations AllocationMap `json:"allocations,omitempty"` 22 23 // ipv4 24 IPV4 []string `json:"ipv4"` 25 26 // ipv6 27 IPV6 []string `json:"ipv6"` 28 29 // status 30 Status string `json:"status,omitempty"` 31 } 32 33 // Validate validates this IP a m status 34 func (m *IPAMStatus) Validate(formats strfmt.Registry) error { 35 var res []error 36 37 if err := m.validateAllocations(formats); err != nil { 38 res = append(res, err) 39 } 40 41 if len(res) > 0 { 42 return errors.CompositeValidationError(res...) 43 } 44 return nil 45 } 46 47 func (m *IPAMStatus) validateAllocations(formats strfmt.Registry) error { 48 49 if swag.IsZero(m.Allocations) { // not required 50 return nil 51 } 52 53 if err := m.Allocations.Validate(formats); err != nil { 54 if ve, ok := err.(*errors.Validation); ok { 55 return ve.ValidateName("allocations") 56 } 57 return err 58 } 59 60 return nil 61 } 62 63 // MarshalBinary interface implementation 64 func (m *IPAMStatus) MarshalBinary() ([]byte, error) { 65 if m == nil { 66 return nil, nil 67 } 68 return swag.WriteJSON(m) 69 } 70 71 // UnmarshalBinary interface implementation 72 func (m *IPAMStatus) UnmarshalBinary(b []byte) error { 73 var res IPAMStatus 74 if err := swag.ReadJSON(b, &res); err != nil { 75 return err 76 } 77 *m = res 78 return nil 79 }