Ejemplo n.º 1
0
        public async Task <IEXResponse <IEnumerable <HolidaysAndTradingDatesUSResponse> > > HolidaysAndTradingDatesUSAsync(
            DateType type, DirectionType direction = DirectionType.Next, int last = 1, DateTime?startDate = null)
        {
            const string urlPattern = "ref-data/us/dates/[type]/[direction]/[last]/[startDate]";

            var qsb = new QueryStringBuilder();

            var pathNvc = new NameValueCollection
            {
                { "type", type.GetDescriptionFromEnum() },
                { "direction", direction.GetDescriptionFromEnum() },
                { "last", last.ToString() },
                { "startDate", startDate == null?DateTime.Now.ToString("yyyyMMdd") : ((DateTime)startDate).ToString("yyyyMMdd") }
            };

            return(await executor.ExecuteAsync <IEnumerable <HolidaysAndTradingDatesUSResponse> >(urlPattern, pathNvc, qsb));
        }