Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [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 | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 9 | "encoding/json" |
| 10 | |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 11 | strfmt "github.com/go-openapi/strfmt" |
| 12 | |
| 13 | "github.com/go-openapi/errors" |
| 14 | "github.com/go-openapi/swag" |
| 15 | "github.com/go-openapi/validate" |
| 16 | ) |
| 17 | |
| 18 | // EventTrigger event trigger |
| 19 | // swagger:model EventTrigger |
| 20 | type EventTrigger struct { |
| 21 | |
| 22 | // e n b Id |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 23 | ENBID string `json:"ENBId,omitempty"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 24 | |
| 25 | // interface direction |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 26 | InterfaceDirection int64 `json:"InterfaceDirection,omitempty"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 27 | |
| 28 | // plmn Id |
| 29 | PlmnID string `json:"PlmnId,omitempty"` |
| 30 | |
| 31 | // procedure code |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 32 | ProcedureCode int64 `json:"ProcedureCode,omitempty"` |
| 33 | |
| 34 | // trigger nature |
| 35 | // Enum: [now on change] |
| 36 | TriggerNature string `json:"TriggerNature,omitempty"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 37 | |
| 38 | // type of message |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 39 | TypeOfMessage int64 `json:"TypeOfMessage,omitempty"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | // Validate validates this event trigger |
| 43 | func (m *EventTrigger) Validate(formats strfmt.Registry) error { |
| 44 | var res []error |
| 45 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 46 | if err := m.validateTriggerNature(formats); err != nil { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 47 | res = append(res, err) |
| 48 | } |
| 49 | |
| 50 | if len(res) > 0 { |
| 51 | return errors.CompositeValidationError(res...) |
| 52 | } |
| 53 | return nil |
| 54 | } |
| 55 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 56 | var eventTriggerTypeTriggerNaturePropEnum []interface{} |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 57 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 58 | func init() { |
| 59 | var res []string |
| 60 | if err := json.Unmarshal([]byte(`["now","on change"]`), &res); err != nil { |
| 61 | panic(err) |
| 62 | } |
| 63 | for _, v := range res { |
| 64 | eventTriggerTypeTriggerNaturePropEnum = append(eventTriggerTypeTriggerNaturePropEnum, v) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | const ( |
| 69 | |
| 70 | // EventTriggerTriggerNatureNow captures enum value "now" |
| 71 | EventTriggerTriggerNatureNow string = "now" |
| 72 | |
| 73 | // EventTriggerTriggerNatureOnChange captures enum value "on change" |
| 74 | EventTriggerTriggerNatureOnChange string = "on change" |
| 75 | ) |
| 76 | |
| 77 | // prop value enum |
| 78 | func (m *EventTrigger) validateTriggerNatureEnum(path, location string, value string) error { |
| 79 | if err := validate.Enum(path, location, value, eventTriggerTypeTriggerNaturePropEnum); err != nil { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 80 | return err |
| 81 | } |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 82 | return nil |
| 83 | } |
| 84 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 85 | func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 86 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 87 | if swag.IsZero(m.TriggerNature) { // not required |
| 88 | return nil |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 89 | } |
| 90 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 91 | // value enum |
| 92 | if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 93 | return err |
| 94 | } |
| 95 | |
| 96 | return nil |
| 97 | } |
| 98 | |
| 99 | // MarshalBinary interface implementation |
| 100 | func (m *EventTrigger) MarshalBinary() ([]byte, error) { |
| 101 | if m == nil { |
| 102 | return nil, nil |
| 103 | } |
| 104 | return swag.WriteJSON(m) |
| 105 | } |
| 106 | |
| 107 | // UnmarshalBinary interface implementation |
| 108 | func (m *EventTrigger) UnmarshalBinary(b []byte) error { |
| 109 | var res EventTrigger |
| 110 | if err := swag.ReadJSON(b, &res); err != nil { |
| 111 | return err |
| 112 | } |
| 113 | *m = res |
| 114 | return nil |
| 115 | } |