< Summary

Class:Microsoft.Azure.Graph.RBAC.GroupsOperationsExtensions
Assembly:Microsoft.Azure.Graph.RBAC
File(s):C:\Git\azure-sdk-for-net\sdk\graphrbac\Microsoft.Azure.Graph.RBAC\src\Generated\GroupsOperationsExtensions.cs
Covered lines:22
Uncovered lines:38
Coverable lines:60
Total lines:577
Line coverage:36.6% (22 of 60)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
IsMemberOf(...)-0%100%
IsMemberOfAsync()-0%100%
RemoveMember(...)-100%100%
RemoveMemberAsync()-100%100%
AddMember(...)-100%100%
AddMemberAsync()-100%100%
Create(...)-100%100%
CreateAsync()-100%100%
List(...)-100%100%
ListAsync()-100%100%
GetGroupMembers(...)-0%100%
GetGroupMembersAsync()-0%100%
Get(...)-100%100%
GetAsync()-33.33%100%
Delete(...)-100%100%
DeleteAsync()-100%100%
GetMemberGroups(...)-0%100%
GetMemberGroupsAsync()-0%100%
ListOwners(...)-0%100%
ListOwnersAsync()-0%100%
AddOwner(...)-0%100%
AddOwnerAsync()-0%100%
RemoveOwner(...)-0%100%
RemoveOwnerAsync()-0%100%
ListNext(...)-0%100%
ListNextAsync()-0%100%
GetGroupMembersNext(...)-0%100%
GetGroupMembersNextAsync()-0%100%
ListOwnersNext(...)-0%100%
ListOwnersNextAsync()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\graphrbac\Microsoft.Azure.Graph.RBAC\src\Generated\GroupsOperationsExtensions.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.Graph.RBAC
 12{
 13    using Microsoft.Rest;
 14    using Microsoft.Rest.Azure;
 15    using Microsoft.Rest.Azure.OData;
 16    using Models;
 17    using System.Collections;
 18    using System.Collections.Generic;
 19    using System.Threading;
 20    using System.Threading.Tasks;
 21
 22    /// <summary>
 23    /// Extension methods for GroupsOperations.
 24    /// </summary>
 25    public static partial class GroupsOperationsExtensions
 26    {
 27            /// <summary>
 28            /// Checks whether the specified user, group, contact, or service principal is
 29            /// a direct or transitive member of the specified group.
 30            /// </summary>
 31            /// <param name='operations'>
 32            /// The operations group for this extension method.
 33            /// </param>
 34            /// <param name='parameters'>
 35            /// The check group membership parameters.
 36            /// </param>
 37            public static CheckGroupMembershipResult IsMemberOf(this IGroupsOperations operations, CheckGroupMembershipP
 38            {
 039                return operations.IsMemberOfAsync(parameters).GetAwaiter().GetResult();
 40            }
 41
 42            /// <summary>
 43            /// Checks whether the specified user, group, contact, or service principal is
 44            /// a direct or transitive member of the specified group.
 45            /// </summary>
 46            /// <param name='operations'>
 47            /// The operations group for this extension method.
 48            /// </param>
 49            /// <param name='parameters'>
 50            /// The check group membership parameters.
 51            /// </param>
 52            /// <param name='cancellationToken'>
 53            /// The cancellation token.
 54            /// </param>
 55            public static async Task<CheckGroupMembershipResult> IsMemberOfAsync(this IGroupsOperations operations, Chec
 56            {
 057                using (var _result = await operations.IsMemberOfWithHttpMessagesAsync(parameters, null, cancellationToke
 58                {
 059                    return _result.Body;
 60                }
 061            }
 62
 63            /// <summary>
 64            /// Remove a member from a group.
 65            /// </summary>
 66            /// <param name='operations'>
 67            /// The operations group for this extension method.
 68            /// </param>
 69            /// <param name='groupObjectId'>
 70            /// The object ID of the group from which to remove the member.
 71            /// </param>
 72            /// <param name='memberObjectId'>
 73            /// Member object id
 74            /// </param>
 75            public static void RemoveMember(this IGroupsOperations operations, string groupObjectId, string memberObject
 76            {
 277                operations.RemoveMemberAsync(groupObjectId, memberObjectId).GetAwaiter().GetResult();
 278            }
 79
 80            /// <summary>
 81            /// Remove a member from a group.
 82            /// </summary>
 83            /// <param name='operations'>
 84            /// The operations group for this extension method.
 85            /// </param>
 86            /// <param name='groupObjectId'>
 87            /// The object ID of the group from which to remove the member.
 88            /// </param>
 89            /// <param name='memberObjectId'>
 90            /// Member object id
 91            /// </param>
 92            /// <param name='cancellationToken'>
 93            /// The cancellation token.
 94            /// </param>
 95            public static async Task RemoveMemberAsync(this IGroupsOperations operations, string groupObjectId, string m
 96            {
 297                (await operations.RemoveMemberWithHttpMessagesAsync(groupObjectId, memberObjectId, null, cancellationTok
 298            }
 99
 100            /// <summary>
 101            /// Add a member to a group.
 102            /// </summary>
 103            /// <param name='operations'>
 104            /// The operations group for this extension method.
 105            /// </param>
 106            /// <param name='groupObjectId'>
 107            /// The object ID of the group to which to add the member.
 108            /// </param>
 109            /// <param name='parameters'>
 110            /// The URL of the member object, such as
 111            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 112            /// </param>
 113            public static void AddMember(this IGroupsOperations operations, string groupObjectId, GroupAddMemberParamete
 114            {
 2115                operations.AddMemberAsync(groupObjectId, parameters).GetAwaiter().GetResult();
 2116            }
 117
 118            /// <summary>
 119            /// Add a member to a group.
 120            /// </summary>
 121            /// <param name='operations'>
 122            /// The operations group for this extension method.
 123            /// </param>
 124            /// <param name='groupObjectId'>
 125            /// The object ID of the group to which to add the member.
 126            /// </param>
 127            /// <param name='parameters'>
 128            /// The URL of the member object, such as
 129            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 130            /// </param>
 131            /// <param name='cancellationToken'>
 132            /// The cancellation token.
 133            /// </param>
 134            public static async Task AddMemberAsync(this IGroupsOperations operations, string groupObjectId, GroupAddMem
 135            {
 2136                (await operations.AddMemberWithHttpMessagesAsync(groupObjectId, parameters, null, cancellationToken).Con
 2137            }
 138
 139            /// <summary>
 140            /// Create a group in the directory.
 141            /// </summary>
 142            /// <param name='operations'>
 143            /// The operations group for this extension method.
 144            /// </param>
 145            /// <param name='parameters'>
 146            /// The parameters for the group to create.
 147            /// </param>
 148            public static ADGroup Create(this IGroupsOperations operations, GroupCreateParameters parameters)
 149            {
 4150                return operations.CreateAsync(parameters).GetAwaiter().GetResult();
 151            }
 152
 153            /// <summary>
 154            /// Create a group in the directory.
 155            /// </summary>
 156            /// <param name='operations'>
 157            /// The operations group for this extension method.
 158            /// </param>
 159            /// <param name='parameters'>
 160            /// The parameters for the group to create.
 161            /// </param>
 162            /// <param name='cancellationToken'>
 163            /// The cancellation token.
 164            /// </param>
 165            public static async Task<ADGroup> CreateAsync(this IGroupsOperations operations, GroupCreateParameters param
 166            {
 4167                using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).C
 168                {
 4169                    return _result.Body;
 170                }
 4171            }
 172
 173            /// <summary>
 174            /// Gets list of groups for the current tenant.
 175            /// </summary>
 176            /// <param name='operations'>
 177            /// The operations group for this extension method.
 178            /// </param>
 179            /// <param name='odataQuery'>
 180            /// OData parameters to apply to the operation.
 181            /// </param>
 182            public static IPage<ADGroup> List(this IGroupsOperations operations, ODataQuery<ADGroup> odataQuery = defaul
 183            {
 8184                return operations.ListAsync(odataQuery).GetAwaiter().GetResult();
 185            }
 186
 187            /// <summary>
 188            /// Gets list of groups for the current tenant.
 189            /// </summary>
 190            /// <param name='operations'>
 191            /// The operations group for this extension method.
 192            /// </param>
 193            /// <param name='odataQuery'>
 194            /// OData parameters to apply to the operation.
 195            /// </param>
 196            /// <param name='cancellationToken'>
 197            /// The cancellation token.
 198            /// </param>
 199            public static async Task<IPage<ADGroup>> ListAsync(this IGroupsOperations operations, ODataQuery<ADGroup> od
 200            {
 8201                using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).Con
 202                {
 8203                    return _result.Body;
 204                }
 8205            }
 206
 207            /// <summary>
 208            /// Gets the members of a group.
 209            /// </summary>
 210            /// <param name='operations'>
 211            /// The operations group for this extension method.
 212            /// </param>
 213            /// <param name='objectId'>
 214            /// The object ID of the group whose members should be retrieved.
 215            /// </param>
 216            public static IPage<DirectoryObject> GetGroupMembers(this IGroupsOperations operations, string objectId)
 217            {
 0218                return operations.GetGroupMembersAsync(objectId).GetAwaiter().GetResult();
 219            }
 220
 221            /// <summary>
 222            /// Gets the members of a group.
 223            /// </summary>
 224            /// <param name='operations'>
 225            /// The operations group for this extension method.
 226            /// </param>
 227            /// <param name='objectId'>
 228            /// The object ID of the group whose members should be retrieved.
 229            /// </param>
 230            /// <param name='cancellationToken'>
 231            /// The cancellation token.
 232            /// </param>
 233            public static async Task<IPage<DirectoryObject>> GetGroupMembersAsync(this IGroupsOperations operations, str
 234            {
 0235                using (var _result = await operations.GetGroupMembersWithHttpMessagesAsync(objectId, null, cancellationT
 236                {
 0237                    return _result.Body;
 238                }
 0239            }
 240
 241            /// <summary>
 242            /// Gets group information from the directory.
 243            /// </summary>
 244            /// <param name='operations'>
 245            /// The operations group for this extension method.
 246            /// </param>
 247            /// <param name='objectId'>
 248            /// The object ID of the user for which to get group information.
 249            /// </param>
 250            public static ADGroup Get(this IGroupsOperations operations, string objectId)
 251            {
 2252                return operations.GetAsync(objectId).GetAwaiter().GetResult();
 253            }
 254
 255            /// <summary>
 256            /// Gets group information from the directory.
 257            /// </summary>
 258            /// <param name='operations'>
 259            /// The operations group for this extension method.
 260            /// </param>
 261            /// <param name='objectId'>
 262            /// The object ID of the user for which to get group information.
 263            /// </param>
 264            /// <param name='cancellationToken'>
 265            /// The cancellation token.
 266            /// </param>
 267            public static async Task<ADGroup> GetAsync(this IGroupsOperations operations, string objectId, CancellationT
 268            {
 2269                using (var _result = await operations.GetWithHttpMessagesAsync(objectId, null, cancellationToken).Config
 270                {
 0271                    return _result.Body;
 272                }
 0273            }
 274
 275            /// <summary>
 276            /// Delete a group from the directory.
 277            /// </summary>
 278            /// <param name='operations'>
 279            /// The operations group for this extension method.
 280            /// </param>
 281            /// <param name='objectId'>
 282            /// The object ID of the group to delete.
 283            /// </param>
 284            public static void Delete(this IGroupsOperations operations, string objectId)
 285            {
 4286                operations.DeleteAsync(objectId).GetAwaiter().GetResult();
 4287            }
 288
 289            /// <summary>
 290            /// Delete a group from the directory.
 291            /// </summary>
 292            /// <param name='operations'>
 293            /// The operations group for this extension method.
 294            /// </param>
 295            /// <param name='objectId'>
 296            /// The object ID of the group to delete.
 297            /// </param>
 298            /// <param name='cancellationToken'>
 299            /// The cancellation token.
 300            /// </param>
 301            public static async Task DeleteAsync(this IGroupsOperations operations, string objectId, CancellationToken c
 302            {
 4303                (await operations.DeleteWithHttpMessagesAsync(objectId, null, cancellationToken).ConfigureAwait(false)).
 4304            }
 305
 306            /// <summary>
 307            /// Gets a collection of object IDs of groups of which the specified group is a
 308            /// member.
 309            /// </summary>
 310            /// <param name='operations'>
 311            /// The operations group for this extension method.
 312            /// </param>
 313            /// <param name='objectId'>
 314            /// The object ID of the group for which to get group membership.
 315            /// </param>
 316            /// <param name='parameters'>
 317            /// Group filtering parameters.
 318            /// </param>
 319            public static IEnumerable<string> GetMemberGroups(this IGroupsOperations operations, string objectId, GroupG
 320            {
 0321                return operations.GetMemberGroupsAsync(objectId, parameters).GetAwaiter().GetResult();
 322            }
 323
 324            /// <summary>
 325            /// Gets a collection of object IDs of groups of which the specified group is a
 326            /// member.
 327            /// </summary>
 328            /// <param name='operations'>
 329            /// The operations group for this extension method.
 330            /// </param>
 331            /// <param name='objectId'>
 332            /// The object ID of the group for which to get group membership.
 333            /// </param>
 334            /// <param name='parameters'>
 335            /// Group filtering parameters.
 336            /// </param>
 337            /// <param name='cancellationToken'>
 338            /// The cancellation token.
 339            /// </param>
 340            public static async Task<IEnumerable<string>> GetMemberGroupsAsync(this IGroupsOperations operations, string
 341            {
 0342                using (var _result = await operations.GetMemberGroupsWithHttpMessagesAsync(objectId, parameters, null, c
 343                {
 0344                    return _result.Body;
 345                }
 0346            }
 347
 348            /// <summary>
 349            /// Directory objects that are owners of the group.
 350            /// </summary>
 351            /// <remarks>
 352            /// The owners are a set of non-admin users who are allowed to modify this
 353            /// object.
 354            /// </remarks>
 355            /// <param name='operations'>
 356            /// The operations group for this extension method.
 357            /// </param>
 358            /// <param name='objectId'>
 359            /// The object ID of the group for which to get owners.
 360            /// </param>
 361            public static IPage<DirectoryObject> ListOwners(this IGroupsOperations operations, string objectId)
 362            {
 0363                return operations.ListOwnersAsync(objectId).GetAwaiter().GetResult();
 364            }
 365
 366            /// <summary>
 367            /// Directory objects that are owners of the group.
 368            /// </summary>
 369            /// <remarks>
 370            /// The owners are a set of non-admin users who are allowed to modify this
 371            /// object.
 372            /// </remarks>
 373            /// <param name='operations'>
 374            /// The operations group for this extension method.
 375            /// </param>
 376            /// <param name='objectId'>
 377            /// The object ID of the group for which to get owners.
 378            /// </param>
 379            /// <param name='cancellationToken'>
 380            /// The cancellation token.
 381            /// </param>
 382            public static async Task<IPage<DirectoryObject>> ListOwnersAsync(this IGroupsOperations operations, string o
 383            {
 0384                using (var _result = await operations.ListOwnersWithHttpMessagesAsync(objectId, null, cancellationToken)
 385                {
 0386                    return _result.Body;
 387                }
 0388            }
 389
 390            /// <summary>
 391            /// Add an owner to a group.
 392            /// </summary>
 393            /// <param name='operations'>
 394            /// The operations group for this extension method.
 395            /// </param>
 396            /// <param name='objectId'>
 397            /// The object ID of the application to which to add the owner.
 398            /// </param>
 399            /// <param name='parameters'>
 400            /// The URL of the owner object, such as
 401            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 402            /// </param>
 403            public static void AddOwner(this IGroupsOperations operations, string objectId, AddOwnerParameters parameter
 404            {
 0405                operations.AddOwnerAsync(objectId, parameters).GetAwaiter().GetResult();
 0406            }
 407
 408            /// <summary>
 409            /// Add an owner to a group.
 410            /// </summary>
 411            /// <param name='operations'>
 412            /// The operations group for this extension method.
 413            /// </param>
 414            /// <param name='objectId'>
 415            /// The object ID of the application to which to add the owner.
 416            /// </param>
 417            /// <param name='parameters'>
 418            /// The URL of the owner object, such as
 419            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 420            /// </param>
 421            /// <param name='cancellationToken'>
 422            /// The cancellation token.
 423            /// </param>
 424            public static async Task AddOwnerAsync(this IGroupsOperations operations, string objectId, AddOwnerParameter
 425            {
 0426                (await operations.AddOwnerWithHttpMessagesAsync(objectId, parameters, null, cancellationToken).Configure
 0427            }
 428
 429            /// <summary>
 430            /// Remove a member from owners.
 431            /// </summary>
 432            /// <param name='operations'>
 433            /// The operations group for this extension method.
 434            /// </param>
 435            /// <param name='objectId'>
 436            /// The object ID of the group from which to remove the owner.
 437            /// </param>
 438            /// <param name='ownerObjectId'>
 439            /// Owner object id
 440            /// </param>
 441            public static void RemoveOwner(this IGroupsOperations operations, string objectId, string ownerObjectId)
 442            {
 0443                operations.RemoveOwnerAsync(objectId, ownerObjectId).GetAwaiter().GetResult();
 0444            }
 445
 446            /// <summary>
 447            /// Remove a member from owners.
 448            /// </summary>
 449            /// <param name='operations'>
 450            /// The operations group for this extension method.
 451            /// </param>
 452            /// <param name='objectId'>
 453            /// The object ID of the group from which to remove the owner.
 454            /// </param>
 455            /// <param name='ownerObjectId'>
 456            /// Owner object id
 457            /// </param>
 458            /// <param name='cancellationToken'>
 459            /// The cancellation token.
 460            /// </param>
 461            public static async Task RemoveOwnerAsync(this IGroupsOperations operations, string objectId, string ownerOb
 462            {
 0463                (await operations.RemoveOwnerWithHttpMessagesAsync(objectId, ownerObjectId, null, cancellationToken).Con
 0464            }
 465
 466            /// <summary>
 467            /// Gets a list of groups for the current tenant.
 468            /// </summary>
 469            /// <param name='operations'>
 470            /// The operations group for this extension method.
 471            /// </param>
 472            /// <param name='nextLink'>
 473            /// Next link for the list operation.
 474            /// </param>
 475            public static IPage<ADGroup> ListNext(this IGroupsOperations operations, string nextLink)
 476            {
 0477                return operations.ListNextAsync(nextLink).GetAwaiter().GetResult();
 478            }
 479
 480            /// <summary>
 481            /// Gets a list of groups for the current tenant.
 482            /// </summary>
 483            /// <param name='operations'>
 484            /// The operations group for this extension method.
 485            /// </param>
 486            /// <param name='nextLink'>
 487            /// Next link for the list operation.
 488            /// </param>
 489            /// <param name='cancellationToken'>
 490            /// The cancellation token.
 491            /// </param>
 492            public static async Task<IPage<ADGroup>> ListNextAsync(this IGroupsOperations operations, string nextLink, C
 493            {
 0494                using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).C
 495                {
 0496                    return _result.Body;
 497                }
 0498            }
 499
 500            /// <summary>
 501            /// Gets the members of a group.
 502            /// </summary>
 503            /// <param name='operations'>
 504            /// The operations group for this extension method.
 505            /// </param>
 506            /// <param name='nextLink'>
 507            /// Next link for the list operation.
 508            /// </param>
 509            public static IPage<DirectoryObject> GetGroupMembersNext(this IGroupsOperations operations, string nextLink)
 510            {
 0511                return operations.GetGroupMembersNextAsync(nextLink).GetAwaiter().GetResult();
 512            }
 513
 514            /// <summary>
 515            /// Gets the members of a group.
 516            /// </summary>
 517            /// <param name='operations'>
 518            /// The operations group for this extension method.
 519            /// </param>
 520            /// <param name='nextLink'>
 521            /// Next link for the list operation.
 522            /// </param>
 523            /// <param name='cancellationToken'>
 524            /// The cancellation token.
 525            /// </param>
 526            public static async Task<IPage<DirectoryObject>> GetGroupMembersNextAsync(this IGroupsOperations operations,
 527            {
 0528                using (var _result = await operations.GetGroupMembersNextWithHttpMessagesAsync(nextLink, null, cancellat
 529                {
 0530                    return _result.Body;
 531                }
 0532            }
 533
 534            /// <summary>
 535            /// Directory objects that are owners of the group.
 536            /// </summary>
 537            /// <remarks>
 538            /// The owners are a set of non-admin users who are allowed to modify this
 539            /// object.
 540            /// </remarks>
 541            /// <param name='operations'>
 542            /// The operations group for this extension method.
 543            /// </param>
 544            /// <param name='nextPageLink'>
 545            /// The NextLink from the previous successful call to List operation.
 546            /// </param>
 547            public static IPage<DirectoryObject> ListOwnersNext(this IGroupsOperations operations, string nextPageLink)
 548            {
 0549                return operations.ListOwnersNextAsync(nextPageLink).GetAwaiter().GetResult();
 550            }
 551
 552            /// <summary>
 553            /// Directory objects that are owners of the group.
 554            /// </summary>
 555            /// <remarks>
 556            /// The owners are a set of non-admin users who are allowed to modify this
 557            /// object.
 558            /// </remarks>
 559            /// <param name='operations'>
 560            /// The operations group for this extension method.
 561            /// </param>
 562            /// <param name='nextPageLink'>
 563            /// The NextLink from the previous successful call to List operation.
 564            /// </param>
 565            /// <param name='cancellationToken'>
 566            /// The cancellation token.
 567            /// </param>
 568            public static async Task<IPage<DirectoryObject>> ListOwnersNextAsync(this IGroupsOperations operations, stri
 569            {
 0570                using (var _result = await operations.ListOwnersNextWithHttpMessagesAsync(nextPageLink, null, cancellati
 571                {
 0572                    return _result.Body;
 573                }
 0574            }
 575
 576    }
 577}