Ejemplo n.º 1
0
        public virtual Response <DeletedVault> Get(string vaultName, CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("DeletedVaultContainer.Get");
            scope.Start();
            try
            {
                if (vaultName == null)
                {
                    throw new ArgumentNullException(nameof(vaultName));
                }

                var response = _restClient.Get(Id.Name, vaultName, cancellationToken: cancellationToken);
                if (response.Value == null)
                {
                    throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
                }
                return(Response.FromValue(new DeletedVault(Parent, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Ejemplo n.º 2
0
 public virtual Response <DeletedVault> Get(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("DeletedVault.Get");
     scope.Start();
     try
     {
         var response = _restClient.Get(Id.Parent.Name, Id.Name, cancellationToken);
         if (response.Value == null)
         {
             throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse());
         }
         return(Response.FromValue(new DeletedVault(this, response.Value), response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }