mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 03:01:31 +00:00
feat: Removing accept header previews (#2515)
This commit is contained in:
@@ -71,14 +71,13 @@ namespace Octokit
|
||||
/// <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>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("GET", "/projects/columns/{column_id}/cards")]
|
||||
public Task<IReadOnlyList<ProjectCard>> GetAll(int columnId, ProjectCardRequest request, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(request, nameof(request));
|
||||
Ensure.ArgumentNotNull(options, nameof(options));
|
||||
|
||||
return ApiConnection.GetAll<ProjectCard>(ApiUrls.ProjectCards(columnId), request.ToParametersDictionary(), AcceptHeaders.ProjectsApiPreview, options);
|
||||
return ApiConnection.GetAll<ProjectCard>(ApiUrls.ProjectCards(columnId), request.ToParametersDictionary(), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -88,11 +87,10 @@ namespace Octokit
|
||||
/// See the <a href="https://developer.github.com/v3/repos/projects/#get-a-project-card">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The id of the card</param>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("GET", "/projects/columns/cards/{card_id}")]
|
||||
public Task<ProjectCard> Get(int id)
|
||||
{
|
||||
return ApiConnection.Get<ProjectCard>(ApiUrls.ProjectCard(id), null, AcceptHeaders.ProjectsApiPreview);
|
||||
return ApiConnection.Get<ProjectCard>(ApiUrls.ProjectCard(id), null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,13 +101,12 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <param name="columnId">The id of the column</param>
|
||||
/// <param name="newProjectCard">The card to create</param>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("POST", "/projects/columns/{column_id}/cards")]
|
||||
public Task<ProjectCard> Create(int columnId, NewProjectCard newProjectCard)
|
||||
{
|
||||
Ensure.ArgumentNotNull(newProjectCard, nameof(newProjectCard));
|
||||
|
||||
return ApiConnection.Post<ProjectCard>(ApiUrls.ProjectCards(columnId), newProjectCard, AcceptHeaders.ProjectsApiPreview);
|
||||
return ApiConnection.Post<ProjectCard>(ApiUrls.ProjectCards(columnId), newProjectCard);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -120,13 +117,12 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <param name="id">The id of the card</param>
|
||||
/// <param name="projectCardUpdate">New values to update the card with</param>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("GET", "/projects/columns/cards/{card_id}")]
|
||||
public Task<ProjectCard> Update(int id, ProjectCardUpdate projectCardUpdate)
|
||||
{
|
||||
Ensure.ArgumentNotNull(projectCardUpdate, nameof(projectCardUpdate));
|
||||
|
||||
return ApiConnection.Patch<ProjectCard>(ApiUrls.ProjectCard(id), projectCardUpdate, AcceptHeaders.ProjectsApiPreview);
|
||||
return ApiConnection.Patch<ProjectCard>(ApiUrls.ProjectCard(id), projectCardUpdate);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -136,7 +132,6 @@ namespace Octokit
|
||||
/// See the <a href="https://developer.github.com/v3/repos/projects/#delete-a-project-card">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="id">The id of the card</param>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("DELETE", "/projects/columns/cards/{card_id}")]
|
||||
public async Task<bool> Delete(int id)
|
||||
{
|
||||
@@ -144,7 +139,7 @@ namespace Octokit
|
||||
|
||||
try
|
||||
{
|
||||
var httpStatusCode = await Connection.Delete(endpoint, new object(), AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false);
|
||||
var httpStatusCode = await Connection.Delete(endpoint, new object()).ConfigureAwait(false);
|
||||
return httpStatusCode == HttpStatusCode.NoContent;
|
||||
}
|
||||
catch (NotFoundException)
|
||||
@@ -161,7 +156,6 @@ namespace Octokit
|
||||
/// </remarks>
|
||||
/// <param name="id">The id of the card</param>
|
||||
/// <param name="position">The position to move the card</param>
|
||||
[Preview("inertia")]
|
||||
[ManualRoute("POST", "/projects/columns/cards/{card_id}/moves")]
|
||||
public async Task<bool> Move(int id, ProjectCardMove position)
|
||||
{
|
||||
@@ -170,7 +164,7 @@ namespace Octokit
|
||||
var endpoint = ApiUrls.ProjectCardMove(id);
|
||||
try
|
||||
{
|
||||
var httpStatusCode = await Connection.Post(endpoint, position, AcceptHeaders.ProjectsApiPreview).ConfigureAwait(false);
|
||||
var httpStatusCode = await Connection.Post(endpoint, position, null).ConfigureAwait(false);
|
||||
return httpStatusCode == HttpStatusCode.Created;
|
||||
}
|
||||
catch (NotFoundException)
|
||||
|
||||
Reference in New Issue
Block a user