Exemplo n.º 1
0
        public async Task <BacklogResponse <int> > GetTicketCountAsync(TicketQuery query = null)
        {
            query = query ?? new TicketQuery();
            query.Project(this);

            var response = await Client.GetAsync("/api/v2/issues/count", query.Build()).ConfigureAwait(false);

            return(await Client.CreateResponseAsync <int, _Count>(
                       response,
                       HttpStatusCode.OK,
                       data => data.count).ConfigureAwait(false));
        }
Exemplo n.º 2
0
        public async Task <BacklogResponse <Ticket[]> > GetTicketsAsync(TicketQuery query = null)
        {
            query = query ?? new TicketQuery();
            query.Project(this);

            var response = await Client.GetAsync("/api/v2/issues", query.Build()).ConfigureAwait(false);

            return(await Client.CreateResponseAsync <Ticket[], List <_Ticket> >(
                       response,
                       HttpStatusCode.OK,
                       data => data.Select(x => Client.ItemsCache.Update(x.id, () => new Ticket(x, this, Client))).ToArray()
                       ).ConfigureAwait(false));
        }