blob: 210fba78630bb1836b1a551c7f4a889f1cece6d9 [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 (
9 strfmt "github.com/go-openapi/strfmt"
10
Mohamed Abukar429da192020-02-26 16:46:34 +020011 "github.com/go-openapi/errors"
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020012 "github.com/go-openapi/swag"
Mohamed Abukar429da192020-02-26 16:46:34 +020013 "github.com/go-openapi/validate"
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020014)
15
16// PolicyParams policy params
17// swagger:model PolicyParams
18type PolicyParams struct {
19
Mohamed Abukar429da192020-02-26 16:46:34 +020020 // client endpoint
21 // Required: true
22 ClientEndpoint *string `json:"ClientEndpoint"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020023
Mohamed Abukar429da192020-02-26 16:46:34 +020024 // event triggers
25 // Required: true
26 EventTriggers EventTriggerList `json:"EventTriggers"`
27
28 // meid
29 // Required: true
30 Meid *string `json:"Meid"`
31
32 // policy action definitions
33 // Required: true
34 PolicyActionDefinitions *PolicyActionDefinition `json:"PolicyActionDefinitions"`
35
36 // r a n function ID
37 // Required: true
38 RANFunctionID *int64 `json:"RANFunctionID"`
Mohamed Abukar3895a8c2020-02-10 09:48:59 +020039}
40
41// Validate validates this policy params
42func (m *PolicyParams) Validate(formats strfmt.Registry) error {
Mohamed Abukar429da192020-02-26 16:46:34 +020043 var res []error
44
45 if err := m.validateClientEndpoint(formats); err != nil {
46 res = append(res, err)
47 }
48
49 if err := m.validateEventTriggers(formats); err != nil {
50 res = append(res, err)
51 }
52
53 if err := m.validateMeid(formats); err != nil {
54 res = append(res, err)
55 }
56
57 if err := m.validatePolicyActionDefinitions(formats); err != nil {
58 res = append(res, err)
59 }
60
61 if err := m.validateRANFunctionID(formats); err != nil {
62 res = append(res, err)
63 }
64
65 if len(res) > 0 {
66 return errors.CompositeValidationError(res...)
67 }
68 return nil
69}
70
71func (m *PolicyParams) validateClientEndpoint(formats strfmt.Registry) error {
72
73 if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
74 return err
75 }
76
77 return nil
78}
79
80func (m *PolicyParams) validateEventTriggers(formats strfmt.Registry) error {
81
82 if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
83 return err
84 }
85
86 if err := m.EventTriggers.Validate(formats); err != nil {
87 if ve, ok := err.(*errors.Validation); ok {
88 return ve.ValidateName("EventTriggers")
89 }
90 return err
91 }
92
93 return nil
94}
95
96func (m *PolicyParams) validateMeid(formats strfmt.Registry) error {
97
98 if err := validate.Required("Meid", "body", m.Meid); err != nil {
99 return err
100 }
101
102 return nil
103}
104
105func (m *PolicyParams) validatePolicyActionDefinitions(formats strfmt.Registry) error {
106
107 if err := validate.Required("PolicyActionDefinitions", "body", m.PolicyActionDefinitions); err != nil {
108 return err
109 }
110
111 if m.PolicyActionDefinitions != nil {
112 if err := m.PolicyActionDefinitions.Validate(formats); err != nil {
113 if ve, ok := err.(*errors.Validation); ok {
114 return ve.ValidateName("PolicyActionDefinitions")
115 }
116 return err
117 }
118 }
119
120 return nil
121}
122
123func (m *PolicyParams) validateRANFunctionID(formats strfmt.Registry) error {
124
125 if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
126 return err
127 }
128
Mohamed Abukar3895a8c2020-02-10 09:48:59 +0200129 return nil
130}
131
132// MarshalBinary interface implementation
133func (m *PolicyParams) MarshalBinary() ([]byte, error) {
134 if m == nil {
135 return nil, nil
136 }
137 return swag.WriteJSON(m)
138}
139
140// UnmarshalBinary interface implementation
141func (m *PolicyParams) UnmarshalBinary(b []byte) error {
142 var res PolicyParams
143 if err := swag.ReadJSON(b, &res); err != nil {
144 return err
145 }
146 *m = res
147 return nil
148}