This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
forked from ory/kratos-client-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_submit_self_service_settings_flow_body.go
269 lines (224 loc) · 11.6 KB
/
model_submit_self_service_settings_flow_body.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
/*
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
API version: latest
Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"fmt"
)
// SubmitSelfServiceSettingsFlowBody - struct for SubmitSelfServiceSettingsFlowBody
type SubmitSelfServiceSettingsFlowBody struct {
SubmitSelfServiceSettingsFlowWithLookupMethodBody *SubmitSelfServiceSettingsFlowWithLookupMethodBody
SubmitSelfServiceSettingsFlowWithOidcMethodBody *SubmitSelfServiceSettingsFlowWithOidcMethodBody
SubmitSelfServiceSettingsFlowWithPasswordMethodBody *SubmitSelfServiceSettingsFlowWithPasswordMethodBody
SubmitSelfServiceSettingsFlowWithProfileMethodBody *SubmitSelfServiceSettingsFlowWithProfileMethodBody
SubmitSelfServiceSettingsFlowWithTotpMethodBody *SubmitSelfServiceSettingsFlowWithTotpMethodBody
SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody *SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody
}
// SubmitSelfServiceSettingsFlowWithLookupMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithLookupMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithLookupMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithLookupMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithLookupMethodBody: v,
}
}
// SubmitSelfServiceSettingsFlowWithOidcMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithOidcMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithOidcMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithOidcMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithOidcMethodBody: v,
}
}
// SubmitSelfServiceSettingsFlowWithPasswordMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithPasswordMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithPasswordMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithPasswordMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithPasswordMethodBody: v,
}
}
// SubmitSelfServiceSettingsFlowWithProfileMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithProfileMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithProfileMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithProfileMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithProfileMethodBody: v,
}
}
// SubmitSelfServiceSettingsFlowWithTotpMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithTotpMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithTotpMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithTotpMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithTotpMethodBody: v,
}
}
// SubmitSelfServiceSettingsFlowWithWebAuthnMethodBodyAsSubmitSelfServiceSettingsFlowBody is a convenience function that returns SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody wrapped in SubmitSelfServiceSettingsFlowBody
func SubmitSelfServiceSettingsFlowWithWebAuthnMethodBodyAsSubmitSelfServiceSettingsFlowBody(v *SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody) SubmitSelfServiceSettingsFlowBody {
return SubmitSelfServiceSettingsFlowBody{
SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *SubmitSelfServiceSettingsFlowBody) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithLookupMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithLookupMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithLookupMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithLookupMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithLookupMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithLookupMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithLookupMethodBody = nil
}
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithOidcMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithOidcMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithOidcMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithOidcMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithOidcMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithOidcMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithOidcMethodBody = nil
}
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithPasswordMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithPasswordMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithPasswordMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithPasswordMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithPasswordMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithPasswordMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithPasswordMethodBody = nil
}
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithProfileMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithProfileMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithProfileMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithProfileMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithProfileMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithProfileMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithProfileMethodBody = nil
}
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithTotpMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithTotpMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithTotpMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithTotpMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithTotpMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithTotpMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithTotpMethodBody = nil
}
// try to unmarshal data into SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody
err = newStrictDecoder(data).Decode(&dst.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody)
if err == nil {
jsonSubmitSelfServiceSettingsFlowWithWebAuthnMethodBody, _ := json.Marshal(dst.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody)
if string(jsonSubmitSelfServiceSettingsFlowWithWebAuthnMethodBody) == "{}" { // empty struct
dst.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody = nil
} else {
match++
}
} else {
dst.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.SubmitSelfServiceSettingsFlowWithLookupMethodBody = nil
dst.SubmitSelfServiceSettingsFlowWithOidcMethodBody = nil
dst.SubmitSelfServiceSettingsFlowWithPasswordMethodBody = nil
dst.SubmitSelfServiceSettingsFlowWithProfileMethodBody = nil
dst.SubmitSelfServiceSettingsFlowWithTotpMethodBody = nil
dst.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody = nil
return fmt.Errorf("Data matches more than one schema in oneOf(SubmitSelfServiceSettingsFlowBody)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("Data failed to match schemas in oneOf(SubmitSelfServiceSettingsFlowBody)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src SubmitSelfServiceSettingsFlowBody) MarshalJSON() ([]byte, error) {
if src.SubmitSelfServiceSettingsFlowWithLookupMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithLookupMethodBody)
}
if src.SubmitSelfServiceSettingsFlowWithOidcMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithOidcMethodBody)
}
if src.SubmitSelfServiceSettingsFlowWithPasswordMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithPasswordMethodBody)
}
if src.SubmitSelfServiceSettingsFlowWithProfileMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithProfileMethodBody)
}
if src.SubmitSelfServiceSettingsFlowWithTotpMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithTotpMethodBody)
}
if src.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody != nil {
return json.Marshal(&src.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *SubmitSelfServiceSettingsFlowBody) GetActualInstance() (interface{}) {
if obj == nil {
return nil
}
if obj.SubmitSelfServiceSettingsFlowWithLookupMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithLookupMethodBody
}
if obj.SubmitSelfServiceSettingsFlowWithOidcMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithOidcMethodBody
}
if obj.SubmitSelfServiceSettingsFlowWithPasswordMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithPasswordMethodBody
}
if obj.SubmitSelfServiceSettingsFlowWithProfileMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithProfileMethodBody
}
if obj.SubmitSelfServiceSettingsFlowWithTotpMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithTotpMethodBody
}
if obj.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody != nil {
return obj.SubmitSelfServiceSettingsFlowWithWebAuthnMethodBody
}
// all schemas are nil
return nil
}
type NullableSubmitSelfServiceSettingsFlowBody struct {
value *SubmitSelfServiceSettingsFlowBody
isSet bool
}
func (v NullableSubmitSelfServiceSettingsFlowBody) Get() *SubmitSelfServiceSettingsFlowBody {
return v.value
}
func (v *NullableSubmitSelfServiceSettingsFlowBody) Set(val *SubmitSelfServiceSettingsFlowBody) {
v.value = val
v.isSet = true
}
func (v NullableSubmitSelfServiceSettingsFlowBody) IsSet() bool {
return v.isSet
}
func (v *NullableSubmitSelfServiceSettingsFlowBody) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSubmitSelfServiceSettingsFlowBody(val *SubmitSelfServiceSettingsFlowBody) *NullableSubmitSelfServiceSettingsFlowBody {
return &NullableSubmitSelfServiceSettingsFlowBody{value: val, isSet: true}
}
func (v NullableSubmitSelfServiceSettingsFlowBody) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSubmitSelfServiceSettingsFlowBody) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}