1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
9 strfmt "github.com/go-openapi/strfmt"
11 "github.com/go-openapi/errors"
12 "github.com/go-openapi/swag"
13 "github.com/go-openapi/validate"
16 // PolicyParams policy params
17 // swagger:model PolicyParams
18 type PolicyParams struct {
22 ClientEndpoint *string `json:"ClientEndpoint"`
26 EventTriggers EventTriggerList `json:"EventTriggers"`
30 Meid *string `json:"Meid"`
32 // policy action definitions
34 PolicyActionDefinitions *PolicyActionDefinition `json:"PolicyActionDefinitions"`
38 RANFunctionID *int64 `json:"RANFunctionID"`
41 // Validate validates this policy params
42 func (m *PolicyParams) Validate(formats strfmt.Registry) error {
45 if err := m.validateClientEndpoint(formats); err != nil {
46 res = append(res, err)
49 if err := m.validateEventTriggers(formats); err != nil {
50 res = append(res, err)
53 if err := m.validateMeid(formats); err != nil {
54 res = append(res, err)
57 if err := m.validatePolicyActionDefinitions(formats); err != nil {
58 res = append(res, err)
61 if err := m.validateRANFunctionID(formats); err != nil {
62 res = append(res, err)
66 return errors.CompositeValidationError(res...)
71 func (m *PolicyParams) validateClientEndpoint(formats strfmt.Registry) error {
73 if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
80 func (m *PolicyParams) validateEventTriggers(formats strfmt.Registry) error {
82 if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
86 if err := m.EventTriggers.Validate(formats); err != nil {
87 if ve, ok := err.(*errors.Validation); ok {
88 return ve.ValidateName("EventTriggers")
96 func (m *PolicyParams) validateMeid(formats strfmt.Registry) error {
98 if err := validate.Required("Meid", "body", m.Meid); err != nil {
105 func (m *PolicyParams) validatePolicyActionDefinitions(formats strfmt.Registry) error {
107 if err := validate.Required("PolicyActionDefinitions", "body", m.PolicyActionDefinitions); err != nil {
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")
123 func (m *PolicyParams) validateRANFunctionID(formats strfmt.Registry) error {
125 if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
132 // MarshalBinary interface implementation
133 func (m *PolicyParams) MarshalBinary() ([]byte, error) {
137 return swag.WriteJSON(m)
140 // UnmarshalBinary interface implementation
141 func (m *PolicyParams) UnmarshalBinary(b []byte) error {
143 if err := swag.ReadJSON(b, &res); err != nil {