/// <inheritdoc />
 public async Task <IReadOnlyList <ICalendar> > ListCalendarAsync(
     CalendarRequest request,
     CancellationToken cancellationToken = default) =>
 await _httpClient.GetAsync <IReadOnlyList <ICalendar>, List <JsonCalendar> >(
     await request.EnsureNotNull(nameof(request))
     .GetUriBuilderAsync(_httpClient).ConfigureAwait(false),
     cancellationToken).ConfigureAwait(false);
        /// <summary>
        /// Gets list of trading days from Alpaca REST API endpoint.
        /// </summary>
        /// <param name="request">Calendar items 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 trading date information object.</returns>
        public Task <IReadOnlyList <ICalendar> > ListCalendarAsync(
            CalendarRequest request,
            CancellationToken cancellationToken = default)
        {
            request.EnsureNotNull(nameof(request));

            var builder = new UriBuilder(_httpClient.BaseAddress)
            {
                Path  = _httpClient.BaseAddress.AbsolutePath + "calendar",
                Query = new QueryBuilder()
                        .AddParameter("start", request.TimeInterval?.From, DateTimeHelper.DateFormat)
                        .AddParameter("end", request.TimeInterval?.Into, DateTimeHelper.DateFormat)
            };

            return(_httpClient.GetObjectsListAsync <ICalendar, JsonCalendar>(
                       _alpacaRestApiThrottler, builder, cancellationToken));
        }
 /// <inheritdoc />
 public Task <IReadOnlyList <ICalendar> > ListCalendarAsync(
     CalendarRequest request,
     CancellationToken cancellationToken = default) =>
 _httpClient.GetAsync <IReadOnlyList <ICalendar>, List <JsonCalendar> >(
     request.EnsureNotNull(nameof(request)).GetUriBuilder(_httpClient),
     cancellationToken, _alpacaRestApiThrottler);