1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
11 strfmt "github.com/go-openapi/strfmt"
13 "github.com/go-openapi/errors"
14 "github.com/go-openapi/swag"
15 "github.com/go-openapi/validate"
18 // Format1ActionDefinition format1 action definition
19 // swagger:model Format1ActionDefinition
20 type Format1ActionDefinition struct {
24 ActionParameters []*ActionParameters `json:"ActionParameters"`
28 StyleID *int64 `json:"StyleID"`
31 // Validate validates this format1 action definition
32 func (m *Format1ActionDefinition) Validate(formats strfmt.Registry) error {
35 if err := m.validateActionParameters(formats); err != nil {
36 res = append(res, err)
39 if err := m.validateStyleID(formats); err != nil {
40 res = append(res, err)
44 return errors.CompositeValidationError(res...)
49 func (m *Format1ActionDefinition) validateActionParameters(formats strfmt.Registry) error {
51 if err := validate.Required("ActionParameters", "body", m.ActionParameters); err != nil {
55 for i := 0; i < len(m.ActionParameters); i++ {
56 if swag.IsZero(m.ActionParameters[i]) { // not required
60 if m.ActionParameters[i] != nil {
61 if err := m.ActionParameters[i].Validate(formats); err != nil {
62 if ve, ok := err.(*errors.Validation); ok {
63 return ve.ValidateName("ActionParameters" + "." + strconv.Itoa(i))
74 func (m *Format1ActionDefinition) validateStyleID(formats strfmt.Registry) error {
76 if err := validate.Required("StyleID", "body", m.StyleID); err != nil {
83 // MarshalBinary interface implementation
84 func (m *Format1ActionDefinition) MarshalBinary() ([]byte, error) {
88 return swag.WriteJSON(m)
91 // UnmarshalBinary interface implementation
92 func (m *Format1ActionDefinition) UnmarshalBinary(b []byte) error {
93 var res Format1ActionDefinition
94 if err := swag.ReadJSON(b, &res); err != nil {