| | 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 AccessTokensOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class AccessTokensOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Exchange ACR Refresh token for an ACR Access Token |
| | 26 | | /// </summary> |
| | 27 | | /// <param name='operations'> |
| | 28 | | /// The operations group for this extension method. |
| | 29 | | /// </param> |
| | 30 | | /// <param name='service'> |
| | 31 | | /// Indicates the name of your Azure container registry. |
| | 32 | | /// </param> |
| | 33 | | /// <param name='scope'> |
| | 34 | | /// Which is expected to be a valid scope, and can be specified more than once |
| | 35 | | /// for multiple scope requests. You obtained this from the Www-Authenticate |
| | 36 | | /// response header from the challenge. |
| | 37 | | /// </param> |
| | 38 | | /// <param name='refreshToken'> |
| | 39 | | /// Must be a valid ACR refresh token |
| | 40 | | /// </param> |
| | 41 | | /// <param name='cancellationToken'> |
| | 42 | | /// The cancellation token. |
| | 43 | | /// </param> |
| | 44 | | public static async Task<AccessToken> GetAsync(this IAccessTokensOperations operations, string service, stri |
| | 45 | | { |
| 2 | 46 | | using (var _result = await operations.GetWithHttpMessagesAsync(service, scope, refreshToken, null, cance |
| | 47 | | { |
| 2 | 48 | | return _result.Body; |
| | 49 | | } |
| 2 | 50 | | } |
| | 51 | |
|
| | 52 | | /// <summary> |
| | 53 | | /// Exchange Username, Password and Scope an ACR Access Token |
| | 54 | | /// </summary> |
| | 55 | | /// <param name='operations'> |
| | 56 | | /// The operations group for this extension method. |
| | 57 | | /// </param> |
| | 58 | | /// <param name='service'> |
| | 59 | | /// Indicates the name of your Azure container registry. |
| | 60 | | /// </param> |
| | 61 | | /// <param name='scope'> |
| | 62 | | /// Expected to be a valid scope, and can be specified more than once for |
| | 63 | | /// multiple scope requests. You can obtain this from the Www-Authenticate |
| | 64 | | /// response header from the challenge. |
| | 65 | | /// </param> |
| | 66 | | /// <param name='cancellationToken'> |
| | 67 | | /// The cancellation token. |
| | 68 | | /// </param> |
| | 69 | | public static async Task<AccessToken> GetFromLoginAsync(this IAccessTokensOperations operations, string serv |
| | 70 | | { |
| 2 | 71 | | using (var _result = await operations.GetFromLoginWithHttpMessagesAsync(service, scope, null, cancellati |
| | 72 | | { |
| 2 | 73 | | return _result.Body; |
| | 74 | | } |
| 2 | 75 | | } |
| | 76 | |
|
| | 77 | | } |
| | 78 | | } |