public async virtual Task <Response <ServerDevOpsAuditingSettings> > GetAsync(string devOpsAuditingSettingsName, CancellationToken cancellationToken = default) { if (devOpsAuditingSettingsName == null) { throw new ArgumentNullException(nameof(devOpsAuditingSettingsName)); } using var scope = _clientDiagnostics.CreateScope("ServerDevOpsAuditingSettingsCollection.Get"); scope.Start(); try { var response = await _serverDevOpsAuditSettingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, devOpsAuditingSettingsName, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new ServerDevOpsAuditingSettings(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <ServerDevOpsAuditingSettingsResource> > GetAsync(CancellationToken cancellationToken = default) { using var scope = _serverDevOpsAuditingSettingsServerDevOpsAuditSettingsClientDiagnostics.CreateScope("ServerDevOpsAuditingSettingsResource.Get"); scope.Start(); try { var response = await _serverDevOpsAuditingSettingsServerDevOpsAuditSettingsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new ServerDevOpsAuditingSettingsResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }