/// <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>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AWSAccessKey" value="********************"/&gt;
 ///         &lt;add key="AWSSecretKey" value="****************************************"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </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;
     }
 }
Exemple #5
0
 internal ListVaultsPaginator(IAmazonGlacier client, ListVaultsRequest request)
 {
     this._client  = client;
     this._request = request;
 }
Exemple #6
0
 /// <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;
 }
Exemple #7
0
 /// <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>
 /// &lt;?xml version="1.0" encoding="utf-8" ?&gt;
 /// &lt;configuration&gt;
 ///     &lt;appSettings&gt;
 ///         &lt;add key="AWSProfileName" value="AWS Default"/&gt;
 ///     &lt;/appSettings&gt;
 /// &lt;/configuration&gt;
 /// </code>
 ///
 /// </summary>
 /// <param name="region">Amazon Glacier region endpoint</param>
 public ArchiveTransferManager(RegionEndpoint region)
 {
     this.glacierClient = new AmazonGlacierClient(region);
     this.shouldDispose = true;
 }