forked from Azure/azure-sdk-for-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
4669 lines (4402 loc) · 156 KB
/
models.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 graphrbac
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/graphrbac/1.6/graphrbac"
// AddOwnerParameters request parameters for adding a owner to an application.
type AddOwnerParameters struct {
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]interface{} `json:""`
// URL - A owner object URL, such as "https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd", where "0b1f9851-1bf0-433f-aec3-cb9272f093dc" is the tenantId and "f260bbc4-c254-447b-94cf-293b5ec434dd" is the objectId of the owner (user, application, servicePrincipal, group) to be added.
URL *string `json:"url,omitempty"`
}
// MarshalJSON is the custom marshaler for AddOwnerParameters.
func (aop AddOwnerParameters) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if aop.URL != nil {
objectMap["url"] = aop.URL
}
for k, v := range aop.AdditionalProperties {
objectMap[k] = v
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for AddOwnerParameters struct.
func (aop *AddOwnerParameters) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
default:
if v != nil {
var additionalProperties interface{}
err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
if aop.AdditionalProperties == nil {
aop.AdditionalProperties = make(map[string]interface{})
}
aop.AdditionalProperties[k] = additionalProperties
}
case "url":
if v != nil {
var URL string
err = json.Unmarshal(*v, &URL)
if err != nil {
return err
}
aop.URL = &URL
}
}
}
return nil
}
// ADGroup active Directory group information.
type ADGroup struct {
autorest.Response `json:"-"`
// DisplayName - The display name of the group.
DisplayName *string `json:"displayName,omitempty"`
// MailEnabled - Whether the group is mail-enabled. Must be false. This is because only pure security groups can be created using the Graph API.
MailEnabled *bool `json:"mailEnabled,omitempty"`
// MailNickname - The mail alias for the group.
MailNickname *string `json:"mailNickname,omitempty"`
// SecurityEnabled - Whether the group is security-enable.
SecurityEnabled *bool `json:"securityEnabled,omitempty"`
// Mail - The primary email address of the group.
Mail *string `json:"mail,omitempty"`
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]interface{} `json:""`
// ObjectID - READ-ONLY; The object ID.
ObjectID *string `json:"objectId,omitempty"`
// DeletionTimestamp - READ-ONLY; The time at which the directory object was deleted.
DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"`
// ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser'
ObjectType ObjectType `json:"objectType,omitempty"`
}
// MarshalJSON is the custom marshaler for ADGroup.
func (ag ADGroup) MarshalJSON() ([]byte, error) {
ag.ObjectType = ObjectTypeGroup
objectMap := make(map[string]interface{})
if ag.DisplayName != nil {
objectMap["displayName"] = ag.DisplayName
}
if ag.MailEnabled != nil {
objectMap["mailEnabled"] = ag.MailEnabled
}
if ag.MailNickname != nil {
objectMap["mailNickname"] = ag.MailNickname
}
if ag.SecurityEnabled != nil {
objectMap["securityEnabled"] = ag.SecurityEnabled
}
if ag.Mail != nil {
objectMap["mail"] = ag.Mail
}
if ag.ObjectType != "" {
objectMap["objectType"] = ag.ObjectType
}
for k, v := range ag.AdditionalProperties {
objectMap[k] = v
}
return json.Marshal(objectMap)
}
// AsApplication is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsApplication() (*Application, bool) {
return nil, false
}
// AsADGroup is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsADGroup() (*ADGroup, bool) {
return &ag, true
}
// AsServicePrincipal is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsServicePrincipal() (*ServicePrincipal, bool) {
return nil, false
}
// AsUser is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsUser() (*User, bool) {
return nil, false
}
// AsDirectoryObject is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsDirectoryObject() (*DirectoryObject, bool) {
return nil, false
}
// AsBasicDirectoryObject is the BasicDirectoryObject implementation for ADGroup.
func (ag ADGroup) AsBasicDirectoryObject() (BasicDirectoryObject, bool) {
return &ag, true
}
// UnmarshalJSON is the custom unmarshaler for ADGroup struct.
func (ag *ADGroup) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "displayName":
if v != nil {
var displayName string
err = json.Unmarshal(*v, &displayName)
if err != nil {
return err
}
ag.DisplayName = &displayName
}
case "mailEnabled":
if v != nil {
var mailEnabled bool
err = json.Unmarshal(*v, &mailEnabled)
if err != nil {
return err
}
ag.MailEnabled = &mailEnabled
}
case "mailNickname":
if v != nil {
var mailNickname string
err = json.Unmarshal(*v, &mailNickname)
if err != nil {
return err
}
ag.MailNickname = &mailNickname
}
case "securityEnabled":
if v != nil {
var securityEnabled bool
err = json.Unmarshal(*v, &securityEnabled)
if err != nil {
return err
}
ag.SecurityEnabled = &securityEnabled
}
case "mail":
if v != nil {
var mailVar string
err = json.Unmarshal(*v, &mailVar)
if err != nil {
return err
}
ag.Mail = &mailVar
}
default:
if v != nil {
var additionalProperties interface{}
err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
if ag.AdditionalProperties == nil {
ag.AdditionalProperties = make(map[string]interface{})
}
ag.AdditionalProperties[k] = additionalProperties
}
case "objectId":
if v != nil {
var objectID string
err = json.Unmarshal(*v, &objectID)
if err != nil {
return err
}
ag.ObjectID = &objectID
}
case "deletionTimestamp":
if v != nil {
var deletionTimestamp date.Time
err = json.Unmarshal(*v, &deletionTimestamp)
if err != nil {
return err
}
ag.DeletionTimestamp = &deletionTimestamp
}
case "objectType":
if v != nil {
var objectType ObjectType
err = json.Unmarshal(*v, &objectType)
if err != nil {
return err
}
ag.ObjectType = objectType
}
}
}
return nil
}
// Application active Directory application information.
type Application struct {
autorest.Response `json:"-"`
// AppID - The application ID.
AppID *string `json:"appId,omitempty"`
// AllowGuestsSignIn - A property on the application to indicate if the application accepts other IDPs or not or partially accepts.
AllowGuestsSignIn *bool `json:"allowGuestsSignIn,omitempty"`
// AllowPassthroughUsers - Indicates that the application supports pass through users who have no presence in the resource tenant.
AllowPassthroughUsers *bool `json:"allowPassthroughUsers,omitempty"`
// AppLogoURL - The url for the application logo image stored in a CDN.
AppLogoURL *string `json:"appLogoUrl,omitempty"`
// AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals.
AppRoles *[]AppRole `json:"appRoles,omitempty"`
// AppPermissions - The application permissions.
AppPermissions *[]string `json:"appPermissions,omitempty"`
// AvailableToOtherTenants - Whether the application is available to other tenants.
AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"`
// DisplayName - The display name of the application.
DisplayName *string `json:"displayName,omitempty"`
// ErrorURL - A URL provided by the author of the application to report errors when using the application.
ErrorURL *string `json:"errorUrl,omitempty"`
// GroupMembershipClaims - Configures the groups claim issued in a user or OAuth 2.0 access token that the app expects. Possible values include: 'None', 'SecurityGroup', 'All'
GroupMembershipClaims GroupMembershipClaimTypes `json:"groupMembershipClaims,omitempty"`
// Homepage - The home page of the application.
Homepage *string `json:"homepage,omitempty"`
// IdentifierUris - A collection of URIs for the application.
IdentifierUris *[]string `json:"identifierUris,omitempty"`
// InformationalUrls - URLs with more information about the application.
InformationalUrls *InformationalURL `json:"informationalUrls,omitempty"`
// IsDeviceOnlyAuthSupported - Specifies whether this application supports device authentication without a user. The default is false.
IsDeviceOnlyAuthSupported *bool `json:"isDeviceOnlyAuthSupported,omitempty"`
// KeyCredentials - A collection of KeyCredential objects.
KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"`
// KnownClientApplications - Client applications that are tied to this resource application. Consent to any of the known client applications will result in implicit consent to the resource application through a combined consent dialog (showing the OAuth permission scopes required by the client and the resource).
KnownClientApplications *[]string `json:"knownClientApplications,omitempty"`
// LogoutURL - the url of the logout page
LogoutURL *string `json:"logoutUrl,omitempty"`
// Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2
Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"`
// Oauth2AllowURLPathMatching - Specifies whether during a token Request Azure AD will allow path matching of the redirect URI against the applications collection of replyURLs. The default is false.
Oauth2AllowURLPathMatching *bool `json:"oauth2AllowUrlPathMatching,omitempty"`
// Oauth2Permissions - The collection of OAuth 2.0 permission scopes that the web API (resource) application exposes to client applications. These permission scopes may be granted to client applications during consent.
Oauth2Permissions *[]OAuth2Permission `json:"oauth2Permissions,omitempty"`
// Oauth2RequirePostResponse - Specifies whether, as part of OAuth 2.0 token requests, Azure AD will allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests will be allowed.
Oauth2RequirePostResponse *bool `json:"oauth2RequirePostResponse,omitempty"`
// OrgRestrictions - A list of tenants allowed to access application.
OrgRestrictions *[]string `json:"orgRestrictions,omitempty"`
OptionalClaims *OptionalClaims `json:"optionalClaims,omitempty"`
// PasswordCredentials - A collection of PasswordCredential objects
PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"`
// PreAuthorizedApplications - list of pre-authorized applications.
PreAuthorizedApplications *[]PreAuthorizedApplication `json:"preAuthorizedApplications,omitempty"`
// PublicClient - Specifies whether this application is a public client (such as an installed application running on a mobile device). Default is false.
PublicClient *bool `json:"publicClient,omitempty"`
// PublisherDomain - Reliable domain which can be used to identify an application.
PublisherDomain *string `json:"publisherDomain,omitempty"`
// ReplyUrls - A collection of reply URLs for the application.
ReplyUrls *[]string `json:"replyUrls,omitempty"`
// RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience.
RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"`
// SamlMetadataURL - The URL to the SAML metadata for the application.
SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"`
// SignInAudience - Audience for signing in to the application (AzureADMyOrganization, AzureADAllOrganizations, AzureADAndMicrosoftAccounts).
SignInAudience *string `json:"signInAudience,omitempty"`
// WwwHomepage - The primary Web page.
WwwHomepage *string `json:"wwwHomepage,omitempty"`
// AdditionalProperties - Unmatched properties from the message are deserialized this collection
AdditionalProperties map[string]interface{} `json:""`
// ObjectID - READ-ONLY; The object ID.
ObjectID *string `json:"objectId,omitempty"`
// DeletionTimestamp - READ-ONLY; The time at which the directory object was deleted.
DeletionTimestamp *date.Time `json:"deletionTimestamp,omitempty"`
// ObjectType - Possible values include: 'ObjectTypeDirectoryObject', 'ObjectTypeApplication', 'ObjectTypeGroup', 'ObjectTypeServicePrincipal', 'ObjectTypeUser'
ObjectType ObjectType `json:"objectType,omitempty"`
}
// MarshalJSON is the custom marshaler for Application.
func (a Application) MarshalJSON() ([]byte, error) {
a.ObjectType = ObjectTypeApplication
objectMap := make(map[string]interface{})
if a.AppID != nil {
objectMap["appId"] = a.AppID
}
if a.AllowGuestsSignIn != nil {
objectMap["allowGuestsSignIn"] = a.AllowGuestsSignIn
}
if a.AllowPassthroughUsers != nil {
objectMap["allowPassthroughUsers"] = a.AllowPassthroughUsers
}
if a.AppLogoURL != nil {
objectMap["appLogoUrl"] = a.AppLogoURL
}
if a.AppRoles != nil {
objectMap["appRoles"] = a.AppRoles
}
if a.AppPermissions != nil {
objectMap["appPermissions"] = a.AppPermissions
}
if a.AvailableToOtherTenants != nil {
objectMap["availableToOtherTenants"] = a.AvailableToOtherTenants
}
if a.DisplayName != nil {
objectMap["displayName"] = a.DisplayName
}
if a.ErrorURL != nil {
objectMap["errorUrl"] = a.ErrorURL
}
if a.GroupMembershipClaims != "" {
objectMap["groupMembershipClaims"] = a.GroupMembershipClaims
}
if a.Homepage != nil {
objectMap["homepage"] = a.Homepage
}
if a.IdentifierUris != nil {
objectMap["identifierUris"] = a.IdentifierUris
}
if a.InformationalUrls != nil {
objectMap["informationalUrls"] = a.InformationalUrls
}
if a.IsDeviceOnlyAuthSupported != nil {
objectMap["isDeviceOnlyAuthSupported"] = a.IsDeviceOnlyAuthSupported
}
if a.KeyCredentials != nil {
objectMap["keyCredentials"] = a.KeyCredentials
}
if a.KnownClientApplications != nil {
objectMap["knownClientApplications"] = a.KnownClientApplications
}
if a.LogoutURL != nil {
objectMap["logoutUrl"] = a.LogoutURL
}
if a.Oauth2AllowImplicitFlow != nil {
objectMap["oauth2AllowImplicitFlow"] = a.Oauth2AllowImplicitFlow
}
if a.Oauth2AllowURLPathMatching != nil {
objectMap["oauth2AllowUrlPathMatching"] = a.Oauth2AllowURLPathMatching
}
if a.Oauth2Permissions != nil {
objectMap["oauth2Permissions"] = a.Oauth2Permissions
}
if a.Oauth2RequirePostResponse != nil {
objectMap["oauth2RequirePostResponse"] = a.Oauth2RequirePostResponse
}
if a.OrgRestrictions != nil {
objectMap["orgRestrictions"] = a.OrgRestrictions
}
if a.OptionalClaims != nil {
objectMap["optionalClaims"] = a.OptionalClaims
}
if a.PasswordCredentials != nil {
objectMap["passwordCredentials"] = a.PasswordCredentials
}
if a.PreAuthorizedApplications != nil {
objectMap["preAuthorizedApplications"] = a.PreAuthorizedApplications
}
if a.PublicClient != nil {
objectMap["publicClient"] = a.PublicClient
}
if a.PublisherDomain != nil {
objectMap["publisherDomain"] = a.PublisherDomain
}
if a.ReplyUrls != nil {
objectMap["replyUrls"] = a.ReplyUrls
}
if a.RequiredResourceAccess != nil {
objectMap["requiredResourceAccess"] = a.RequiredResourceAccess
}
if a.SamlMetadataURL != nil {
objectMap["samlMetadataUrl"] = a.SamlMetadataURL
}
if a.SignInAudience != nil {
objectMap["signInAudience"] = a.SignInAudience
}
if a.WwwHomepage != nil {
objectMap["wwwHomepage"] = a.WwwHomepage
}
if a.ObjectType != "" {
objectMap["objectType"] = a.ObjectType
}
for k, v := range a.AdditionalProperties {
objectMap[k] = v
}
return json.Marshal(objectMap)
}
// AsApplication is the BasicDirectoryObject implementation for Application.
func (a Application) AsApplication() (*Application, bool) {
return &a, true
}
// AsADGroup is the BasicDirectoryObject implementation for Application.
func (a Application) AsADGroup() (*ADGroup, bool) {
return nil, false
}
// AsServicePrincipal is the BasicDirectoryObject implementation for Application.
func (a Application) AsServicePrincipal() (*ServicePrincipal, bool) {
return nil, false
}
// AsUser is the BasicDirectoryObject implementation for Application.
func (a Application) AsUser() (*User, bool) {
return nil, false
}
// AsDirectoryObject is the BasicDirectoryObject implementation for Application.
func (a Application) AsDirectoryObject() (*DirectoryObject, bool) {
return nil, false
}
// AsBasicDirectoryObject is the BasicDirectoryObject implementation for Application.
func (a Application) AsBasicDirectoryObject() (BasicDirectoryObject, bool) {
return &a, true
}
// UnmarshalJSON is the custom unmarshaler for Application struct.
func (a *Application) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "appId":
if v != nil {
var appID string
err = json.Unmarshal(*v, &appID)
if err != nil {
return err
}
a.AppID = &appID
}
case "allowGuestsSignIn":
if v != nil {
var allowGuestsSignIn bool
err = json.Unmarshal(*v, &allowGuestsSignIn)
if err != nil {
return err
}
a.AllowGuestsSignIn = &allowGuestsSignIn
}
case "allowPassthroughUsers":
if v != nil {
var allowPassthroughUsers bool
err = json.Unmarshal(*v, &allowPassthroughUsers)
if err != nil {
return err
}
a.AllowPassthroughUsers = &allowPassthroughUsers
}
case "appLogoUrl":
if v != nil {
var appLogoURL string
err = json.Unmarshal(*v, &appLogoURL)
if err != nil {
return err
}
a.AppLogoURL = &appLogoURL
}
case "appRoles":
if v != nil {
var appRoles []AppRole
err = json.Unmarshal(*v, &appRoles)
if err != nil {
return err
}
a.AppRoles = &appRoles
}
case "appPermissions":
if v != nil {
var appPermissions []string
err = json.Unmarshal(*v, &appPermissions)
if err != nil {
return err
}
a.AppPermissions = &appPermissions
}
case "availableToOtherTenants":
if v != nil {
var availableToOtherTenants bool
err = json.Unmarshal(*v, &availableToOtherTenants)
if err != nil {
return err
}
a.AvailableToOtherTenants = &availableToOtherTenants
}
case "displayName":
if v != nil {
var displayName string
err = json.Unmarshal(*v, &displayName)
if err != nil {
return err
}
a.DisplayName = &displayName
}
case "errorUrl":
if v != nil {
var errorURL string
err = json.Unmarshal(*v, &errorURL)
if err != nil {
return err
}
a.ErrorURL = &errorURL
}
case "groupMembershipClaims":
if v != nil {
var groupMembershipClaims GroupMembershipClaimTypes
err = json.Unmarshal(*v, &groupMembershipClaims)
if err != nil {
return err
}
a.GroupMembershipClaims = groupMembershipClaims
}
case "homepage":
if v != nil {
var homepage string
err = json.Unmarshal(*v, &homepage)
if err != nil {
return err
}
a.Homepage = &homepage
}
case "identifierUris":
if v != nil {
var identifierUris []string
err = json.Unmarshal(*v, &identifierUris)
if err != nil {
return err
}
a.IdentifierUris = &identifierUris
}
case "informationalUrls":
if v != nil {
var informationalUrls InformationalURL
err = json.Unmarshal(*v, &informationalUrls)
if err != nil {
return err
}
a.InformationalUrls = &informationalUrls
}
case "isDeviceOnlyAuthSupported":
if v != nil {
var isDeviceOnlyAuthSupported bool
err = json.Unmarshal(*v, &isDeviceOnlyAuthSupported)
if err != nil {
return err
}
a.IsDeviceOnlyAuthSupported = &isDeviceOnlyAuthSupported
}
case "keyCredentials":
if v != nil {
var keyCredentials []KeyCredential
err = json.Unmarshal(*v, &keyCredentials)
if err != nil {
return err
}
a.KeyCredentials = &keyCredentials
}
case "knownClientApplications":
if v != nil {
var knownClientApplications []string
err = json.Unmarshal(*v, &knownClientApplications)
if err != nil {
return err
}
a.KnownClientApplications = &knownClientApplications
}
case "logoutUrl":
if v != nil {
var logoutURL string
err = json.Unmarshal(*v, &logoutURL)
if err != nil {
return err
}
a.LogoutURL = &logoutURL
}
case "oauth2AllowImplicitFlow":
if v != nil {
var oauth2AllowImplicitFlow bool
err = json.Unmarshal(*v, &oauth2AllowImplicitFlow)
if err != nil {
return err
}
a.Oauth2AllowImplicitFlow = &oauth2AllowImplicitFlow
}
case "oauth2AllowUrlPathMatching":
if v != nil {
var oauth2AllowURLPathMatching bool
err = json.Unmarshal(*v, &oauth2AllowURLPathMatching)
if err != nil {
return err
}
a.Oauth2AllowURLPathMatching = &oauth2AllowURLPathMatching
}
case "oauth2Permissions":
if v != nil {
var oauth2Permissions []OAuth2Permission
err = json.Unmarshal(*v, &oauth2Permissions)
if err != nil {
return err
}
a.Oauth2Permissions = &oauth2Permissions
}
case "oauth2RequirePostResponse":
if v != nil {
var oauth2RequirePostResponse bool
err = json.Unmarshal(*v, &oauth2RequirePostResponse)
if err != nil {
return err
}
a.Oauth2RequirePostResponse = &oauth2RequirePostResponse
}
case "orgRestrictions":
if v != nil {
var orgRestrictions []string
err = json.Unmarshal(*v, &orgRestrictions)
if err != nil {
return err
}
a.OrgRestrictions = &orgRestrictions
}
case "optionalClaims":
if v != nil {
var optionalClaims OptionalClaims
err = json.Unmarshal(*v, &optionalClaims)
if err != nil {
return err
}
a.OptionalClaims = &optionalClaims
}
case "passwordCredentials":
if v != nil {
var passwordCredentials []PasswordCredential
err = json.Unmarshal(*v, &passwordCredentials)
if err != nil {
return err
}
a.PasswordCredentials = &passwordCredentials
}
case "preAuthorizedApplications":
if v != nil {
var preAuthorizedApplications []PreAuthorizedApplication
err = json.Unmarshal(*v, &preAuthorizedApplications)
if err != nil {
return err
}
a.PreAuthorizedApplications = &preAuthorizedApplications
}
case "publicClient":
if v != nil {
var publicClient bool
err = json.Unmarshal(*v, &publicClient)
if err != nil {
return err
}
a.PublicClient = &publicClient
}
case "publisherDomain":
if v != nil {
var publisherDomain string
err = json.Unmarshal(*v, &publisherDomain)
if err != nil {
return err
}
a.PublisherDomain = &publisherDomain
}
case "replyUrls":
if v != nil {
var replyUrls []string
err = json.Unmarshal(*v, &replyUrls)
if err != nil {
return err
}
a.ReplyUrls = &replyUrls
}
case "requiredResourceAccess":
if v != nil {
var requiredResourceAccess []RequiredResourceAccess
err = json.Unmarshal(*v, &requiredResourceAccess)
if err != nil {
return err
}
a.RequiredResourceAccess = &requiredResourceAccess
}
case "samlMetadataUrl":
if v != nil {
var samlMetadataURL string
err = json.Unmarshal(*v, &samlMetadataURL)
if err != nil {
return err
}
a.SamlMetadataURL = &samlMetadataURL
}
case "signInAudience":
if v != nil {
var signInAudience string
err = json.Unmarshal(*v, &signInAudience)
if err != nil {
return err
}
a.SignInAudience = &signInAudience
}
case "wwwHomepage":
if v != nil {
var wwwHomepage string
err = json.Unmarshal(*v, &wwwHomepage)
if err != nil {
return err
}
a.WwwHomepage = &wwwHomepage
}
default:
if v != nil {
var additionalProperties interface{}
err = json.Unmarshal(*v, &additionalProperties)
if err != nil {
return err
}
if a.AdditionalProperties == nil {
a.AdditionalProperties = make(map[string]interface{})
}
a.AdditionalProperties[k] = additionalProperties
}
case "objectId":
if v != nil {
var objectID string
err = json.Unmarshal(*v, &objectID)
if err != nil {
return err
}
a.ObjectID = &objectID
}
case "deletionTimestamp":
if v != nil {
var deletionTimestamp date.Time
err = json.Unmarshal(*v, &deletionTimestamp)
if err != nil {
return err
}
a.DeletionTimestamp = &deletionTimestamp
}
case "objectType":
if v != nil {
var objectType ObjectType
err = json.Unmarshal(*v, &objectType)
if err != nil {
return err
}
a.ObjectType = objectType
}
}
}
return nil
}
// ApplicationBase active Directive Application common properties shared among GET, POST and PATCH
type ApplicationBase struct {
// AllowGuestsSignIn - A property on the application to indicate if the application accepts other IDPs or not or partially accepts.
AllowGuestsSignIn *bool `json:"allowGuestsSignIn,omitempty"`
// AllowPassthroughUsers - Indicates that the application supports pass through users who have no presence in the resource tenant.
AllowPassthroughUsers *bool `json:"allowPassthroughUsers,omitempty"`
// AppLogoURL - The url for the application logo image stored in a CDN.
AppLogoURL *string `json:"appLogoUrl,omitempty"`
// AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals.
AppRoles *[]AppRole `json:"appRoles,omitempty"`
// AppPermissions - The application permissions.
AppPermissions *[]string `json:"appPermissions,omitempty"`
// AvailableToOtherTenants - Whether the application is available to other tenants.
AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"`
// ErrorURL - A URL provided by the author of the application to report errors when using the application.
ErrorURL *string `json:"errorUrl,omitempty"`
// GroupMembershipClaims - Configures the groups claim issued in a user or OAuth 2.0 access token that the app expects. Possible values include: 'None', 'SecurityGroup', 'All'
GroupMembershipClaims GroupMembershipClaimTypes `json:"groupMembershipClaims,omitempty"`
// Homepage - The home page of the application.
Homepage *string `json:"homepage,omitempty"`
// InformationalUrls - URLs with more information about the application.
InformationalUrls *InformationalURL `json:"informationalUrls,omitempty"`
// IsDeviceOnlyAuthSupported - Specifies whether this application supports device authentication without a user. The default is false.
IsDeviceOnlyAuthSupported *bool `json:"isDeviceOnlyAuthSupported,omitempty"`
// KeyCredentials - A collection of KeyCredential objects.
KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"`
// KnownClientApplications - Client applications that are tied to this resource application. Consent to any of the known client applications will result in implicit consent to the resource application through a combined consent dialog (showing the OAuth permission scopes required by the client and the resource).
KnownClientApplications *[]string `json:"knownClientApplications,omitempty"`
// LogoutURL - the url of the logout page
LogoutURL *string `json:"logoutUrl,omitempty"`
// Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2
Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"`
// Oauth2AllowURLPathMatching - Specifies whether during a token Request Azure AD will allow path matching of the redirect URI against the applications collection of replyURLs. The default is false.
Oauth2AllowURLPathMatching *bool `json:"oauth2AllowUrlPathMatching,omitempty"`
// Oauth2Permissions - The collection of OAuth 2.0 permission scopes that the web API (resource) application exposes to client applications. These permission scopes may be granted to client applications during consent.
Oauth2Permissions *[]OAuth2Permission `json:"oauth2Permissions,omitempty"`
// Oauth2RequirePostResponse - Specifies whether, as part of OAuth 2.0 token requests, Azure AD will allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests will be allowed.
Oauth2RequirePostResponse *bool `json:"oauth2RequirePostResponse,omitempty"`
// OrgRestrictions - A list of tenants allowed to access application.
OrgRestrictions *[]string `json:"orgRestrictions,omitempty"`
OptionalClaims *OptionalClaims `json:"optionalClaims,omitempty"`
// PasswordCredentials - A collection of PasswordCredential objects
PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"`
// PreAuthorizedApplications - list of pre-authorized applications.
PreAuthorizedApplications *[]PreAuthorizedApplication `json:"preAuthorizedApplications,omitempty"`
// PublicClient - Specifies whether this application is a public client (such as an installed application running on a mobile device). Default is false.
PublicClient *bool `json:"publicClient,omitempty"`
// PublisherDomain - Reliable domain which can be used to identify an application.
PublisherDomain *string `json:"publisherDomain,omitempty"`
// ReplyUrls - A collection of reply URLs for the application.
ReplyUrls *[]string `json:"replyUrls,omitempty"`
// RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience.
RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"`
// SamlMetadataURL - The URL to the SAML metadata for the application.
SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"`
// SignInAudience - Audience for signing in to the application (AzureADMyOrganization, AzureADAllOrganizations, AzureADAndMicrosoftAccounts).
SignInAudience *string `json:"signInAudience,omitempty"`
// WwwHomepage - The primary Web page.
WwwHomepage *string `json:"wwwHomepage,omitempty"`
}
// ApplicationCreateParameters request parameters for creating a new application.
type ApplicationCreateParameters struct {
// DisplayName - The display name of the application.
DisplayName *string `json:"displayName,omitempty"`
// IdentifierUris - A collection of URIs for the application.
IdentifierUris *[]string `json:"identifierUris,omitempty"`
// AllowGuestsSignIn - A property on the application to indicate if the application accepts other IDPs or not or partially accepts.
AllowGuestsSignIn *bool `json:"allowGuestsSignIn,omitempty"`
// AllowPassthroughUsers - Indicates that the application supports pass through users who have no presence in the resource tenant.
AllowPassthroughUsers *bool `json:"allowPassthroughUsers,omitempty"`
// AppLogoURL - The url for the application logo image stored in a CDN.
AppLogoURL *string `json:"appLogoUrl,omitempty"`
// AppRoles - The collection of application roles that an application may declare. These roles can be assigned to users, groups or service principals.
AppRoles *[]AppRole `json:"appRoles,omitempty"`
// AppPermissions - The application permissions.
AppPermissions *[]string `json:"appPermissions,omitempty"`
// AvailableToOtherTenants - Whether the application is available to other tenants.
AvailableToOtherTenants *bool `json:"availableToOtherTenants,omitempty"`
// ErrorURL - A URL provided by the author of the application to report errors when using the application.
ErrorURL *string `json:"errorUrl,omitempty"`
// GroupMembershipClaims - Configures the groups claim issued in a user or OAuth 2.0 access token that the app expects. Possible values include: 'None', 'SecurityGroup', 'All'
GroupMembershipClaims GroupMembershipClaimTypes `json:"groupMembershipClaims,omitempty"`
// Homepage - The home page of the application.
Homepage *string `json:"homepage,omitempty"`
// InformationalUrls - URLs with more information about the application.
InformationalUrls *InformationalURL `json:"informationalUrls,omitempty"`
// IsDeviceOnlyAuthSupported - Specifies whether this application supports device authentication without a user. The default is false.
IsDeviceOnlyAuthSupported *bool `json:"isDeviceOnlyAuthSupported,omitempty"`
// KeyCredentials - A collection of KeyCredential objects.
KeyCredentials *[]KeyCredential `json:"keyCredentials,omitempty"`
// KnownClientApplications - Client applications that are tied to this resource application. Consent to any of the known client applications will result in implicit consent to the resource application through a combined consent dialog (showing the OAuth permission scopes required by the client and the resource).
KnownClientApplications *[]string `json:"knownClientApplications,omitempty"`
// LogoutURL - the url of the logout page
LogoutURL *string `json:"logoutUrl,omitempty"`
// Oauth2AllowImplicitFlow - Whether to allow implicit grant flow for OAuth2
Oauth2AllowImplicitFlow *bool `json:"oauth2AllowImplicitFlow,omitempty"`
// Oauth2AllowURLPathMatching - Specifies whether during a token Request Azure AD will allow path matching of the redirect URI against the applications collection of replyURLs. The default is false.
Oauth2AllowURLPathMatching *bool `json:"oauth2AllowUrlPathMatching,omitempty"`
// Oauth2Permissions - The collection of OAuth 2.0 permission scopes that the web API (resource) application exposes to client applications. These permission scopes may be granted to client applications during consent.
Oauth2Permissions *[]OAuth2Permission `json:"oauth2Permissions,omitempty"`
// Oauth2RequirePostResponse - Specifies whether, as part of OAuth 2.0 token requests, Azure AD will allow POST requests, as opposed to GET requests. The default is false, which specifies that only GET requests will be allowed.
Oauth2RequirePostResponse *bool `json:"oauth2RequirePostResponse,omitempty"`
// OrgRestrictions - A list of tenants allowed to access application.
OrgRestrictions *[]string `json:"orgRestrictions,omitempty"`
OptionalClaims *OptionalClaims `json:"optionalClaims,omitempty"`
// PasswordCredentials - A collection of PasswordCredential objects
PasswordCredentials *[]PasswordCredential `json:"passwordCredentials,omitempty"`
// PreAuthorizedApplications - list of pre-authorized applications.
PreAuthorizedApplications *[]PreAuthorizedApplication `json:"preAuthorizedApplications,omitempty"`
// PublicClient - Specifies whether this application is a public client (such as an installed application running on a mobile device). Default is false.
PublicClient *bool `json:"publicClient,omitempty"`
// PublisherDomain - Reliable domain which can be used to identify an application.
PublisherDomain *string `json:"publisherDomain,omitempty"`
// ReplyUrls - A collection of reply URLs for the application.
ReplyUrls *[]string `json:"replyUrls,omitempty"`
// RequiredResourceAccess - Specifies resources that this application requires access to and the set of OAuth permission scopes and application roles that it needs under each of those resources. This pre-configuration of required resource access drives the consent experience.
RequiredResourceAccess *[]RequiredResourceAccess `json:"requiredResourceAccess,omitempty"`
// SamlMetadataURL - The URL to the SAML metadata for the application.
SamlMetadataURL *string `json:"samlMetadataUrl,omitempty"`
// SignInAudience - Audience for signing in to the application (AzureADMyOrganization, AzureADAllOrganizations, AzureADAndMicrosoftAccounts).
SignInAudience *string `json:"signInAudience,omitempty"`
// WwwHomepage - The primary Web page.
WwwHomepage *string `json:"wwwHomepage,omitempty"`
}
// ApplicationListResult application list operation result.
type ApplicationListResult struct {
autorest.Response `json:"-"`
// Value - A collection of applications.
Value *[]Application `json:"value,omitempty"`
// OdataNextLink - The URL to get the next set of results.
OdataNextLink *string `json:"odata.nextLink,omitempty"`
}
// ApplicationListResultIterator provides access to a complete listing of Application values.
type ApplicationListResultIterator struct {
i int
page ApplicationListResultPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
func (iter *ApplicationListResultIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListResultIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
sc = iter.Response().Response.Response.StatusCode
}
tracing.EndSpan(ctx, sc, err)
}()
}
iter.i++
if iter.i < len(iter.page.Values()) {
return nil
}
err = iter.page.NextWithContext(ctx)
if err != nil {
iter.i--
return err
}
iter.i = 0
return nil
}
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
func (iter *ApplicationListResultIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.