/// <summary>
/// Uploads all files in the upload queue.
/// </summary>
/// <returns>A <see cref="Task"/> that will will return an instance of <see cref="EntityList{T}"/> containing
/// one instance of <see cref="BatchFile"/> per file uploaded.</returns>
public async Task <Entity> UploadFiles()
{
processedFilesCounter = 0;
try
{
// perform handshake if needed
Batch = Batch ?? await client.Batch();
}
catch (ServerErrorException exception)
{
throw new FailedHandshakeException("Failed to initialize batch with the server.", exception);
}
foreach (string path in filesToUpload)
{
await ProcessFile(path);
}
return(await Batch.Info());
}