public async virtual Task <Response <FrontendIPConfiguration> > GetAsync(string frontendIPConfigurationName, CancellationToken cancellationToken = default) { if (frontendIPConfigurationName == null) { throw new ArgumentNullException(nameof(frontendIPConfigurationName)); } using var scope = _clientDiagnostics.CreateScope("FrontendIPConfigurationCollection.Get"); scope.Start(); try { var response = await _loadBalancerFrontendIPConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, frontendIPConfigurationName, cancellationToken).ConfigureAwait(false); if (response.Value == null) { throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false); } return(Response.FromValue(new FrontendIPConfiguration(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <FrontendIPConfiguration> > GetAsync(CancellationToken cancellationToken = default) { using var scope = _frontendIPConfigurationLoadBalancerFrontendIPConfigurationsClientDiagnostics.CreateScope("FrontendIPConfiguration.Get"); scope.Start(); try { var response = await _frontendIPConfigurationLoadBalancerFrontendIPConfigurationsRestClient.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 FrontendIPConfiguration(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }