-
Notifications
You must be signed in to change notification settings - Fork 4
/
model_app_role_assignment.go
485 lines (405 loc) · 16 KB
/
model_app_role_assignment.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
/*
Libre Graph API
Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.
API version: v1.0.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package libregraph
import (
"bytes"
"encoding/json"
"fmt"
"time"
)
// checks if the AppRoleAssignment type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AppRoleAssignment{}
// AppRoleAssignment struct for AppRoleAssignment
type AppRoleAssignment struct {
// The unique identifier for the object. 12345678-9abc-def0-1234-56789abcde. The value of the ID property is often, but not exclusively, in the form of a GUID. The value should be treated as an opaque identifier and not based in being a GUID. Null values are not allowed. Read-only.
Id *string `json:"id,omitempty"`
DeletedDateTime *time.Time `json:"deletedDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?([Zz]|[+-][0-9][0-9]:[0-9][0-9])$"`
// The identifier (id) for the app role which is assigned to the user. Required on create.
AppRoleId string `json:"appRoleId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
// The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.
CreatedDateTime NullableTime `json:"createdDateTime,omitempty" validate:"regexp=^[0-9]{4,}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]([.][0-9]{1,12})?(Z|[+-][0-9][0-9]:[0-9][0-9])$"`
// The display name of the user, group, or service principal that was granted the app role assignment. Read-only.
PrincipalDisplayName NullableString `json:"principalDisplayName,omitempty"`
// The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create.
PrincipalId NullableString `json:"principalId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
// The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only.
PrincipalType NullableString `json:"principalType,omitempty"`
// The display name of the resource app's service principal to which the assignment is made.
ResourceDisplayName NullableString `json:"resourceDisplayName,omitempty"`
// The unique identifier (id) for the resource service principal for which the assignment is made. Required on create.
ResourceId NullableString `json:"resourceId" validate:"regexp=^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"`
}
type _AppRoleAssignment AppRoleAssignment
// NewAppRoleAssignment instantiates a new AppRoleAssignment 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 NewAppRoleAssignment(appRoleId string, principalId NullableString, resourceId NullableString) *AppRoleAssignment {
this := AppRoleAssignment{}
this.AppRoleId = appRoleId
this.PrincipalId = principalId
this.ResourceId = resourceId
return &this
}
// NewAppRoleAssignmentWithDefaults instantiates a new AppRoleAssignment 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 NewAppRoleAssignmentWithDefaults() *AppRoleAssignment {
this := AppRoleAssignment{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AppRoleAssignment) 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 *AppRoleAssignment) 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 *AppRoleAssignment) 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 *AppRoleAssignment) SetId(v string) {
o.Id = &v
}
// GetDeletedDateTime returns the DeletedDateTime field value if set, zero value otherwise.
func (o *AppRoleAssignment) GetDeletedDateTime() time.Time {
if o == nil || IsNil(o.DeletedDateTime) {
var ret time.Time
return ret
}
return *o.DeletedDateTime
}
// GetDeletedDateTimeOk returns a tuple with the DeletedDateTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AppRoleAssignment) GetDeletedDateTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.DeletedDateTime) {
return nil, false
}
return o.DeletedDateTime, true
}
// HasDeletedDateTime returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasDeletedDateTime() bool {
if o != nil && !IsNil(o.DeletedDateTime) {
return true
}
return false
}
// SetDeletedDateTime gets a reference to the given time.Time and assigns it to the DeletedDateTime field.
func (o *AppRoleAssignment) SetDeletedDateTime(v time.Time) {
o.DeletedDateTime = &v
}
// GetAppRoleId returns the AppRoleId field value
func (o *AppRoleAssignment) GetAppRoleId() string {
if o == nil {
var ret string
return ret
}
return o.AppRoleId
}
// GetAppRoleIdOk returns a tuple with the AppRoleId field value
// and a boolean to check if the value has been set.
func (o *AppRoleAssignment) GetAppRoleIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.AppRoleId, true
}
// SetAppRoleId sets field value
func (o *AppRoleAssignment) SetAppRoleId(v string) {
o.AppRoleId = v
}
// GetCreatedDateTime returns the CreatedDateTime field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetCreatedDateTime() time.Time {
if o == nil || IsNil(o.CreatedDateTime.Get()) {
var ret time.Time
return ret
}
return *o.CreatedDateTime.Get()
}
// GetCreatedDateTimeOk returns a tuple with the CreatedDateTime 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 *AppRoleAssignment) GetCreatedDateTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return o.CreatedDateTime.Get(), o.CreatedDateTime.IsSet()
}
// HasCreatedDateTime returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasCreatedDateTime() bool {
if o != nil && o.CreatedDateTime.IsSet() {
return true
}
return false
}
// SetCreatedDateTime gets a reference to the given NullableTime and assigns it to the CreatedDateTime field.
func (o *AppRoleAssignment) SetCreatedDateTime(v time.Time) {
o.CreatedDateTime.Set(&v)
}
// SetCreatedDateTimeNil sets the value for CreatedDateTime to be an explicit nil
func (o *AppRoleAssignment) SetCreatedDateTimeNil() {
o.CreatedDateTime.Set(nil)
}
// UnsetCreatedDateTime ensures that no value is present for CreatedDateTime, not even an explicit nil
func (o *AppRoleAssignment) UnsetCreatedDateTime() {
o.CreatedDateTime.Unset()
}
// GetPrincipalDisplayName returns the PrincipalDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetPrincipalDisplayName() string {
if o == nil || IsNil(o.PrincipalDisplayName.Get()) {
var ret string
return ret
}
return *o.PrincipalDisplayName.Get()
}
// GetPrincipalDisplayNameOk returns a tuple with the PrincipalDisplayName 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 *AppRoleAssignment) GetPrincipalDisplayNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.PrincipalDisplayName.Get(), o.PrincipalDisplayName.IsSet()
}
// HasPrincipalDisplayName returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasPrincipalDisplayName() bool {
if o != nil && o.PrincipalDisplayName.IsSet() {
return true
}
return false
}
// SetPrincipalDisplayName gets a reference to the given NullableString and assigns it to the PrincipalDisplayName field.
func (o *AppRoleAssignment) SetPrincipalDisplayName(v string) {
o.PrincipalDisplayName.Set(&v)
}
// SetPrincipalDisplayNameNil sets the value for PrincipalDisplayName to be an explicit nil
func (o *AppRoleAssignment) SetPrincipalDisplayNameNil() {
o.PrincipalDisplayName.Set(nil)
}
// UnsetPrincipalDisplayName ensures that no value is present for PrincipalDisplayName, not even an explicit nil
func (o *AppRoleAssignment) UnsetPrincipalDisplayName() {
o.PrincipalDisplayName.Unset()
}
// GetPrincipalId returns the PrincipalId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *AppRoleAssignment) GetPrincipalId() string {
if o == nil || o.PrincipalId.Get() == nil {
var ret string
return ret
}
return *o.PrincipalId.Get()
}
// GetPrincipalIdOk returns a tuple with the PrincipalId field value
// 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 *AppRoleAssignment) GetPrincipalIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.PrincipalId.Get(), o.PrincipalId.IsSet()
}
// SetPrincipalId sets field value
func (o *AppRoleAssignment) SetPrincipalId(v string) {
o.PrincipalId.Set(&v)
}
// GetPrincipalType returns the PrincipalType field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetPrincipalType() string {
if o == nil || IsNil(o.PrincipalType.Get()) {
var ret string
return ret
}
return *o.PrincipalType.Get()
}
// GetPrincipalTypeOk returns a tuple with the PrincipalType 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 *AppRoleAssignment) GetPrincipalTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.PrincipalType.Get(), o.PrincipalType.IsSet()
}
// HasPrincipalType returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasPrincipalType() bool {
if o != nil && o.PrincipalType.IsSet() {
return true
}
return false
}
// SetPrincipalType gets a reference to the given NullableString and assigns it to the PrincipalType field.
func (o *AppRoleAssignment) SetPrincipalType(v string) {
o.PrincipalType.Set(&v)
}
// SetPrincipalTypeNil sets the value for PrincipalType to be an explicit nil
func (o *AppRoleAssignment) SetPrincipalTypeNil() {
o.PrincipalType.Set(nil)
}
// UnsetPrincipalType ensures that no value is present for PrincipalType, not even an explicit nil
func (o *AppRoleAssignment) UnsetPrincipalType() {
o.PrincipalType.Unset()
}
// GetResourceDisplayName returns the ResourceDisplayName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AppRoleAssignment) GetResourceDisplayName() string {
if o == nil || IsNil(o.ResourceDisplayName.Get()) {
var ret string
return ret
}
return *o.ResourceDisplayName.Get()
}
// GetResourceDisplayNameOk returns a tuple with the ResourceDisplayName 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 *AppRoleAssignment) GetResourceDisplayNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ResourceDisplayName.Get(), o.ResourceDisplayName.IsSet()
}
// HasResourceDisplayName returns a boolean if a field has been set.
func (o *AppRoleAssignment) HasResourceDisplayName() bool {
if o != nil && o.ResourceDisplayName.IsSet() {
return true
}
return false
}
// SetResourceDisplayName gets a reference to the given NullableString and assigns it to the ResourceDisplayName field.
func (o *AppRoleAssignment) SetResourceDisplayName(v string) {
o.ResourceDisplayName.Set(&v)
}
// SetResourceDisplayNameNil sets the value for ResourceDisplayName to be an explicit nil
func (o *AppRoleAssignment) SetResourceDisplayNameNil() {
o.ResourceDisplayName.Set(nil)
}
// UnsetResourceDisplayName ensures that no value is present for ResourceDisplayName, not even an explicit nil
func (o *AppRoleAssignment) UnsetResourceDisplayName() {
o.ResourceDisplayName.Unset()
}
// GetResourceId returns the ResourceId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *AppRoleAssignment) GetResourceId() string {
if o == nil || o.ResourceId.Get() == nil {
var ret string
return ret
}
return *o.ResourceId.Get()
}
// GetResourceIdOk returns a tuple with the ResourceId field value
// 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 *AppRoleAssignment) GetResourceIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.ResourceId.Get(), o.ResourceId.IsSet()
}
// SetResourceId sets field value
func (o *AppRoleAssignment) SetResourceId(v string) {
o.ResourceId.Set(&v)
}
func (o AppRoleAssignment) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AppRoleAssignment) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.DeletedDateTime) {
toSerialize["deletedDateTime"] = o.DeletedDateTime
}
toSerialize["appRoleId"] = o.AppRoleId
if o.CreatedDateTime.IsSet() {
toSerialize["createdDateTime"] = o.CreatedDateTime.Get()
}
if o.PrincipalDisplayName.IsSet() {
toSerialize["principalDisplayName"] = o.PrincipalDisplayName.Get()
}
toSerialize["principalId"] = o.PrincipalId.Get()
if o.PrincipalType.IsSet() {
toSerialize["principalType"] = o.PrincipalType.Get()
}
if o.ResourceDisplayName.IsSet() {
toSerialize["resourceDisplayName"] = o.ResourceDisplayName.Get()
}
toSerialize["resourceId"] = o.ResourceId.Get()
return toSerialize, nil
}
func (o *AppRoleAssignment) UnmarshalJSON(data []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{
"appRoleId",
"principalId",
"resourceId",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(data, &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)
}
}
varAppRoleAssignment := _AppRoleAssignment{}
decoder := json.NewDecoder(bytes.NewReader(data))
decoder.DisallowUnknownFields()
err = decoder.Decode(&varAppRoleAssignment)
if err != nil {
return err
}
*o = AppRoleAssignment(varAppRoleAssignment)
return err
}
type NullableAppRoleAssignment struct {
value *AppRoleAssignment
isSet bool
}
func (v NullableAppRoleAssignment) Get() *AppRoleAssignment {
return v.value
}
func (v *NullableAppRoleAssignment) Set(val *AppRoleAssignment) {
v.value = val
v.isSet = true
}
func (v NullableAppRoleAssignment) IsSet() bool {
return v.isSet
}
func (v *NullableAppRoleAssignment) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAppRoleAssignment(val *AppRoleAssignment) *NullableAppRoleAssignment {
return &NullableAppRoleAssignment{value: val, isSet: true}
}
func (v NullableAppRoleAssignment) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAppRoleAssignment) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}