Mohamed Abukar | 3602bf8 | 2021-04-04 18:07:52 +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 ( |
| 9 | "encoding/json" |
| 10 | |
Mohamed Abukar | 3602bf8 | 2021-04-04 18:07:52 +0300 | [diff] [blame] | 11 | "github.com/go-openapi/errors" |
Mohamed Abukar | c79bd0e | 2021-05-06 11:16:03 +0000 | [diff] [blame^] | 12 | "github.com/go-openapi/strfmt" |
Mohamed Abukar | 3602bf8 | 2021-04-04 18:07:52 +0300 | [diff] [blame] | 13 | "github.com/go-openapi/swag" |
| 14 | "github.com/go-openapi/validate" |
| 15 | ) |
| 16 | |
| 17 | // SubsequentAction SubsequentAction is an OPTIONAL IE |
Mohamed Abukar | c79bd0e | 2021-05-06 11:16:03 +0000 | [diff] [blame^] | 18 | // |
Mohamed Abukar | 3602bf8 | 2021-04-04 18:07:52 +0300 | [diff] [blame] | 19 | // swagger:model SubsequentAction |
| 20 | type SubsequentAction struct { |
| 21 | |
| 22 | // subsequent action type |
| 23 | // Required: true |
| 24 | // Enum: [continue wait] |
| 25 | SubsequentActionType *string `json:"SubsequentActionType"` |
| 26 | |
| 27 | // time to wait |
| 28 | // Required: true |
| 29 | // Enum: [zero w1ms w2ms w5ms w10ms w20ms w30ms w40ms w50ms w100ms w200ms w500ms w1s w2s w5s w10s w20s w60s] |
| 30 | TimeToWait *string `json:"TimeToWait"` |
| 31 | } |
| 32 | |
| 33 | // Validate validates this subsequent action |
| 34 | func (m *SubsequentAction) Validate(formats strfmt.Registry) error { |
| 35 | var res []error |
| 36 | |
| 37 | if err := m.validateSubsequentActionType(formats); err != nil { |
| 38 | res = append(res, err) |
| 39 | } |
| 40 | |
| 41 | if err := m.validateTimeToWait(formats); err != nil { |
| 42 | res = append(res, err) |
| 43 | } |
| 44 | |
| 45 | if len(res) > 0 { |
| 46 | return errors.CompositeValidationError(res...) |
| 47 | } |
| 48 | return nil |
| 49 | } |
| 50 | |
| 51 | var subsequentActionTypeSubsequentActionTypePropEnum []interface{} |
| 52 | |
| 53 | func init() { |
| 54 | var res []string |
| 55 | if err := json.Unmarshal([]byte(`["continue","wait"]`), &res); err != nil { |
| 56 | panic(err) |
| 57 | } |
| 58 | for _, v := range res { |
| 59 | subsequentActionTypeSubsequentActionTypePropEnum = append(subsequentActionTypeSubsequentActionTypePropEnum, v) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | const ( |
| 64 | |
| 65 | // SubsequentActionSubsequentActionTypeContinue captures enum value "continue" |
| 66 | SubsequentActionSubsequentActionTypeContinue string = "continue" |
| 67 | |
| 68 | // SubsequentActionSubsequentActionTypeWait captures enum value "wait" |
| 69 | SubsequentActionSubsequentActionTypeWait string = "wait" |
| 70 | ) |
| 71 | |
| 72 | // prop value enum |
| 73 | func (m *SubsequentAction) validateSubsequentActionTypeEnum(path, location string, value string) error { |
| 74 | if err := validate.Enum(path, location, value, subsequentActionTypeSubsequentActionTypePropEnum); err != nil { |
| 75 | return err |
| 76 | } |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | func (m *SubsequentAction) validateSubsequentActionType(formats strfmt.Registry) error { |
| 81 | |
| 82 | if err := validate.Required("SubsequentActionType", "body", m.SubsequentActionType); err != nil { |
| 83 | return err |
| 84 | } |
| 85 | |
| 86 | // value enum |
| 87 | if err := m.validateSubsequentActionTypeEnum("SubsequentActionType", "body", *m.SubsequentActionType); err != nil { |
| 88 | return err |
| 89 | } |
| 90 | |
| 91 | return nil |
| 92 | } |
| 93 | |
| 94 | var subsequentActionTypeTimeToWaitPropEnum []interface{} |
| 95 | |
| 96 | func init() { |
| 97 | var res []string |
| 98 | if err := json.Unmarshal([]byte(`["zero","w1ms","w2ms","w5ms","w10ms","w20ms","w30ms","w40ms","w50ms","w100ms","w200ms","w500ms","w1s","w2s","w5s","w10s","w20s","w60s"]`), &res); err != nil { |
| 99 | panic(err) |
| 100 | } |
| 101 | for _, v := range res { |
| 102 | subsequentActionTypeTimeToWaitPropEnum = append(subsequentActionTypeTimeToWaitPropEnum, v) |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | const ( |
| 107 | |
| 108 | // SubsequentActionTimeToWaitZero captures enum value "zero" |
| 109 | SubsequentActionTimeToWaitZero string = "zero" |
| 110 | |
| 111 | // SubsequentActionTimeToWaitW1ms captures enum value "w1ms" |
| 112 | SubsequentActionTimeToWaitW1ms string = "w1ms" |
| 113 | |
| 114 | // SubsequentActionTimeToWaitW2ms captures enum value "w2ms" |
| 115 | SubsequentActionTimeToWaitW2ms string = "w2ms" |
| 116 | |
| 117 | // SubsequentActionTimeToWaitW5ms captures enum value "w5ms" |
| 118 | SubsequentActionTimeToWaitW5ms string = "w5ms" |
| 119 | |
| 120 | // SubsequentActionTimeToWaitW10ms captures enum value "w10ms" |
| 121 | SubsequentActionTimeToWaitW10ms string = "w10ms" |
| 122 | |
| 123 | // SubsequentActionTimeToWaitW20ms captures enum value "w20ms" |
| 124 | SubsequentActionTimeToWaitW20ms string = "w20ms" |
| 125 | |
| 126 | // SubsequentActionTimeToWaitW30ms captures enum value "w30ms" |
| 127 | SubsequentActionTimeToWaitW30ms string = "w30ms" |
| 128 | |
| 129 | // SubsequentActionTimeToWaitW40ms captures enum value "w40ms" |
| 130 | SubsequentActionTimeToWaitW40ms string = "w40ms" |
| 131 | |
| 132 | // SubsequentActionTimeToWaitW50ms captures enum value "w50ms" |
| 133 | SubsequentActionTimeToWaitW50ms string = "w50ms" |
| 134 | |
| 135 | // SubsequentActionTimeToWaitW100ms captures enum value "w100ms" |
| 136 | SubsequentActionTimeToWaitW100ms string = "w100ms" |
| 137 | |
| 138 | // SubsequentActionTimeToWaitW200ms captures enum value "w200ms" |
| 139 | SubsequentActionTimeToWaitW200ms string = "w200ms" |
| 140 | |
| 141 | // SubsequentActionTimeToWaitW500ms captures enum value "w500ms" |
| 142 | SubsequentActionTimeToWaitW500ms string = "w500ms" |
| 143 | |
| 144 | // SubsequentActionTimeToWaitW1s captures enum value "w1s" |
| 145 | SubsequentActionTimeToWaitW1s string = "w1s" |
| 146 | |
| 147 | // SubsequentActionTimeToWaitW2s captures enum value "w2s" |
| 148 | SubsequentActionTimeToWaitW2s string = "w2s" |
| 149 | |
| 150 | // SubsequentActionTimeToWaitW5s captures enum value "w5s" |
| 151 | SubsequentActionTimeToWaitW5s string = "w5s" |
| 152 | |
| 153 | // SubsequentActionTimeToWaitW10s captures enum value "w10s" |
| 154 | SubsequentActionTimeToWaitW10s string = "w10s" |
| 155 | |
| 156 | // SubsequentActionTimeToWaitW20s captures enum value "w20s" |
| 157 | SubsequentActionTimeToWaitW20s string = "w20s" |
| 158 | |
| 159 | // SubsequentActionTimeToWaitW60s captures enum value "w60s" |
| 160 | SubsequentActionTimeToWaitW60s string = "w60s" |
| 161 | ) |
| 162 | |
| 163 | // prop value enum |
| 164 | func (m *SubsequentAction) validateTimeToWaitEnum(path, location string, value string) error { |
| 165 | if err := validate.Enum(path, location, value, subsequentActionTypeTimeToWaitPropEnum); err != nil { |
| 166 | return err |
| 167 | } |
| 168 | return nil |
| 169 | } |
| 170 | |
| 171 | func (m *SubsequentAction) validateTimeToWait(formats strfmt.Registry) error { |
| 172 | |
| 173 | if err := validate.Required("TimeToWait", "body", m.TimeToWait); err != nil { |
| 174 | return err |
| 175 | } |
| 176 | |
| 177 | // value enum |
| 178 | if err := m.validateTimeToWaitEnum("TimeToWait", "body", *m.TimeToWait); err != nil { |
| 179 | return err |
| 180 | } |
| 181 | |
| 182 | return nil |
| 183 | } |
| 184 | |
| 185 | // MarshalBinary interface implementation |
| 186 | func (m *SubsequentAction) MarshalBinary() ([]byte, error) { |
| 187 | if m == nil { |
| 188 | return nil, nil |
| 189 | } |
| 190 | return swag.WriteJSON(m) |
| 191 | } |
| 192 | |
| 193 | // UnmarshalBinary interface implementation |
| 194 | func (m *SubsequentAction) UnmarshalBinary(b []byte) error { |
| 195 | var res SubsequentAction |
| 196 | if err := swag.ReadJSON(b, &res); err != nil { |
| 197 | return err |
| 198 | } |
| 199 | *m = res |
| 200 | return nil |
| 201 | } |