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 ( |
| 9 | strfmt "github.com/go-openapi/strfmt" |
| 10 | |
| 11 | "github.com/go-openapi/errors" |
| 12 | "github.com/go-openapi/swag" |
| 13 | "github.com/go-openapi/validate" |
| 14 | ) |
| 15 | |
| 16 | // ReportParams report params |
| 17 | // swagger:model ReportParams |
| 18 | type ReportParams struct { |
| 19 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 20 | // client endpoint |
| 21 | // Required: true |
| 22 | ClientEndpoint *string `json:"ClientEndpoint"` |
| 23 | |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 24 | // event triggers |
| 25 | // Required: true |
| 26 | EventTriggers EventTriggerList `json:"EventTriggers"` |
| 27 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 28 | // meid |
| 29 | Meid string `json:"Meid,omitempty"` |
| 30 | |
| 31 | // r a n function ID |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 32 | // Required: true |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 33 | RANFunctionID *int64 `json:"RANFunctionID"` |
| 34 | |
| 35 | // report action definitions |
| 36 | ReportActionDefinitions *ReportActionDefinition `json:"ReportActionDefinitions,omitempty"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | // Validate validates this report params |
| 40 | func (m *ReportParams) Validate(formats strfmt.Registry) error { |
| 41 | var res []error |
| 42 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 43 | if err := m.validateClientEndpoint(formats); err != nil { |
| 44 | res = append(res, err) |
| 45 | } |
| 46 | |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 47 | if err := m.validateEventTriggers(formats); err != nil { |
| 48 | res = append(res, err) |
| 49 | } |
| 50 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 51 | if err := m.validateRANFunctionID(formats); err != nil { |
| 52 | res = append(res, err) |
| 53 | } |
| 54 | |
| 55 | if err := m.validateReportActionDefinitions(formats); err != nil { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 56 | res = append(res, err) |
| 57 | } |
| 58 | |
| 59 | if len(res) > 0 { |
| 60 | return errors.CompositeValidationError(res...) |
| 61 | } |
| 62 | return nil |
| 63 | } |
| 64 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 65 | func (m *ReportParams) validateClientEndpoint(formats strfmt.Registry) error { |
| 66 | |
| 67 | if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil { |
| 68 | return err |
| 69 | } |
| 70 | |
| 71 | return nil |
| 72 | } |
| 73 | |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 74 | func (m *ReportParams) validateEventTriggers(formats strfmt.Registry) error { |
| 75 | |
| 76 | if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil { |
| 77 | return err |
| 78 | } |
| 79 | |
| 80 | if err := m.EventTriggers.Validate(formats); err != nil { |
| 81 | if ve, ok := err.(*errors.Validation); ok { |
| 82 | return ve.ValidateName("EventTriggers") |
| 83 | } |
| 84 | return err |
| 85 | } |
| 86 | |
| 87 | return nil |
| 88 | } |
| 89 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 90 | func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 91 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 92 | if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil { |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 93 | return err |
| 94 | } |
| 95 | |
| 96 | return nil |
| 97 | } |
| 98 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 99 | func (m *ReportParams) validateReportActionDefinitions(formats strfmt.Registry) error { |
| 100 | |
| 101 | if swag.IsZero(m.ReportActionDefinitions) { // not required |
| 102 | return nil |
| 103 | } |
| 104 | |
| 105 | if m.ReportActionDefinitions != nil { |
| 106 | if err := m.ReportActionDefinitions.Validate(formats); err != nil { |
| 107 | if ve, ok := err.(*errors.Validation); ok { |
| 108 | return ve.ValidateName("ReportActionDefinitions") |
| 109 | } |
| 110 | return err |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | return nil |
| 115 | } |
| 116 | |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 117 | // MarshalBinary interface implementation |
| 118 | func (m *ReportParams) MarshalBinary() ([]byte, error) { |
| 119 | if m == nil { |
| 120 | return nil, nil |
| 121 | } |
| 122 | return swag.WriteJSON(m) |
| 123 | } |
| 124 | |
| 125 | // UnmarshalBinary interface implementation |
| 126 | func (m *ReportParams) UnmarshalBinary(b []byte) error { |
| 127 | var res ReportParams |
| 128 | if err := swag.ReadJSON(b, &res); err != nil { |
| 129 | return err |
| 130 | } |
| 131 | *m = res |
| 132 | return nil |
| 133 | } |