Пример #1
0
        static void GetVaultAccessPolicy(IAmazonGlacier glacier)
        {
            var req = new GetVaultAccessPolicyRequest
            {
                VaultName = VaultName
            };

            Task <GetVaultAccessPolicyResponse> res = glacier.GetVaultAccessPolicyAsync(req);

            Task.WaitAll(res);

            if (res.IsCompletedSuccessfully)
            {
                Console.WriteLine($"Access policy for vault {VaultName} is '{res.Result.Policy.Policy}'");
            }
        }
 private Amazon.Glacier.Model.GetVaultAccessPolicyResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.GetVaultAccessPolicyRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "GetVaultAccessPolicy");
     try
     {
         #if DESKTOP
         return(client.GetVaultAccessPolicy(request));
         #elif CORECLR
         return(client.GetVaultAccessPolicyAsync(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;
     }
 }