public async virtual Task <Response <ManagedInstanceDatabaseVulnerabilityAssessmentScan> > GetAsync(string scanId, CancellationToken cancellationToken = default) { if (scanId == null) { throw new ArgumentNullException(nameof(scanId)); } using var scope = _clientDiagnostics.CreateScope("ManagedInstanceDatabaseVulnerabilityAssessmentScanCollection.Get"); scope.Start(); try { var response = await _managedDatabaseVulnerabilityAssessmentScansRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, scanId, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new ManagedInstanceDatabaseVulnerabilityAssessmentScan(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <ManagedInstanceDatabaseVulnerabilityAssessmentScanResource> > GetAsync(CancellationToken cancellationToken = default) { using var scope = _managedInstanceDatabaseVulnerabilityAssessmentScanManagedDatabaseVulnerabilityAssessmentScansClientDiagnostics.CreateScope("ManagedInstanceDatabaseVulnerabilityAssessmentScanResource.Get"); scope.Start(); try { var response = await _managedInstanceDatabaseVulnerabilityAssessmentScanManagedDatabaseVulnerabilityAssessmentScansRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ManagedInstanceDatabaseVulnerabilityAssessmentScanResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }