static void DeleteArchive(IAmazonGlacier glacier, string archiveId) { var req = new DeleteArchiveRequest { VaultName = VaultName, ArchiveId = archiveId }; Task <DeleteArchiveResponse> res = glacier.DeleteArchiveAsync(req); Task.WaitAll(res); if (res.IsCompletedSuccessfully) { Console.WriteLine($"Deleted ArchiveId: {archiveId}"); } }
private Amazon.Glacier.Model.DeleteArchiveResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.DeleteArchiveRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "DeleteArchive"); try { #if DESKTOP return(client.DeleteArchive(request)); #elif CORECLR return(client.DeleteArchiveAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }