| | 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 ServicePrincipalsOperations. |
| | 24 | | /// </summary> |
| | 25 | | public static partial class ServicePrincipalsOperationsExtensions |
| | 26 | | { |
| | 27 | | /// <summary> |
| | 28 | | /// Creates a service principal in the directory. |
| | 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 service principal. |
| | 35 | | /// </param> |
| | 36 | | public static ServicePrincipal Create(this IServicePrincipalsOperations operations, ServicePrincipalCreatePa |
| | 37 | | { |
| 0 | 38 | | return operations.CreateAsync(parameters).GetAwaiter().GetResult(); |
| | 39 | | } |
| | 40 | |
|
| | 41 | | /// <summary> |
| | 42 | | /// Creates a service principal in the directory. |
| | 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 service principal. |
| | 49 | | /// </param> |
| | 50 | | /// <param name='cancellationToken'> |
| | 51 | | /// The cancellation token. |
| | 52 | | /// </param> |
| | 53 | | public static async Task<ServicePrincipal> CreateAsync(this IServicePrincipalsOperations operations, Service |
| | 54 | | { |
| 0 | 55 | | using (var _result = await operations.CreateWithHttpMessagesAsync(parameters, null, cancellationToken).C |
| | 56 | | { |
| 0 | 57 | | return _result.Body; |
| | 58 | | } |
| 0 | 59 | | } |
| | 60 | |
|
| | 61 | | /// <summary> |
| | 62 | | /// Gets a list of service principals from 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<ServicePrincipal> List(this IServicePrincipalsOperations operations, ODataQuery<ServiceP |
| | 71 | | { |
| 8 | 72 | | return operations.ListAsync(odataQuery).GetAwaiter().GetResult(); |
| | 73 | | } |
| | 74 | |
|
| | 75 | | /// <summary> |
| | 76 | | /// Gets a list of service principals from 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<ServicePrincipal>> ListAsync(this IServicePrincipalsOperations operations, OD |
| | 88 | | { |
| 8 | 89 | | using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).Con |
| | 90 | | { |
| 8 | 91 | | return _result.Body; |
| | 92 | | } |
| 8 | 93 | | } |
| | 94 | |
|
| | 95 | | /// <summary> |
| | 96 | | /// Updates a service principal in the directory. |
| | 97 | | /// </summary> |
| | 98 | | /// <param name='operations'> |
| | 99 | | /// The operations group for this extension method. |
| | 100 | | /// </param> |
| | 101 | | /// <param name='objectId'> |
| | 102 | | /// The object ID of the service principal to delete. |
| | 103 | | /// </param> |
| | 104 | | /// <param name='parameters'> |
| | 105 | | /// Parameters to update a service principal. |
| | 106 | | /// </param> |
| | 107 | | public static void Update(this IServicePrincipalsOperations operations, string objectId, ServicePrincipalUpd |
| | 108 | | { |
| 0 | 109 | | operations.UpdateAsync(objectId, parameters).GetAwaiter().GetResult(); |
| 0 | 110 | | } |
| | 111 | |
|
| | 112 | | /// <summary> |
| | 113 | | /// Updates a service principal in the directory. |
| | 114 | | /// </summary> |
| | 115 | | /// <param name='operations'> |
| | 116 | | /// The operations group for this extension method. |
| | 117 | | /// </param> |
| | 118 | | /// <param name='objectId'> |
| | 119 | | /// The object ID of the service principal to delete. |
| | 120 | | /// </param> |
| | 121 | | /// <param name='parameters'> |
| | 122 | | /// Parameters to update a service principal. |
| | 123 | | /// </param> |
| | 124 | | /// <param name='cancellationToken'> |
| | 125 | | /// The cancellation token. |
| | 126 | | /// </param> |
| | 127 | | public static async Task UpdateAsync(this IServicePrincipalsOperations operations, string objectId, ServiceP |
| | 128 | | { |
| 0 | 129 | | (await operations.UpdateWithHttpMessagesAsync(objectId, parameters, null, cancellationToken).ConfigureAw |
| 0 | 130 | | } |
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// Deletes a service principal from the directory. |
| | 134 | | /// </summary> |
| | 135 | | /// <param name='operations'> |
| | 136 | | /// The operations group for this extension method. |
| | 137 | | /// </param> |
| | 138 | | /// <param name='objectId'> |
| | 139 | | /// The object ID of the service principal to delete. |
| | 140 | | /// </param> |
| | 141 | | public static void Delete(this IServicePrincipalsOperations operations, string objectId) |
| | 142 | | { |
| 0 | 143 | | operations.DeleteAsync(objectId).GetAwaiter().GetResult(); |
| 0 | 144 | | } |
| | 145 | |
|
| | 146 | | /// <summary> |
| | 147 | | /// Deletes a service principal from the directory. |
| | 148 | | /// </summary> |
| | 149 | | /// <param name='operations'> |
| | 150 | | /// The operations group for this extension method. |
| | 151 | | /// </param> |
| | 152 | | /// <param name='objectId'> |
| | 153 | | /// The object ID of the service principal to delete. |
| | 154 | | /// </param> |
| | 155 | | /// <param name='cancellationToken'> |
| | 156 | | /// The cancellation token. |
| | 157 | | /// </param> |
| | 158 | | public static async Task DeleteAsync(this IServicePrincipalsOperations operations, string objectId, Cancella |
| | 159 | | { |
| 0 | 160 | | (await operations.DeleteWithHttpMessagesAsync(objectId, null, cancellationToken).ConfigureAwait(false)). |
| 0 | 161 | | } |
| | 162 | |
|
| | 163 | | /// <summary> |
| | 164 | | /// Gets service principal information from the directory. Query by objectId or |
| | 165 | | /// pass a filter to query by appId |
| | 166 | | /// </summary> |
| | 167 | | /// <param name='operations'> |
| | 168 | | /// The operations group for this extension method. |
| | 169 | | /// </param> |
| | 170 | | /// <param name='objectId'> |
| | 171 | | /// The object ID of the service principal to get. |
| | 172 | | /// </param> |
| | 173 | | public static ServicePrincipal Get(this IServicePrincipalsOperations operations, string objectId) |
| | 174 | | { |
| 2 | 175 | | return operations.GetAsync(objectId).GetAwaiter().GetResult(); |
| | 176 | | } |
| | 177 | |
|
| | 178 | | /// <summary> |
| | 179 | | /// Gets service principal information from the directory. Query by objectId or |
| | 180 | | /// pass a filter to query by appId |
| | 181 | | /// </summary> |
| | 182 | | /// <param name='operations'> |
| | 183 | | /// The operations group for this extension method. |
| | 184 | | /// </param> |
| | 185 | | /// <param name='objectId'> |
| | 186 | | /// The object ID of the service principal to get. |
| | 187 | | /// </param> |
| | 188 | | /// <param name='cancellationToken'> |
| | 189 | | /// The cancellation token. |
| | 190 | | /// </param> |
| | 191 | | public static async Task<ServicePrincipal> GetAsync(this IServicePrincipalsOperations operations, string obj |
| | 192 | | { |
| 2 | 193 | | using (var _result = await operations.GetWithHttpMessagesAsync(objectId, null, cancellationToken).Config |
| | 194 | | { |
| 2 | 195 | | return _result.Body; |
| | 196 | | } |
| 2 | 197 | | } |
| | 198 | |
|
| | 199 | | /// <summary> |
| | 200 | | /// Directory objects that are owners of this service principal. |
| | 201 | | /// </summary> |
| | 202 | | /// <remarks> |
| | 203 | | /// The owners are a set of non-admin users who are allowed to modify this |
| | 204 | | /// object. |
| | 205 | | /// </remarks> |
| | 206 | | /// <param name='operations'> |
| | 207 | | /// The operations group for this extension method. |
| | 208 | | /// </param> |
| | 209 | | /// <param name='objectId'> |
| | 210 | | /// The object ID of the service principal for which to get owners. |
| | 211 | | /// </param> |
| | 212 | | public static IPage<DirectoryObject> ListOwners(this IServicePrincipalsOperations operations, string objectI |
| | 213 | | { |
| 0 | 214 | | return operations.ListOwnersAsync(objectId).GetAwaiter().GetResult(); |
| | 215 | | } |
| | 216 | |
|
| | 217 | | /// <summary> |
| | 218 | | /// Directory objects that are owners of this service principal. |
| | 219 | | /// </summary> |
| | 220 | | /// <remarks> |
| | 221 | | /// The owners are a set of non-admin users who are allowed to modify this |
| | 222 | | /// object. |
| | 223 | | /// </remarks> |
| | 224 | | /// <param name='operations'> |
| | 225 | | /// The operations group for this extension method. |
| | 226 | | /// </param> |
| | 227 | | /// <param name='objectId'> |
| | 228 | | /// The object ID of the service principal for which to get owners. |
| | 229 | | /// </param> |
| | 230 | | /// <param name='cancellationToken'> |
| | 231 | | /// The cancellation token. |
| | 232 | | /// </param> |
| | 233 | | public static async Task<IPage<DirectoryObject>> ListOwnersAsync(this IServicePrincipalsOperations operation |
| | 234 | | { |
| 0 | 235 | | using (var _result = await operations.ListOwnersWithHttpMessagesAsync(objectId, null, cancellationToken) |
| | 236 | | { |
| 0 | 237 | | return _result.Body; |
| | 238 | | } |
| 0 | 239 | | } |
| | 240 | |
|
| | 241 | | /// <summary> |
| | 242 | | /// Get the keyCredentials associated with the specified service principal. |
| | 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 service principal for which to get keyCredentials. |
| | 249 | | /// </param> |
| | 250 | | public static IEnumerable<KeyCredential> ListKeyCredentials(this IServicePrincipalsOperations operations, st |
| | 251 | | { |
| 0 | 252 | | return operations.ListKeyCredentialsAsync(objectId).GetAwaiter().GetResult(); |
| | 253 | | } |
| | 254 | |
|
| | 255 | | /// <summary> |
| | 256 | | /// Get the keyCredentials associated with the specified service principal. |
| | 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 service principal for which to get keyCredentials. |
| | 263 | | /// </param> |
| | 264 | | /// <param name='cancellationToken'> |
| | 265 | | /// The cancellation token. |
| | 266 | | /// </param> |
| | 267 | | public static async Task<IEnumerable<KeyCredential>> ListKeyCredentialsAsync(this IServicePrincipalsOperatio |
| | 268 | | { |
| 0 | 269 | | using (var _result = await operations.ListKeyCredentialsWithHttpMessagesAsync(objectId, null, cancellati |
| | 270 | | { |
| 0 | 271 | | return _result.Body; |
| | 272 | | } |
| 0 | 273 | | } |
| | 274 | |
|
| | 275 | | /// <summary> |
| | 276 | | /// Update the keyCredentials associated with a service principal. |
| | 277 | | /// </summary> |
| | 278 | | /// <param name='operations'> |
| | 279 | | /// The operations group for this extension method. |
| | 280 | | /// </param> |
| | 281 | | /// <param name='objectId'> |
| | 282 | | /// The object ID for which to get service principal information. |
| | 283 | | /// </param> |
| | 284 | | /// <param name='parameters'> |
| | 285 | | /// Parameters to update the keyCredentials of an existing service principal. |
| | 286 | | /// </param> |
| | 287 | | public static void UpdateKeyCredentials(this IServicePrincipalsOperations operations, string objectId, KeyCr |
| | 288 | | { |
| 0 | 289 | | operations.UpdateKeyCredentialsAsync(objectId, parameters).GetAwaiter().GetResult(); |
| 0 | 290 | | } |
| | 291 | |
|
| | 292 | | /// <summary> |
| | 293 | | /// Update the keyCredentials associated with a service principal. |
| | 294 | | /// </summary> |
| | 295 | | /// <param name='operations'> |
| | 296 | | /// The operations group for this extension method. |
| | 297 | | /// </param> |
| | 298 | | /// <param name='objectId'> |
| | 299 | | /// The object ID for which to get service principal information. |
| | 300 | | /// </param> |
| | 301 | | /// <param name='parameters'> |
| | 302 | | /// Parameters to update the keyCredentials of an existing service principal. |
| | 303 | | /// </param> |
| | 304 | | /// <param name='cancellationToken'> |
| | 305 | | /// The cancellation token. |
| | 306 | | /// </param> |
| | 307 | | public static async Task UpdateKeyCredentialsAsync(this IServicePrincipalsOperations operations, string obje |
| | 308 | | { |
| 0 | 309 | | (await operations.UpdateKeyCredentialsWithHttpMessagesAsync(objectId, parameters, null, cancellationToke |
| 0 | 310 | | } |
| | 311 | |
|
| | 312 | | /// <summary> |
| | 313 | | /// Gets the passwordCredentials associated with a service principal. |
| | 314 | | /// </summary> |
| | 315 | | /// <param name='operations'> |
| | 316 | | /// The operations group for this extension method. |
| | 317 | | /// </param> |
| | 318 | | /// <param name='objectId'> |
| | 319 | | /// The object ID of the service principal. |
| | 320 | | /// </param> |
| | 321 | | public static IEnumerable<PasswordCredential> ListPasswordCredentials(this IServicePrincipalsOperations oper |
| | 322 | | { |
| 0 | 323 | | return operations.ListPasswordCredentialsAsync(objectId).GetAwaiter().GetResult(); |
| | 324 | | } |
| | 325 | |
|
| | 326 | | /// <summary> |
| | 327 | | /// Gets the passwordCredentials associated with a service principal. |
| | 328 | | /// </summary> |
| | 329 | | /// <param name='operations'> |
| | 330 | | /// The operations group for this extension method. |
| | 331 | | /// </param> |
| | 332 | | /// <param name='objectId'> |
| | 333 | | /// The object ID of the service principal. |
| | 334 | | /// </param> |
| | 335 | | /// <param name='cancellationToken'> |
| | 336 | | /// The cancellation token. |
| | 337 | | /// </param> |
| | 338 | | public static async Task<IEnumerable<PasswordCredential>> ListPasswordCredentialsAsync(this IServicePrincipa |
| | 339 | | { |
| 0 | 340 | | using (var _result = await operations.ListPasswordCredentialsWithHttpMessagesAsync(objectId, null, cance |
| | 341 | | { |
| 0 | 342 | | return _result.Body; |
| | 343 | | } |
| 0 | 344 | | } |
| | 345 | |
|
| | 346 | | /// <summary> |
| | 347 | | /// Updates the passwordCredentials associated with a service principal. |
| | 348 | | /// </summary> |
| | 349 | | /// <param name='operations'> |
| | 350 | | /// The operations group for this extension method. |
| | 351 | | /// </param> |
| | 352 | | /// <param name='objectId'> |
| | 353 | | /// The object ID of the service principal. |
| | 354 | | /// </param> |
| | 355 | | /// <param name='parameters'> |
| | 356 | | /// Parameters to update the passwordCredentials of an existing service |
| | 357 | | /// principal. |
| | 358 | | /// </param> |
| | 359 | | public static void UpdatePasswordCredentials(this IServicePrincipalsOperations operations, string objectId, |
| | 360 | | { |
| 0 | 361 | | operations.UpdatePasswordCredentialsAsync(objectId, parameters).GetAwaiter().GetResult(); |
| 0 | 362 | | } |
| | 363 | |
|
| | 364 | | /// <summary> |
| | 365 | | /// Updates the passwordCredentials associated with a service principal. |
| | 366 | | /// </summary> |
| | 367 | | /// <param name='operations'> |
| | 368 | | /// The operations group for this extension method. |
| | 369 | | /// </param> |
| | 370 | | /// <param name='objectId'> |
| | 371 | | /// The object ID of the service principal. |
| | 372 | | /// </param> |
| | 373 | | /// <param name='parameters'> |
| | 374 | | /// Parameters to update the passwordCredentials of an existing service |
| | 375 | | /// principal. |
| | 376 | | /// </param> |
| | 377 | | /// <param name='cancellationToken'> |
| | 378 | | /// The cancellation token. |
| | 379 | | /// </param> |
| | 380 | | public static async Task UpdatePasswordCredentialsAsync(this IServicePrincipalsOperations operations, string |
| | 381 | | { |
| 0 | 382 | | (await operations.UpdatePasswordCredentialsWithHttpMessagesAsync(objectId, parameters, null, cancellatio |
| 0 | 383 | | } |
| | 384 | |
|
| | 385 | | /// <summary> |
| | 386 | | /// Gets a list of service principals from the current tenant. |
| | 387 | | /// </summary> |
| | 388 | | /// <param name='operations'> |
| | 389 | | /// The operations group for this extension method. |
| | 390 | | /// </param> |
| | 391 | | /// <param name='nextLink'> |
| | 392 | | /// Next link for the list operation. |
| | 393 | | /// </param> |
| | 394 | | public static IPage<ServicePrincipal> ListNext(this IServicePrincipalsOperations operations, string nextLink |
| | 395 | | { |
| 0 | 396 | | return operations.ListNextAsync(nextLink).GetAwaiter().GetResult(); |
| | 397 | | } |
| | 398 | |
|
| | 399 | | /// <summary> |
| | 400 | | /// Gets a list of service principals from the current tenant. |
| | 401 | | /// </summary> |
| | 402 | | /// <param name='operations'> |
| | 403 | | /// The operations group for this extension method. |
| | 404 | | /// </param> |
| | 405 | | /// <param name='nextLink'> |
| | 406 | | /// Next link for the list operation. |
| | 407 | | /// </param> |
| | 408 | | /// <param name='cancellationToken'> |
| | 409 | | /// The cancellation token. |
| | 410 | | /// </param> |
| | 411 | | public static async Task<IPage<ServicePrincipal>> ListNextAsync(this IServicePrincipalsOperations operations |
| | 412 | | { |
| 0 | 413 | | using (var _result = await operations.ListNextWithHttpMessagesAsync(nextLink, null, cancellationToken).C |
| | 414 | | { |
| 0 | 415 | | return _result.Body; |
| | 416 | | } |
| 0 | 417 | | } |
| | 418 | |
|
| | 419 | | /// <summary> |
| | 420 | | /// Directory objects that are owners of this service principal. |
| | 421 | | /// </summary> |
| | 422 | | /// <remarks> |
| | 423 | | /// The owners are a set of non-admin users who are allowed to modify this |
| | 424 | | /// object. |
| | 425 | | /// </remarks> |
| | 426 | | /// <param name='operations'> |
| | 427 | | /// The operations group for this extension method. |
| | 428 | | /// </param> |
| | 429 | | /// <param name='nextPageLink'> |
| | 430 | | /// The NextLink from the previous successful call to List operation. |
| | 431 | | /// </param> |
| | 432 | | public static IPage<DirectoryObject> ListOwnersNext(this IServicePrincipalsOperations operations, string nex |
| | 433 | | { |
| 0 | 434 | | return operations.ListOwnersNextAsync(nextPageLink).GetAwaiter().GetResult(); |
| | 435 | | } |
| | 436 | |
|
| | 437 | | /// <summary> |
| | 438 | | /// Directory objects that are owners of this service principal. |
| | 439 | | /// </summary> |
| | 440 | | /// <remarks> |
| | 441 | | /// The owners are a set of non-admin users who are allowed to modify this |
| | 442 | | /// object. |
| | 443 | | /// </remarks> |
| | 444 | | /// <param name='operations'> |
| | 445 | | /// The operations group for this extension method. |
| | 446 | | /// </param> |
| | 447 | | /// <param name='nextPageLink'> |
| | 448 | | /// The NextLink from the previous successful call to List operation. |
| | 449 | | /// </param> |
| | 450 | | /// <param name='cancellationToken'> |
| | 451 | | /// The cancellation token. |
| | 452 | | /// </param> |
| | 453 | | public static async Task<IPage<DirectoryObject>> ListOwnersNextAsync(this IServicePrincipalsOperations opera |
| | 454 | | { |
| 0 | 455 | | using (var _result = await operations.ListOwnersNextWithHttpMessagesAsync(nextPageLink, null, cancellati |
| | 456 | | { |
| 0 | 457 | | return _result.Body; |
| | 458 | | } |
| 0 | 459 | | } |
| | 460 | |
|
| | 461 | | } |
| | 462 | | } |