< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Create(...)-0%100%
CreateAsync()-0%100%
List(...)-0%100%
ListAsync()-0%100%
Delete(...)-0%100%
DeleteAsync()-0%100%
Get(...)-0%100%
GetAsync()-0%100%
Patch(...)-0%100%
PatchAsync()-0%100%
ListOwners(...)-0%100%
ListOwnersAsync()-0%100%
AddOwner(...)-0%100%
AddOwnerAsync()-0%100%
RemoveOwner(...)-0%100%
RemoveOwnerAsync()-0%100%
ListKeyCredentials(...)-0%100%
ListKeyCredentialsAsync()-0%100%
UpdateKeyCredentials(...)-0%100%
UpdateKeyCredentialsAsync()-0%100%
ListPasswordCredentials(...)-0%100%
ListPasswordCredentialsAsync()-0%100%
UpdatePasswordCredentials(...)-0%100%
UpdatePasswordCredentialsAsync()-0%100%
GetServicePrincipalsIdByAppId(...)-0%100%
GetServicePrincipalsIdByAppIdAsync()-0%100%
ListNext(...)-0%100%
ListNextAsync()-0%100%
ListOwnersNext(...)-0%100%
ListOwnersNextAsync()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\graphrbac\Microsoft.Azure.Graph.RBAC\src\Generated\ApplicationsOperationsExtensions.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 ApplicationsOperations.
 24    /// </summary>
 25    public static partial class ApplicationsOperationsExtensions
 26    {
 27            /// <summary>
 28            /// Create a new application.
 29            /// </summary>
 30            /// <param name='operations'>
 31            /// The operations group for this extension method.
 32            /// </param>
 33            /// <param name='parameters'>
 34            /// The parameters for creating an application.
 35            /// </param>
 36            public static Application Create(this IApplicationsOperations operations, ApplicationCreateParameters parame
 37            {
 038                return operations.CreateAsync(parameters).GetAwaiter().GetResult();
 39            }
 40
 41            /// <summary>
 42            /// Create a new application.
 43            /// </summary>
 44            /// <param name='operations'>
 45            /// The operations group for this extension method.
 46            /// </param>
 47            /// <param name='parameters'>
 48            /// The parameters for creating an application.
 49            /// </param>
 50            /// <param name='cancellationToken'>
 51            /// The cancellation token.
 52            /// </param>
 53            public static async Task<Application> CreateAsync(this IApplicationsOperations operations, ApplicationCreate
 54            {
 055                using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).C
 56                {
 057                    return _result.Body;
 58                }
 059            }
 60
 61            /// <summary>
 62            /// Lists applications by filter parameters.
 63            /// </summary>
 64            /// <param name='operations'>
 65            /// The operations group for this extension method.
 66            /// </param>
 67            /// <param name='odataQuery'>
 68            /// OData parameters to apply to the operation.
 69            /// </param>
 70            public static IPage<Application> List(this IApplicationsOperations operations, ODataQuery<Application> odata
 71            {
 072                return operations.ListAsync(odataQuery).GetAwaiter().GetResult();
 73            }
 74
 75            /// <summary>
 76            /// Lists applications by filter parameters.
 77            /// </summary>
 78            /// <param name='operations'>
 79            /// The operations group for this extension method.
 80            /// </param>
 81            /// <param name='odataQuery'>
 82            /// OData parameters to apply to the operation.
 83            /// </param>
 84            /// <param name='cancellationToken'>
 85            /// The cancellation token.
 86            /// </param>
 87            public static async Task<IPage<Application>> ListAsync(this IApplicationsOperations operations, ODataQuery<A
 88            {
 089                using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).Con
 90                {
 091                    return _result.Body;
 92                }
 093            }
 94
 95            /// <summary>
 96            /// Delete an application.
 97            /// </summary>
 98            /// <param name='operations'>
 99            /// The operations group for this extension method.
 100            /// </param>
 101            /// <param name='applicationObjectId'>
 102            /// Application object ID.
 103            /// </param>
 104            public static void Delete(this IApplicationsOperations operations, string applicationObjectId)
 105            {
 0106                operations.DeleteAsync(applicationObjectId).GetAwaiter().GetResult();
 0107            }
 108
 109            /// <summary>
 110            /// Delete an application.
 111            /// </summary>
 112            /// <param name='operations'>
 113            /// The operations group for this extension method.
 114            /// </param>
 115            /// <param name='applicationObjectId'>
 116            /// Application object ID.
 117            /// </param>
 118            /// <param name='cancellationToken'>
 119            /// The cancellation token.
 120            /// </param>
 121            public static async Task DeleteAsync(this IApplicationsOperations operations, string applicationObjectId, Ca
 122            {
 0123                (await operations.DeleteWithHttpMessagesAsync(applicationObjectId, null, cancellationToken).ConfigureAwa
 0124            }
 125
 126            /// <summary>
 127            /// Get an application by object ID.
 128            /// </summary>
 129            /// <param name='operations'>
 130            /// The operations group for this extension method.
 131            /// </param>
 132            /// <param name='applicationObjectId'>
 133            /// Application object ID.
 134            /// </param>
 135            public static Application Get(this IApplicationsOperations operations, string applicationObjectId)
 136            {
 0137                return operations.GetAsync(applicationObjectId).GetAwaiter().GetResult();
 138            }
 139
 140            /// <summary>
 141            /// Get an application by object ID.
 142            /// </summary>
 143            /// <param name='operations'>
 144            /// The operations group for this extension method.
 145            /// </param>
 146            /// <param name='applicationObjectId'>
 147            /// Application object ID.
 148            /// </param>
 149            /// <param name='cancellationToken'>
 150            /// The cancellation token.
 151            /// </param>
 152            public static async Task<Application> GetAsync(this IApplicationsOperations operations, string applicationOb
 153            {
 0154                using (var _result = await operations.GetWithHttpMessagesAsync(applicationObjectId, null, cancellationTo
 155                {
 0156                    return _result.Body;
 157                }
 0158            }
 159
 160            /// <summary>
 161            /// Update an existing application.
 162            /// </summary>
 163            /// <param name='operations'>
 164            /// The operations group for this extension method.
 165            /// </param>
 166            /// <param name='applicationObjectId'>
 167            /// Application object ID.
 168            /// </param>
 169            /// <param name='parameters'>
 170            /// Parameters to update an existing application.
 171            /// </param>
 172            public static void Patch(this IApplicationsOperations operations, string applicationObjectId, ApplicationUpd
 173            {
 0174                operations.PatchAsync(applicationObjectId, parameters).GetAwaiter().GetResult();
 0175            }
 176
 177            /// <summary>
 178            /// Update an existing application.
 179            /// </summary>
 180            /// <param name='operations'>
 181            /// The operations group for this extension method.
 182            /// </param>
 183            /// <param name='applicationObjectId'>
 184            /// Application object ID.
 185            /// </param>
 186            /// <param name='parameters'>
 187            /// Parameters to update an existing application.
 188            /// </param>
 189            /// <param name='cancellationToken'>
 190            /// The cancellation token.
 191            /// </param>
 192            public static async Task PatchAsync(this IApplicationsOperations operations, string applicationObjectId, App
 193            {
 0194                (await operations.PatchWithHttpMessagesAsync(applicationObjectId, parameters, null, cancellationToken).C
 0195            }
 196
 197            /// <summary>
 198            /// Directory objects that are owners of the application.
 199            /// </summary>
 200            /// <remarks>
 201            /// The owners are a set of non-admin users who are allowed to modify this
 202            /// object.
 203            /// </remarks>
 204            /// <param name='operations'>
 205            /// The operations group for this extension method.
 206            /// </param>
 207            /// <param name='applicationObjectId'>
 208            /// The object ID of the application for which to get owners.
 209            /// </param>
 210            public static IPage<DirectoryObject> ListOwners(this IApplicationsOperations operations, string applicationO
 211            {
 0212                return operations.ListOwnersAsync(applicationObjectId).GetAwaiter().GetResult();
 213            }
 214
 215            /// <summary>
 216            /// Directory objects that are owners of the application.
 217            /// </summary>
 218            /// <remarks>
 219            /// The owners are a set of non-admin users who are allowed to modify this
 220            /// object.
 221            /// </remarks>
 222            /// <param name='operations'>
 223            /// The operations group for this extension method.
 224            /// </param>
 225            /// <param name='applicationObjectId'>
 226            /// The object ID of the application for which to get owners.
 227            /// </param>
 228            /// <param name='cancellationToken'>
 229            /// The cancellation token.
 230            /// </param>
 231            public static async Task<IPage<DirectoryObject>> ListOwnersAsync(this IApplicationsOperations operations, st
 232            {
 0233                using (var _result = await operations.ListOwnersWithHttpMessagesAsync(applicationObjectId, null, cancell
 234                {
 0235                    return _result.Body;
 236                }
 0237            }
 238
 239            /// <summary>
 240            /// Add an owner to an application.
 241            /// </summary>
 242            /// <param name='operations'>
 243            /// The operations group for this extension method.
 244            /// </param>
 245            /// <param name='applicationObjectId'>
 246            /// The object ID of the application to which to add the owner.
 247            /// </param>
 248            /// <param name='parameters'>
 249            /// The URL of the owner object, such as
 250            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 251            /// </param>
 252            public static void AddOwner(this IApplicationsOperations operations, string applicationObjectId, AddOwnerPar
 253            {
 0254                operations.AddOwnerAsync(applicationObjectId, parameters).GetAwaiter().GetResult();
 0255            }
 256
 257            /// <summary>
 258            /// Add an owner to an application.
 259            /// </summary>
 260            /// <param name='operations'>
 261            /// The operations group for this extension method.
 262            /// </param>
 263            /// <param name='applicationObjectId'>
 264            /// The object ID of the application to which to add the owner.
 265            /// </param>
 266            /// <param name='parameters'>
 267            /// The URL of the owner object, such as
 268            /// https://graph.windows.net/0b1f9851-1bf0-433f-aec3-cb9272f093dc/directoryObjects/f260bbc4-c254-447b-94cf-
 269            /// </param>
 270            /// <param name='cancellationToken'>
 271            /// The cancellation token.
 272            /// </param>
 273            public static async Task AddOwnerAsync(this IApplicationsOperations operations, string applicationObjectId, 
 274            {
 0275                (await operations.AddOwnerWithHttpMessagesAsync(applicationObjectId, parameters, null, cancellationToken
 0276            }
 277
 278            /// <summary>
 279            /// Remove a member from owners.
 280            /// </summary>
 281            /// <param name='operations'>
 282            /// The operations group for this extension method.
 283            /// </param>
 284            /// <param name='applicationObjectId'>
 285            /// The object ID of the application from which to remove the owner.
 286            /// </param>
 287            /// <param name='ownerObjectId'>
 288            /// Owner object id
 289            /// </param>
 290            public static void RemoveOwner(this IApplicationsOperations operations, string applicationObjectId, string o
 291            {
 0292                operations.RemoveOwnerAsync(applicationObjectId, ownerObjectId).GetAwaiter().GetResult();
 0293            }
 294
 295            /// <summary>
 296            /// Remove a member from owners.
 297            /// </summary>
 298            /// <param name='operations'>
 299            /// The operations group for this extension method.
 300            /// </param>
 301            /// <param name='applicationObjectId'>
 302            /// The object ID of the application from which to remove the owner.
 303            /// </param>
 304            /// <param name='ownerObjectId'>
 305            /// Owner object id
 306            /// </param>
 307            /// <param name='cancellationToken'>
 308            /// The cancellation token.
 309            /// </param>
 310            public static async Task RemoveOwnerAsync(this IApplicationsOperations operations, string applicationObjectI
 311            {
 0312                (await operations.RemoveOwnerWithHttpMessagesAsync(applicationObjectId, ownerObjectId, null, cancellatio
 0313            }
 314
 315            /// <summary>
 316            /// Get the keyCredentials associated with an application.
 317            /// </summary>
 318            /// <param name='operations'>
 319            /// The operations group for this extension method.
 320            /// </param>
 321            /// <param name='applicationObjectId'>
 322            /// Application object ID.
 323            /// </param>
 324            public static IEnumerable<KeyCredential> ListKeyCredentials(this IApplicationsOperations operations, string 
 325            {
 0326                return operations.ListKeyCredentialsAsync(applicationObjectId).GetAwaiter().GetResult();
 327            }
 328
 329            /// <summary>
 330            /// Get the keyCredentials associated with an application.
 331            /// </summary>
 332            /// <param name='operations'>
 333            /// The operations group for this extension method.
 334            /// </param>
 335            /// <param name='applicationObjectId'>
 336            /// Application object ID.
 337            /// </param>
 338            /// <param name='cancellationToken'>
 339            /// The cancellation token.
 340            /// </param>
 341            public static async Task<IEnumerable<KeyCredential>> ListKeyCredentialsAsync(this IApplicationsOperations op
 342            {
 0343                using (var _result = await operations.ListKeyCredentialsWithHttpMessagesAsync(applicationObjectId, null,
 344                {
 0345                    return _result.Body;
 346                }
 0347            }
 348
 349            /// <summary>
 350            /// Update the keyCredentials associated with an application.
 351            /// </summary>
 352            /// <param name='operations'>
 353            /// The operations group for this extension method.
 354            /// </param>
 355            /// <param name='applicationObjectId'>
 356            /// Application object ID.
 357            /// </param>
 358            /// <param name='parameters'>
 359            /// Parameters to update the keyCredentials of an existing application.
 360            /// </param>
 361            public static void UpdateKeyCredentials(this IApplicationsOperations operations, string applicationObjectId,
 362            {
 0363                operations.UpdateKeyCredentialsAsync(applicationObjectId, parameters).GetAwaiter().GetResult();
 0364            }
 365
 366            /// <summary>
 367            /// Update the keyCredentials associated with an application.
 368            /// </summary>
 369            /// <param name='operations'>
 370            /// The operations group for this extension method.
 371            /// </param>
 372            /// <param name='applicationObjectId'>
 373            /// Application object ID.
 374            /// </param>
 375            /// <param name='parameters'>
 376            /// Parameters to update the keyCredentials of an existing application.
 377            /// </param>
 378            /// <param name='cancellationToken'>
 379            /// The cancellation token.
 380            /// </param>
 381            public static async Task UpdateKeyCredentialsAsync(this IApplicationsOperations operations, string applicati
 382            {
 0383                (await operations.UpdateKeyCredentialsWithHttpMessagesAsync(applicationObjectId, parameters, null, cance
 0384            }
 385
 386            /// <summary>
 387            /// Get the passwordCredentials associated with an application.
 388            /// </summary>
 389            /// <param name='operations'>
 390            /// The operations group for this extension method.
 391            /// </param>
 392            /// <param name='applicationObjectId'>
 393            /// Application object ID.
 394            /// </param>
 395            public static IEnumerable<PasswordCredential> ListPasswordCredentials(this IApplicationsOperations operation
 396            {
 0397                return operations.ListPasswordCredentialsAsync(applicationObjectId).GetAwaiter().GetResult();
 398            }
 399
 400            /// <summary>
 401            /// Get the passwordCredentials associated with an application.
 402            /// </summary>
 403            /// <param name='operations'>
 404            /// The operations group for this extension method.
 405            /// </param>
 406            /// <param name='applicationObjectId'>
 407            /// Application object ID.
 408            /// </param>
 409            /// <param name='cancellationToken'>
 410            /// The cancellation token.
 411            /// </param>
 412            public static async Task<IEnumerable<PasswordCredential>> ListPasswordCredentialsAsync(this IApplicationsOpe
 413            {
 0414                using (var _result = await operations.ListPasswordCredentialsWithHttpMessagesAsync(applicationObjectId, 
 415                {
 0416                    return _result.Body;
 417                }
 0418            }
 419
 420            /// <summary>
 421            /// Update passwordCredentials associated with an application.
 422            /// </summary>
 423            /// <param name='operations'>
 424            /// The operations group for this extension method.
 425            /// </param>
 426            /// <param name='applicationObjectId'>
 427            /// Application object ID.
 428            /// </param>
 429            /// <param name='parameters'>
 430            /// Parameters to update passwordCredentials of an existing application.
 431            /// </param>
 432            public static void UpdatePasswordCredentials(this IApplicationsOperations operations, string applicationObje
 433            {
 0434                operations.UpdatePasswordCredentialsAsync(applicationObjectId, parameters).GetAwaiter().GetResult();
 0435            }
 436
 437            /// <summary>
 438            /// Update passwordCredentials associated with an application.
 439            /// </summary>
 440            /// <param name='operations'>
 441            /// The operations group for this extension method.
 442            /// </param>
 443            /// <param name='applicationObjectId'>
 444            /// Application object ID.
 445            /// </param>
 446            /// <param name='parameters'>
 447            /// Parameters to update passwordCredentials of an existing application.
 448            /// </param>
 449            /// <param name='cancellationToken'>
 450            /// The cancellation token.
 451            /// </param>
 452            public static async Task UpdatePasswordCredentialsAsync(this IApplicationsOperations operations, string appl
 453            {
 0454                (await operations.UpdatePasswordCredentialsWithHttpMessagesAsync(applicationObjectId, parameters, null, 
 0455            }
 456
 457            /// <summary>
 458            /// Gets an object id for a given application id from the current tenant.
 459            /// </summary>
 460            /// <param name='operations'>
 461            /// The operations group for this extension method.
 462            /// </param>
 463            /// <param name='applicationID'>
 464            /// The application ID.
 465            /// </param>
 466            public static ServicePrincipalObjectResult GetServicePrincipalsIdByAppId(this IApplicationsOperations operat
 467            {
 0468                return operations.GetServicePrincipalsIdByAppIdAsync(applicationID).GetAwaiter().GetResult();
 469            }
 470
 471            /// <summary>
 472            /// Gets an object id for a given application id from the current tenant.
 473            /// </summary>
 474            /// <param name='operations'>
 475            /// The operations group for this extension method.
 476            /// </param>
 477            /// <param name='applicationID'>
 478            /// The application ID.
 479            /// </param>
 480            /// <param name='cancellationToken'>
 481            /// The cancellation token.
 482            /// </param>
 483            public static async Task<ServicePrincipalObjectResult> GetServicePrincipalsIdByAppIdAsync(this IApplications
 484            {
 0485                using (var _result = await operations.GetServicePrincipalsIdByAppIdWithHttpMessagesAsync(applicationID, 
 486                {
 0487                    return _result.Body;
 488                }
 0489            }
 490
 491            /// <summary>
 492            /// Gets a list of applications from the current tenant.
 493            /// </summary>
 494            /// <param name='operations'>
 495            /// The operations group for this extension method.
 496            /// </param>
 497            /// <param name='nextLink'>
 498            /// Next link for the list operation.
 499            /// </param>
 500            public static IPage<Application> ListNext(this IApplicationsOperations operations, string nextLink)
 501            {
 0502                return operations.ListNextAsync(nextLink).GetAwaiter().GetResult();
 503            }
 504
 505            /// <summary>
 506            /// Gets a list of applications from the current tenant.
 507            /// </summary>
 508            /// <param name='operations'>
 509            /// The operations group for this extension method.
 510            /// </param>
 511            /// <param name='nextLink'>
 512            /// Next link for the list operation.
 513            /// </param>
 514            /// <param name='cancellationToken'>
 515            /// The cancellation token.
 516            /// </param>
 517            public static async Task<IPage<Application>> ListNextAsync(this IApplicationsOperations operations, string n
 518            {
 0519                using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).C
 520                {
 0521                    return _result.Body;
 522                }
 0523            }
 524
 525            /// <summary>
 526            /// Directory objects that are owners of the application.
 527            /// </summary>
 528            /// <remarks>
 529            /// The owners are a set of non-admin users who are allowed to modify this
 530            /// object.
 531            /// </remarks>
 532            /// <param name='operations'>
 533            /// The operations group for this extension method.
 534            /// </param>
 535            /// <param name='nextPageLink'>
 536            /// The NextLink from the previous successful call to List operation.
 537            /// </param>
 538            public static IPage<DirectoryObject> ListOwnersNext(this IApplicationsOperations operations, string nextPage
 539            {
 0540                return operations.ListOwnersNextAsync(nextPageLink).GetAwaiter().GetResult();
 541            }
 542
 543            /// <summary>
 544            /// Directory objects that are owners of the application.
 545            /// </summary>
 546            /// <remarks>
 547            /// The owners are a set of non-admin users who are allowed to modify this
 548            /// object.
 549            /// </remarks>
 550            /// <param name='operations'>
 551            /// The operations group for this extension method.
 552            /// </param>
 553            /// <param name='nextPageLink'>
 554            /// The NextLink from the previous successful call to List operation.
 555            /// </param>
 556            /// <param name='cancellationToken'>
 557            /// The cancellation token.
 558            /// </param>
 559            public static async Task<IPage<DirectoryObject>> ListOwnersNextAsync(this IApplicationsOperations operations
 560            {
 0561                using (var _result = await operations.ListOwnersNextWithHttpMessagesAsync(nextPageLink, null, cancellati
 562                {
 0563                    return _result.Body;
 564                }
 0565            }
 566
 567    }
 568}