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 "github.com/go-openapi/errors"
12 "github.com/go-openapi/strfmt"
13 "github.com/go-openapi/swag"
14 "github.com/go-openapi/validate"
17 // ActionToBeSetup action to be setup
19 // swagger:model ActionToBeSetup
20 type ActionToBeSetup struct {
23 ActionDefinition *ActionDefinition `json:"ActionDefinition,omitempty"`
29 ActionID *int64 `json:"ActionID"`
33 // Enum: [insert policy report]
34 ActionType *string `json:"ActionType"`
37 SubsequentAction *SubsequentAction `json:"SubsequentAction,omitempty"`
40 // Validate validates this action to be setup
41 func (m *ActionToBeSetup) Validate(formats strfmt.Registry) error {
44 if err := m.validateActionDefinition(formats); err != nil {
45 res = append(res, err)
48 if err := m.validateActionID(formats); err != nil {
49 res = append(res, err)
52 if err := m.validateActionType(formats); err != nil {
53 res = append(res, err)
56 if err := m.validateSubsequentAction(formats); err != nil {
57 res = append(res, err)
61 return errors.CompositeValidationError(res...)
66 func (m *ActionToBeSetup) validateActionDefinition(formats strfmt.Registry) error {
68 if swag.IsZero(m.ActionDefinition) { // not required
72 if m.ActionDefinition != nil {
73 if err := m.ActionDefinition.Validate(formats); err != nil {
74 if ve, ok := err.(*errors.Validation); ok {
75 return ve.ValidateName("ActionDefinition")
84 func (m *ActionToBeSetup) validateActionID(formats strfmt.Registry) error {
86 if err := validate.Required("ActionID", "body", m.ActionID); err != nil {
90 if err := validate.MinimumInt("ActionID", "body", int64(*m.ActionID), 0, false); err != nil {
94 if err := validate.MaximumInt("ActionID", "body", int64(*m.ActionID), 255, false); err != nil {
101 var actionToBeSetupTypeActionTypePropEnum []interface{}
105 if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
108 for _, v := range res {
109 actionToBeSetupTypeActionTypePropEnum = append(actionToBeSetupTypeActionTypePropEnum, v)
115 // ActionToBeSetupActionTypeInsert captures enum value "insert"
116 ActionToBeSetupActionTypeInsert string = "insert"
118 // ActionToBeSetupActionTypePolicy captures enum value "policy"
119 ActionToBeSetupActionTypePolicy string = "policy"
121 // ActionToBeSetupActionTypeReport captures enum value "report"
122 ActionToBeSetupActionTypeReport string = "report"
126 func (m *ActionToBeSetup) validateActionTypeEnum(path, location string, value string) error {
127 if err := validate.Enum(path, location, value, actionToBeSetupTypeActionTypePropEnum); err != nil {
133 func (m *ActionToBeSetup) validateActionType(formats strfmt.Registry) error {
135 if err := validate.Required("ActionType", "body", m.ActionType); err != nil {
140 if err := m.validateActionTypeEnum("ActionType", "body", *m.ActionType); err != nil {
147 func (m *ActionToBeSetup) validateSubsequentAction(formats strfmt.Registry) error {
149 if swag.IsZero(m.SubsequentAction) { // not required
153 if m.SubsequentAction != nil {
154 if err := m.SubsequentAction.Validate(formats); err != nil {
155 if ve, ok := err.(*errors.Validation); ok {
156 return ve.ValidateName("SubsequentAction")
165 // MarshalBinary interface implementation
166 func (m *ActionToBeSetup) MarshalBinary() ([]byte, error) {
170 return swag.WriteJSON(m)
173 // UnmarshalBinary interface implementation
174 func (m *ActionToBeSetup) UnmarshalBinary(b []byte) error {
175 var res ActionToBeSetup
176 if err := swag.ReadJSON(b, &res); err != nil {