Add interface to read metrics
[ric-plt/xapp-frame.git] / pkg / clientmodel / format2_action_definition.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         "strconv"
10
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 // Format2ActionDefinition format2 action definition
19 // swagger:model Format2ActionDefinition
20 type Format2ActionDefinition struct {
21
22         // r a n ue group parameters
23         // Required: true
24         RANUeGroupParameters []*RANUeGroupList `json:"RANUeGroupParameters"`
25 }
26
27 // Validate validates this format2 action definition
28 func (m *Format2ActionDefinition) Validate(formats strfmt.Registry) error {
29         var res []error
30
31         if err := m.validateRANUeGroupParameters(formats); err != nil {
32                 res = append(res, err)
33         }
34
35         if len(res) > 0 {
36                 return errors.CompositeValidationError(res...)
37         }
38         return nil
39 }
40
41 func (m *Format2ActionDefinition) validateRANUeGroupParameters(formats strfmt.Registry) error {
42
43         if err := validate.Required("RANUeGroupParameters", "body", m.RANUeGroupParameters); err != nil {
44                 return err
45         }
46
47         for i := 0; i < len(m.RANUeGroupParameters); i++ {
48                 if swag.IsZero(m.RANUeGroupParameters[i]) { // not required
49                         continue
50                 }
51
52                 if m.RANUeGroupParameters[i] != nil {
53                         if err := m.RANUeGroupParameters[i].Validate(formats); err != nil {
54                                 if ve, ok := err.(*errors.Validation); ok {
55                                         return ve.ValidateName("RANUeGroupParameters" + "." + strconv.Itoa(i))
56                                 }
57                                 return err
58                         }
59                 }
60
61         }
62
63         return nil
64 }
65
66 // MarshalBinary interface implementation
67 func (m *Format2ActionDefinition) MarshalBinary() ([]byte, error) {
68         if m == nil {
69                 return nil, nil
70         }
71         return swag.WriteJSON(m)
72 }
73
74 // UnmarshalBinary interface implementation
75 func (m *Format2ActionDefinition) UnmarshalBinary(b []byte) error {
76         var res Format2ActionDefinition
77         if err := swag.ReadJSON(b, &res); err != nil {
78                 return err
79         }
80         *m = res
81         return nil
82 }