blob: 02955ce62f096f87014c4b46ce5b945ebdd361be [file] [log] [blame]
Mohamed Abukar3895a8c2020-02-10 09:48:59 +02001// Code generated by go-swagger; DO NOT EDIT.
2
3package 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
8import (
Mohamed Abukar429da192020-02-26 16:46:34 +02009 "encoding/json"
10
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020011 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
20type EventTrigger struct {
21
22 // e n b Id
Mohamed Abukar429da192020-02-26 16:46:34 +020023 ENBID string `json:"ENBId,omitempty"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020024
25 // interface direction
Mohamed Abukar429da192020-02-26 16:46:34 +020026 InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020027
28 // plmn Id
29 PlmnID string `json:"PlmnId,omitempty"`
30
31 // procedure code
Mohamed Abukar429da192020-02-26 16:46:34 +020032 ProcedureCode int64 `json:"ProcedureCode,omitempty"`
33
34 // trigger nature
35 // Enum: [now on change]
36 TriggerNature string `json:"TriggerNature,omitempty"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020037
38 // type of message
Mohamed Abukar429da192020-02-26 16:46:34 +020039 TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020040}
41
42// Validate validates this event trigger
43func (m *EventTrigger) Validate(formats strfmt.Registry) error {
44 var res []error
45
Mohamed Abukar429da192020-02-26 16:46:34 +020046 if err := m.validateTriggerNature(formats); err != nil {
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020047 res = append(res, err)
48 }
49
50 if len(res) > 0 {
51 return errors.CompositeValidationError(res...)
52 }
53 return nil
54}
55
Mohamed Abukar429da192020-02-26 16:46:34 +020056var eventTriggerTypeTriggerNaturePropEnum []interface{}
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020057
Mohamed Abukar429da192020-02-26 16:46:34 +020058func 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
68const (
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
78func (m *EventTrigger) validateTriggerNatureEnum(path, location string, value string) error {
79 if err := validate.Enum(path, location, value, eventTriggerTypeTriggerNaturePropEnum); err != nil {
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020080 return err
81 }
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020082 return nil
83}
84
Mohamed Abukar429da192020-02-26 16:46:34 +020085func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020086
Mohamed Abukar429da192020-02-26 16:46:34 +020087 if swag.IsZero(m.TriggerNature) { // not required
88 return nil
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020089 }
90
Mohamed Abukar429da192020-02-26 16:46:34 +020091 // value enum
92 if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020093 return err
94 }
95
96 return nil
97}
98
99// MarshalBinary interface implementation
100func (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
108func (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}