| | 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 | |
|
| | 11 | | namespace Microsoft.Azure.Graph.RBAC |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Azure; |
| | 15 | | using Models; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for OAuth2PermissionGrantOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class OAuth2PermissionGrantOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. |
| | 26 | | /// </summary> |
| | 27 | | /// <param name='operations'> |
| | 28 | | /// The operations group for this extension method. |
| | 29 | | /// </param> |
| | 30 | | /// <param name='filter'> |
| | 31 | | /// This is the Service Principal ObjectId associated with the app |
| | 32 | | /// </param> |
| | 33 | | public static IPage<OAuth2PermissionGrant> List(this IOAuth2PermissionGrantOperations operations, string fil |
| | 34 | | { |
| 0 | 35 | | return operations.ListAsync(filter).GetAwaiter().GetResult(); |
| | 36 | | } |
| | 37 | |
|
| | 38 | | /// <summary> |
| | 39 | | /// Queries OAuth2 permissions grants for the relevant SP ObjectId of an app. |
| | 40 | | /// </summary> |
| | 41 | | /// <param name='operations'> |
| | 42 | | /// The operations group for this extension method. |
| | 43 | | /// </param> |
| | 44 | | /// <param name='filter'> |
| | 45 | | /// This is the Service Principal ObjectId associated with the app |
| | 46 | | /// </param> |
| | 47 | | /// <param name='cancellationToken'> |
| | 48 | | /// The cancellation token. |
| | 49 | | /// </param> |
| | 50 | | public static async Task<IPage<OAuth2PermissionGrant>> ListAsync(this IOAuth2PermissionGrantOperations opera |
| | 51 | | { |
| 0 | 52 | | using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).Configu |
| | 53 | | { |
| 0 | 54 | | return _result.Body; |
| | 55 | | } |
| 0 | 56 | | } |
| | 57 | |
|
| | 58 | | /// <summary> |
| | 59 | | /// Grants OAuth2 permissions for the relevant resource Ids of an app. |
| | 60 | | /// </summary> |
| | 61 | | /// <param name='operations'> |
| | 62 | | /// The operations group for this extension method. |
| | 63 | | /// </param> |
| | 64 | | /// <param name='body'> |
| | 65 | | /// The relevant app Service Principal Object Id and the Service Principal |
| | 66 | | /// Object Id you want to grant. |
| | 67 | | /// </param> |
| | 68 | | public static OAuth2PermissionGrant Create(this IOAuth2PermissionGrantOperations operations, OAuth2Permissio |
| | 69 | | { |
| 0 | 70 | | return operations.CreateAsync(body).GetAwaiter().GetResult(); |
| | 71 | | } |
| | 72 | |
|
| | 73 | | /// <summary> |
| | 74 | | /// Grants OAuth2 permissions for the relevant resource Ids of an app. |
| | 75 | | /// </summary> |
| | 76 | | /// <param name='operations'> |
| | 77 | | /// The operations group for this extension method. |
| | 78 | | /// </param> |
| | 79 | | /// <param name='body'> |
| | 80 | | /// The relevant app Service Principal Object Id and the Service Principal |
| | 81 | | /// Object Id you want to grant. |
| | 82 | | /// </param> |
| | 83 | | /// <param name='cancellationToken'> |
| | 84 | | /// The cancellation token. |
| | 85 | | /// </param> |
| | 86 | | public static async Task<OAuth2PermissionGrant> CreateAsync(this IOAuth2PermissionGrantOperations operations |
| | 87 | | { |
| 0 | 88 | | using (var _result = await operations.CreateWithHttpMessagesAsync(body, null, cancellationToken).Configu |
| | 89 | | { |
| 0 | 90 | | return _result.Body; |
| | 91 | | } |
| 0 | 92 | | } |
| | 93 | |
|
| | 94 | | /// <summary> |
| | 95 | | /// Delete a OAuth2 permission grant for the relevant resource Ids of an app. |
| | 96 | | /// </summary> |
| | 97 | | /// <param name='operations'> |
| | 98 | | /// The operations group for this extension method. |
| | 99 | | /// </param> |
| | 100 | | /// <param name='objectId'> |
| | 101 | | /// The object ID of a permission grant. |
| | 102 | | /// </param> |
| | 103 | | public static void Delete(this IOAuth2PermissionGrantOperations operations, string objectId) |
| | 104 | | { |
| 0 | 105 | | operations.DeleteAsync(objectId).GetAwaiter().GetResult(); |
| 0 | 106 | | } |
| | 107 | |
|
| | 108 | | /// <summary> |
| | 109 | | /// Delete a OAuth2 permission grant for the relevant resource Ids of an app. |
| | 110 | | /// </summary> |
| | 111 | | /// <param name='operations'> |
| | 112 | | /// The operations group for this extension method. |
| | 113 | | /// </param> |
| | 114 | | /// <param name='objectId'> |
| | 115 | | /// The object ID of a permission grant. |
| | 116 | | /// </param> |
| | 117 | | /// <param name='cancellationToken'> |
| | 118 | | /// The cancellation token. |
| | 119 | | /// </param> |
| | 120 | | public static async Task DeleteAsync(this IOAuth2PermissionGrantOperations operations, string objectId, Canc |
| | 121 | | { |
| 0 | 122 | | (await operations.DeleteWithHttpMessagesAsync(objectId, null, cancellationToken).ConfigureAwait(false)). |
| 0 | 123 | | } |
| | 124 | |
|
| | 125 | | /// <summary> |
| | 126 | | /// Gets the next page of OAuth2 permission grants |
| | 127 | | /// </summary> |
| | 128 | | /// <param name='operations'> |
| | 129 | | /// The operations group for this extension method. |
| | 130 | | /// </param> |
| | 131 | | /// <param name='nextLink'> |
| | 132 | | /// Next link for the list operation. |
| | 133 | | /// </param> |
| | 134 | | public static IPage<OAuth2PermissionGrant> ListNext(this IOAuth2PermissionGrantOperations operations, string |
| | 135 | | { |
| 0 | 136 | | return operations.ListNextAsync(nextLink).GetAwaiter().GetResult(); |
| | 137 | | } |
| | 138 | |
|
| | 139 | | /// <summary> |
| | 140 | | /// Gets the next page of OAuth2 permission grants |
| | 141 | | /// </summary> |
| | 142 | | /// <param name='operations'> |
| | 143 | | /// The operations group for this extension method. |
| | 144 | | /// </param> |
| | 145 | | /// <param name='nextLink'> |
| | 146 | | /// Next link for the list operation. |
| | 147 | | /// </param> |
| | 148 | | /// <param name='cancellationToken'> |
| | 149 | | /// The cancellation token. |
| | 150 | | /// </param> |
| | 151 | | public static async Task<IPage<OAuth2PermissionGrant>> ListNextAsync(this IOAuth2PermissionGrantOperations o |
| | 152 | | { |
| 0 | 153 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).C |
| | 154 | | { |
| 0 | 155 | | return _result.Body; |
| | 156 | | } |
| 0 | 157 | | } |
| | 158 | |
|
| | 159 | | } |
| | 160 | | } |