| // Code generated by go-swagger; DO NOT EDIT. |
| |
| package models |
| |
| // This file was generated by the swagger tool. |
| // Editing this file might prove futile when you re-run the swagger generate command |
| |
| import ( |
| "github.com/go-openapi/errors" |
| "github.com/go-openapi/strfmt" |
| "github.com/go-openapi/swag" |
| "github.com/go-openapi/validate" |
| ) |
| |
| // SubscriptionParams subscription params |
| // |
| // swagger:model SubscriptionParams |
| type SubscriptionParams struct { |
| |
| // client endpoint |
| // Required: true |
| ClientEndpoint *SubscriptionParamsClientEndpoint `json:"ClientEndpoint"` |
| |
| // e2 subscription directives |
| E2SubscriptionDirectives *SubscriptionParamsE2SubscriptionDirectives `json:"E2SubscriptionDirectives,omitempty"` |
| |
| // meid |
| // Required: true |
| Meid *string `json:"Meid"` |
| |
| // r a n function ID |
| // Required: true |
| // Maximum: 4095 |
| // Minimum: 0 |
| RANFunctionID *int64 `json:"RANFunctionID"` |
| |
| // subscription details |
| // Required: true |
| SubscriptionDetails SubscriptionDetailsList `json:"SubscriptionDetails"` |
| |
| // Optional subscription ID (Submgr allocates if not given) |
| SubscriptionID string `json:"SubscriptionId,omitempty"` |
| } |
| |
| // Validate validates this subscription params |
| func (m *SubscriptionParams) Validate(formats strfmt.Registry) error { |
| var res []error |
| |
| if err := m.validateClientEndpoint(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateE2SubscriptionDirectives(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateMeid(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateRANFunctionID(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateSubscriptionDetails(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
| |
| func (m *SubscriptionParams) validateClientEndpoint(formats strfmt.Registry) error { |
| |
| if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil { |
| return err |
| } |
| |
| if m.ClientEndpoint != nil { |
| if err := m.ClientEndpoint.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("ClientEndpoint") |
| } |
| return err |
| } |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParams) validateE2SubscriptionDirectives(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.E2SubscriptionDirectives) { // not required |
| return nil |
| } |
| |
| if m.E2SubscriptionDirectives != nil { |
| if err := m.E2SubscriptionDirectives.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("E2SubscriptionDirectives") |
| } |
| return err |
| } |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParams) validateMeid(formats strfmt.Registry) error { |
| |
| if err := validate.Required("Meid", "body", m.Meid); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParams) validateRANFunctionID(formats strfmt.Registry) error { |
| |
| if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil { |
| return err |
| } |
| |
| if err := validate.MinimumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 0, false); err != nil { |
| return err |
| } |
| |
| if err := validate.MaximumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 4095, false); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParams) validateSubscriptionDetails(formats strfmt.Registry) error { |
| |
| if err := validate.Required("SubscriptionDetails", "body", m.SubscriptionDetails); err != nil { |
| return err |
| } |
| |
| if err := m.SubscriptionDetails.Validate(formats); err != nil { |
| if ve, ok := err.(*errors.Validation); ok { |
| return ve.ValidateName("SubscriptionDetails") |
| } |
| return err |
| } |
| |
| return nil |
| } |
| |
| // MarshalBinary interface implementation |
| func (m *SubscriptionParams) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
| |
| // UnmarshalBinary interface implementation |
| func (m *SubscriptionParams) UnmarshalBinary(b []byte) error { |
| var res SubscriptionParams |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |
| |
| // SubscriptionParamsClientEndpoint xApp service address and port |
| // |
| // swagger:model SubscriptionParamsClientEndpoint |
| type SubscriptionParamsClientEndpoint struct { |
| |
| // xApp HTTP service address port |
| // Maximum: 65535 |
| // Minimum: 0 |
| HTTPPort *int64 `json:"HTTPPort,omitempty"` |
| |
| // xApp service address name like 'service-ricxapp-xappname-http.ricxapp' |
| Host string `json:"Host,omitempty"` |
| |
| // xApp RMR service address port |
| // Maximum: 65535 |
| // Minimum: 0 |
| RMRPort *int64 `json:"RMRPort,omitempty"` |
| } |
| |
| // Validate validates this subscription params client endpoint |
| func (m *SubscriptionParamsClientEndpoint) Validate(formats strfmt.Registry) error { |
| var res []error |
| |
| if err := m.validateHTTPPort(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateRMRPort(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
| |
| func (m *SubscriptionParamsClientEndpoint) validateHTTPPort(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.HTTPPort) { // not required |
| return nil |
| } |
| |
| if err := validate.MinimumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 0, false); err != nil { |
| return err |
| } |
| |
| if err := validate.MaximumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 65535, false); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParamsClientEndpoint) validateRMRPort(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.RMRPort) { // not required |
| return nil |
| } |
| |
| if err := validate.MinimumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 0, false); err != nil { |
| return err |
| } |
| |
| if err := validate.MaximumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 65535, false); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| // MarshalBinary interface implementation |
| func (m *SubscriptionParamsClientEndpoint) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
| |
| // UnmarshalBinary interface implementation |
| func (m *SubscriptionParamsClientEndpoint) UnmarshalBinary(b []byte) error { |
| var res SubscriptionParamsClientEndpoint |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |
| |
| // SubscriptionParamsE2SubscriptionDirectives Optional. If not set Submgr uses its default values |
| // |
| // swagger:model SubscriptionParamsE2SubscriptionDirectives |
| type SubscriptionParamsE2SubscriptionDirectives struct { |
| |
| // How many times E2 subscription request is retried |
| // Maximum: 10 |
| // Minimum: 0 |
| E2RetryCount *int64 `json:"E2RetryCount,omitempty"` |
| |
| // How long time response is waited from E2 node |
| // Maximum: 10 |
| // Minimum: 1 |
| E2TimeoutTimerValue int64 `json:"E2TimeoutTimerValue,omitempty"` |
| |
| // Subscription needs RMR route from E2Term to xApp |
| RMRRoutingNeeded bool `json:"RMRRoutingNeeded,omitempty"` |
| } |
| |
| // Validate validates this subscription params e2 subscription directives |
| func (m *SubscriptionParamsE2SubscriptionDirectives) Validate(formats strfmt.Registry) error { |
| var res []error |
| |
| if err := m.validateE2RetryCount(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if err := m.validateE2TimeoutTimerValue(formats); err != nil { |
| res = append(res, err) |
| } |
| |
| if len(res) > 0 { |
| return errors.CompositeValidationError(res...) |
| } |
| return nil |
| } |
| |
| func (m *SubscriptionParamsE2SubscriptionDirectives) validateE2RetryCount(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.E2RetryCount) { // not required |
| return nil |
| } |
| |
| if err := validate.MinimumInt("E2SubscriptionDirectives"+"."+"E2RetryCount", "body", int64(*m.E2RetryCount), 0, false); err != nil { |
| return err |
| } |
| |
| if err := validate.MaximumInt("E2SubscriptionDirectives"+"."+"E2RetryCount", "body", int64(*m.E2RetryCount), 10, false); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| func (m *SubscriptionParamsE2SubscriptionDirectives) validateE2TimeoutTimerValue(formats strfmt.Registry) error { |
| |
| if swag.IsZero(m.E2TimeoutTimerValue) { // not required |
| return nil |
| } |
| |
| if err := validate.MinimumInt("E2SubscriptionDirectives"+"."+"E2TimeoutTimerValue", "body", int64(m.E2TimeoutTimerValue), 1, false); err != nil { |
| return err |
| } |
| |
| if err := validate.MaximumInt("E2SubscriptionDirectives"+"."+"E2TimeoutTimerValue", "body", int64(m.E2TimeoutTimerValue), 10, false); err != nil { |
| return err |
| } |
| |
| return nil |
| } |
| |
| // MarshalBinary interface implementation |
| func (m *SubscriptionParamsE2SubscriptionDirectives) MarshalBinary() ([]byte, error) { |
| if m == nil { |
| return nil, nil |
| } |
| return swag.WriteJSON(m) |
| } |
| |
| // UnmarshalBinary interface implementation |
| func (m *SubscriptionParamsE2SubscriptionDirectives) UnmarshalBinary(b []byte) error { |
| var res SubscriptionParamsE2SubscriptionDirectives |
| if err := swag.ReadJSON(b, &res); err != nil { |
| return err |
| } |
| *m = res |
| return nil |
| } |