New API version with additional structures and params
[ric-plt/xapp-frame.git] / pkg / clientmodel / report_params.go
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
20         // client endpoint
21         // Required: true
22         ClientEndpoint *string `json:"ClientEndpoint"`
23
24         // event triggers
25         // Required: true
26         EventTriggers EventTriggerList `json:"EventTriggers"`
27
28         // meid
29         Meid string `json:"Meid,omitempty"`
30
31         // r a n function ID
32         // Required: true
33         RANFunctionID *int64 `json:"RANFunctionID"`
34
35         // report action definitions
36         ReportActionDefinitions *ReportActionDefinition `json:"ReportActionDefinitions,omitempty"`
37 }
38
39 // Validate validates this report params
40 func (m *ReportParams) Validate(formats strfmt.Registry) error {
41         var res []error
42
43         if err := m.validateClientEndpoint(formats); err != nil {
44                 res = append(res, err)
45         }
46
47         if err := m.validateEventTriggers(formats); err != nil {
48                 res = append(res, err)
49         }
50
51         if err := m.validateRANFunctionID(formats); err != nil {
52                 res = append(res, err)
53         }
54
55         if err := m.validateReportActionDefinitions(formats); err != nil {
56                 res = append(res, err)
57         }
58
59         if len(res) > 0 {
60                 return errors.CompositeValidationError(res...)
61         }
62         return nil
63 }
64
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
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
90 func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
91
92         if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
93                 return err
94         }
95
96         return nil
97 }
98
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
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 }