Example #1
0
 public async Task<Response<ExpressRoutePortsLocationListResult>> ListAsync(CancellationToken cancellationToken = default)
 {
     using var message = CreateListRequest();
     await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);
     switch (message.Response.Status)
     {
         case 200:
             {
                 ExpressRoutePortsLocationListResult value = default;
                 using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);
                 value = ExpressRoutePortsLocationListResult.DeserializeExpressRoutePortsLocationListResult(document.RootElement);
                 return Response.FromValue(value, message.Response);
             }
        public async Task <Response <ExpressRoutePortsLocationListResult> > ListAsync(string subscriptionId, CancellationToken cancellationToken = default)
        {
            if (subscriptionId == null)
            {
                throw new ArgumentNullException(nameof(subscriptionId));
            }

            using var message = CreateListRequest(subscriptionId);
            await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

            switch (message.Response.Status)
            {
            case 200:
            {
                ExpressRoutePortsLocationListResult value = default;
                using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                value = ExpressRoutePortsLocationListResult.DeserializeExpressRoutePortsLocationListResult(document.RootElement);
                return(Response.FromValue(value, message.Response));
            }