| | | 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 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 UsersOperations. |
| | | 24 | | /// </summary> |
| | | 25 | | public static partial class UsersOperationsExtensions |
| | | 26 | | { |
| | | 27 | | /// <summary> |
| | | 28 | | /// Create a new user. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name='operations'> |
| | | 31 | | /// The operations group for this extension method. |
| | | 32 | | /// </param> |
| | | 33 | | /// <param name='parameters'> |
| | | 34 | | /// Parameters to create a user. |
| | | 35 | | /// </param> |
| | | 36 | | public static User Create(this IUsersOperations operations, UserCreateParameters parameters) |
| | | 37 | | { |
| | 4 | 38 | | return operations.CreateAsync(parameters).GetAwaiter().GetResult(); |
| | | 39 | | } |
| | | 40 | | |
| | | 41 | | /// <summary> |
| | | 42 | | /// Create a new user. |
| | | 43 | | /// </summary> |
| | | 44 | | /// <param name='operations'> |
| | | 45 | | /// The operations group for this extension method. |
| | | 46 | | /// </param> |
| | | 47 | | /// <param name='parameters'> |
| | | 48 | | /// Parameters to create a user. |
| | | 49 | | /// </param> |
| | | 50 | | /// <param name='cancellationToken'> |
| | | 51 | | /// The cancellation token. |
| | | 52 | | /// </param> |
| | | 53 | | public static async Task<User> CreateAsync(this IUsersOperations operations, UserCreateParameters parameters |
| | | 54 | | { |
| | 4 | 55 | | using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).C |
| | | 56 | | { |
| | 4 | 57 | | return _result.Body; |
| | | 58 | | } |
| | 4 | 59 | | } |
| | | 60 | | |
| | | 61 | | /// <summary> |
| | | 62 | | /// Gets list of users for the current tenant. |
| | | 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<User> List(this IUsersOperations operations, ODataQuery<User> odataQuery = default(OData |
| | | 71 | | { |
| | 10 | 72 | | return operations.ListAsync(odataQuery).GetAwaiter().GetResult(); |
| | | 73 | | } |
| | | 74 | | |
| | | 75 | | /// <summary> |
| | | 76 | | /// Gets list of users for the current tenant. |
| | | 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<User>> ListAsync(this IUsersOperations operations, ODataQuery<User> odataQuer |
| | | 88 | | { |
| | 10 | 89 | | using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).Con |
| | | 90 | | { |
| | 10 | 91 | | return _result.Body; |
| | | 92 | | } |
| | 10 | 93 | | } |
| | | 94 | | |
| | | 95 | | /// <summary> |
| | | 96 | | /// Gets user information from the directory. |
| | | 97 | | /// </summary> |
| | | 98 | | /// <param name='operations'> |
| | | 99 | | /// The operations group for this extension method. |
| | | 100 | | /// </param> |
| | | 101 | | /// <param name='upnOrObjectId'> |
| | | 102 | | /// The object ID or principal name of the user for which to get information. |
| | | 103 | | /// </param> |
| | | 104 | | public static User Get(this IUsersOperations operations, string upnOrObjectId) |
| | | 105 | | { |
| | 4 | 106 | | return operations.GetAsync(upnOrObjectId).GetAwaiter().GetResult(); |
| | | 107 | | } |
| | | 108 | | |
| | | 109 | | /// <summary> |
| | | 110 | | /// Gets user information from the directory. |
| | | 111 | | /// </summary> |
| | | 112 | | /// <param name='operations'> |
| | | 113 | | /// The operations group for this extension method. |
| | | 114 | | /// </param> |
| | | 115 | | /// <param name='upnOrObjectId'> |
| | | 116 | | /// The object ID or principal name of the user for which to get information. |
| | | 117 | | /// </param> |
| | | 118 | | /// <param name='cancellationToken'> |
| | | 119 | | /// The cancellation token. |
| | | 120 | | /// </param> |
| | | 121 | | public static async Task<User> GetAsync(this IUsersOperations operations, string upnOrObjectId, Cancellation |
| | | 122 | | { |
| | 4 | 123 | | using (var _result = await operations.GetWithHttpMessagesAsync(upnOrObjectId, null, cancellationToken).C |
| | | 124 | | { |
| | 2 | 125 | | return _result.Body; |
| | | 126 | | } |
| | 2 | 127 | | } |
| | | 128 | | |
| | | 129 | | /// <summary> |
| | | 130 | | /// Updates a user. |
| | | 131 | | /// </summary> |
| | | 132 | | /// <param name='operations'> |
| | | 133 | | /// The operations group for this extension method. |
| | | 134 | | /// </param> |
| | | 135 | | /// <param name='upnOrObjectId'> |
| | | 136 | | /// The object ID or principal name of the user to update. |
| | | 137 | | /// </param> |
| | | 138 | | /// <param name='parameters'> |
| | | 139 | | /// Parameters to update an existing user. |
| | | 140 | | /// </param> |
| | | 141 | | public static void Update(this IUsersOperations operations, string upnOrObjectId, UserUpdateParameters param |
| | | 142 | | { |
| | 0 | 143 | | operations.UpdateAsync(upnOrObjectId, parameters).GetAwaiter().GetResult(); |
| | 0 | 144 | | } |
| | | 145 | | |
| | | 146 | | /// <summary> |
| | | 147 | | /// Updates a user. |
| | | 148 | | /// </summary> |
| | | 149 | | /// <param name='operations'> |
| | | 150 | | /// The operations group for this extension method. |
| | | 151 | | /// </param> |
| | | 152 | | /// <param name='upnOrObjectId'> |
| | | 153 | | /// The object ID or principal name of the user to update. |
| | | 154 | | /// </param> |
| | | 155 | | /// <param name='parameters'> |
| | | 156 | | /// Parameters to update an existing user. |
| | | 157 | | /// </param> |
| | | 158 | | /// <param name='cancellationToken'> |
| | | 159 | | /// The cancellation token. |
| | | 160 | | /// </param> |
| | | 161 | | public static async Task UpdateAsync(this IUsersOperations operations, string upnOrObjectId, UserUpdateParam |
| | | 162 | | { |
| | 0 | 163 | | (await operations.UpdateWithHttpMessagesAsync(upnOrObjectId, parameters, null, cancellationToken).Config |
| | 0 | 164 | | } |
| | | 165 | | |
| | | 166 | | /// <summary> |
| | | 167 | | /// Delete a user. |
| | | 168 | | /// </summary> |
| | | 169 | | /// <param name='operations'> |
| | | 170 | | /// The operations group for this extension method. |
| | | 171 | | /// </param> |
| | | 172 | | /// <param name='upnOrObjectId'> |
| | | 173 | | /// The object ID or principal name of the user to delete. |
| | | 174 | | /// </param> |
| | | 175 | | public static void Delete(this IUsersOperations operations, string upnOrObjectId) |
| | | 176 | | { |
| | 4 | 177 | | operations.DeleteAsync(upnOrObjectId).GetAwaiter().GetResult(); |
| | 4 | 178 | | } |
| | | 179 | | |
| | | 180 | | /// <summary> |
| | | 181 | | /// Delete a user. |
| | | 182 | | /// </summary> |
| | | 183 | | /// <param name='operations'> |
| | | 184 | | /// The operations group for this extension method. |
| | | 185 | | /// </param> |
| | | 186 | | /// <param name='upnOrObjectId'> |
| | | 187 | | /// The object ID or principal name of the user to delete. |
| | | 188 | | /// </param> |
| | | 189 | | /// <param name='cancellationToken'> |
| | | 190 | | /// The cancellation token. |
| | | 191 | | /// </param> |
| | | 192 | | public static async Task DeleteAsync(this IUsersOperations operations, string upnOrObjectId, CancellationTok |
| | | 193 | | { |
| | 4 | 194 | | (await operations.DeleteWithHttpMessagesAsync(upnOrObjectId, null, cancellationToken).ConfigureAwait(fal |
| | 4 | 195 | | } |
| | | 196 | | |
| | | 197 | | /// <summary> |
| | | 198 | | /// Gets a collection that contains the object IDs of the groups of which the |
| | | 199 | | /// user is a member. |
| | | 200 | | /// </summary> |
| | | 201 | | /// <param name='operations'> |
| | | 202 | | /// The operations group for this extension method. |
| | | 203 | | /// </param> |
| | | 204 | | /// <param name='objectId'> |
| | | 205 | | /// The object ID of the user for which to get group membership. |
| | | 206 | | /// </param> |
| | | 207 | | /// <param name='parameters'> |
| | | 208 | | /// User filtering parameters. |
| | | 209 | | /// </param> |
| | | 210 | | public static IEnumerable<string> GetMemberGroups(this IUsersOperations operations, string objectId, UserGet |
| | | 211 | | { |
| | 6 | 212 | | return operations.GetMemberGroupsAsync(objectId, parameters).GetAwaiter().GetResult(); |
| | | 213 | | } |
| | | 214 | | |
| | | 215 | | /// <summary> |
| | | 216 | | /// Gets a collection that contains the object IDs of the groups of which the |
| | | 217 | | /// user is a member. |
| | | 218 | | /// </summary> |
| | | 219 | | /// <param name='operations'> |
| | | 220 | | /// The operations group for this extension method. |
| | | 221 | | /// </param> |
| | | 222 | | /// <param name='objectId'> |
| | | 223 | | /// The object ID of the user for which to get group membership. |
| | | 224 | | /// </param> |
| | | 225 | | /// <param name='parameters'> |
| | | 226 | | /// User filtering parameters. |
| | | 227 | | /// </param> |
| | | 228 | | /// <param name='cancellationToken'> |
| | | 229 | | /// The cancellation token. |
| | | 230 | | /// </param> |
| | | 231 | | public static async Task<IEnumerable<string>> GetMemberGroupsAsync(this IUsersOperations operations, string |
| | | 232 | | { |
| | 6 | 233 | | using (var _result = await operations.GetMemberGroupsWithHttpMessagesAsync(objectId, parameters, null, c |
| | | 234 | | { |
| | 6 | 235 | | return _result.Body; |
| | | 236 | | } |
| | 6 | 237 | | } |
| | | 238 | | |
| | | 239 | | /// <summary> |
| | | 240 | | /// Gets a list of users for the current tenant. |
| | | 241 | | /// </summary> |
| | | 242 | | /// <param name='operations'> |
| | | 243 | | /// The operations group for this extension method. |
| | | 244 | | /// </param> |
| | | 245 | | /// <param name='nextLink'> |
| | | 246 | | /// Next link for the list operation. |
| | | 247 | | /// </param> |
| | | 248 | | public static IPage<User> ListNext(this IUsersOperations operations, string nextLink) |
| | | 249 | | { |
| | 0 | 250 | | return operations.ListNextAsync(nextLink).GetAwaiter().GetResult(); |
| | | 251 | | } |
| | | 252 | | |
| | | 253 | | /// <summary> |
| | | 254 | | /// Gets a list of users for the current tenant. |
| | | 255 | | /// </summary> |
| | | 256 | | /// <param name='operations'> |
| | | 257 | | /// The operations group for this extension method. |
| | | 258 | | /// </param> |
| | | 259 | | /// <param name='nextLink'> |
| | | 260 | | /// Next link for the list operation. |
| | | 261 | | /// </param> |
| | | 262 | | /// <param name='cancellationToken'> |
| | | 263 | | /// The cancellation token. |
| | | 264 | | /// </param> |
| | | 265 | | public static async Task<IPage<User>> ListNextAsync(this IUsersOperations operations, string nextLink, Cance |
| | | 266 | | { |
| | 0 | 267 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).C |
| | | 268 | | { |
| | 0 | 269 | | return _result.Body; |
| | | 270 | | } |
| | 0 | 271 | | } |
| | | 272 | | |
| | | 273 | | } |
| | | 274 | | } |