-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathaccess_package_resource.go
446 lines (444 loc) · 17.4 KB
/
access_package_resource.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
package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
type AccessPackageResource struct {
Entity
}
// NewAccessPackageResource instantiates a new AccessPackageResource and sets the default values.
func NewAccessPackageResource()(*AccessPackageResource) {
m := &AccessPackageResource{
Entity: *NewEntity(),
}
return m
}
// CreateAccessPackageResourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateAccessPackageResourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewAccessPackageResource(), nil
}
// GetAttributes gets the attributes property value. Contains information about the attributes to be collected from the requestor and sent to the resource application.
// returns a []AccessPackageResourceAttributeable when successful
func (m *AccessPackageResource) GetAttributes()([]AccessPackageResourceAttributeable) {
val, err := m.GetBackingStore().Get("attributes")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AccessPackageResourceAttributeable)
}
return nil
}
// GetCreatedDateTime gets the createdDateTime property value. 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.
// returns a *Time when successful
func (m *AccessPackageResource) GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("createdDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetDescription gets the description property value. A description for the resource.
// returns a *string when successful
func (m *AccessPackageResource) GetDescription()(*string) {
val, err := m.GetBackingStore().Get("description")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDisplayName gets the displayName property value. The display name of the resource, such as the application name, group name or site name.
// returns a *string when successful
func (m *AccessPackageResource) GetDisplayName()(*string) {
val, err := m.GetBackingStore().Get("displayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetEnvironment gets the environment property value. Contains the environment information for the resource. This can be set using either the @odata.bind annotation or the environment's originId.Supports $expand.
// returns a AccessPackageResourceEnvironmentable when successful
func (m *AccessPackageResource) GetEnvironment()(AccessPackageResourceEnvironmentable) {
val, err := m.GetBackingStore().Get("environment")
if err != nil {
panic(err)
}
if val != nil {
return val.(AccessPackageResourceEnvironmentable)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *AccessPackageResource) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.Entity.GetFieldDeserializers()
res["attributes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAccessPackageResourceAttributeFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AccessPackageResourceAttributeable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AccessPackageResourceAttributeable)
}
}
m.SetAttributes(res)
}
return nil
}
res["createdDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetCreatedDateTime(val)
}
return nil
}
res["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDescription(val)
}
return nil
}
res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDisplayName(val)
}
return nil
}
res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetObjectValue(CreateAccessPackageResourceEnvironmentFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
m.SetEnvironment(val.(AccessPackageResourceEnvironmentable))
}
return nil
}
res["modifiedDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetModifiedDateTime(val)
}
return nil
}
res["originId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOriginId(val)
}
return nil
}
res["originSystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOriginSystem(val)
}
return nil
}
res["roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAccessPackageResourceRoleFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AccessPackageResourceRoleable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AccessPackageResourceRoleable)
}
}
m.SetRoles(res)
}
return nil
}
res["scopes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAccessPackageResourceScopeFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AccessPackageResourceScopeable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AccessPackageResourceScopeable)
}
}
m.SetScopes(res)
}
return nil
}
return res
}
// GetModifiedDateTime gets the modifiedDateTime property value. 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.
// returns a *Time when successful
func (m *AccessPackageResource) GetModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("modifiedDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetOriginId gets the originId property value. The unique identifier of the resource in the origin system. For a Microsoft Entra group, this is the identifier of the group.
// returns a *string when successful
func (m *AccessPackageResource) GetOriginId()(*string) {
val, err := m.GetBackingStore().Get("originId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetOriginSystem gets the originSystem property value. The type of the resource in the origin system, such as SharePointOnline, AadApplication or AadGroup.
// returns a *string when successful
func (m *AccessPackageResource) GetOriginSystem()(*string) {
val, err := m.GetBackingStore().Get("originSystem")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetRoles gets the roles property value. Read-only. Nullable. Supports $expand.
// returns a []AccessPackageResourceRoleable when successful
func (m *AccessPackageResource) GetRoles()([]AccessPackageResourceRoleable) {
val, err := m.GetBackingStore().Get("roles")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AccessPackageResourceRoleable)
}
return nil
}
// GetScopes gets the scopes property value. Read-only. Nullable. Supports $expand.
// returns a []AccessPackageResourceScopeable when successful
func (m *AccessPackageResource) GetScopes()([]AccessPackageResourceScopeable) {
val, err := m.GetBackingStore().Get("scopes")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AccessPackageResourceScopeable)
}
return nil
}
// Serialize serializes information the current object
func (m *AccessPackageResource) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.Entity.Serialize(writer)
if err != nil {
return err
}
if m.GetAttributes() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAttributes()))
for i, v := range m.GetAttributes() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("attributes", cast)
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("createdDateTime", m.GetCreatedDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("description", m.GetDescription())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("displayName", m.GetDisplayName())
if err != nil {
return err
}
}
{
err = writer.WriteObjectValue("environment", m.GetEnvironment())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("modifiedDateTime", m.GetModifiedDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("originId", m.GetOriginId())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("originSystem", m.GetOriginSystem())
if err != nil {
return err
}
}
if m.GetRoles() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRoles()))
for i, v := range m.GetRoles() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("roles", cast)
if err != nil {
return err
}
}
if m.GetScopes() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetScopes()))
for i, v := range m.GetScopes() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("scopes", cast)
if err != nil {
return err
}
}
return nil
}
// SetAttributes sets the attributes property value. Contains information about the attributes to be collected from the requestor and sent to the resource application.
func (m *AccessPackageResource) SetAttributes(value []AccessPackageResourceAttributeable)() {
err := m.GetBackingStore().Set("attributes", value)
if err != nil {
panic(err)
}
}
// SetCreatedDateTime sets the createdDateTime property value. 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.
func (m *AccessPackageResource) SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("createdDateTime", value)
if err != nil {
panic(err)
}
}
// SetDescription sets the description property value. A description for the resource.
func (m *AccessPackageResource) SetDescription(value *string)() {
err := m.GetBackingStore().Set("description", value)
if err != nil {
panic(err)
}
}
// SetDisplayName sets the displayName property value. The display name of the resource, such as the application name, group name or site name.
func (m *AccessPackageResource) SetDisplayName(value *string)() {
err := m.GetBackingStore().Set("displayName", value)
if err != nil {
panic(err)
}
}
// SetEnvironment sets the environment property value. Contains the environment information for the resource. This can be set using either the @odata.bind annotation or the environment's originId.Supports $expand.
func (m *AccessPackageResource) SetEnvironment(value AccessPackageResourceEnvironmentable)() {
err := m.GetBackingStore().Set("environment", value)
if err != nil {
panic(err)
}
}
// SetModifiedDateTime sets the modifiedDateTime property value. 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.
func (m *AccessPackageResource) SetModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() {
err := m.GetBackingStore().Set("modifiedDateTime", value)
if err != nil {
panic(err)
}
}
// SetOriginId sets the originId property value. The unique identifier of the resource in the origin system. For a Microsoft Entra group, this is the identifier of the group.
func (m *AccessPackageResource) SetOriginId(value *string)() {
err := m.GetBackingStore().Set("originId", value)
if err != nil {
panic(err)
}
}
// SetOriginSystem sets the originSystem property value. The type of the resource in the origin system, such as SharePointOnline, AadApplication or AadGroup.
func (m *AccessPackageResource) SetOriginSystem(value *string)() {
err := m.GetBackingStore().Set("originSystem", value)
if err != nil {
panic(err)
}
}
// SetRoles sets the roles property value. Read-only. Nullable. Supports $expand.
func (m *AccessPackageResource) SetRoles(value []AccessPackageResourceRoleable)() {
err := m.GetBackingStore().Set("roles", value)
if err != nil {
panic(err)
}
}
// SetScopes sets the scopes property value. Read-only. Nullable. Supports $expand.
func (m *AccessPackageResource) SetScopes(value []AccessPackageResourceScopeable)() {
err := m.GetBackingStore().Set("scopes", value)
if err != nil {
panic(err)
}
}
type AccessPackageResourceable interface {
Entityable
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable
GetAttributes()([]AccessPackageResourceAttributeable)
GetCreatedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetDescription()(*string)
GetDisplayName()(*string)
GetEnvironment()(AccessPackageResourceEnvironmentable)
GetModifiedDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
GetOriginId()(*string)
GetOriginSystem()(*string)
GetRoles()([]AccessPackageResourceRoleable)
GetScopes()([]AccessPackageResourceScopeable)
SetAttributes(value []AccessPackageResourceAttributeable)()
SetCreatedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetDescription(value *string)()
SetDisplayName(value *string)()
SetEnvironment(value AccessPackageResourceEnvironmentable)()
SetModifiedDateTime(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)()
SetOriginId(value *string)()
SetOriginSystem(value *string)()
SetRoles(value []AccessPackageResourceRoleable)()
SetScopes(value []AccessPackageResourceScopeable)()
}