/// <summary> /// Downloads the .nupkg file of a Package. /// </summary> /// <remarks> /// Required permissions: Packages.View. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='key'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Stream> DownloadPackageByKeyAsync(this IProcesses operations, string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { var _result = await operations.DownloadPackageByKeyWithHttpMessagesAsync(key, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); return(_result.Body); }