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 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 11 | "github.com/go-openapi/errors" |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 12 | "github.com/go-openapi/swag" |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 13 | "github.com/go-openapi/validate" |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 14 | ) |
| 15 | |
| 16 | // PolicyParams policy params |
| 17 | // swagger:model PolicyParams |
| 18 | type PolicyParams 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"` |
Mohamed Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 23 | |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 24 | // 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 Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | // Validate validates this policy params |
| 42 | func (m *PolicyParams) Validate(formats strfmt.Registry) error { |
Mohamed Abukar | 429da19 | 2020-02-26 16:46:34 +0200 | [diff] [blame] | 43 | 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 | |
| 71 | func (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 | |
| 80 | func (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 | |
| 96 | func (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 | |
| 105 | func (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 | |
| 123 | func (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 Abukar | 3895a8c | 2020-02-10 09:48:59 +0200 | [diff] [blame] | 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // MarshalBinary interface implementation |
| 133 | func (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 |
| 141 | func (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 | } |