...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package models
20
21
22
23
24 import (
25 "context"
26
27 "github.com/go-openapi/errors"
28 "github.com/go-openapi/strfmt"
29 "github.com/go-openapi/swag"
30 "github.com/go-openapi/validate"
31 )
32
33
34
35
36
37
38 type Rfc3161V001Schema struct {
39
40
41
42 Tsr *Rfc3161V001SchemaTsr `json:"tsr"`
43 }
44
45
46 func (m *Rfc3161V001Schema) Validate(formats strfmt.Registry) error {
47 var res []error
48
49 if err := m.validateTsr(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 *Rfc3161V001Schema) validateTsr(formats strfmt.Registry) error {
60
61 if err := validate.Required("tsr", "body", m.Tsr); err != nil {
62 return err
63 }
64
65 if m.Tsr != nil {
66 if err := m.Tsr.Validate(formats); err != nil {
67 if ve, ok := err.(*errors.Validation); ok {
68 return ve.ValidateName("tsr")
69 } else if ce, ok := err.(*errors.CompositeError); ok {
70 return ce.ValidateName("tsr")
71 }
72 return err
73 }
74 }
75
76 return nil
77 }
78
79
80 func (m *Rfc3161V001Schema) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
81 var res []error
82
83 if err := m.contextValidateTsr(ctx, formats); err != nil {
84 res = append(res, err)
85 }
86
87 if len(res) > 0 {
88 return errors.CompositeValidationError(res...)
89 }
90 return nil
91 }
92
93 func (m *Rfc3161V001Schema) contextValidateTsr(ctx context.Context, formats strfmt.Registry) error {
94
95 if m.Tsr != nil {
96
97 if err := m.Tsr.ContextValidate(ctx, formats); err != nil {
98 if ve, ok := err.(*errors.Validation); ok {
99 return ve.ValidateName("tsr")
100 } else if ce, ok := err.(*errors.CompositeError); ok {
101 return ce.ValidateName("tsr")
102 }
103 return err
104 }
105 }
106
107 return nil
108 }
109
110
111 func (m *Rfc3161V001Schema) MarshalBinary() ([]byte, error) {
112 if m == nil {
113 return nil, nil
114 }
115 return swag.WriteJSON(m)
116 }
117
118
119 func (m *Rfc3161V001Schema) UnmarshalBinary(b []byte) error {
120 var res Rfc3161V001Schema
121 if err := swag.ReadJSON(b, &res); err != nil {
122 return err
123 }
124 *m = res
125 return nil
126 }
127
128
129
130
131 type Rfc3161V001SchemaTsr struct {
132
133
134
135
136 Content *strfmt.Base64 `json:"content"`
137 }
138
139
140 func (m *Rfc3161V001SchemaTsr) Validate(formats strfmt.Registry) error {
141 var res []error
142
143 if err := m.validateContent(formats); err != nil {
144 res = append(res, err)
145 }
146
147 if len(res) > 0 {
148 return errors.CompositeValidationError(res...)
149 }
150 return nil
151 }
152
153 func (m *Rfc3161V001SchemaTsr) validateContent(formats strfmt.Registry) error {
154
155 if err := validate.Required("tsr"+"."+"content", "body", m.Content); err != nil {
156 return err
157 }
158
159 return nil
160 }
161
162
163 func (m *Rfc3161V001SchemaTsr) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
164 return nil
165 }
166
167
168 func (m *Rfc3161V001SchemaTsr) MarshalBinary() ([]byte, error) {
169 if m == nil {
170 return nil, nil
171 }
172 return swag.WriteJSON(m)
173 }
174
175
176 func (m *Rfc3161V001SchemaTsr) UnmarshalBinary(b []byte) error {
177 var res Rfc3161V001SchemaTsr
178 if err := swag.ReadJSON(b, &res); err != nil {
179 return err
180 }
181 *m = res
182 return nil
183 }
184
View as plain text