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