Update REST API spec
[ric-plt/xapp-frame.git] / pkg / clientmodel / subscription_detail.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 // SubscriptionDetail subscription detail
16 //
17 // swagger:model SubscriptionDetail
18 type SubscriptionDetail struct {
19
20         // action to be setup list
21         // Required: true
22         ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
23
24         // event triggers
25         // Required: true
26         EventTriggers *EventTriggerDefinition `json:"EventTriggers"`
27
28         // xapp event instance Id
29         // Required: true
30         // Maximum: 65535
31         // Minimum: 0
32         XappEventInstanceID *int64 `json:"XappEventInstanceId"`
33 }
34
35 // Validate validates this subscription detail
36 func (m *SubscriptionDetail) Validate(formats strfmt.Registry) error {
37         var res []error
38
39         if err := m.validateActionToBeSetupList(formats); err != nil {
40                 res = append(res, err)
41         }
42
43         if err := m.validateEventTriggers(formats); err != nil {
44                 res = append(res, err)
45         }
46
47         if err := m.validateXappEventInstanceID(formats); err != nil {
48                 res = append(res, err)
49         }
50
51         if len(res) > 0 {
52                 return errors.CompositeValidationError(res...)
53         }
54         return nil
55 }
56
57 func (m *SubscriptionDetail) validateActionToBeSetupList(formats strfmt.Registry) error {
58
59         if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
60                 return err
61         }
62
63         if err := m.ActionToBeSetupList.Validate(formats); err != nil {
64                 if ve, ok := err.(*errors.Validation); ok {
65                         return ve.ValidateName("ActionToBeSetupList")
66                 }
67                 return err
68         }
69
70         return nil
71 }
72
73 func (m *SubscriptionDetail) validateEventTriggers(formats strfmt.Registry) error {
74
75         if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
76                 return err
77         }
78
79         if m.EventTriggers != nil {
80                 if err := m.EventTriggers.Validate(formats); err != nil {
81                         if ve, ok := err.(*errors.Validation); ok {
82                                 return ve.ValidateName("EventTriggers")
83                         }
84                         return err
85                 }
86         }
87
88         return nil
89 }
90
91 func (m *SubscriptionDetail) validateXappEventInstanceID(formats strfmt.Registry) error {
92
93         if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
94                 return err
95         }
96
97         if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
98                 return err
99         }
100
101         if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
102                 return err
103         }
104
105         return nil
106 }
107
108 // MarshalBinary interface implementation
109 func (m *SubscriptionDetail) MarshalBinary() ([]byte, error) {
110         if m == nil {
111                 return nil, nil
112         }
113         return swag.WriteJSON(m)
114 }
115
116 // UnmarshalBinary interface implementation
117 func (m *SubscriptionDetail) UnmarshalBinary(b []byte) error {
118         var res SubscriptionDetail
119         if err := swag.ReadJSON(b, &res); err != nil {
120                 return err
121         }
122         *m = res
123         return nil
124 }