/// <inheritdoc cref="NetworkingApiBuilder.ListNetworksAsync" />
        public async Task <IPage <Network> > ListNetworksAsync(Identifier startNetworkId = null, int?pageSize = null, CancellationToken cancellationToken = default(CancellationToken))
        {
            PreparedRequest request = await _networkingApiBuilder.ListNetworksAsync(cancellationToken);

            request.Url.SetQueryParams(new
            {
                marker = startNetworkId,
                limit  = pageSize
            });

            return(await request.SendAsync()
                   .ReceiveJson <NetworkCollection>());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sends the <see cref="PreparedRequest"/>.
        /// </summary>
        /// <param name="requestTask">A task which returns the request.</param>
        /// <returns>The HTTP response message.</returns>
        public static async Task <HttpResponseMessage> SendAsync(this Task <PreparedRequest> requestTask)
        {
            PreparedRequest request = await requestTask.ConfigureAwait(false);

            return(await request.SendAsync().ConfigureAwait(false));
        }