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
This commit is contained in:
Ryan Gribble
2018-07-11 20:38:54 +10:00
committed by GitHub
parent 1515dc2a2f
commit 043e64b89f
13 changed files with 467 additions and 17 deletions
@@ -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 @@ namespace Octokit.Reactive
{
Ensure.ArgumentNotNull(options, nameof(options));
return GetAll(columnId, new ProjectCardRequest(), options);
}
/// <summary>
/// Gets all cards.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/projects/#list-projects-cards">API documentation</a> for more information.
/// </remarks>
/// <param name="columnId">The id of the column</param>
/// <param name="request">Used to filter the list of project cards returned</param>
public IObservable<ProjectCard> GetAll(int columnId, ProjectCardRequest request)
{
Ensure.ArgumentNotNull(request, nameof(request));
return GetAll(columnId, request, ApiOptions.None);
}
/// <summary>
/// Gets all cards.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/projects/#list-projects-cards">API documentation</a> for more information.
/// </remarks>
/// <param name="columnId">The id of the column</param>
/// <param name="request">Used to filter the list of project cards returned</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<ProjectCard> 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<ProjectCard>(url, new Dictionary<string, string>(), AcceptHeaders.ProjectsApiPreview, options);
return _connection.GetAndFlattenAllPages<ProjectCard>(url, request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options);
}
/// <summary>