public virtual Response <NetworkInterfaceIPConfigurationResource> Get(string ipConfigurationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(ipConfigurationName, nameof(ipConfigurationName)); using var scope = _networkInterfaceIPConfigurationClientDiagnostics.CreateScope("NetworkInterfaceIPConfigurationCollection.Get"); scope.Start(); try { var response = _networkInterfaceIPConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ipConfigurationName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new NetworkInterfaceIPConfigurationResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <NetworkInterfaceIPConfiguration> Get(CancellationToken cancellationToken = default) { using var scope = _networkInterfaceIPConfigurationClientDiagnostics.CreateScope("NetworkInterfaceIPConfiguration.Get"); scope.Start(); try { var response = _networkInterfaceIPConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _networkInterfaceIPConfigurationClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new NetworkInterfaceIPConfiguration(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }