| | | 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.ContainerRegistry |
| | | 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 RefreshTokensOperations. |
| | | 21 | | /// </summary> |
| | | 22 | | public static partial class RefreshTokensOperationsExtensions |
| | | 23 | | { |
| | | 24 | | /// <summary> |
| | | 25 | | /// Exchange AAD tokens for an ACR refresh Token |
| | | 26 | | /// </summary> |
| | | 27 | | /// <param name='operations'> |
| | | 28 | | /// The operations group for this extension method. |
| | | 29 | | /// </param> |
| | | 30 | | /// <param name='grantType'> |
| | | 31 | | /// Can take a value of access_token_refresh_token, or access_token, or |
| | | 32 | | /// refresh_token. Possible values include: 'access_token_refresh_token', |
| | | 33 | | /// 'access_token', 'refresh_token' |
| | | 34 | | /// </param> |
| | | 35 | | /// <param name='service'> |
| | | 36 | | /// Indicates the name of your Azure container registry. |
| | | 37 | | /// </param> |
| | | 38 | | /// <param name='tenant'> |
| | | 39 | | /// AAD tenant associated to the AAD credentials. |
| | | 40 | | /// </param> |
| | | 41 | | /// <param name='refreshToken'> |
| | | 42 | | /// AAD refresh token, mandatory when grant_type is access_token_refresh_token |
| | | 43 | | /// or refresh_token |
| | | 44 | | /// </param> |
| | | 45 | | /// <param name='accessToken'> |
| | | 46 | | /// AAD access token, mandatory when grant_type is access_token_refresh_token |
| | | 47 | | /// or access_token. |
| | | 48 | | /// </param> |
| | | 49 | | /// <param name='cancellationToken'> |
| | | 50 | | /// The cancellation token. |
| | | 51 | | /// </param> |
| | | 52 | | public static async Task<RefreshToken> GetFromExchangeAsync(this IRefreshTokensOperations operations, string |
| | | 53 | | { |
| | 4 | 54 | | using (var _result = await operations.GetFromExchangeWithHttpMessagesAsync(grantType, service, tenant, r |
| | | 55 | | { |
| | 4 | 56 | | return _result.Body; |
| | | 57 | | } |
| | 4 | 58 | | } |
| | | 59 | | |
| | | 60 | | } |
| | | 61 | | } |