7853a3b3374d3c7f5b64167433ef6c77c20b0569
[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         strfmt "github.com/go-openapi/strfmt"
10
11         "github.com/go-openapi/errors"
12         "github.com/go-openapi/swag"
13         "github.com/go-openapi/validate"
14 )
15
16 // SubscriptionInstance subscription instance
17 // swagger:model SubscriptionInstance
18 type SubscriptionInstance struct {
19
20         // Empty string when no error.
21         // Required: true
22         ErrorCause *string `json:"ErrorCause"`
23
24         // instance Id
25         // Required: true
26         // Maximum: 65535
27         // Minimum: 0
28         InstanceID *int64 `json:"InstanceId"`
29
30         // requestor Id
31         // Required: true
32         // Maximum: 65535
33         // Minimum: 0
34         RequestorID *int64 `json:"RequestorId"`
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.validateErrorCause(formats); err != nil {
42                 res = append(res, err)
43         }
44
45         if err := m.validateInstanceID(formats); err != nil {
46                 res = append(res, err)
47         }
48
49         if err := m.validateRequestorID(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) validateErrorCause(formats strfmt.Registry) error {
60
61         if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
62                 return err
63         }
64
65         return nil
66 }
67
68 func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
69
70         if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
71                 return err
72         }
73
74         if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
75                 return err
76         }
77
78         if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
79                 return err
80         }
81
82         return nil
83 }
84
85 func (m *SubscriptionInstance) validateRequestorID(formats strfmt.Registry) error {
86
87         if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
88                 return err
89         }
90
91         if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
92                 return err
93         }
94
95         if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 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 }