From 043e64b89f5c51106d6862efcbecf962147af81f Mon Sep 17 00:00:00 2001 From: Ryan Gribble Date: Wed, 11 Jul 2018 20:38:54 +1000 Subject: [PATCH] Implement new Project Card archiving (#1842) * add Archived to ProjectCard response add Archived to ProjectCardUpdate update integration tests * Add ProjectCardRequest model and update GetAll calls to use it Update unit tests Update integration tests * skip_branch_with_pr still ends up building the branch on the initial push, so let's only build master instead --- .../Clients/IObservableProjectCardsClient.cs | 21 ++++ .../Clients/ObservableProjectCardsClient.cs | 35 +++++- .../Clients/ProjectCardsClientTests.cs | 105 +++++++++++++++++- .../ObservableProjectCardsClientTests.cs | 100 ++++++++++++++++- .../Clients/ProjectCardsClientTests.cs | 24 +++- .../Models/ProjectCardRequestTests.cs | 28 +++++ .../ObservableProjectCardsClientTests.cs | 23 +++- Octokit/Clients/IProjectCardsClient.cs | 21 ++++ Octokit/Clients/ProjectCardsClient.cs | 34 +++++- Octokit/Models/Request/ProjectCardRequest.cs | 64 +++++++++++ Octokit/Models/Request/ProjectCardUpdate.cs | 17 ++- Octokit/Models/Response/ProjectCard.cs | 8 +- appveyor.yml | 4 +- 13 files changed, 467 insertions(+), 17 deletions(-) create mode 100644 Octokit.Tests/Models/ProjectCardRequestTests.cs create mode 100644 Octokit/Models/Request/ProjectCardRequest.cs diff --git a/Octokit.Reactive/Clients/IObservableProjectCardsClient.cs b/Octokit.Reactive/Clients/IObservableProjectCardsClient.cs index d9e8496f00..ff6209b0aa 100644 --- a/Octokit.Reactive/Clients/IObservableProjectCardsClient.cs +++ b/Octokit.Reactive/Clients/IObservableProjectCardsClient.cs @@ -30,6 +30,27 @@ public interface IObservableProjectCardsClient /// Options for changing the API response IObservable GetAll(int columnId, ApiOptions options); + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + IObservable GetAll(int columnId, ProjectCardRequest request); + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + /// Options for changing the API response + IObservable GetAll(int columnId, ProjectCardRequest request, ApiOptions options); + /// /// Gets a single card. /// diff --git a/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs b/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs index fc77652fa6..424f1c7cc3 100644 --- a/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs +++ b/Octokit.Reactive/Clients/ObservableProjectCardsClient.cs @@ -1,7 +1,6 @@ using Octokit.Reactive.Internal; using System; using System.Reactive.Threading.Tasks; -using System.Collections.Generic; namespace Octokit.Reactive { @@ -48,9 +47,41 @@ public IObservable GetAll(int columnId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); + return GetAll(columnId, new ProjectCardRequest(), options); + } + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + public IObservable GetAll(int columnId, ProjectCardRequest request) + { + Ensure.ArgumentNotNull(request, nameof(request)); + + return GetAll(columnId, request, ApiOptions.None); + } + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + /// Options for changing the API response + public IObservable GetAll(int columnId, ProjectCardRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); + var url = ApiUrls.ProjectCards(columnId); - return _connection.GetAndFlattenAllPages(url, new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return _connection.GetAndFlattenAllPages(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); } /// diff --git a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs index 538872765b..3c127e0b9d 100644 --- a/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Clients/ProjectCardsClientTests.cs @@ -2,8 +2,6 @@ using Octokit.Tests.Integration; using Octokit.Tests.Integration.Helpers; using System; -using System.Linq; -using System.Net; using System.Threading.Tasks; using Xunit; @@ -33,8 +31,57 @@ public async Task GetsAllCards() var result = await _github.Repository.Project.Card.GetAll(column.Id); Assert.Equal(2, result.Count); - Assert.True(result.FirstOrDefault(x => x.Id == card1.Id).Id == card1.Id); - Assert.True(result.FirstOrDefault(x => x.Id == card2.Id).Id == card2.Id); + Assert.Contains(result, x => x.Id == card1.Id); + Assert.Contains(result, x => x.Id == card2.Id); + } + + [IntegrationTest] + public async Task GetsAllArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.Archived); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request); + + Assert.Equal(1, result.Count); + Assert.Contains(result, x => x.Id == card2.Id); + } + + [IntegrationTest] + public async Task GetsAllNotArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.NotArchived); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request); + + Assert.Equal(1, result.Count); + Assert.Contains(result, x => x.Id == card1.Id); + } + + [IntegrationTest] + public async Task GetsAllArchivedAndNotArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.All); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request); + + Assert.Equal(2, result.Count); + Assert.Contains(result, x => x.Id == card1.Id); + Assert.Contains(result, x => x.Id == card2.Id); } [IntegrationTest] @@ -207,7 +254,10 @@ public async Task UpdatesCard() var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); var column = await CreateColumnHelper(_github, project.Id); var card = await CreateCardHelper(_github, column.Id); - var cardUpdate = new ProjectCardUpdate("newNameOfNote"); + var cardUpdate = new ProjectCardUpdate + { + Note = "newNameOfNote" + }; var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); @@ -215,6 +265,42 @@ public async Task UpdatesCard() Assert.Equal(card.Id, result.Id); } + [IntegrationTest] + public async Task ArchivesCard() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card = await CreateCardHelper(_github, column.Id); + var cardUpdate = new ProjectCardUpdate + { + Archived = true + }; + + var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); + + Assert.Equal(card.Id, result.Id); + Assert.False(card.Archived); + Assert.True(result.Archived); + } + + [IntegrationTest] + public async Task UnarchivesCard() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card = await CreateArchivedCardHelper(_github, column.Id); + var cardUpdate = new ProjectCardUpdate + { + Archived = false + }; + + var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); + + Assert.Equal(card.Id, result.Id); + Assert.True(card.Archived); + Assert.False(result.Archived); + } + public void Dispose() { if (_context != null) @@ -343,6 +429,15 @@ private static async Task CreateCardHelper(IGitHubClient githubClie return result; } + private static async Task CreateArchivedCardHelper(IGitHubClient githubClient, int columnId) + { + var newCard = new NewProjectCard(Helper.MakeNameWithTimestamp("new-card")); + var card = await githubClient.Repository.Project.Card.Create(columnId, newCard); + var result = await githubClient.Repository.Project.Card.Update(card.Id, new ProjectCardUpdate { Archived = true }); + + return result; + } + private static async Task CreateIssueCardHelper(IGitHubClient githubClient, int issueId, int columnId) { var newCard = new NewProjectCard(issueId, ProjectCardContentType.Issue); diff --git a/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs b/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs index d1181610c6..d3f29dbaea 100644 --- a/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs +++ b/Octokit.Tests.Integration/Reactive/ObservableProjectCardsClientTests.cs @@ -4,7 +4,6 @@ using Octokit.Tests.Integration.Helpers; using System; using System.Linq; -using System.Net; using System.Threading.Tasks; using Xunit; using System.Reactive.Linq; @@ -39,6 +38,55 @@ public async Task GetsAllCards() Assert.True(result.FirstOrDefault(x => x.Id == card2.Id).Id == card2.Id); } + [IntegrationTest] + public async Task GetsAllArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.Archived); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request).ToList(); + + Assert.Equal(1, result.Count); + Assert.Contains(result, x => x.Id == card2.Id); + } + + [IntegrationTest] + public async Task GetsAllNotArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.NotArchived); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request).ToList(); + + Assert.Equal(1, result.Count); + Assert.Contains(result, x => x.Id == card1.Id); + } + + [IntegrationTest] + public async Task GetsAllArchivedAndNotArchivedCards() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card1 = await CreateCardHelper(_github, column.Id); + var card2 = await CreateArchivedCardHelper(_github, column.Id); + + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.All); + + var result = await _github.Repository.Project.Card.GetAll(column.Id, request).ToList(); + + Assert.Equal(2, result.Count); + Assert.Contains(result, x => x.Id == card1.Id); + Assert.Contains(result, x => x.Id == card2.Id); + } + [IntegrationTest] public async Task ReturnsCorrectCountOfCardWithoutStart() { @@ -209,7 +257,10 @@ public async Task UpdatesCard() var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); var column = await CreateColumnHelper(_github, project.Id); var card = await CreateCardHelper(_github, column.Id); - var cardUpdate = new ProjectCardUpdate("newNameOfNote"); + var cardUpdate = new ProjectCardUpdate + { + Note = "newNameOfNote" + }; var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); @@ -217,6 +268,42 @@ public async Task UpdatesCard() Assert.Equal(card.Id, result.Id); } + [IntegrationTest] + public async Task ArchivesCard() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card = await CreateCardHelper(_github, column.Id); + var cardUpdate = new ProjectCardUpdate + { + Archived = true + }; + + var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); + + Assert.Equal(card.Id, result.Id); + Assert.False(card.Archived); + Assert.True(result.Archived); + } + + [IntegrationTest] + public async Task UnarchivesCard() + { + var project = await CreateRepositoryProjectHelper(_github, _context.RepositoryId); + var column = await CreateColumnHelper(_github, project.Id); + var card = await CreateArchivedCardHelper(_github, column.Id); + var cardUpdate = new ProjectCardUpdate + { + Archived = false + }; + + var result = await _github.Repository.Project.Card.Update(card.Id, cardUpdate); + + Assert.Equal(card.Id, result.Id); + Assert.True(card.Archived); + Assert.False(result.Archived); + } + public void Dispose() { if (_context != null) @@ -345,6 +432,15 @@ private static async Task CreateCardHelper(IObservableGitHubClient return result; } + private static async Task CreateArchivedCardHelper(IObservableGitHubClient githubClient, int columnId) + { + var newCard = new NewProjectCard(Helper.MakeNameWithTimestamp("new-card")); + var card = await githubClient.Repository.Project.Card.Create(columnId, newCard); + var result = await githubClient.Repository.Project.Card.Update(card.Id, new ProjectCardUpdate { Archived = true }); + + return result; + } + private static async Task CreateIssueCardHelper(IObservableGitHubClient githubClient, int issueId, int columnId) { var newCard = new NewProjectCard(issueId, ProjectCardContentType.Issue); diff --git a/Octokit.Tests/Clients/ProjectCardsClientTests.cs b/Octokit.Tests/Clients/ProjectCardsClientTests.cs index e2edc82cad..7021c2e77d 100644 --- a/Octokit.Tests/Clients/ProjectCardsClientTests.cs +++ b/Octokit.Tests/Clients/ProjectCardsClientTests.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading.Tasks; using NSubstitute; using Xunit; @@ -33,12 +34,33 @@ public async Task RequestCorrectURL() Args.ApiOptions); } + [Fact] + public async Task SendsAppropriateParameters() + { + var connection = Substitute.For(); + var client = new ProjectCardsClient(connection); + + await client.GetAll(1, new ProjectCardRequest(ProjectCardArchivedStateFilter.NotArchived)); + + connection.Received().GetAll( + Arg.Is(u => u.ToString() == "projects/columns/1/cards"), + Arg.Is>(x => + x.Count == 1 + && x["archived_state"] == "not_archived"), + "application/vnd.github.inertia-preview+json", + Args.ApiOptions); + } + [Fact] public async Task EnsuresNonNullArguments() { var client = new ProjectCardsClient(Substitute.For()); + var request = new ProjectCardRequest(); - await Assert.ThrowsAsync(() => client.GetAll(1, null)); + await Assert.ThrowsAsync(() => client.GetAll(1, (ProjectCardRequest)null)); + await Assert.ThrowsAsync(() => client.GetAll(1, (ApiOptions)null)); + await Assert.ThrowsAsync(() => client.GetAll(1, null, ApiOptions.None)); + await Assert.ThrowsAsync(() => client.GetAll(1, request, null)); } } diff --git a/Octokit.Tests/Models/ProjectCardRequestTests.cs b/Octokit.Tests/Models/ProjectCardRequestTests.cs new file mode 100644 index 0000000000..60efbf9a29 --- /dev/null +++ b/Octokit.Tests/Models/ProjectCardRequestTests.cs @@ -0,0 +1,28 @@ +using Octokit; +using Xunit; + +public class ProjectCardRequestTests +{ + public class TheToParametersDictionaryMethod + { + [Fact] + public void ContainsSetValues() + { + var request = new ProjectCardRequest(ProjectCardArchivedStateFilter.All); + + var parameters = request.ToParametersDictionary(); + + Assert.Equal("all", parameters["archived_state"]); + } + + [Fact] + public void ReturnsDefaultValuesForDefaultRequest() + { + var request = new ProjectCardRequest(); + + var parameters = request.ToParametersDictionary(); + + Assert.Empty(parameters); + } + } +} diff --git a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs index 8be07b0e4c..3fa491ffdf 100644 --- a/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs +++ b/Octokit.Tests/Reactive/ObservableProjectCardsClientTests.cs @@ -37,13 +37,34 @@ public void RequestCorrectURL() "application/vnd.github.inertia-preview+json"); } + [Fact] + public async Task SendsAppropriateParameters() + { + var connection = Substitute.For(); + var gitHubClient = new GitHubClient(connection); + var client = new ObservableProjectCardsClient(gitHubClient); + + client.GetAll(1, new ProjectCardRequest(ProjectCardArchivedStateFilter.NotArchived)); + + connection.Received().Get>( + Arg.Is(u => u.ToString() == "projects/columns/1/cards"), + Arg.Is>(x => + x.Count == 1 + && x["archived_state"] == "not_archived"), + "application/vnd.github.inertia-preview+json"); + } + [Fact] public async Task EnsuresNonNullArguments() { var gitHubClient = Substitute.For(); var client = new ObservableProjectCardsClient(gitHubClient); + var request = new ProjectCardRequest(); - await Assert.ThrowsAsync(() => client.GetAll(1, null).ToTask()); + await Assert.ThrowsAsync(() => client.GetAll(1, (ProjectCardRequest)null).ToTask()); + await Assert.ThrowsAsync(() => client.GetAll(1, (ApiOptions)null).ToTask()); + await Assert.ThrowsAsync(() => client.GetAll(1, null, ApiOptions.None).ToTask()); + await Assert.ThrowsAsync(() => client.GetAll(1, request, null).ToTask()); } } diff --git a/Octokit/Clients/IProjectCardsClient.cs b/Octokit/Clients/IProjectCardsClient.cs index c33831c34c..f119de634d 100644 --- a/Octokit/Clients/IProjectCardsClient.cs +++ b/Octokit/Clients/IProjectCardsClient.cs @@ -31,6 +31,27 @@ public interface IProjectCardsClient /// Options for changing the API response Task> GetAll(int columnId, ApiOptions options); + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + Task> GetAll(int columnId, ProjectCardRequest request); + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + /// Options for changing the API response + Task> GetAll(int columnId, ProjectCardRequest request, ApiOptions options); + /// /// Gets a single card. /// diff --git a/Octokit/Clients/ProjectCardsClient.cs b/Octokit/Clients/ProjectCardsClient.cs index a16cd58086..bc952bd7cd 100644 --- a/Octokit/Clients/ProjectCardsClient.cs +++ b/Octokit/Clients/ProjectCardsClient.cs @@ -41,7 +41,39 @@ public Task> GetAll(int columnId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); - return ApiConnection.GetAll(ApiUrls.ProjectCards(columnId), new Dictionary(), AcceptHeaders.ProjectsApiPreview, options); + return GetAll(columnId, new ProjectCardRequest(), options); + } + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + public Task> GetAll(int columnId, ProjectCardRequest request) + { + Ensure.ArgumentNotNull(request, nameof(request)); + + return GetAll(columnId, request, ApiOptions.None); + } + + /// + /// Gets all cards. + /// + /// + /// See the API documentation for more information. + /// + /// The id of the column + /// Used to filter the list of project cards returned + /// Options for changing the API response + public Task> GetAll(int columnId, ProjectCardRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, nameof(request)); + Ensure.ArgumentNotNull(options, nameof(options)); + + return ApiConnection.GetAll(ApiUrls.ProjectCards(columnId), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options); } /// diff --git a/Octokit/Models/Request/ProjectCardRequest.cs b/Octokit/Models/Request/ProjectCardRequest.cs new file mode 100644 index 0000000000..1c316d9ba1 --- /dev/null +++ b/Octokit/Models/Request/ProjectCardRequest.cs @@ -0,0 +1,64 @@ +using System.Diagnostics; +using System.Globalization; +using Octokit.Internal; + +namespace Octokit +{ + /// + /// Used to filter requests for lists of projects + /// + [DebuggerDisplay("{DebuggerDisplay,nq}")] + public class ProjectCardRequest : RequestParameters + { + /// + /// Used to filter requests for lists of projects + /// + public ProjectCardRequest() + { + } + + /// + /// Used to filter requests for lists of projects + /// + /// Which project cards to include. + public ProjectCardRequest(ProjectCardArchivedStateFilter archived) + { + ArchivedState = archived; + } + + /// + /// Which project cards to include./>. + /// + [Parameter(Key = "archived_state")] + public ProjectCardArchivedStateFilter? ArchivedState { get; private set; } + + internal string DebuggerDisplay + { + get + { + return string.Format(CultureInfo.InvariantCulture, "ArchivedState: {0} ", ArchivedState?.ToString() ?? "null"); + } + } + } + + public enum ProjectCardArchivedStateFilter + { + /// + /// Items that are open. + /// + [Parameter(Value = "not_archived")] + NotArchived, + + /// + /// Items that are closed. + /// + [Parameter(Value = "archived")] + Archived, + + /// + /// All the items. + /// + [Parameter(Value = "all")] + All + } +} diff --git a/Octokit/Models/Request/ProjectCardUpdate.cs b/Octokit/Models/Request/ProjectCardUpdate.cs index e0fe7c1c59..1e7f47d627 100644 --- a/Octokit/Models/Request/ProjectCardUpdate.cs +++ b/Octokit/Models/Request/ProjectCardUpdate.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Globalization; namespace Octokit @@ -6,6 +7,11 @@ namespace Octokit [DebuggerDisplay("{DebuggerDisplay,nq}")] public class ProjectCardUpdate { + public ProjectCardUpdate() + { + } + + [Obsolete("This constructor will be removed in a future release, due to the 'Note' parameter not being mandatory. Use object initializer syntax instead.")] public ProjectCardUpdate(string note) { Note = note; @@ -14,13 +20,18 @@ public ProjectCardUpdate(string note) /// /// The new note of the card. /// - public string Note { get; private set; } + public string Note { get; set; } + + /// + /// Archive/Unarchive the card. + /// + public bool? Archived { get; set; } internal string DebuggerDisplay { get { - return string.Format(CultureInfo.InvariantCulture, "Note: {0}", Note); + return string.Format(CultureInfo.InvariantCulture, "Note: {0}, Archived: {1}", Note, Archived?.ToString() ?? "null"); } } } diff --git a/Octokit/Models/Response/ProjectCard.cs b/Octokit/Models/Response/ProjectCard.cs index ff8f139832..c8128e1436 100644 --- a/Octokit/Models/Response/ProjectCard.cs +++ b/Octokit/Models/Response/ProjectCard.cs @@ -9,7 +9,7 @@ public class ProjectCard { public ProjectCard() { } - public ProjectCard(string columnUrl, string contentUrl, int id, string nodeId, string note, User creator, DateTimeOffset createdAt, DateTimeOffset updatedAt) + public ProjectCard(string columnUrl, string contentUrl, int id, string nodeId, string note, User creator, DateTimeOffset createdAt, DateTimeOffset updatedAt, bool archived) { ColumnUrl = columnUrl; ContentUrl = contentUrl; @@ -19,6 +19,7 @@ public ProjectCard(string columnUrl, string contentUrl, int id, string nodeId, s Creator = creator; CreatedAt = createdAt; UpdatedAt = updatedAt; + Archived = archived; } /// @@ -61,6 +62,11 @@ public ProjectCard(string columnUrl, string contentUrl, int id, string nodeId, s /// public DateTimeOffset UpdatedAt { get; protected set; } + /// + /// Whether this card is archived. + /// + public bool Archived { get; protected set; } + internal string DebuggerDisplay { get diff --git a/appveyor.yml b/appveyor.yml index e2e754cd50..6d09d6be6b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,8 @@ image: Visual Studio 2017 -skip_branch_with_pr: true +branches: + only: + - master init: - git config --global core.autocrlf input