/// <summary> /// Implements the Dispose pattern for the AmazonWebServiceClient /// </summary> /// <param name="disposing">Whether this object is being disposed via a call to Dispose /// or garbage collected.</param> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing && glacierClient != null) { if (shouldDispose) { glacierClient.Dispose(); } glacierClient = null; } this.disposed = true; } }
/// <summary> /// Constructs an ArchiveTransferManager object using an existing Amazon Glacier client. /// </summary> /// <param name="glacier">An AmazonGlacier client that used to make service calls.</param> public ArchiveTransferManager(IAmazonGlacier glacier) { this.glacierClient = glacier; this.shouldDispose = false; }
/// <summary> /// Constructs an ArchiveTransferManager object for the specified Amazon Glacier region endpoint using the credentials /// loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSAccessKey" value="********************"/> /// <add key="AWSSecretKey" value="****************************************"/> /// </appSettings> /// </configuration> /// </code> /// /// </summary> /// <param name="region">Amazon Glacier region endpoint</param> public ArchiveTransferManager(RegionEndpoint region) { this.glacierClient = new AmazonGlacierClient(region); this.shouldDispose = true; }
private Amazon.Glacier.Model.GetVaultNotificationsResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.GetVaultNotificationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "GetVaultNotifications"); try { #if DESKTOP return(client.GetVaultNotifications(request)); #elif CORECLR return(client.GetVaultNotificationsAsync(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; } }
internal ListVaultsPaginator(IAmazonGlacier client, ListVaultsRequest request) { this._client = client; this._request = request; }
/// <summary> /// Constructs an ArchiveTransferManager object for the specified Amazon Glacier region endpoint using the credentials /// loaded from the application's default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance. /// /// Example App.config with credentials set. /// <code> /// <?xml version="1.0" encoding="utf-8" ?> /// <configuration> /// <appSettings> /// <add key="AWSProfileName" value="AWS Default"/> /// </appSettings> /// </configuration> /// </code> /// /// </summary> /// <param name="region">Amazon Glacier region endpoint</param> public ArchiveTransferManager(RegionEndpoint region) { this.glacierClient = new AmazonGlacierClient(region); this.shouldDispose = true; }