@@ -32,7 +32,11 @@ type Client interface {
32
32
// [Preview API] Materialize an existing AAD service principal into the ADO account.
33
33
CreateServicePrincipal (context.Context , CreateServicePrincipalArgs ) (* GraphServicePrincipal , error )
34
34
// [Preview API] Materialize an existing AAD or MSA user into the ADO account.
35
- CreateUser (context.Context , CreateUserArgs ) (* GraphUser , error )
35
+ CreateUserOriginId (ctx context.Context , args CreateUserOriginIdArgs ) (* GraphUser , error )
36
+ // [Preview API] Materialize an existing AAD or MSA user into the ADO account.
37
+ CreateUserMailAddress (ctx context.Context , args CreateUserMailAddressArgs ) (* GraphUser , error )
38
+ // [Preview API] Materialize an existing AAD or MSA user into the ADO account.
39
+ CreateUserUserPrincipalName (ctx context.Context , args CreateUserUserPrincipalNameArgs ) (* GraphUser , error )
36
40
// [Preview API]
37
41
DeleteAvatar (context.Context , DeleteAvatarArgs ) error
38
42
// [Preview API] Removes an Azure DevOps group from all of its parent groups.
@@ -202,7 +206,57 @@ type CreateServicePrincipalArgs struct {
202
206
}
203
207
204
208
// [Preview API] Materialize an existing AAD or MSA user into the ADO account.
205
- func (client * ClientImpl ) CreateUser (ctx context.Context , args CreateUserArgs ) (* GraphUser , error ) {
209
+ func (client * ClientImpl ) CreateUserOriginId (ctx context.Context , args CreateUserOriginIdArgs ) (* GraphUser , error ) {
210
+ if args .CreationContext == nil {
211
+ return nil , & azuredevops.ArgumentNilError {ArgumentName : "args.CreationContext" }
212
+ }
213
+ queryParams := url.Values {}
214
+ if args .GroupDescriptors != nil {
215
+ listAsString := strings .Join ((* args .GroupDescriptors )[:], "," )
216
+ queryParams .Add ("groupDescriptors" , listAsString )
217
+ }
218
+ body , marshalErr := json .Marshal (* args .CreationContext )
219
+ if marshalErr != nil {
220
+ return nil , marshalErr
221
+ }
222
+ locationId , _ := uuid .Parse ("005e26ec-6b77-4e4f-a986-b3827bf241f5" )
223
+ resp , err := client .Client .Send (ctx , http .MethodPost , locationId , "7.1-preview.1" , nil , queryParams , bytes .NewReader (body ), "application/json" , "application/json" , nil )
224
+ if err != nil {
225
+ return nil , err
226
+ }
227
+
228
+ var responseValue GraphUser
229
+ err = client .Client .UnmarshalBody (resp , & responseValue )
230
+ return & responseValue , err
231
+ }
232
+
233
+ // [Preview API] Materialize an existing AAD or MSA user into the ADO account.
234
+ func (client * ClientImpl ) CreateUserUserPrincipalName (ctx context.Context , args CreateUserUserPrincipalNameArgs ) (* GraphUser , error ) {
235
+ if args .CreationContext == nil {
236
+ return nil , & azuredevops.ArgumentNilError {ArgumentName : "args.CreationContext" }
237
+ }
238
+ queryParams := url.Values {}
239
+ if args .GroupDescriptors != nil {
240
+ listAsString := strings .Join ((* args .GroupDescriptors )[:], "," )
241
+ queryParams .Add ("groupDescriptors" , listAsString )
242
+ }
243
+ body , marshalErr := json .Marshal (* args .CreationContext )
244
+ if marshalErr != nil {
245
+ return nil , marshalErr
246
+ }
247
+ locationId , _ := uuid .Parse ("005e26ec-6b77-4e4f-a986-b3827bf241f5" )
248
+ resp , err := client .Client .Send (ctx , http .MethodPost , locationId , "7.1-preview.1" , nil , queryParams , bytes .NewReader (body ), "application/json" , "application/json" , nil )
249
+ if err != nil {
250
+ return nil , err
251
+ }
252
+
253
+ var responseValue GraphUser
254
+ err = client .Client .UnmarshalBody (resp , & responseValue )
255
+ return & responseValue , err
256
+ }
257
+
258
+ // [Preview API] Materialize an existing AAD or MSA user into the ADO account.
259
+ func (client * ClientImpl ) CreateUserMailAddress (ctx context.Context , args CreateUserMailAddressArgs ) (* GraphUser , error ) {
206
260
if args .CreationContext == nil {
207
261
return nil , & azuredevops.ArgumentNilError {ArgumentName : "args.CreationContext" }
208
262
}
@@ -226,14 +280,32 @@ func (client *ClientImpl) CreateUser(ctx context.Context, args CreateUserArgs) (
226
280
return & responseValue , err
227
281
}
228
282
229
- // Arguments for the CreateUser function
230
- type CreateUserArgs struct {
283
+
284
+ // Arguments for the CreateUserOriginId function
285
+ type CreateUserOriginIdArgs struct {
231
286
// (required) The subset of the full graph user used to uniquely find the graph subject in an external provider.
232
- CreationContext * GraphUserCreationContext
287
+ CreationContext * GraphUserOriginIdCreationContext
233
288
// (optional) A comma separated list of descriptors of groups you want the graph user to join
234
289
GroupDescriptors * []string
235
290
}
236
291
292
+ // Arguments for the CreateUserPrincipalName function
293
+ type CreateUserUserPrincipalNameArgs struct {
294
+ // (required) The subset of the full graph user used to uniquely find the graph subject in an external provider.
295
+ CreationContext * GraphUserPrincipalNameCreationContext
296
+ // (optional) A comma separated list of descriptors of groups you want the graph user to join
297
+ GroupDescriptors * []string
298
+ }
299
+
300
+ // Arguments for the CreateUserMailAddress function
301
+ type CreateUserMailAddressArgs struct {
302
+ // (required) The subset of the full graph user used to uniquely find the graph subject in an external provider.
303
+ CreationContext * GraphUserMailAddressCreationContext
304
+ // (optional) A comma separated list of descriptors of groups you want the graph user to join
305
+ GroupDescriptors * []string
306
+ }
307
+
308
+
237
309
// [Preview API]
238
310
func (client * ClientImpl ) DeleteAvatar (ctx context.Context , args DeleteAvatarArgs ) error {
239
311
routeValues := make (map [string ]string )
0 commit comments