github.com/kubearmor/cilium@v1.6.12/api/v1/models/policy.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/swag" 12 ) 13 14 // Policy Policy definition 15 // swagger:model Policy 16 type Policy struct { 17 18 // Policy definition as JSON. 19 Policy string `json:"policy,omitempty"` 20 21 // Revision number of the policy. Incremented each time the policy is 22 // changed in the agent's repository 23 // 24 Revision int64 `json:"revision,omitempty"` 25 } 26 27 // Validate validates this policy 28 func (m *Policy) Validate(formats strfmt.Registry) error { 29 return nil 30 } 31 32 // MarshalBinary interface implementation 33 func (m *Policy) MarshalBinary() ([]byte, error) { 34 if m == nil { 35 return nil, nil 36 } 37 return swag.WriteJSON(m) 38 } 39 40 // UnmarshalBinary interface implementation 41 func (m *Policy) UnmarshalBinary(b []byte) error { 42 var res Policy 43 if err := swag.ReadJSON(b, &res); err != nil { 44 return err 45 } 46 *m = res 47 return nil 48 }