Skip to content

Commit

Permalink
more cleanup of route metadata (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey authored Mar 19, 2020
1 parent dc2f6ff commit 87d2b0f
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Octokit/Clients/AssigneesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public async Task<bool> CheckAssignee(string owner, string name, string assignee
/// <param name="number">The issue number</param>
/// <param name="assignees">List of names of assignees to add</param>
/// <returns></returns>
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{number}/assignees")]
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/assignees")]
public Task<Issue> AddAssignees(string owner, string name, int number, AssigneesUpdate assignees)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -126,7 +126,7 @@ public Task<Issue> AddAssignees(string owner, string name, int number, Assignees
/// <param name="number">The issue number</param>
/// <param name="assignees">List of assignees to remove</param>
/// <returns></returns>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{number}/assignees")]
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/assignees")]
public Task<Issue> RemoveAssignees(string owner, string name, int number, AssigneesUpdate assignees)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Clients/CheckRunsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public Task<CheckRun> Update(long repositoryId, long checkRunId, CheckRunUpdate
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -142,7 +142,7 @@ public Task<CheckRunsResponse> GetAllForReference(long repositoryId, string refe
/// <param name="name">The name of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -183,7 +183,7 @@ public Task<CheckRunsResponse> GetAllForReference(long repositoryId, string refe
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
/// <param name="options">Options to change the API response</param>
[Preview("antiope")]
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")]
public async Task<CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/CommitStatusClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Task<CombinedCommitStatus> GetCombined(long repositoryId, string referenc
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
[ManualRoute("POST", "/repos/{owner}/{repo}/statuses/{ref}")]
[ManualRoute("POST", "/repos/{owner}/{repo}/statuses/{sha}")]
public Task<CommitStatus> Create(string owner, string name, string reference, NewCommitStatus newCommitStatus)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -164,7 +164,7 @@ public Task<CommitStatus> Create(string owner, string name, string reference, Ne
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <param name="newCommitStatus">The commit status to create</param>
[ManualRoute("POST", "/repositories/{id}/statuses/{ref}")]
[ManualRoute("POST", "/repositories/{id}/statuses/{sha}")]
public Task<CommitStatus> Create(long repositoryId, string reference, NewCommitStatus newCommitStatus)
{
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
Expand Down
6 changes: 3 additions & 3 deletions Octokit/Clients/IssueReactionsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public IssueReactionsClient(IApiConnection apiConnection)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue id</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/reactions")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")]
public Task<IReadOnlyList<Reaction>> GetAll(string owner, string name, int number)
{
return GetAll(owner, name, number, ApiOptions.None);
Expand All @@ -38,7 +38,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(string owner, string name, int numbe
/// <param name="number">The issue id</param>
/// <param name="options">Options for changing the API response</param>
[Preview("squirrel-girl")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/reactions")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")]
public Task<IReadOnlyList<Reaction>> GetAll(string owner, string name, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -85,7 +85,7 @@ public Task<IReadOnlyList<Reaction>> GetAll(long repositoryId, int number, ApiOp
/// <param name="number">The issue id</param>
/// <param name="reaction">The reaction to create</param>
[Preview("squirrel-girl")]
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{number}/reactions")]
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")]
public Task<Reaction> Create(string owner, string name, int number, NewReaction reaction)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/IssueTimelineClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public IssueTimelineClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="owner">The owner of the repository</param>
/// <param name="repo">The name of the repository</param>
/// <param name="number">The issue number</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/timeline")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/timeline")]
public Task<IReadOnlyList<TimelineEventInfo>> GetAllForIssue(string owner, string repo, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -45,7 +45,7 @@ public Task<IReadOnlyList<TimelineEventInfo>> GetAllForIssue(string owner, strin
/// <param name="options">Options for changing the API repsonse</param>
[Preview("mockingbird")]
[Preview("starfox")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/timeline")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/timeline")]
public Task<IReadOnlyList<TimelineEventInfo>> GetAllForIssue(string owner, string repo, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
8 changes: 4 additions & 4 deletions Octokit/Clients/IssuesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public IssuesClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
[Preview("squirrel-girl")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}")]
public Task<Issue> Get(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -473,7 +473,7 @@ public Task<Issue> Create(long repositoryId, NewIssue newIssue)
/// <param name="number">The issue number</param>
/// <param name="issueUpdate">An <see cref="IssueUpdate"/> instance describing the changes to make to the issue
/// </param>
[ManualRoute("PATCH", "/repos/{owner}/{repo}/issues/{number}")]
[ManualRoute("PATCH", "/repos/{owner}/{repo}/issues/{issue_number}")]
public Task<Issue> Update(string owner, string name, int number, IssueUpdate issueUpdate)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -507,7 +507,7 @@ public Task<Issue> Update(long repositoryId, int number, IssueUpdate issueUpdate
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
[ManualRoute("PUT", "/repos/{owner}/{repo}/issues/{number}/lock")]
[ManualRoute("PUT", "/repos/{owner}/{repo}/issues/{issue_number}/lock")]
public Task Lock(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -535,7 +535,7 @@ public Task Lock(long repositoryId, int number)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{number}/lock")]
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/lock")]
public Task Unlock(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/IssuesEventsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public IssuesEventsClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The issue number</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/events")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/events")]
public Task<IReadOnlyList<IssueEvent>> GetAllForIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -58,7 +58,7 @@ public Task<IReadOnlyList<IssueEvent>> GetAllForIssue(long repositoryId, int num
/// <param name="number">The issue number</param>
/// <param name="options">Options for changing the API response</param>
[Preview("starfox")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/events")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/events")]
public Task<IReadOnlyList<IssueEvent>> GetAllForIssue(string owner, string name, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
20 changes: 10 additions & 10 deletions Octokit/Clients/IssuesLabelsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public IssuesLabelsClient(IApiConnection apiConnection)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -58,7 +58,7 @@ public Task<IReadOnlyList<Label>> GetAllForIssue(long repositoryId, int number)
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForIssue(string owner, string name, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -159,7 +159,7 @@ public Task<IReadOnlyList<Label>> GetAllForRepository(long repositoryId, ApiOpti
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the milestone</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{number}/labels")]
[ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{milestone_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForMilestone(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -176,7 +176,7 @@ public Task<IReadOnlyList<Label>> GetAllForMilestone(string owner, string name,
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The number of the milestone</param>
[ManualRoute("GET", "/repositories/{id}/milestones/{number}/labels")]
[ManualRoute("GET", "/repositories/{id}/milestones/{milestone_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForMilestone(long repositoryId, int number)
{
return GetAllForMilestone(repositoryId, number, ApiOptions.None);
Expand All @@ -192,7 +192,7 @@ public Task<IReadOnlyList<Label>> GetAllForMilestone(long repositoryId, int numb
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the milestone</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{number}/labels")]
[ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{milestone_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForMilestone(string owner, string name, int number, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -211,7 +211,7 @@ public Task<IReadOnlyList<Label>> GetAllForMilestone(string owner, string name,
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="number">The number of the milestone</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("GET", "/repositories/{id}/milestones/{number}/labels")]
[ManualRoute("GET", "/repositories/{id}/milestones/{milestone_number}/labels")]
public Task<IReadOnlyList<Label>> GetAllForMilestone(long repositoryId, int number, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
Expand Down Expand Up @@ -377,7 +377,7 @@ public Task<Label> Update(long repositoryId, string labelName, LabelUpdate label
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
/// <param name="labels">The names of the labels to add</param>
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task<IReadOnlyList<Label>> AddToIssue(string owner, string name, int number, string[] labels)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -414,7 +414,7 @@ public Task<IReadOnlyList<Label>> AddToIssue(long repositoryId, int number, stri
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
/// <param name="labelName">The name of the label to remove</param>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task<IReadOnlyList<Label>> RemoveFromIssue(string owner, string name, int number, string labelName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -451,7 +451,7 @@ public Task<IReadOnlyList<Label>> RemoveFromIssue(long repositoryId, int number,
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
/// <param name="labels">The names of the labels to set</param>
[ManualRoute("PUT", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("PUT", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task<IReadOnlyList<Label>> ReplaceAllForIssue(string owner, string name, int number, string[] labels)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -487,7 +487,7 @@ public Task<IReadOnlyList<Label>> ReplaceAllForIssue(long repositoryId, int numb
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="number">The number of the issue</param>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{number}/labels")]
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/labels")]
public Task RemoveAllFromIssue(string owner, string name, int number)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
2 changes: 1 addition & 1 deletion Octokit/Clients/MergingClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public MergingClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="name">The name of the repository</param>
/// <param name="merge">The merge to create</param>
/// <returns></returns>
[ManualRoute("POST", "/repos/{owner}/{name}/merges")]
[ManualRoute("POST", "/repos/{owner}/{repo}/merges")]
public Task<Merge> Create(string owner, string name, NewMerge merge)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
Loading

0 comments on commit 87d2b0f

Please sign in to comment.