/// <summary>
        ///     Downloads the objects in Amazon S3 that have a key that starts with the value
        ///     specified by the <c>S3Directory</c>
        ///     property of the passed in <c>TransferUtilityDownloadDirectoryRequest</c> object.
        /// </summary>
        /// <param name="request">
        ///     Contains all the parameters required to download objects from Amazon S3
        ///     into a local directory.
        /// </param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task DownloadDirectoryAsync(TransferUtilityDownloadDirectoryRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var command = new DownloadDirectoryCommand(this._s3Client, request, this._config);

            command.DownloadFilesConcurrently = request.DownloadFilesConcurrently;
            return(command.ExecuteAsync(cancellationToken));
        }
        /// <summary>
        ///     Downloads the objects in Amazon S3 that have a key that starts with the value
        ///     specified by the <c>S3Directory</c>
        ///     property of the passed in <c>TransferUtilityDownloadDirectoryRequest</c> object.
        /// </summary>
        /// <param name="request">
        ///     Contains all the parameters required to download objects from Amazon S3
        ///     into a local directory.
        /// </param>
        public void DownloadDirectory(TransferUtilityDownloadDirectoryRequest request)
        {
            BaseCommand command = new DownloadDirectoryCommand(this._s3Client, request);

            command.Execute();
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DownloadDirectory operation.
        /// <seealso cref="M:Amazon.S3.Transfer.TransferUtility.DownloadDirectory"/>
        /// </summary>
        /// <param name="request">
        ///     Contains all the parameters required to download objects from a directory in Amazon S3
        ///     to a local directory.
        /// </param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback procedure using the AsyncState property.</param>
        /// <exception cref="T:System.ArgumentNullException"></exception>
        /// <exception cref="T:System.Net.WebException"></exception>
        /// <exception cref="T:Amazon.S3.AmazonS3Exception"></exception>
        /// <returns>An IAsyncResult that can be used to poll, or wait for results, or both.
        /// This values is also needed when invoking EndDownload.</returns>
        public IAsyncResult BeginDownloadDirectory(TransferUtilityDownloadDirectoryRequest request, AsyncCallback callback, object state)
        {
            BaseCommand command = new DownloadDirectoryCommand(this._s3Client, request);

            return(beginOperation(command, callback, state));
        }