Update REST API spec
[ric-plt/xapp-frame.git] / pkg / clientmodel / subscription_instance.go
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         "github.com/go-openapi/errors"
10         "github.com/go-openapi/strfmt"
11         "github.com/go-openapi/swag"
12         "github.com/go-openapi/validate"
13 )
14
15 // SubscriptionInstance subscription instance
16 //
17 // swagger:model SubscriptionInstance
18 type SubscriptionInstance struct {
19
20         // e2 event instance Id
21         // Required: true
22         // Maximum: 65535
23         // Minimum: 0
24         E2EventInstanceID *int64 `json:"E2EventInstanceId"`
25
26         // Empty string when no error.
27         // Required: true
28         ErrorCause *string `json:"ErrorCause"`
29
30         // xapp event instance Id
31         // Required: true
32         // Maximum: 65535
33         // Minimum: 0
34         XappEventInstanceID *int64 `json:"XappEventInstanceId"`
35 }
36
37 // Validate validates this subscription instance
38 func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
39         var res []error
40
41         if err := m.validateE2EventInstanceID(formats); err != nil {
42                 res = append(res, err)
43         }
44
45         if err := m.validateErrorCause(formats); err != nil {
46                 res = append(res, err)
47         }
48
49         if err := m.validateXappEventInstanceID(formats); err != nil {
50                 res = append(res, err)
51         }
52
53         if len(res) > 0 {
54                 return errors.CompositeValidationError(res...)
55         }
56         return nil
57 }
58
59 func (m *SubscriptionInstance) validateE2EventInstanceID(formats strfmt.Registry) error {
60
61         if err := validate.Required("E2EventInstanceId", "body", m.E2EventInstanceID); err != nil {
62                 return err
63         }
64
65         if err := validate.MinimumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 0, false); err != nil {
66                 return err
67         }
68
69         if err := validate.MaximumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 65535, false); err != nil {
70                 return err
71         }
72
73         return nil
74 }
75
76 func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
77
78         if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
79                 return err
80         }
81
82         return nil
83 }
84
85 func (m *SubscriptionInstance) validateXappEventInstanceID(formats strfmt.Registry) error {
86
87         if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
88                 return err
89         }
90
91         if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
92                 return err
93         }
94
95         if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
96                 return err
97         }
98
99         return nil
100 }
101
102 // MarshalBinary interface implementation
103 func (m *SubscriptionInstance) MarshalBinary() ([]byte, error) {
104         if m == nil {
105                 return nil, nil
106         }
107         return swag.WriteJSON(m)
108 }
109
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 {
114                 return err
115         }
116         *m = res
117         return nil
118 }