-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel_update_user.go
403 lines (341 loc) · 11.1 KB
/
model_update_user.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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
/*
openobserve
OpenObserve API documents [https://openobserve.ai/docs/](https://openobserve.ai/docs/)
API version: 0.14.5
Contact: hello@zinclabs.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the UpdateUser type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateUser{}
// UpdateUser struct for UpdateUser
type UpdateUser struct {
ChangePassword *bool `json:"change_password,omitempty"`
FirstName NullableString `json:"first_name,omitempty"`
LastName NullableString `json:"last_name,omitempty"`
NewPassword NullableString `json:"new_password,omitempty"`
OldPassword NullableString `json:"old_password,omitempty"`
Role NullableUserRole `json:"role,omitempty"`
Token NullableString `json:"token,omitempty"`
}
// NewUpdateUser instantiates a new UpdateUser object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewUpdateUser() *UpdateUser {
this := UpdateUser{}
return &this
}
// NewUpdateUserWithDefaults instantiates a new UpdateUser object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewUpdateUserWithDefaults() *UpdateUser {
this := UpdateUser{}
return &this
}
// GetChangePassword returns the ChangePassword field value if set, zero value otherwise.
func (o *UpdateUser) GetChangePassword() bool {
if o == nil || IsNil(o.ChangePassword) {
var ret bool
return ret
}
return *o.ChangePassword
}
// GetChangePasswordOk returns a tuple with the ChangePassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UpdateUser) GetChangePasswordOk() (*bool, bool) {
if o == nil || IsNil(o.ChangePassword) {
return nil, false
}
return o.ChangePassword, true
}
// HasChangePassword returns a boolean if a field has been set.
func (o *UpdateUser) HasChangePassword() bool {
if o != nil && !IsNil(o.ChangePassword) {
return true
}
return false
}
// SetChangePassword gets a reference to the given bool and assigns it to the ChangePassword field.
func (o *UpdateUser) SetChangePassword(v bool) {
o.ChangePassword = &v
}
// GetFirstName returns the FirstName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetFirstName() string {
if o == nil || IsNil(o.FirstName.Get()) {
var ret string
return ret
}
return *o.FirstName.Get()
}
// GetFirstNameOk returns a tuple with the FirstName field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetFirstNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.FirstName.Get(), o.FirstName.IsSet()
}
// HasFirstName returns a boolean if a field has been set.
func (o *UpdateUser) HasFirstName() bool {
if o != nil && o.FirstName.IsSet() {
return true
}
return false
}
// SetFirstName gets a reference to the given NullableString and assigns it to the FirstName field.
func (o *UpdateUser) SetFirstName(v string) {
o.FirstName.Set(&v)
}
// SetFirstNameNil sets the value for FirstName to be an explicit nil
func (o *UpdateUser) SetFirstNameNil() {
o.FirstName.Set(nil)
}
// UnsetFirstName ensures that no value is present for FirstName, not even an explicit nil
func (o *UpdateUser) UnsetFirstName() {
o.FirstName.Unset()
}
// GetLastName returns the LastName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetLastName() string {
if o == nil || IsNil(o.LastName.Get()) {
var ret string
return ret
}
return *o.LastName.Get()
}
// GetLastNameOk returns a tuple with the LastName field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetLastNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.LastName.Get(), o.LastName.IsSet()
}
// HasLastName returns a boolean if a field has been set.
func (o *UpdateUser) HasLastName() bool {
if o != nil && o.LastName.IsSet() {
return true
}
return false
}
// SetLastName gets a reference to the given NullableString and assigns it to the LastName field.
func (o *UpdateUser) SetLastName(v string) {
o.LastName.Set(&v)
}
// SetLastNameNil sets the value for LastName to be an explicit nil
func (o *UpdateUser) SetLastNameNil() {
o.LastName.Set(nil)
}
// UnsetLastName ensures that no value is present for LastName, not even an explicit nil
func (o *UpdateUser) UnsetLastName() {
o.LastName.Unset()
}
// GetNewPassword returns the NewPassword field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetNewPassword() string {
if o == nil || IsNil(o.NewPassword.Get()) {
var ret string
return ret
}
return *o.NewPassword.Get()
}
// GetNewPasswordOk returns a tuple with the NewPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetNewPasswordOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.NewPassword.Get(), o.NewPassword.IsSet()
}
// HasNewPassword returns a boolean if a field has been set.
func (o *UpdateUser) HasNewPassword() bool {
if o != nil && o.NewPassword.IsSet() {
return true
}
return false
}
// SetNewPassword gets a reference to the given NullableString and assigns it to the NewPassword field.
func (o *UpdateUser) SetNewPassword(v string) {
o.NewPassword.Set(&v)
}
// SetNewPasswordNil sets the value for NewPassword to be an explicit nil
func (o *UpdateUser) SetNewPasswordNil() {
o.NewPassword.Set(nil)
}
// UnsetNewPassword ensures that no value is present for NewPassword, not even an explicit nil
func (o *UpdateUser) UnsetNewPassword() {
o.NewPassword.Unset()
}
// GetOldPassword returns the OldPassword field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetOldPassword() string {
if o == nil || IsNil(o.OldPassword.Get()) {
var ret string
return ret
}
return *o.OldPassword.Get()
}
// GetOldPasswordOk returns a tuple with the OldPassword field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetOldPasswordOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.OldPassword.Get(), o.OldPassword.IsSet()
}
// HasOldPassword returns a boolean if a field has been set.
func (o *UpdateUser) HasOldPassword() bool {
if o != nil && o.OldPassword.IsSet() {
return true
}
return false
}
// SetOldPassword gets a reference to the given NullableString and assigns it to the OldPassword field.
func (o *UpdateUser) SetOldPassword(v string) {
o.OldPassword.Set(&v)
}
// SetOldPasswordNil sets the value for OldPassword to be an explicit nil
func (o *UpdateUser) SetOldPasswordNil() {
o.OldPassword.Set(nil)
}
// UnsetOldPassword ensures that no value is present for OldPassword, not even an explicit nil
func (o *UpdateUser) UnsetOldPassword() {
o.OldPassword.Unset()
}
// GetRole returns the Role field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetRole() UserRole {
if o == nil || IsNil(o.Role.Get()) {
var ret UserRole
return ret
}
return *o.Role.Get()
}
// GetRoleOk returns a tuple with the Role field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetRoleOk() (*UserRole, bool) {
if o == nil {
return nil, false
}
return o.Role.Get(), o.Role.IsSet()
}
// HasRole returns a boolean if a field has been set.
func (o *UpdateUser) HasRole() bool {
if o != nil && o.Role.IsSet() {
return true
}
return false
}
// SetRole gets a reference to the given NullableUserRole and assigns it to the Role field.
func (o *UpdateUser) SetRole(v UserRole) {
o.Role.Set(&v)
}
// SetRoleNil sets the value for Role to be an explicit nil
func (o *UpdateUser) SetRoleNil() {
o.Role.Set(nil)
}
// UnsetRole ensures that no value is present for Role, not even an explicit nil
func (o *UpdateUser) UnsetRole() {
o.Role.Unset()
}
// GetToken returns the Token field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateUser) GetToken() string {
if o == nil || IsNil(o.Token.Get()) {
var ret string
return ret
}
return *o.Token.Get()
}
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateUser) GetTokenOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Token.Get(), o.Token.IsSet()
}
// HasToken returns a boolean if a field has been set.
func (o *UpdateUser) HasToken() bool {
if o != nil && o.Token.IsSet() {
return true
}
return false
}
// SetToken gets a reference to the given NullableString and assigns it to the Token field.
func (o *UpdateUser) SetToken(v string) {
o.Token.Set(&v)
}
// SetTokenNil sets the value for Token to be an explicit nil
func (o *UpdateUser) SetTokenNil() {
o.Token.Set(nil)
}
// UnsetToken ensures that no value is present for Token, not even an explicit nil
func (o *UpdateUser) UnsetToken() {
o.Token.Unset()
}
func (o UpdateUser) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UpdateUser) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.ChangePassword) {
toSerialize["change_password"] = o.ChangePassword
}
if o.FirstName.IsSet() {
toSerialize["first_name"] = o.FirstName.Get()
}
if o.LastName.IsSet() {
toSerialize["last_name"] = o.LastName.Get()
}
if o.NewPassword.IsSet() {
toSerialize["new_password"] = o.NewPassword.Get()
}
if o.OldPassword.IsSet() {
toSerialize["old_password"] = o.OldPassword.Get()
}
if o.Role.IsSet() {
toSerialize["role"] = o.Role.Get()
}
if o.Token.IsSet() {
toSerialize["token"] = o.Token.Get()
}
return toSerialize, nil
}
type NullableUpdateUser struct {
value *UpdateUser
isSet bool
}
func (v NullableUpdateUser) Get() *UpdateUser {
return v.value
}
func (v *NullableUpdateUser) Set(val *UpdateUser) {
v.value = val
v.isSet = true
}
func (v NullableUpdateUser) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateUser) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateUser(val *UpdateUser) *NullableUpdateUser {
return &NullableUpdateUser{value: val, isSet: true}
}
func (v NullableUpdateUser) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateUser) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}