diff --git a/TrelloNet/Cards/Card.cs b/TrelloNet/Cards/Card.cs index 6c92c12..0a05051 100644 --- a/TrelloNet/Cards/Card.cs +++ b/TrelloNet/Cards/Card.cs @@ -20,6 +20,7 @@ public class Card : ICardId, IUpdatableCard public CardBadges Badges { get; set; } public List Checklists { get; set; } public List Attachments { get; set; } + public List Actions { get; set; } public string Url { get; set; } public double Pos { get; set; } diff --git a/TrelloNet/Cards/IAsyncCards.cs b/TrelloNet/Cards/IAsyncCards.cs index 196edec..7b1d6c5 100644 --- a/TrelloNet/Cards/IAsyncCards.cs +++ b/TrelloNet/Cards/IAsyncCards.cs @@ -31,8 +31,8 @@ public interface IAsyncCards /// GET /lists/[list_id]/cards ///
/// Required permissions: read - /// - Task> ForList(IListId list, CardFilter filter = CardFilter.Open); + /// + Task> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable actionIncludes = null); /// /// GET /members/[member_id or username]/cards diff --git a/TrelloNet/Cards/ICards.cs b/TrelloNet/Cards/ICards.cs index 288797d..0532675 100644 --- a/TrelloNet/Cards/ICards.cs +++ b/TrelloNet/Cards/ICards.cs @@ -33,7 +33,7 @@ public interface ICards ///
/// Required permissions: read ///
- IEnumerable ForList(IListId list, CardFilter filter = CardFilter.Open); + IEnumerable ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable actionIncludes = null); /// /// GET /members/[member_id or username]/cards diff --git a/TrelloNet/Cards/Internal/AsyncCards.cs b/TrelloNet/Cards/Internal/AsyncCards.cs index f5121f0..64592a6 100644 --- a/TrelloNet/Cards/Internal/AsyncCards.cs +++ b/TrelloNet/Cards/Internal/AsyncCards.cs @@ -26,11 +26,11 @@ public Task WithShortId(int shortId, IBoardId boardId) public Task> ForBoard(IBoardId board, BoardCardFilter filter = BoardCardFilter.Visible) { return _restClient.RequestListAsync(new CardsForBoardRequest(board, filter)); - } - - public Task> ForList(IListId list, CardFilter filter = CardFilter.Open) - { - return _restClient.RequestListAsync(new CardsForListRequest(list, filter)); + } + + public Task> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable actionIncludes = null) + { + return _restClient.RequestListAsync(new CardsForListRequest(list, filter, actionIncludes)); } public Task> ForMember(IMemberId member, CardFilter filter = CardFilter.Open) diff --git a/TrelloNet/Cards/Internal/Cards.cs b/TrelloNet/Cards/Internal/Cards.cs index 8ac599f..242f378 100644 --- a/TrelloNet/Cards/Internal/Cards.cs +++ b/TrelloNet/Cards/Internal/Cards.cs @@ -27,9 +27,9 @@ public IEnumerable ForBoard(IBoardId board, BoardCardFilter filter = Board return _restClient.Request>(new CardsForBoardRequest(board, filter)); } - public IEnumerable ForList(IListId list, CardFilter filter = CardFilter.Open) + public IEnumerable ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable actionIncludes = null) { - return _restClient.Request>(new CardsForListRequest(list, filter)); + return _restClient.Request>(new CardsForListRequest(list, filter, actionIncludes)); } public IEnumerable ForMember(IMemberId member, CardFilter filter = CardFilter.Open) diff --git a/TrelloNet/Cards/Internal/CardsForListRequest.cs b/TrelloNet/Cards/Internal/CardsForListRequest.cs index 163418b..37b7547 100644 --- a/TrelloNet/Cards/Internal/CardsForListRequest.cs +++ b/TrelloNet/Cards/Internal/CardsForListRequest.cs @@ -1,12 +1,15 @@ +using System.Collections.Generic; namespace TrelloNet.Internal { internal class CardsForListRequest : ListsRequest { - public CardsForListRequest(IListId list, CardFilter filter) + public CardsForListRequest(IListId list, CardFilter filter, IEnumerable includeActions = null) : base(list, "cards") { this.AddCommonCardParameters(); this.AddFilter(filter); + this.AddTypeInclude(includeActions); + } } } \ No newline at end of file diff --git a/TrelloNet/Internal/RestRequestExtensions.cs b/TrelloNet/Internal/RestRequestExtensions.cs index c46d4e6..a661438 100644 --- a/TrelloNet/Internal/RestRequestExtensions.cs +++ b/TrelloNet/Internal/RestRequestExtensions.cs @@ -60,5 +60,15 @@ public static void AddTypeFilter(this RestRequest request, IEnumerable actionIncludes) + { + var includeString = "all"; + + if (actionIncludes != null && actionIncludes.Any()) + includeString = string.Join(",", actionIncludes.Select(f => f.ToTrelloString())); + + request.AddParameter("actions", includeString, ParameterType.GetOrPost); + } } } \ No newline at end of file