-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathdevice.go
1421 lines (1419 loc) · 56.2 KB
/
device.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
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package models
import (
i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time"
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
)
type Device struct {
DirectoryObject
}
// NewDevice instantiates a new Device and sets the default values.
func NewDevice()(*Device) {
m := &Device{
DirectoryObject: *NewDirectoryObject(),
}
odataTypeValue := "#microsoft.graph.device"
m.SetOdataType(&odataTypeValue)
return m
}
// CreateDeviceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value
// returns a Parsable when successful
func CreateDeviceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) {
return NewDevice(), nil
}
// GetAccountEnabled gets the accountEnabled property value. true if the account is enabled; otherwise, false. Required. Default is true. Supports $filter (eq, ne, not, in). Only callers with at least the Cloud Device Administrator role can set this property.
// returns a *bool when successful
func (m *Device) GetAccountEnabled()(*bool) {
val, err := m.GetBackingStore().Get("accountEnabled")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetAlternativeSecurityIds gets the alternativeSecurityIds property value. For internal use only. Not nullable. Supports $filter (eq, not, ge, le).
// returns a []AlternativeSecurityIdable when successful
func (m *Device) GetAlternativeSecurityIds()([]AlternativeSecurityIdable) {
val, err := m.GetBackingStore().Get("alternativeSecurityIds")
if err != nil {
panic(err)
}
if val != nil {
return val.([]AlternativeSecurityIdable)
}
return nil
}
// GetApproximateLastSignInDateTime gets the approximateLastSignInDateTime 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. Supports $filter (eq, ne, not, ge, le, and eq on null values) and $orderby.
// returns a *Time when successful
func (m *Device) GetApproximateLastSignInDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("approximateLastSignInDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetComplianceExpirationDateTime gets the complianceExpirationDateTime property value. The timestamp when the device is no longer deemed compliant. 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 *Device) GetComplianceExpirationDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("complianceExpirationDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetDeviceCategory gets the deviceCategory property value. User-defined property set by Intune to automatically add devices to groups and simplify managing devices.
// returns a *string when successful
func (m *Device) GetDeviceCategory()(*string) {
val, err := m.GetBackingStore().Get("deviceCategory")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDeviceId gets the deviceId property value. Unique identifier set by Azure Device Registration Service at the time of registration. This alternate key can be used to reference the device object. Supports $filter (eq, ne, not, startsWith).
// returns a *string when successful
func (m *Device) GetDeviceId()(*string) {
val, err := m.GetBackingStore().Get("deviceId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDeviceMetadata gets the deviceMetadata property value. For internal use only. Set to null.
// returns a *string when successful
func (m *Device) GetDeviceMetadata()(*string) {
val, err := m.GetBackingStore().Get("deviceMetadata")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDeviceOwnership gets the deviceOwnership property value. Ownership of the device. Intune sets this property. Possible values are: unknown, company, personal.
// returns a *string when successful
func (m *Device) GetDeviceOwnership()(*string) {
val, err := m.GetBackingStore().Get("deviceOwnership")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetDeviceVersion gets the deviceVersion property value. For internal use only.
// returns a *int32 when successful
func (m *Device) GetDeviceVersion()(*int32) {
val, err := m.GetBackingStore().Get("deviceVersion")
if err != nil {
panic(err)
}
if val != nil {
return val.(*int32)
}
return nil
}
// GetDisplayName gets the displayName property value. The display name for the device. Maximum length is 256 characters. Required. Supports $filter (eq, ne, not, ge, le, in, startsWith, and eq on null values), $search, and $orderby.
// returns a *string when successful
func (m *Device) GetDisplayName()(*string) {
val, err := m.GetBackingStore().Get("displayName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetEnrollmentProfileName gets the enrollmentProfileName property value. Enrollment profile applied to the device. For example, Apple Device Enrollment Profile, Device enrollment - Corporate device identifiers, or Windows Autopilot profile name. This property is set by Intune.
// returns a *string when successful
func (m *Device) GetEnrollmentProfileName()(*string) {
val, err := m.GetBackingStore().Get("enrollmentProfileName")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetEnrollmentType gets the enrollmentType property value. Enrollment type of the device. Intune sets this property. Possible values are: unknown, userEnrollment, deviceEnrollmentManager, appleBulkWithUser, appleBulkWithoutUser, windowsAzureADJoin, windowsBulkUserless, windowsAutoEnrollment, windowsBulkAzureDomainJoin, windowsCoManagement, windowsAzureADJoinUsingDeviceAuth,appleUserEnrollment, appleUserEnrollmentWithServiceAccount. NOTE: This property might return other values apart from those listed.
// returns a *string when successful
func (m *Device) GetEnrollmentType()(*string) {
val, err := m.GetBackingStore().Get("enrollmentType")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetExtensions gets the extensions property value. The collection of open extensions defined for the device. Read-only. Nullable.
// returns a []Extensionable when successful
func (m *Device) GetExtensions()([]Extensionable) {
val, err := m.GetBackingStore().Get("extensions")
if err != nil {
panic(err)
}
if val != nil {
return val.([]Extensionable)
}
return nil
}
// GetFieldDeserializers the deserialization information for the current model
// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful
func (m *Device) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) {
res := m.DirectoryObject.GetFieldDeserializers()
res["accountEnabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetAccountEnabled(val)
}
return nil
}
res["alternativeSecurityIds"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateAlternativeSecurityIdFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]AlternativeSecurityIdable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(AlternativeSecurityIdable)
}
}
m.SetAlternativeSecurityIds(res)
}
return nil
}
res["approximateLastSignInDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetApproximateLastSignInDateTime(val)
}
return nil
}
res["complianceExpirationDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetComplianceExpirationDateTime(val)
}
return nil
}
res["deviceCategory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceCategory(val)
}
return nil
}
res["deviceId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceId(val)
}
return nil
}
res["deviceMetadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceMetadata(val)
}
return nil
}
res["deviceOwnership"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetDeviceOwnership(val)
}
return nil
}
res["deviceVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetInt32Value()
if err != nil {
return err
}
if val != nil {
m.SetDeviceVersion(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["enrollmentProfileName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetEnrollmentProfileName(val)
}
return nil
}
res["enrollmentType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetEnrollmentType(val)
}
return nil
}
res["extensions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateExtensionFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]Extensionable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(Extensionable)
}
}
m.SetExtensions(res)
}
return nil
}
res["isCompliant"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsCompliant(val)
}
return nil
}
res["isManaged"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsManaged(val)
}
return nil
}
res["isManagementRestricted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsManagementRestricted(val)
}
return nil
}
res["isRooted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetIsRooted(val)
}
return nil
}
res["managementType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetManagementType(val)
}
return nil
}
res["manufacturer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetManufacturer(val)
}
return nil
}
res["mdmAppId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetMdmAppId(val)
}
return nil
}
res["memberOf"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateDirectoryObjectFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]DirectoryObjectable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(DirectoryObjectable)
}
}
m.SetMemberOf(res)
}
return nil
}
res["model"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetModel(val)
}
return nil
}
res["onPremisesLastSyncDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetOnPremisesLastSyncDateTime(val)
}
return nil
}
res["onPremisesSecurityIdentifier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOnPremisesSecurityIdentifier(val)
}
return nil
}
res["onPremisesSyncEnabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetBoolValue()
if err != nil {
return err
}
if val != nil {
m.SetOnPremisesSyncEnabled(val)
}
return nil
}
res["operatingSystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOperatingSystem(val)
}
return nil
}
res["operatingSystemVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetOperatingSystemVersion(val)
}
return nil
}
res["physicalIds"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfPrimitiveValues("string")
if err != nil {
return err
}
if val != nil {
res := make([]string, len(val))
for i, v := range val {
if v != nil {
res[i] = *(v.(*string))
}
}
m.SetPhysicalIds(res)
}
return nil
}
res["profileType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetProfileType(val)
}
return nil
}
res["registeredOwners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateDirectoryObjectFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]DirectoryObjectable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(DirectoryObjectable)
}
}
m.SetRegisteredOwners(res)
}
return nil
}
res["registeredUsers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateDirectoryObjectFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]DirectoryObjectable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(DirectoryObjectable)
}
}
m.SetRegisteredUsers(res)
}
return nil
}
res["registrationDateTime"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetTimeValue()
if err != nil {
return err
}
if val != nil {
m.SetRegistrationDateTime(val)
}
return nil
}
res["systemLabels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfPrimitiveValues("string")
if err != nil {
return err
}
if val != nil {
res := make([]string, len(val))
for i, v := range val {
if v != nil {
res[i] = *(v.(*string))
}
}
m.SetSystemLabels(res)
}
return nil
}
res["transitiveMemberOf"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetCollectionOfObjectValues(CreateDirectoryObjectFromDiscriminatorValue)
if err != nil {
return err
}
if val != nil {
res := make([]DirectoryObjectable, len(val))
for i, v := range val {
if v != nil {
res[i] = v.(DirectoryObjectable)
}
}
m.SetTransitiveMemberOf(res)
}
return nil
}
res["trustType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error {
val, err := n.GetStringValue()
if err != nil {
return err
}
if val != nil {
m.SetTrustType(val)
}
return nil
}
return res
}
// GetIsCompliant gets the isCompliant property value. true if the device complies with Mobile Device Management (MDM) policies; otherwise, false. Read-only. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).
// returns a *bool when successful
func (m *Device) GetIsCompliant()(*bool) {
val, err := m.GetBackingStore().Get("isCompliant")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetIsManaged gets the isManaged property value. true if the device is managed by a Mobile Device Management (MDM) app; otherwise, false. This can only be updated by Intune for any device OS type or by an approved MDM app for Windows OS devices. Supports $filter (eq, ne, not).
// returns a *bool when successful
func (m *Device) GetIsManaged()(*bool) {
val, err := m.GetBackingStore().Get("isManaged")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetIsManagementRestricted gets the isManagementRestricted property value. The isManagementRestricted property
// returns a *bool when successful
func (m *Device) GetIsManagementRestricted()(*bool) {
val, err := m.GetBackingStore().Get("isManagementRestricted")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetIsRooted gets the isRooted property value. true if the device is rooted or jail-broken. This property can only be updated by Intune.
// returns a *bool when successful
func (m *Device) GetIsRooted()(*bool) {
val, err := m.GetBackingStore().Get("isRooted")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetManagementType gets the managementType property value. The management channel of the device. This property is set by Intune. Possible values are: eas, mdm, easMdm, intuneClient, easIntuneClient, configurationManagerClient, configurationManagerClientMdm, configurationManagerClientMdmEas, unknown, jamf, googleCloudDevicePolicyController.
// returns a *string when successful
func (m *Device) GetManagementType()(*string) {
val, err := m.GetBackingStore().Get("managementType")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetManufacturer gets the manufacturer property value. Manufacturer of the device. Read-only.
// returns a *string when successful
func (m *Device) GetManufacturer()(*string) {
val, err := m.GetBackingStore().Get("manufacturer")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetMdmAppId gets the mdmAppId property value. Application identifier used to register device into MDM. Read-only. Supports $filter (eq, ne, not, startsWith).
// returns a *string when successful
func (m *Device) GetMdmAppId()(*string) {
val, err := m.GetBackingStore().Get("mdmAppId")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetMemberOf gets the memberOf property value. Groups and administrative units that this device is a member of. Read-only. Nullable. Supports $expand.
// returns a []DirectoryObjectable when successful
func (m *Device) GetMemberOf()([]DirectoryObjectable) {
val, err := m.GetBackingStore().Get("memberOf")
if err != nil {
panic(err)
}
if val != nil {
return val.([]DirectoryObjectable)
}
return nil
}
// GetModel gets the model property value. Model of the device. Read-only.
// returns a *string when successful
func (m *Device) GetModel()(*string) {
val, err := m.GetBackingStore().Get("model")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetOnPremisesLastSyncDateTime gets the onPremisesLastSyncDateTime property value. The last time at which the object was synced with the on-premises directory. 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. Supports $filter (eq, ne, not, ge, le, in).
// returns a *Time when successful
func (m *Device) GetOnPremisesLastSyncDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("onPremisesLastSyncDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetOnPremisesSecurityIdentifier gets the onPremisesSecurityIdentifier property value. The on-premises security identifier (SID) for the user who was synchronized from on-premises to the cloud. Read-only. Returned only on $select. Supports $filter (eq).
// returns a *string when successful
func (m *Device) GetOnPremisesSecurityIdentifier()(*string) {
val, err := m.GetBackingStore().Get("onPremisesSecurityIdentifier")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetOnPremisesSyncEnabled gets the onPremisesSyncEnabled property value. true if this object is synced from an on-premises directory; false if this object was originally synced from an on-premises directory but is no longer synced; null if this object has never been synced from an on-premises directory (default). Read-only. Supports $filter (eq, ne, not, in, and eq on null values).
// returns a *bool when successful
func (m *Device) GetOnPremisesSyncEnabled()(*bool) {
val, err := m.GetBackingStore().Get("onPremisesSyncEnabled")
if err != nil {
panic(err)
}
if val != nil {
return val.(*bool)
}
return nil
}
// GetOperatingSystem gets the operatingSystem property value. The type of operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).
// returns a *string when successful
func (m *Device) GetOperatingSystem()(*string) {
val, err := m.GetBackingStore().Get("operatingSystem")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetOperatingSystemVersion gets the operatingSystemVersion property value. The version of the operating system on the device. Required. Supports $filter (eq, ne, not, ge, le, startsWith, and eq on null values).
// returns a *string when successful
func (m *Device) GetOperatingSystemVersion()(*string) {
val, err := m.GetBackingStore().Get("operatingSystemVersion")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetPhysicalIds gets the physicalIds property value. For internal use only. Not nullable. Supports $filter (eq, not, ge, le, startsWith,/$count eq 0, /$count ne 0).
// returns a []string when successful
func (m *Device) GetPhysicalIds()([]string) {
val, err := m.GetBackingStore().Get("physicalIds")
if err != nil {
panic(err)
}
if val != nil {
return val.([]string)
}
return nil
}
// GetProfileType gets the profileType property value. The profile type of the device. Possible values: RegisteredDevice (default), SecureVM, Printer, Shared, IoT.
// returns a *string when successful
func (m *Device) GetProfileType()(*string) {
val, err := m.GetBackingStore().Get("profileType")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// GetRegisteredOwners gets the registeredOwners property value. The user that cloud joined the device or registered their personal device. The registered owner is set at the time of registration. Read-only. Nullable. Supports $expand.
// returns a []DirectoryObjectable when successful
func (m *Device) GetRegisteredOwners()([]DirectoryObjectable) {
val, err := m.GetBackingStore().Get("registeredOwners")
if err != nil {
panic(err)
}
if val != nil {
return val.([]DirectoryObjectable)
}
return nil
}
// GetRegisteredUsers gets the registeredUsers property value. Collection of registered users of the device. For cloud joined devices and registered personal devices, registered users are set to the same value as registered owners at the time of registration. Read-only. Nullable. Supports $expand.
// returns a []DirectoryObjectable when successful
func (m *Device) GetRegisteredUsers()([]DirectoryObjectable) {
val, err := m.GetBackingStore().Get("registeredUsers")
if err != nil {
panic(err)
}
if val != nil {
return val.([]DirectoryObjectable)
}
return nil
}
// GetRegistrationDateTime gets the registrationDateTime property value. Date and time of when the device was registered. 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 *Device) GetRegistrationDateTime()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) {
val, err := m.GetBackingStore().Get("registrationDateTime")
if err != nil {
panic(err)
}
if val != nil {
return val.(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)
}
return nil
}
// GetSystemLabels gets the systemLabels property value. List of labels applied to the device by the system. Supports $filter (/$count eq 0, /$count ne 0).
// returns a []string when successful
func (m *Device) GetSystemLabels()([]string) {
val, err := m.GetBackingStore().Get("systemLabels")
if err != nil {
panic(err)
}
if val != nil {
return val.([]string)
}
return nil
}
// GetTransitiveMemberOf gets the transitiveMemberOf property value. Groups and administrative units that the device is a member of. This operation is transitive. Supports $expand.
// returns a []DirectoryObjectable when successful
func (m *Device) GetTransitiveMemberOf()([]DirectoryObjectable) {
val, err := m.GetBackingStore().Get("transitiveMemberOf")
if err != nil {
panic(err)
}
if val != nil {
return val.([]DirectoryObjectable)
}
return nil
}
// GetTrustType gets the trustType property value. Type of trust for the joined device. Read-only. Possible values: Workplace (indicates bring your own personal devices), AzureAd (Cloud-only joined devices), ServerAd (on-premises domain joined devices joined to Microsoft Entra ID). For more information, see Introduction to device management in Microsoft Entra ID. Supports $filter (eq, ne, not, in).
// returns a *string when successful
func (m *Device) GetTrustType()(*string) {
val, err := m.GetBackingStore().Get("trustType")
if err != nil {
panic(err)
}
if val != nil {
return val.(*string)
}
return nil
}
// Serialize serializes information the current object
func (m *Device) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) {
err := m.DirectoryObject.Serialize(writer)
if err != nil {
return err
}
{
err = writer.WriteBoolValue("accountEnabled", m.GetAccountEnabled())
if err != nil {
return err
}
}
if m.GetAlternativeSecurityIds() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAlternativeSecurityIds()))
for i, v := range m.GetAlternativeSecurityIds() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("alternativeSecurityIds", cast)
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("approximateLastSignInDateTime", m.GetApproximateLastSignInDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteTimeValue("complianceExpirationDateTime", m.GetComplianceExpirationDateTime())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("deviceCategory", m.GetDeviceCategory())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("deviceId", m.GetDeviceId())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("deviceMetadata", m.GetDeviceMetadata())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("deviceOwnership", m.GetDeviceOwnership())
if err != nil {
return err
}
}
{
err = writer.WriteInt32Value("deviceVersion", m.GetDeviceVersion())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("displayName", m.GetDisplayName())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("enrollmentProfileName", m.GetEnrollmentProfileName())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("enrollmentType", m.GetEnrollmentType())
if err != nil {
return err
}
}
if m.GetExtensions() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetExtensions()))
for i, v := range m.GetExtensions() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("extensions", cast)
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isCompliant", m.GetIsCompliant())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isManaged", m.GetIsManaged())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isManagementRestricted", m.GetIsManagementRestricted())
if err != nil {
return err
}
}
{
err = writer.WriteBoolValue("isRooted", m.GetIsRooted())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("managementType", m.GetManagementType())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("manufacturer", m.GetManufacturer())
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("mdmAppId", m.GetMdmAppId())
if err != nil {
return err
}
}
if m.GetMemberOf() != nil {
cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMemberOf()))
for i, v := range m.GetMemberOf() {
if v != nil {
cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable)
}
}
err = writer.WriteCollectionOfObjectValues("memberOf", cast)
if err != nil {
return err
}
}
{
err = writer.WriteStringValue("model", m.GetModel())