| // Code generated by go-swagger; DO NOT EDIT. |
| |
| package clientmodel |
| |
| // This file was generated by the swagger tool. |
| // Editing this file might prove futile when you re-run the swagger generate command |
| |
| import ( |
| strfmt "github.com/go-openapi/strfmt" |
| |
| "github.com/go-openapi/errors" |
| "github.com/go-openapi/swag" |
| ) |
| |
| // PolicyActionDefinition policy action definition |
| // swagger:model PolicyActionDefinition |
| type PolicyActionDefinition struct { |
| |
| // action definition format2 |
| ActionDefinitionFormat2 *Format2ActionDefinition `json:"ActionDefinitionFormat2,omitempty"` |
| } |
| |
| // Validate validates this policy action definition |
| func (m *PolicyActionDefinition) Validate(formats strfmt.Registry) error { |
| var res []error |
| |
| if err := m.validateActionDefinitionFormat2(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
| |
| func (m *PolicyActionDefinition) validateActionDefinitionFormat2(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.ActionDefinitionFormat2) { // not required |
| return nil |
| } |
| |
| if m.ActionDefinitionFormat2 != nil { |
| if err := m.ActionDefinitionFormat2.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("ActionDefinitionFormat2") |
| } |
| return err |
| } |
| } |
| |
| return nil |
| } |
| |
| // MarshalBinary interface implementation |
| func (m *PolicyActionDefinition) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
| |
| // UnmarshalBinary interface implementation |
| func (m *PolicyActionDefinition) UnmarshalBinary(b []byte) error { |
| var res PolicyActionDefinition |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |