-
Notifications
You must be signed in to change notification settings - Fork 3
/
model_identity.go
648 lines (547 loc) · 18 KB
/
model_identity.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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/*
Identity Security Cloud Beta API
Use these APIs to interact with the Identity Security Cloud platform to achieve repeatable, automated processes with greater scalability. These APIs are in beta and are subject to change. 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.1.0-beta
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api_beta
import (
"encoding/json"
"time"
"fmt"
)
// checks if the Identity type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Identity{}
// Identity struct for Identity
type Identity struct {
// System-generated unique ID of the Object
Id *string `json:"id,omitempty"`
// Name of the Object
Name string `json:"name"`
// Creation date of the Object
Created *time.Time `json:"created,omitempty"`
// Last modification date of the Object
Modified *time.Time `json:"modified,omitempty"`
// Alternate unique identifier for the identity
Alias *string `json:"alias,omitempty"`
// The email address of the identity
EmailAddress NullableString `json:"emailAddress,omitempty"`
// The processing state of the identity
ProcessingState NullableString `json:"processingState,omitempty"`
// The identity's status in the system
IdentityStatus *string `json:"identityStatus,omitempty"`
ManagerRef NullableIdentityDtoManagerRef `json:"managerRef,omitempty"`
// Whether this identity is a manager of another identity
IsManager *bool `json:"isManager,omitempty"`
// The last time the identity was refreshed by the system
LastRefresh *time.Time `json:"lastRefresh,omitempty"`
// A map with the identity attributes for the identity
Attributes map[string]interface{} `json:"attributes,omitempty"`
LifecycleState *IdentityDtoLifecycleState `json:"lifecycleState,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Identity Identity
// NewIdentity instantiates a new Identity 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 NewIdentity(name string) *Identity {
this := Identity{}
this.Name = name
var isManager bool = false
this.IsManager = &isManager
return &this
}
// NewIdentityWithDefaults instantiates a new Identity 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 NewIdentityWithDefaults() *Identity {
this := Identity{}
var isManager bool = false
this.IsManager = &isManager
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Identity) GetId() string {
if o == nil || isNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetIdOk() (*string, bool) {
if o == nil || isNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *Identity) HasId() bool {
if o != nil && !isNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Identity) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value
func (o *Identity) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Identity) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Identity) SetName(v string) {
o.Name = v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *Identity) GetCreated() time.Time {
if o == nil || isNil(o.Created) {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetCreatedOk() (*time.Time, bool) {
if o == nil || isNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *Identity) HasCreated() bool {
if o != nil && !isNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *Identity) SetCreated(v time.Time) {
o.Created = &v
}
// GetModified returns the Modified field value if set, zero value otherwise.
func (o *Identity) GetModified() time.Time {
if o == nil || isNil(o.Modified) {
var ret time.Time
return ret
}
return *o.Modified
}
// GetModifiedOk returns a tuple with the Modified field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetModifiedOk() (*time.Time, bool) {
if o == nil || isNil(o.Modified) {
return nil, false
}
return o.Modified, true
}
// HasModified returns a boolean if a field has been set.
func (o *Identity) HasModified() bool {
if o != nil && !isNil(o.Modified) {
return true
}
return false
}
// SetModified gets a reference to the given time.Time and assigns it to the Modified field.
func (o *Identity) SetModified(v time.Time) {
o.Modified = &v
}
// GetAlias returns the Alias field value if set, zero value otherwise.
func (o *Identity) GetAlias() string {
if o == nil || isNil(o.Alias) {
var ret string
return ret
}
return *o.Alias
}
// GetAliasOk returns a tuple with the Alias field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetAliasOk() (*string, bool) {
if o == nil || isNil(o.Alias) {
return nil, false
}
return o.Alias, true
}
// HasAlias returns a boolean if a field has been set.
func (o *Identity) HasAlias() bool {
if o != nil && !isNil(o.Alias) {
return true
}
return false
}
// SetAlias gets a reference to the given string and assigns it to the Alias field.
func (o *Identity) SetAlias(v string) {
o.Alias = &v
}
// GetEmailAddress returns the EmailAddress field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Identity) GetEmailAddress() string {
if o == nil || isNil(o.EmailAddress.Get()) {
var ret string
return ret
}
return *o.EmailAddress.Get()
}
// GetEmailAddressOk returns a tuple with the EmailAddress 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 *Identity) GetEmailAddressOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.EmailAddress.Get(), o.EmailAddress.IsSet()
}
// HasEmailAddress returns a boolean if a field has been set.
func (o *Identity) HasEmailAddress() bool {
if o != nil && o.EmailAddress.IsSet() {
return true
}
return false
}
// SetEmailAddress gets a reference to the given NullableString and assigns it to the EmailAddress field.
func (o *Identity) SetEmailAddress(v string) {
o.EmailAddress.Set(&v)
}
// SetEmailAddressNil sets the value for EmailAddress to be an explicit nil
func (o *Identity) SetEmailAddressNil() {
o.EmailAddress.Set(nil)
}
// UnsetEmailAddress ensures that no value is present for EmailAddress, not even an explicit nil
func (o *Identity) UnsetEmailAddress() {
o.EmailAddress.Unset()
}
// GetProcessingState returns the ProcessingState field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Identity) GetProcessingState() string {
if o == nil || isNil(o.ProcessingState.Get()) {
var ret string
return ret
}
return *o.ProcessingState.Get()
}
// GetProcessingStateOk returns a tuple with the ProcessingState 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 *Identity) GetProcessingStateOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ProcessingState.Get(), o.ProcessingState.IsSet()
}
// HasProcessingState returns a boolean if a field has been set.
func (o *Identity) HasProcessingState() bool {
if o != nil && o.ProcessingState.IsSet() {
return true
}
return false
}
// SetProcessingState gets a reference to the given NullableString and assigns it to the ProcessingState field.
func (o *Identity) SetProcessingState(v string) {
o.ProcessingState.Set(&v)
}
// SetProcessingStateNil sets the value for ProcessingState to be an explicit nil
func (o *Identity) SetProcessingStateNil() {
o.ProcessingState.Set(nil)
}
// UnsetProcessingState ensures that no value is present for ProcessingState, not even an explicit nil
func (o *Identity) UnsetProcessingState() {
o.ProcessingState.Unset()
}
// GetIdentityStatus returns the IdentityStatus field value if set, zero value otherwise.
func (o *Identity) GetIdentityStatus() string {
if o == nil || isNil(o.IdentityStatus) {
var ret string
return ret
}
return *o.IdentityStatus
}
// GetIdentityStatusOk returns a tuple with the IdentityStatus field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetIdentityStatusOk() (*string, bool) {
if o == nil || isNil(o.IdentityStatus) {
return nil, false
}
return o.IdentityStatus, true
}
// HasIdentityStatus returns a boolean if a field has been set.
func (o *Identity) HasIdentityStatus() bool {
if o != nil && !isNil(o.IdentityStatus) {
return true
}
return false
}
// SetIdentityStatus gets a reference to the given string and assigns it to the IdentityStatus field.
func (o *Identity) SetIdentityStatus(v string) {
o.IdentityStatus = &v
}
// GetManagerRef returns the ManagerRef field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Identity) GetManagerRef() IdentityDtoManagerRef {
if o == nil || isNil(o.ManagerRef.Get()) {
var ret IdentityDtoManagerRef
return ret
}
return *o.ManagerRef.Get()
}
// GetManagerRefOk returns a tuple with the ManagerRef 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 *Identity) GetManagerRefOk() (*IdentityDtoManagerRef, bool) {
if o == nil {
return nil, false
}
return o.ManagerRef.Get(), o.ManagerRef.IsSet()
}
// HasManagerRef returns a boolean if a field has been set.
func (o *Identity) HasManagerRef() bool {
if o != nil && o.ManagerRef.IsSet() {
return true
}
return false
}
// SetManagerRef gets a reference to the given NullableIdentityDtoManagerRef and assigns it to the ManagerRef field.
func (o *Identity) SetManagerRef(v IdentityDtoManagerRef) {
o.ManagerRef.Set(&v)
}
// SetManagerRefNil sets the value for ManagerRef to be an explicit nil
func (o *Identity) SetManagerRefNil() {
o.ManagerRef.Set(nil)
}
// UnsetManagerRef ensures that no value is present for ManagerRef, not even an explicit nil
func (o *Identity) UnsetManagerRef() {
o.ManagerRef.Unset()
}
// GetIsManager returns the IsManager field value if set, zero value otherwise.
func (o *Identity) GetIsManager() bool {
if o == nil || isNil(o.IsManager) {
var ret bool
return ret
}
return *o.IsManager
}
// GetIsManagerOk returns a tuple with the IsManager field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetIsManagerOk() (*bool, bool) {
if o == nil || isNil(o.IsManager) {
return nil, false
}
return o.IsManager, true
}
// HasIsManager returns a boolean if a field has been set.
func (o *Identity) HasIsManager() bool {
if o != nil && !isNil(o.IsManager) {
return true
}
return false
}
// SetIsManager gets a reference to the given bool and assigns it to the IsManager field.
func (o *Identity) SetIsManager(v bool) {
o.IsManager = &v
}
// GetLastRefresh returns the LastRefresh field value if set, zero value otherwise.
func (o *Identity) GetLastRefresh() time.Time {
if o == nil || isNil(o.LastRefresh) {
var ret time.Time
return ret
}
return *o.LastRefresh
}
// GetLastRefreshOk returns a tuple with the LastRefresh field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetLastRefreshOk() (*time.Time, bool) {
if o == nil || isNil(o.LastRefresh) {
return nil, false
}
return o.LastRefresh, true
}
// HasLastRefresh returns a boolean if a field has been set.
func (o *Identity) HasLastRefresh() bool {
if o != nil && !isNil(o.LastRefresh) {
return true
}
return false
}
// SetLastRefresh gets a reference to the given time.Time and assigns it to the LastRefresh field.
func (o *Identity) SetLastRefresh(v time.Time) {
o.LastRefresh = &v
}
// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *Identity) GetAttributes() map[string]interface{} {
if o == nil || isNil(o.Attributes) {
var ret map[string]interface{}
return ret
}
return o.Attributes
}
// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetAttributesOk() (map[string]interface{}, bool) {
if o == nil || isNil(o.Attributes) {
return map[string]interface{}{}, false
}
return o.Attributes, true
}
// HasAttributes returns a boolean if a field has been set.
func (o *Identity) HasAttributes() bool {
if o != nil && !isNil(o.Attributes) {
return true
}
return false
}
// SetAttributes gets a reference to the given map[string]interface{} and assigns it to the Attributes field.
func (o *Identity) SetAttributes(v map[string]interface{}) {
o.Attributes = v
}
// GetLifecycleState returns the LifecycleState field value if set, zero value otherwise.
func (o *Identity) GetLifecycleState() IdentityDtoLifecycleState {
if o == nil || isNil(o.LifecycleState) {
var ret IdentityDtoLifecycleState
return ret
}
return *o.LifecycleState
}
// GetLifecycleStateOk returns a tuple with the LifecycleState field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Identity) GetLifecycleStateOk() (*IdentityDtoLifecycleState, bool) {
if o == nil || isNil(o.LifecycleState) {
return nil, false
}
return o.LifecycleState, true
}
// HasLifecycleState returns a boolean if a field has been set.
func (o *Identity) HasLifecycleState() bool {
if o != nil && !isNil(o.LifecycleState) {
return true
}
return false
}
// SetLifecycleState gets a reference to the given IdentityDtoLifecycleState and assigns it to the LifecycleState field.
func (o *Identity) SetLifecycleState(v IdentityDtoLifecycleState) {
o.LifecycleState = &v
}
func (o Identity) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Identity) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
// skip: id is readOnly
toSerialize["name"] = o.Name
// skip: created is readOnly
// skip: modified is readOnly
if !isNil(o.Alias) {
toSerialize["alias"] = o.Alias
}
if o.EmailAddress.IsSet() {
toSerialize["emailAddress"] = o.EmailAddress.Get()
}
if o.ProcessingState.IsSet() {
toSerialize["processingState"] = o.ProcessingState.Get()
}
if !isNil(o.IdentityStatus) {
toSerialize["identityStatus"] = o.IdentityStatus
}
if o.ManagerRef.IsSet() {
toSerialize["managerRef"] = o.ManagerRef.Get()
}
if !isNil(o.IsManager) {
toSerialize["isManager"] = o.IsManager
}
if !isNil(o.LastRefresh) {
toSerialize["lastRefresh"] = o.LastRefresh
}
if !isNil(o.Attributes) {
toSerialize["attributes"] = o.Attributes
}
if !isNil(o.LifecycleState) {
toSerialize["lifecycleState"] = o.LifecycleState
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Identity) UnmarshalJSON(bytes []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"name",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &allProperties)
if err != nil {
return err;
}
for _, requiredProperty := range(requiredProperties) {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIdentity := _Identity{}
if err = json.Unmarshal(bytes, &varIdentity); err == nil {
*o = Identity(varIdentity)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "created")
delete(additionalProperties, "modified")
delete(additionalProperties, "alias")
delete(additionalProperties, "emailAddress")
delete(additionalProperties, "processingState")
delete(additionalProperties, "identityStatus")
delete(additionalProperties, "managerRef")
delete(additionalProperties, "isManager")
delete(additionalProperties, "lastRefresh")
delete(additionalProperties, "attributes")
delete(additionalProperties, "lifecycleState")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIdentity struct {
value *Identity
isSet bool
}
func (v NullableIdentity) Get() *Identity {
return v.value
}
func (v *NullableIdentity) Set(val *Identity) {
v.value = val
v.isSet = true
}
func (v NullableIdentity) IsSet() bool {
return v.isSet
}
func (v *NullableIdentity) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIdentity(val *Identity) *NullableIdentity {
return &NullableIdentity{value: val, isSet: true}
}
func (v NullableIdentity) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIdentity) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}