Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions TrelloNet/Cards/Card.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class Card : ICardId, IUpdatableCard
public CardBadges Badges { get; set; }
public List<Checklist> Checklists { get; set; }
public List<Attachment> Attachments { get; set; }
public List<Action> Actions { get; set; }
public string Url { get; set; }
public double Pos { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions TrelloNet/Cards/IAsyncCards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public interface IAsyncCards
/// GET /lists/[list_id]/cards
/// <br/>
/// Required permissions: read
/// </summary>
Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Open);
/// </summary>
Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null);

/// <summary>
/// GET /members/[member_id or username]/cards
Expand Down
2 changes: 1 addition & 1 deletion TrelloNet/Cards/ICards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public interface ICards
/// <br/>
/// Required permissions: read
/// </summary>
IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open);
IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null);

/// <summary>
/// GET /members/[member_id or username]/cards
Expand Down
10 changes: 5 additions & 5 deletions TrelloNet/Cards/Internal/AsyncCards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ public Task<Card> WithShortId(int shortId, IBoardId boardId)
public Task<IEnumerable<Card>> ForBoard(IBoardId board, BoardCardFilter filter = BoardCardFilter.Visible)
{
return _restClient.RequestListAsync<Card>(new CardsForBoardRequest(board, filter));
}

public Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Open)
{
return _restClient.RequestListAsync<Card>(new CardsForListRequest(list, filter));
}
public Task<IEnumerable<Card>> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null)
{
return _restClient.RequestListAsync<Card>(new CardsForListRequest(list, filter, actionIncludes));
}

public Task<IEnumerable<Card>> ForMember(IMemberId member, CardFilter filter = CardFilter.Open)
Expand Down
4 changes: 2 additions & 2 deletions TrelloNet/Cards/Internal/Cards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public IEnumerable<Card> ForBoard(IBoardId board, BoardCardFilter filter = Board
return _restClient.Request<List<Card>>(new CardsForBoardRequest(board, filter));
}

public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open)
public IEnumerable<Card> ForList(IListId list, CardFilter filter = CardFilter.Open, IEnumerable<ActionType> actionIncludes = null)
{
return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter));
return _restClient.Request<List<Card>>(new CardsForListRequest(list, filter, actionIncludes));
}

public IEnumerable<Card> ForMember(IMemberId member, CardFilter filter = CardFilter.Open)
Expand Down
5 changes: 4 additions & 1 deletion TrelloNet/Cards/Internal/CardsForListRequest.cs
Original file line number Diff line number Diff line change
@@ -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<ActionType> includeActions = null)
: base(list, "cards")
{
this.AddCommonCardParameters();
this.AddFilter(filter);
this.AddTypeInclude(includeActions);

}
}
}
10 changes: 10 additions & 0 deletions TrelloNet/Internal/RestRequestExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,15 @@ public static void AddTypeFilter(this RestRequest request, IEnumerable<ActionTyp

request.AddParameter("filter", filterString, ParameterType.GetOrPost);
}

public static void AddTypeInclude(this RestRequest request, IEnumerable<ActionType> actionIncludes)
{
var includeString = "all";

if (actionIncludes != null && actionIncludes.Any())
includeString = string.Join(",", actionIncludes.Select(f => f.ToTrelloString()));

request.AddParameter("actions", includeString, ParameterType.GetOrPost);
}
}
}