Mohamed Abukar | 9ea6c78 | 2021-04-07 21:18:55 +0300 | [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 ( |
Mohamed Abukar | 9ea6c78 | 2021-04-07 21:18:55 +0300 | [diff] [blame] | 9 | "github.com/go-openapi/errors" |
Mohamed Abukar | c79bd0e | 2021-05-06 11:16:03 +0000 | [diff] [blame^] | 10 | "github.com/go-openapi/strfmt" |
Mohamed Abukar | 9ea6c78 | 2021-04-07 21:18:55 +0300 | [diff] [blame] | 11 | "github.com/go-openapi/swag" |
| 12 | "github.com/go-openapi/validate" |
| 13 | ) |
| 14 | |
| 15 | // SubscriptionDetail subscription detail |
Mohamed Abukar | c79bd0e | 2021-05-06 11:16:03 +0000 | [diff] [blame^] | 16 | // |
Mohamed Abukar | 9ea6c78 | 2021-04-07 21:18:55 +0300 | [diff] [blame] | 17 | // swagger:model SubscriptionDetail |
| 18 | type SubscriptionDetail struct { |
| 19 | |
| 20 | // action to be setup list |
| 21 | // Required: true |
| 22 | ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"` |
| 23 | |
| 24 | // event triggers |
| 25 | // Required: true |
| 26 | EventTriggers *EventTriggerDefinition `json:"EventTriggers"` |
| 27 | |
| 28 | // instance Id |
| 29 | // Required: true |
| 30 | // Maximum: 65535 |
| 31 | // Minimum: 0 |
| 32 | InstanceID *int64 `json:"InstanceId"` |
| 33 | |
| 34 | // requestor Id |
| 35 | // Required: true |
| 36 | // Maximum: 65535 |
| 37 | // Minimum: 0 |
| 38 | RequestorID *int64 `json:"RequestorId"` |
| 39 | } |
| 40 | |
| 41 | // Validate validates this subscription detail |
| 42 | func (m *SubscriptionDetail) Validate(formats strfmt.Registry) error { |
| 43 | var res []error |
| 44 | |
| 45 | if err := m.validateActionToBeSetupList(formats); err != nil { |
| 46 | res = append(res, err) |
| 47 | } |
| 48 | |
| 49 | if err := m.validateEventTriggers(formats); err != nil { |
| 50 | res = append(res, err) |
| 51 | } |
| 52 | |
| 53 | if err := m.validateInstanceID(formats); err != nil { |
| 54 | res = append(res, err) |
| 55 | } |
| 56 | |
| 57 | if err := m.validateRequestorID(formats); err != nil { |
| 58 | res = append(res, err) |
| 59 | } |
| 60 | |
| 61 | if len(res) > 0 { |
| 62 | return errors.CompositeValidationError(res...) |
| 63 | } |
| 64 | return nil |
| 65 | } |
| 66 | |
| 67 | func (m *SubscriptionDetail) validateActionToBeSetupList(formats strfmt.Registry) error { |
| 68 | |
| 69 | if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil { |
| 70 | return err |
| 71 | } |
| 72 | |
| 73 | if err := m.ActionToBeSetupList.Validate(formats); err != nil { |
| 74 | if ve, ok := err.(*errors.Validation); ok { |
| 75 | return ve.ValidateName("ActionToBeSetupList") |
| 76 | } |
| 77 | return err |
| 78 | } |
| 79 | |
| 80 | return nil |
| 81 | } |
| 82 | |
| 83 | func (m *SubscriptionDetail) validateEventTriggers(formats strfmt.Registry) error { |
| 84 | |
| 85 | if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil { |
| 86 | return err |
| 87 | } |
| 88 | |
| 89 | if m.EventTriggers != nil { |
| 90 | if err := m.EventTriggers.Validate(formats); err != nil { |
| 91 | if ve, ok := err.(*errors.Validation); ok { |
| 92 | return ve.ValidateName("EventTriggers") |
| 93 | } |
| 94 | return err |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | func (m *SubscriptionDetail) validateInstanceID(formats strfmt.Registry) error { |
| 102 | |
| 103 | if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil { |
| 104 | return err |
| 105 | } |
| 106 | |
| 107 | if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil { |
| 108 | return err |
| 109 | } |
| 110 | |
| 111 | if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil { |
| 112 | return err |
| 113 | } |
| 114 | |
| 115 | return nil |
| 116 | } |
| 117 | |
| 118 | func (m *SubscriptionDetail) validateRequestorID(formats strfmt.Registry) error { |
| 119 | |
| 120 | if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil { |
| 121 | return err |
| 122 | } |
| 123 | |
| 124 | if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil { |
| 125 | return err |
| 126 | } |
| 127 | |
| 128 | if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil { |
| 129 | return err |
| 130 | } |
| 131 | |
| 132 | return nil |
| 133 | } |
| 134 | |
| 135 | // MarshalBinary interface implementation |
| 136 | func (m *SubscriptionDetail) MarshalBinary() ([]byte, error) { |
| 137 | if m == nil { |
| 138 | return nil, nil |
| 139 | } |
| 140 | return swag.WriteJSON(m) |
| 141 | } |
| 142 | |
| 143 | // UnmarshalBinary interface implementation |
| 144 | func (m *SubscriptionDetail) UnmarshalBinary(b []byte) error { |
| 145 | var res SubscriptionDetail |
| 146 | if err := swag.ReadJSON(b, &res); err != nil { |
| 147 | return err |
| 148 | } |
| 149 | *m = res |
| 150 | return nil |
| 151 | } |