public virtual async Task <Response <QuotaRequestDetailsResource> > GetAsync(string id, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(id, nameof(id)); using var scope = _quotaRequestDetailsQuotaRequestStatusClientDiagnostics.CreateScope("QuotaRequestDetailsCollection.Get"); scope.Start(); try { var response = await _quotaRequestDetailsQuotaRequestStatusRestClient.GetAsync(Id.SubscriptionId, _providerId, _location, id, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new QuotaRequestDetailsResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <QuotaRequestDetailsResource> > GetAsync(CancellationToken cancellationToken = default) { using var scope = _quotaRequestDetailsQuotaRequestStatusClientDiagnostics.CreateScope("QuotaRequestDetailsResource.Get"); scope.Start(); try { var response = await _quotaRequestDetailsQuotaRequestStatusRestClient.GetAsync(Id.SubscriptionId, 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 QuotaRequestDetailsResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }