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 // SubscriptionParams subscription params
17 // swagger:model SubscriptionParams
18 type SubscriptionParams struct {
22 ClientEndpoint *SubscriptionParamsClientEndpoint `json:"ClientEndpoint"`
28 InstanceID *int64 `json:"InstanceId"`
32 Meid *string `json:"Meid"`
38 RANFunctionID *int64 `json:"RANFunctionID"`
44 RequestorID *int64 `json:"RequestorId"`
46 // subscription details
48 SubscriptionDetails SubscriptionDetailsList `json:"SubscriptionDetails"`
51 // Validate validates this subscription params
52 func (m *SubscriptionParams) Validate(formats strfmt.Registry) error {
55 if err := m.validateClientEndpoint(formats); err != nil {
56 res = append(res, err)
59 if err := m.validateInstanceID(formats); err != nil {
60 res = append(res, err)
63 if err := m.validateMeid(formats); err != nil {
64 res = append(res, err)
67 if err := m.validateRANFunctionID(formats); err != nil {
68 res = append(res, err)
71 if err := m.validateRequestorID(formats); err != nil {
72 res = append(res, err)
75 if err := m.validateSubscriptionDetails(formats); err != nil {
76 res = append(res, err)
80 return errors.CompositeValidationError(res...)
85 func (m *SubscriptionParams) validateClientEndpoint(formats strfmt.Registry) error {
87 if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
91 if m.ClientEndpoint != nil {
92 if err := m.ClientEndpoint.Validate(formats); err != nil {
93 if ve, ok := err.(*errors.Validation); ok {
94 return ve.ValidateName("ClientEndpoint")
103 func (m *SubscriptionParams) validateInstanceID(formats strfmt.Registry) error {
105 if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
109 if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
113 if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
120 func (m *SubscriptionParams) validateMeid(formats strfmt.Registry) error {
122 if err := validate.Required("Meid", "body", m.Meid); err != nil {
129 func (m *SubscriptionParams) validateRANFunctionID(formats strfmt.Registry) error {
131 if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
135 if err := validate.MinimumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 0, false); err != nil {
139 if err := validate.MaximumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 4095, false); err != nil {
146 func (m *SubscriptionParams) validateRequestorID(formats strfmt.Registry) error {
148 if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
152 if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
156 if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil {
163 func (m *SubscriptionParams) validateSubscriptionDetails(formats strfmt.Registry) error {
165 if err := validate.Required("SubscriptionDetails", "body", m.SubscriptionDetails); err != nil {
169 if err := m.SubscriptionDetails.Validate(formats); err != nil {
170 if ve, ok := err.(*errors.Validation); ok {
171 return ve.ValidateName("SubscriptionDetails")
179 // MarshalBinary interface implementation
180 func (m *SubscriptionParams) MarshalBinary() ([]byte, error) {
184 return swag.WriteJSON(m)
187 // UnmarshalBinary interface implementation
188 func (m *SubscriptionParams) UnmarshalBinary(b []byte) error {
189 var res SubscriptionParams
190 if err := swag.ReadJSON(b, &res); err != nil {
197 // SubscriptionParamsClientEndpoint xApp service address and port
198 // swagger:model SubscriptionParamsClientEndpoint
199 type SubscriptionParamsClientEndpoint struct {
201 // xApp service address port
204 Port *int64 `json:"Port,omitempty"`
206 // xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
207 ServiceName string `json:"ServiceName,omitempty"`
210 // Validate validates this subscription params client endpoint
211 func (m *SubscriptionParamsClientEndpoint) Validate(formats strfmt.Registry) error {
214 if err := m.validatePort(formats); err != nil {
215 res = append(res, err)
219 return errors.CompositeValidationError(res...)
224 func (m *SubscriptionParamsClientEndpoint) validatePort(formats strfmt.Registry) error {
226 if swag.IsZero(m.Port) { // not required
230 if err := validate.MinimumInt("ClientEndpoint"+"."+"Port", "body", int64(*m.Port), 0, false); err != nil {
234 if err := validate.MaximumInt("ClientEndpoint"+"."+"Port", "body", int64(*m.Port), 65535, false); err != nil {
241 // MarshalBinary interface implementation
242 func (m *SubscriptionParamsClientEndpoint) MarshalBinary() ([]byte, error) {
246 return swag.WriteJSON(m)
249 // UnmarshalBinary interface implementation
250 func (m *SubscriptionParamsClientEndpoint) UnmarshalBinary(b []byte) error {
251 var res SubscriptionParamsClientEndpoint
252 if err := swag.ReadJSON(b, &res); err != nil {