-
Notifications
You must be signed in to change notification settings - Fork 3
/
model_report_details_arguments.go
268 lines (223 loc) · 8.99 KB
/
model_report_details_arguments.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
/*
Identity Security Cloud V3 API
Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. We encourage you to join the SailPoint Developer Community forum at https://developer.sailpoint.com/discuss to connect with other developers using our APIs.
API version: 3.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api_v3
import (
"encoding/json"
"fmt"
)
// ReportDetailsArguments - The string-object map(dictionary) with the arguments needed for report processing.
type ReportDetailsArguments struct {
AccountsExportReportArguments *AccountsExportReportArguments
IdentitiesDetailsReportArguments *IdentitiesDetailsReportArguments
IdentitiesReportArguments *IdentitiesReportArguments
IdentityProfileIdentityErrorReportArguments *IdentityProfileIdentityErrorReportArguments
OrphanUncorrelatedReportArguments *OrphanUncorrelatedReportArguments
SearchExportReportArguments *SearchExportReportArguments
}
// AccountsExportReportArgumentsAsReportDetailsArguments is a convenience function that returns AccountsExportReportArguments wrapped in ReportDetailsArguments
func AccountsExportReportArgumentsAsReportDetailsArguments(v *AccountsExportReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
AccountsExportReportArguments: v,
}
}
// IdentitiesDetailsReportArgumentsAsReportDetailsArguments is a convenience function that returns IdentitiesDetailsReportArguments wrapped in ReportDetailsArguments
func IdentitiesDetailsReportArgumentsAsReportDetailsArguments(v *IdentitiesDetailsReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
IdentitiesDetailsReportArguments: v,
}
}
// IdentitiesReportArgumentsAsReportDetailsArguments is a convenience function that returns IdentitiesReportArguments wrapped in ReportDetailsArguments
func IdentitiesReportArgumentsAsReportDetailsArguments(v *IdentitiesReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
IdentitiesReportArguments: v,
}
}
// IdentityProfileIdentityErrorReportArgumentsAsReportDetailsArguments is a convenience function that returns IdentityProfileIdentityErrorReportArguments wrapped in ReportDetailsArguments
func IdentityProfileIdentityErrorReportArgumentsAsReportDetailsArguments(v *IdentityProfileIdentityErrorReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
IdentityProfileIdentityErrorReportArguments: v,
}
}
// OrphanUncorrelatedReportArgumentsAsReportDetailsArguments is a convenience function that returns OrphanUncorrelatedReportArguments wrapped in ReportDetailsArguments
func OrphanUncorrelatedReportArgumentsAsReportDetailsArguments(v *OrphanUncorrelatedReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
OrphanUncorrelatedReportArguments: v,
}
}
// SearchExportReportArgumentsAsReportDetailsArguments is a convenience function that returns SearchExportReportArguments wrapped in ReportDetailsArguments
func SearchExportReportArgumentsAsReportDetailsArguments(v *SearchExportReportArguments) ReportDetailsArguments {
return ReportDetailsArguments{
SearchExportReportArguments: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *ReportDetailsArguments) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into AccountsExportReportArguments
err = newStrictDecoder(data).Decode(&dst.AccountsExportReportArguments)
if err == nil {
jsonAccountsExportReportArguments, _ := json.Marshal(dst.AccountsExportReportArguments)
if string(jsonAccountsExportReportArguments) == "{}" { // empty struct
dst.AccountsExportReportArguments = nil
} else {
match++
}
} else {
dst.AccountsExportReportArguments = nil
}
// try to unmarshal data into IdentitiesDetailsReportArguments
err = newStrictDecoder(data).Decode(&dst.IdentitiesDetailsReportArguments)
if err == nil {
jsonIdentitiesDetailsReportArguments, _ := json.Marshal(dst.IdentitiesDetailsReportArguments)
if string(jsonIdentitiesDetailsReportArguments) == "{}" { // empty struct
dst.IdentitiesDetailsReportArguments = nil
} else {
match++
}
} else {
dst.IdentitiesDetailsReportArguments = nil
}
// try to unmarshal data into IdentitiesReportArguments
err = newStrictDecoder(data).Decode(&dst.IdentitiesReportArguments)
if err == nil {
jsonIdentitiesReportArguments, _ := json.Marshal(dst.IdentitiesReportArguments)
if string(jsonIdentitiesReportArguments) == "{}" { // empty struct
dst.IdentitiesReportArguments = nil
} else {
match++
}
} else {
dst.IdentitiesReportArguments = nil
}
// try to unmarshal data into IdentityProfileIdentityErrorReportArguments
err = newStrictDecoder(data).Decode(&dst.IdentityProfileIdentityErrorReportArguments)
if err == nil {
jsonIdentityProfileIdentityErrorReportArguments, _ := json.Marshal(dst.IdentityProfileIdentityErrorReportArguments)
if string(jsonIdentityProfileIdentityErrorReportArguments) == "{}" { // empty struct
dst.IdentityProfileIdentityErrorReportArguments = nil
} else {
match++
}
} else {
dst.IdentityProfileIdentityErrorReportArguments = nil
}
// try to unmarshal data into OrphanUncorrelatedReportArguments
err = newStrictDecoder(data).Decode(&dst.OrphanUncorrelatedReportArguments)
if err == nil {
jsonOrphanUncorrelatedReportArguments, _ := json.Marshal(dst.OrphanUncorrelatedReportArguments)
if string(jsonOrphanUncorrelatedReportArguments) == "{}" { // empty struct
dst.OrphanUncorrelatedReportArguments = nil
} else {
match++
}
} else {
dst.OrphanUncorrelatedReportArguments = nil
}
// try to unmarshal data into SearchExportReportArguments
err = newStrictDecoder(data).Decode(&dst.SearchExportReportArguments)
if err == nil {
jsonSearchExportReportArguments, _ := json.Marshal(dst.SearchExportReportArguments)
if string(jsonSearchExportReportArguments) == "{}" { // empty struct
dst.SearchExportReportArguments = nil
} else {
match++
}
} else {
dst.SearchExportReportArguments = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.AccountsExportReportArguments = nil
dst.IdentitiesDetailsReportArguments = nil
dst.IdentitiesReportArguments = nil
dst.IdentityProfileIdentityErrorReportArguments = nil
dst.OrphanUncorrelatedReportArguments = nil
dst.SearchExportReportArguments = nil
return fmt.Errorf("data matches more than one schema in oneOf(ReportDetailsArguments)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("data failed to match schemas in oneOf(ReportDetailsArguments)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src ReportDetailsArguments) MarshalJSON() ([]byte, error) {
if src.AccountsExportReportArguments != nil {
return json.Marshal(&src.AccountsExportReportArguments)
}
if src.IdentitiesDetailsReportArguments != nil {
return json.Marshal(&src.IdentitiesDetailsReportArguments)
}
if src.IdentitiesReportArguments != nil {
return json.Marshal(&src.IdentitiesReportArguments)
}
if src.IdentityProfileIdentityErrorReportArguments != nil {
return json.Marshal(&src.IdentityProfileIdentityErrorReportArguments)
}
if src.OrphanUncorrelatedReportArguments != nil {
return json.Marshal(&src.OrphanUncorrelatedReportArguments)
}
if src.SearchExportReportArguments != nil {
return json.Marshal(&src.SearchExportReportArguments)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *ReportDetailsArguments) GetActualInstance() (interface{}) {
if obj == nil {
return nil
}
if obj.AccountsExportReportArguments != nil {
return obj.AccountsExportReportArguments
}
if obj.IdentitiesDetailsReportArguments != nil {
return obj.IdentitiesDetailsReportArguments
}
if obj.IdentitiesReportArguments != nil {
return obj.IdentitiesReportArguments
}
if obj.IdentityProfileIdentityErrorReportArguments != nil {
return obj.IdentityProfileIdentityErrorReportArguments
}
if obj.OrphanUncorrelatedReportArguments != nil {
return obj.OrphanUncorrelatedReportArguments
}
if obj.SearchExportReportArguments != nil {
return obj.SearchExportReportArguments
}
// all schemas are nil
return nil
}
type NullableReportDetailsArguments struct {
value *ReportDetailsArguments
isSet bool
}
func (v NullableReportDetailsArguments) Get() *ReportDetailsArguments {
return v.value
}
func (v *NullableReportDetailsArguments) Set(val *ReportDetailsArguments) {
v.value = val
v.isSet = true
}
func (v NullableReportDetailsArguments) IsSet() bool {
return v.isSet
}
func (v *NullableReportDetailsArguments) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReportDetailsArguments(val *ReportDetailsArguments) *NullableReportDetailsArguments {
return &NullableReportDetailsArguments{value: val, isSet: true}
}
func (v NullableReportDetailsArguments) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReportDetailsArguments) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}