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 "github.com/go-openapi/errors"
10 "github.com/go-openapi/strfmt"
11 "github.com/go-openapi/swag"
12 "github.com/go-openapi/validate"
15 // SubscriptionInstance subscription instance
17 // swagger:model SubscriptionInstance
18 type SubscriptionInstance struct {
20 // e2 event instance Id
24 E2EventInstanceID *int64 `json:"E2EventInstanceId"`
26 // Empty string when no error.
28 ErrorCause *string `json:"ErrorCause"`
30 // xapp event instance Id
34 XappEventInstanceID *int64 `json:"XappEventInstanceId"`
37 // Validate validates this subscription instance
38 func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
41 if err := m.validateE2EventInstanceID(formats); err != nil {
42 res = append(res, err)
45 if err := m.validateErrorCause(formats); err != nil {
46 res = append(res, err)
49 if err := m.validateXappEventInstanceID(formats); err != nil {
50 res = append(res, err)
54 return errors.CompositeValidationError(res...)
59 func (m *SubscriptionInstance) validateE2EventInstanceID(formats strfmt.Registry) error {
61 if err := validate.Required("E2EventInstanceId", "body", m.E2EventInstanceID); err != nil {
65 if err := validate.MinimumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 0, false); err != nil {
69 if err := validate.MaximumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 65535, false); err != nil {
76 func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
78 if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
85 func (m *SubscriptionInstance) validateXappEventInstanceID(formats strfmt.Registry) error {
87 if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
91 if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
95 if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
102 // MarshalBinary interface implementation
103 func (m *SubscriptionInstance) MarshalBinary() ([]byte, error) {
107 return swag.WriteJSON(m)
110 // UnmarshalBinary interface implementation
111 func (m *SubscriptionInstance) UnmarshalBinary(b []byte) error {
112 var res SubscriptionInstance
113 if err := swag.ReadJSON(b, &res); err != nil {