public async ValueTask <Response <ServiceTagsListResult> > ListAsync(string location, CancellationToken cancellationToken = default) { if (location == null) { throw new ArgumentNullException(nameof(location)); } using var message = CreateListRequest(location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { ServiceTagsListResult 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 = ServiceTagsListResult.DeserializeServiceTagsListResult(document.RootElement); } return(Response.FromValue(value, message.Response)); }
public async Task <Response <ServiceTagsListResult> > ListAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); using var message = CreateListRequest(subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { ServiceTagsListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = ServiceTagsListResult.DeserializeServiceTagsListResult(document.RootElement); return(Response.FromValue(value, message.Response)); }