Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 1 | // Code generated by go-swagger; DO NOT EDIT. |
| 2 | |
| 3 | package clientmodel |
| 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 | // PolicyActionDefinition policy action definition |
| 16 | // swagger:model PolicyActionDefinition |
| 17 | type PolicyActionDefinition struct { |
| 18 | |
| 19 | // action definition format2 |
| 20 | ActionDefinitionFormat2 *Format2ActionDefinition `json:"ActionDefinitionFormat2,omitempty"` |
| 21 | } |
| 22 | |
| 23 | // Validate validates this policy action definition |
| 24 | func (m *PolicyActionDefinition) Validate(formats strfmt.Registry) error { |
| 25 | var res []error |
| 26 | |
| 27 | if err := m.validateActionDefinitionFormat2(formats); err != nil { |
| 28 | res = append(res, err) |
| 29 | } |
| 30 | |
| 31 | if len(res) > 0 { |
| 32 | return errors.CompositeValidationError(res...) |
| 33 | } |
| 34 | return nil |
| 35 | } |
| 36 | |
| 37 | func (m *PolicyActionDefinition) validateActionDefinitionFormat2(formats strfmt.Registry) error { |
| 38 | |
| 39 | if swag.IsZero(m.ActionDefinitionFormat2) { // not required |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | if m.ActionDefinitionFormat2 != nil { |
| 44 | if err := m.ActionDefinitionFormat2.Validate(formats); err != nil { |
| 45 | if ve, ok := err.(*errors.Validation); ok { |
| 46 | return ve.ValidateName("ActionDefinitionFormat2") |
| 47 | } |
| 48 | return err |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | return nil |
| 53 | } |
| 54 | |
| 55 | // MarshalBinary interface implementation |
| 56 | func (m *PolicyActionDefinition) MarshalBinary() ([]byte, error) { |
| 57 | if m == nil { |
| 58 | return nil, nil |
| 59 | } |
| 60 | return swag.WriteJSON(m) |
| 61 | } |
| 62 | |
| 63 | // UnmarshalBinary interface implementation |
| 64 | func (m *PolicyActionDefinition) UnmarshalBinary(b []byte) error { |
| 65 | var res PolicyActionDefinition |
| 66 | if err := swag.ReadJSON(b, &res); err != nil { |
| 67 | return err |
| 68 | } |
| 69 | *m = res |
| 70 | return nil |
| 71 | } |