/// <inheritdoc />
 public async Task <IReadOnlyList <IAccountActivity> > ListAccountActivitiesAsync(
     AccountActivitiesRequest request,
     CancellationToken cancellationToken = default) =>
 await _httpClient.GetAsync <IReadOnlyList <IAccountActivity>, List <JsonAccountActivity> >(
     await request.EnsureNotNull(nameof(request))
     .GetUriBuilderAsync(_httpClient).ConfigureAwait(false),
     cancellationToken).ConfigureAwait(false);
        /// <summary>
        /// Gets list of account activities from Alpaca REST API endpoint by specific activity.
        /// </summary>
        /// <param name="request">Account activities request parameters.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>Read-only list of account activity record objects.</returns>
        public Task <IReadOnlyList <IAccountActivity> > ListAccountActivitiesAsync(
            AccountActivitiesRequest request,
            CancellationToken cancellationToken = default)
        {
            request.EnsureNotNull(nameof(request));

            var builder = new UriBuilder(_httpClient.BaseAddress)
            {
                Path  = _httpClient.BaseAddress.AbsolutePath + $"account/activities",
                Query = new QueryBuilder()
                        .AddParameter("activity_types", request.ActivityTypes)
                        .AddParameter("date", request.Date, DateTimeHelper.DateFormat)
                        .AddParameter("until", request.TimeInterval.Into, "O")
                        .AddParameter("after", request.TimeInterval.From, "O")
                        .AddParameter("direction", request.Direction)
                        .AddParameter("pageSize", request.PageSize)
                        .AddParameter("pageToken", request.PageToken)
            };

            return(_httpClient.GetObjectsListAsync <IAccountActivity, JsonAccountActivity>(
                       _alpacaRestApiThrottler, builder, cancellationToken));
        }
 /// <inheritdoc />
 public Task <IReadOnlyList <IAccountActivity> > ListAccountActivitiesAsync(
     AccountActivitiesRequest request,
     CancellationToken cancellationToken = default) =>
 _httpClient.GetAsync <IReadOnlyList <IAccountActivity>, List <JsonAccountActivity> >(
     request.EnsureNotNull(nameof(request)).GetUriBuilder(_httpClient),
     cancellationToken, _alpacaRestApiThrottler);