public virtual Response <RestorableDroppedDatabase> Get(CancellationToken cancellationToken = default) { using var scope = _restorableDroppedDatabaseClientDiagnostics.CreateScope("RestorableDroppedDatabase.Get"); scope.Start(); try { var response = _restorableDroppedDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _restorableDroppedDatabaseClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new RestorableDroppedDatabase(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <RestorableDroppedDatabaseResource> Get(string restorableDroppedDatabaseId, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(restorableDroppedDatabaseId, nameof(restorableDroppedDatabaseId)); using var scope = _restorableDroppedDatabaseClientDiagnostics.CreateScope("RestorableDroppedDatabaseCollection.Get"); scope.Start(); try { var response = _restorableDroppedDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, restorableDroppedDatabaseId, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new RestorableDroppedDatabaseResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }