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 err := m.ActionDefinition.Validate(formats); err != nil {
73 if ve, ok := err.(*errors.Validation); ok {
74 return ve.ValidateName("ActionDefinition")
82 func (m *ActionToBeSetup) validateActionID(formats strfmt.Registry) error {
84 if err := validate.Required("ActionID", "body", m.ActionID); err != nil {
88 if err := validate.MinimumInt("ActionID", "body", int64(*m.ActionID), 0, false); err != nil {
92 if err := validate.MaximumInt("ActionID", "body", int64(*m.ActionID), 255, false); err != nil {
99 var actionToBeSetupTypeActionTypePropEnum []interface{}
103 if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
106 for _, v := range res {
107 actionToBeSetupTypeActionTypePropEnum = append(actionToBeSetupTypeActionTypePropEnum, v)
113 // ActionToBeSetupActionTypeInsert captures enum value "insert"
114 ActionToBeSetupActionTypeInsert string = "insert"
116 // ActionToBeSetupActionTypePolicy captures enum value "policy"
117 ActionToBeSetupActionTypePolicy string = "policy"
119 // ActionToBeSetupActionTypeReport captures enum value "report"
120 ActionToBeSetupActionTypeReport string = "report"
124 func (m *ActionToBeSetup) validateActionTypeEnum(path, location string, value string) error {
125 if err := validate.Enum(path, location, value, actionToBeSetupTypeActionTypePropEnum); err != nil {
131 func (m *ActionToBeSetup) validateActionType(formats strfmt.Registry) error {
133 if err := validate.Required("ActionType", "body", m.ActionType); err != nil {
138 if err := m.validateActionTypeEnum("ActionType", "body", *m.ActionType); err != nil {
145 func (m *ActionToBeSetup) validateSubsequentAction(formats strfmt.Registry) error {
147 if swag.IsZero(m.SubsequentAction) { // not required
151 if m.SubsequentAction != nil {
152 if err := m.SubsequentAction.Validate(formats); err != nil {
153 if ve, ok := err.(*errors.Validation); ok {
154 return ve.ValidateName("SubsequentAction")
163 // MarshalBinary interface implementation
164 func (m *ActionToBeSetup) MarshalBinary() ([]byte, error) {
168 return swag.WriteJSON(m)
171 // UnmarshalBinary interface implementation
172 func (m *ActionToBeSetup) UnmarshalBinary(b []byte) error {
173 var res ActionToBeSetup
174 if err := swag.ReadJSON(b, &res); err != nil {