/
model_inbound_id_method_by_by_union_inner_inner.go
298 lines (249 loc) · 10 KB
/
model_inbound_id_method_by_by_union_inner_inner.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
/*
Landscape omnikeeper REST API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package okclient
import (
"encoding/json"
"fmt"
)
// InboundIDMethodByByUnionInnerInner - struct for InboundIDMethodByByUnionInnerInner
type InboundIDMethodByByUnionInnerInner struct {
InboundIDMethodByAttribute *InboundIDMethodByAttribute
InboundIDMethodByAttributeModifiers *InboundIDMethodByAttributeModifiers
InboundIDMethodByByUnion *InboundIDMethodByByUnion
InboundIDMethodByData *InboundIDMethodByData
InboundIDMethodByIntersect *InboundIDMethodByIntersect
InboundIDMethodByRelatedTempID *InboundIDMethodByRelatedTempID
InboundIDMethodByTemporaryCIID *InboundIDMethodByTemporaryCIID
}
// InboundIDMethodByAttributeAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByAttribute wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByAttributeAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByAttribute) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByAttribute: v,
}
}
// InboundIDMethodByAttributeModifiersAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByAttributeModifiers wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByAttributeModifiersAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByAttributeModifiers) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByAttributeModifiers: v,
}
}
// InboundIDMethodByByUnionAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByByUnion wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByByUnionAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByByUnion) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByByUnion: v,
}
}
// InboundIDMethodByDataAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByData wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByDataAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByData) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByData: v,
}
}
// InboundIDMethodByIntersectAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByIntersect wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByIntersectAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByIntersect) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByIntersect: v,
}
}
// InboundIDMethodByRelatedTempIDAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByRelatedTempID wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByRelatedTempIDAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByRelatedTempID) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByRelatedTempID: v,
}
}
// InboundIDMethodByTemporaryCIIDAsInboundIDMethodByByUnionInnerInner is a convenience function that returns InboundIDMethodByTemporaryCIID wrapped in InboundIDMethodByByUnionInnerInner
func InboundIDMethodByTemporaryCIIDAsInboundIDMethodByByUnionInnerInner(v *InboundIDMethodByTemporaryCIID) InboundIDMethodByByUnionInnerInner {
return InboundIDMethodByByUnionInnerInner{
InboundIDMethodByTemporaryCIID: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *InboundIDMethodByByUnionInnerInner) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into InboundIDMethodByAttribute
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByAttribute)
if err == nil {
jsonInboundIDMethodByAttribute, _ := json.Marshal(dst.InboundIDMethodByAttribute)
if string(jsonInboundIDMethodByAttribute) == "{}" { // empty struct
dst.InboundIDMethodByAttribute = nil
} else {
match++
}
} else {
dst.InboundIDMethodByAttribute = nil
}
// try to unmarshal data into InboundIDMethodByAttributeModifiers
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByAttributeModifiers)
if err == nil {
jsonInboundIDMethodByAttributeModifiers, _ := json.Marshal(dst.InboundIDMethodByAttributeModifiers)
if string(jsonInboundIDMethodByAttributeModifiers) == "{}" { // empty struct
dst.InboundIDMethodByAttributeModifiers = nil
} else {
match++
}
} else {
dst.InboundIDMethodByAttributeModifiers = nil
}
// try to unmarshal data into InboundIDMethodByByUnion
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByByUnion)
if err == nil {
jsonInboundIDMethodByByUnion, _ := json.Marshal(dst.InboundIDMethodByByUnion)
if string(jsonInboundIDMethodByByUnion) == "{}" { // empty struct
dst.InboundIDMethodByByUnion = nil
} else {
match++
}
} else {
dst.InboundIDMethodByByUnion = nil
}
// try to unmarshal data into InboundIDMethodByData
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByData)
if err == nil {
jsonInboundIDMethodByData, _ := json.Marshal(dst.InboundIDMethodByData)
if string(jsonInboundIDMethodByData) == "{}" { // empty struct
dst.InboundIDMethodByData = nil
} else {
match++
}
} else {
dst.InboundIDMethodByData = nil
}
// try to unmarshal data into InboundIDMethodByIntersect
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByIntersect)
if err == nil {
jsonInboundIDMethodByIntersect, _ := json.Marshal(dst.InboundIDMethodByIntersect)
if string(jsonInboundIDMethodByIntersect) == "{}" { // empty struct
dst.InboundIDMethodByIntersect = nil
} else {
match++
}
} else {
dst.InboundIDMethodByIntersect = nil
}
// try to unmarshal data into InboundIDMethodByRelatedTempID
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByRelatedTempID)
if err == nil {
jsonInboundIDMethodByRelatedTempID, _ := json.Marshal(dst.InboundIDMethodByRelatedTempID)
if string(jsonInboundIDMethodByRelatedTempID) == "{}" { // empty struct
dst.InboundIDMethodByRelatedTempID = nil
} else {
match++
}
} else {
dst.InboundIDMethodByRelatedTempID = nil
}
// try to unmarshal data into InboundIDMethodByTemporaryCIID
err = newStrictDecoder(data).Decode(&dst.InboundIDMethodByTemporaryCIID)
if err == nil {
jsonInboundIDMethodByTemporaryCIID, _ := json.Marshal(dst.InboundIDMethodByTemporaryCIID)
if string(jsonInboundIDMethodByTemporaryCIID) == "{}" { // empty struct
dst.InboundIDMethodByTemporaryCIID = nil
} else {
match++
}
} else {
dst.InboundIDMethodByTemporaryCIID = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.InboundIDMethodByAttribute = nil
dst.InboundIDMethodByAttributeModifiers = nil
dst.InboundIDMethodByByUnion = nil
dst.InboundIDMethodByData = nil
dst.InboundIDMethodByIntersect = nil
dst.InboundIDMethodByRelatedTempID = nil
dst.InboundIDMethodByTemporaryCIID = nil
return fmt.Errorf("Data matches more than one schema in oneOf(InboundIDMethodByByUnionInnerInner)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("Data failed to match schemas in oneOf(InboundIDMethodByByUnionInnerInner)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src InboundIDMethodByByUnionInnerInner) MarshalJSON() ([]byte, error) {
if src.InboundIDMethodByAttribute != nil {
return json.Marshal(&src.InboundIDMethodByAttribute)
}
if src.InboundIDMethodByAttributeModifiers != nil {
return json.Marshal(&src.InboundIDMethodByAttributeModifiers)
}
if src.InboundIDMethodByByUnion != nil {
return json.Marshal(&src.InboundIDMethodByByUnion)
}
if src.InboundIDMethodByData != nil {
return json.Marshal(&src.InboundIDMethodByData)
}
if src.InboundIDMethodByIntersect != nil {
return json.Marshal(&src.InboundIDMethodByIntersect)
}
if src.InboundIDMethodByRelatedTempID != nil {
return json.Marshal(&src.InboundIDMethodByRelatedTempID)
}
if src.InboundIDMethodByTemporaryCIID != nil {
return json.Marshal(&src.InboundIDMethodByTemporaryCIID)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *InboundIDMethodByByUnionInnerInner) GetActualInstance() (interface{}) {
if obj == nil {
return nil
}
if obj.InboundIDMethodByAttribute != nil {
return obj.InboundIDMethodByAttribute
}
if obj.InboundIDMethodByAttributeModifiers != nil {
return obj.InboundIDMethodByAttributeModifiers
}
if obj.InboundIDMethodByByUnion != nil {
return obj.InboundIDMethodByByUnion
}
if obj.InboundIDMethodByData != nil {
return obj.InboundIDMethodByData
}
if obj.InboundIDMethodByIntersect != nil {
return obj.InboundIDMethodByIntersect
}
if obj.InboundIDMethodByRelatedTempID != nil {
return obj.InboundIDMethodByRelatedTempID
}
if obj.InboundIDMethodByTemporaryCIID != nil {
return obj.InboundIDMethodByTemporaryCIID
}
// all schemas are nil
return nil
}
type NullableInboundIDMethodByByUnionInnerInner struct {
value *InboundIDMethodByByUnionInnerInner
isSet bool
}
func (v NullableInboundIDMethodByByUnionInnerInner) Get() *InboundIDMethodByByUnionInnerInner {
return v.value
}
func (v *NullableInboundIDMethodByByUnionInnerInner) Set(val *InboundIDMethodByByUnionInnerInner) {
v.value = val
v.isSet = true
}
func (v NullableInboundIDMethodByByUnionInnerInner) IsSet() bool {
return v.isSet
}
func (v *NullableInboundIDMethodByByUnionInnerInner) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableInboundIDMethodByByUnionInnerInner(val *InboundIDMethodByByUnionInnerInner) *NullableInboundIDMethodByByUnionInnerInner {
return &NullableInboundIDMethodByByUnionInnerInner{value: val, isSet: true}
}
func (v NullableInboundIDMethodByByUnionInnerInner) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableInboundIDMethodByByUnionInnerInner) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}