public async Task <Response <LoadBalancerBackendAddressPoolListResult> > ListAsync(string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default) { if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (loadBalancerName == null) { throw new ArgumentNullException(nameof(loadBalancerName)); } using var message = CreateListRequest(resourceGroupName, loadBalancerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { LoadBalancerBackendAddressPoolListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); if (document.RootElement.ValueKind == JsonValueKind.Null) { value = null; } else { value = LoadBalancerBackendAddressPoolListResult.DeserializeLoadBalancerBackendAddressPoolListResult(document.RootElement); } return(Response.FromValue(value, message.Response)); }
public async Task <Response <LoadBalancerBackendAddressPoolListResult> > ListAsync(string subscriptionId, string resourceGroupName, string loadBalancerName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(loadBalancerName, nameof(loadBalancerName)); using var message = CreateListRequest(subscriptionId, resourceGroupName, loadBalancerName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { LoadBalancerBackendAddressPoolListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = LoadBalancerBackendAddressPoolListResult.DeserializeLoadBalancerBackendAddressPoolListResult(document.RootElement); return(Response.FromValue(value, message.Response)); }