From 87d2b0fdc18f22b758a7cf2fe89c86a018dafcb7 Mon Sep 17 00:00:00 2001 From: Brendan Forster Date: Thu, 19 Mar 2020 16:21:16 -0300 Subject: [PATCH] more cleanup of route metadata (#2158) --- Octokit/Clients/AssigneesClient.cs | 4 ++-- Octokit/Clients/CheckRunsClient.cs | 6 +++--- Octokit/Clients/CommitStatusClient.cs | 4 ++-- Octokit/Clients/IssueReactionsClient.cs | 6 +++--- Octokit/Clients/IssueTimelineClient.cs | 4 ++-- Octokit/Clients/IssuesClient.cs | 8 ++++---- Octokit/Clients/IssuesEventsClient.cs | 4 ++-- Octokit/Clients/IssuesLabelsClient.cs | 20 ++++++++++---------- Octokit/Clients/MergingClient.cs | 2 +- Octokit/Clients/MilestonesClient.cs | 12 ++++++------ Octokit/Clients/RepositoryContentsClient.cs | 4 ++-- Octokit/Clients/RepositoryTrafficClient.cs | 8 ++++---- 12 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Octokit/Clients/AssigneesClient.cs b/Octokit/Clients/AssigneesClient.cs index f1a198831c..4938d934c2 100644 --- a/Octokit/Clients/AssigneesClient.cs +++ b/Octokit/Clients/AssigneesClient.cs @@ -108,7 +108,7 @@ public async Task CheckAssignee(string owner, string name, string assignee /// The issue number /// List of names of assignees to add /// - [ManualRoute("POST", "/repos/{owner}/{repo}/issues/{number}/assignees")] + [ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/assignees")] public Task AddAssignees(string owner, string name, int number, AssigneesUpdate assignees) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -126,7 +126,7 @@ public Task AddAssignees(string owner, string name, int number, Assignees /// The issue number /// List of assignees to remove /// - [ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{number}/assignees")] + [ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{issue_number}/assignees")] public Task RemoveAssignees(string owner, string name, int number, AssigneesUpdate assignees) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); diff --git a/Octokit/Clients/CheckRunsClient.cs b/Octokit/Clients/CheckRunsClient.cs index 603a866b54..dcefe018a9 100644 --- a/Octokit/Clients/CheckRunsClient.cs +++ b/Octokit/Clients/CheckRunsClient.cs @@ -106,7 +106,7 @@ public Task Update(long repositoryId, long checkRunId, CheckRunUpdate /// The owner of the repository /// The name of the repository /// The commit reference (can be a SHA, branch name, or a tag name) - [ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")] + [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")] public Task GetAllForReference(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -142,7 +142,7 @@ public Task GetAllForReference(long repositoryId, string refe /// The name of the repository /// The commit reference (can be a SHA, branch name, or a tag name) /// Details to filter the request, such as by check name - [ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")] + [ManualRoute("GET", "/repos/{owner}/{repo}/commits/{commit_sha}/check-runs")] public Task GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -183,7 +183,7 @@ public Task GetAllForReference(long repositoryId, string refe /// Details to filter the request, such as by check name /// Options to change the API response [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 GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); diff --git a/Octokit/Clients/CommitStatusClient.cs b/Octokit/Clients/CommitStatusClient.cs index 676c5324fa..f7a349875d 100644 --- a/Octokit/Clients/CommitStatusClient.cs +++ b/Octokit/Clients/CommitStatusClient.cs @@ -144,7 +144,7 @@ public Task GetCombined(long repositoryId, string referenc /// The name of the repository /// The reference (SHA, branch name, or tag name) to list commits for /// The commit status to create - [ManualRoute("POST", "/repos/{owner}/{repo}/statuses/{ref}")] + [ManualRoute("POST", "/repos/{owner}/{repo}/statuses/{sha}")] public Task Create(string owner, string name, string reference, NewCommitStatus newCommitStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -164,7 +164,7 @@ public Task Create(string owner, string name, string reference, Ne /// The Id of the repository /// The reference (SHA, branch name, or tag name) to list commits for /// The commit status to create - [ManualRoute("POST", "/repositories/{id}/statuses/{ref}")] + [ManualRoute("POST", "/repositories/{id}/statuses/{sha}")] public Task Create(long repositoryId, string reference, NewCommitStatus newCommitStatus) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); diff --git a/Octokit/Clients/IssueReactionsClient.cs b/Octokit/Clients/IssueReactionsClient.cs index ea6f49b9d2..53c970e096 100644 --- a/Octokit/Clients/IssueReactionsClient.cs +++ b/Octokit/Clients/IssueReactionsClient.cs @@ -23,7 +23,7 @@ public IssueReactionsClient(IApiConnection apiConnection) /// The owner of the repository /// The name of the repository /// The issue id - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/reactions")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")] public Task> GetAll(string owner, string name, int number) { return GetAll(owner, name, number, ApiOptions.None); @@ -38,7 +38,7 @@ public Task> GetAll(string owner, string name, int numbe /// The issue id /// Options for changing the API response [Preview("squirrel-girl")] - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/reactions")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -85,7 +85,7 @@ public Task> GetAll(long repositoryId, int number, ApiOp /// The issue id /// The reaction to create [Preview("squirrel-girl")] - [ManualRoute("POST", "/repos/{owner}/{repo}/issues/{number}/reactions")] + [ManualRoute("POST", "/repos/{owner}/{repo}/issues/{issue_number}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); diff --git a/Octokit/Clients/IssueTimelineClient.cs b/Octokit/Clients/IssueTimelineClient.cs index 5a67862a94..00bbb3766c 100644 --- a/Octokit/Clients/IssueTimelineClient.cs +++ b/Octokit/Clients/IssueTimelineClient.cs @@ -24,7 +24,7 @@ public IssueTimelineClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue number - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/timeline")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/timeline")] public Task> GetAllForIssue(string owner, string repo, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -45,7 +45,7 @@ public Task> GetAllForIssue(string owner, strin /// Options for changing the API repsonse [Preview("mockingbird")] [Preview("starfox")] - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/timeline")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/timeline")] public Task> GetAllForIssue(string owner, string repo, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); diff --git a/Octokit/Clients/IssuesClient.cs b/Octokit/Clients/IssuesClient.cs index 8e9a5a4564..e5b1279329 100644 --- a/Octokit/Clients/IssuesClient.cs +++ b/Octokit/Clients/IssuesClient.cs @@ -67,7 +67,7 @@ public IssuesClient(IApiConnection apiConnection) : base(apiConnection) /// The name of the repository /// The issue number [Preview("squirrel-girl")] - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}")] public Task Get(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -473,7 +473,7 @@ public Task Create(long repositoryId, NewIssue newIssue) /// The issue number /// An instance describing the changes to make to the issue /// - [ManualRoute("PATCH", "/repos/{owner}/{repo}/issues/{number}")] + [ManualRoute("PATCH", "/repos/{owner}/{repo}/issues/{issue_number}")] public Task Update(string owner, string name, int number, IssueUpdate issueUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -507,7 +507,7 @@ public Task Update(long repositoryId, int number, IssueUpdate issueUpdate /// The owner of the repository /// The name of the repository /// The issue number - [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)); @@ -535,7 +535,7 @@ public Task Lock(long repositoryId, int number) /// The owner of the repository /// The name of the repository /// The issue number - [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)); diff --git a/Octokit/Clients/IssuesEventsClient.cs b/Octokit/Clients/IssuesEventsClient.cs index 9b16d636e7..eb782471a2 100644 --- a/Octokit/Clients/IssuesEventsClient.cs +++ b/Octokit/Clients/IssuesEventsClient.cs @@ -24,7 +24,7 @@ public IssuesEventsClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue number - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/events")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/events")] public Task> GetAllForIssue(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -58,7 +58,7 @@ public Task> GetAllForIssue(long repositoryId, int num /// The issue number /// Options for changing the API response [Preview("starfox")] - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/events")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/events")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); diff --git a/Octokit/Clients/IssuesLabelsClient.cs b/Octokit/Clients/IssuesLabelsClient.cs index 173c968213..a39f6a741f 100644 --- a/Octokit/Clients/IssuesLabelsClient.cs +++ b/Octokit/Clients/IssuesLabelsClient.cs @@ -25,7 +25,7 @@ public IssuesLabelsClient(IApiConnection apiConnection) /// The owner of the repository /// The name of the repository /// The number of the issue - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/labels")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/labels")] public Task> GetAllForIssue(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -58,7 +58,7 @@ public Task> GetAllForIssue(long repositoryId, int number) /// The name of the repository /// The number of the issue /// Options for changing the API response - [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{number}/labels")] + [ManualRoute("GET", "/repos/{owner}/{repo}/issues/{issue_number}/labels")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -159,7 +159,7 @@ public Task> GetAllForRepository(long repositoryId, ApiOpti /// The owner of the repository /// The name of the repository /// The number of the milestone - [ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{number}/labels")] + [ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{milestone_number}/labels")] public Task> GetAllForMilestone(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -176,7 +176,7 @@ public Task> GetAllForMilestone(string owner, string name, /// /// The Id of the repository /// The number of the milestone - [ManualRoute("GET", "/repositories/{id}/milestones/{number}/labels")] + [ManualRoute("GET", "/repositories/{id}/milestones/{milestone_number}/labels")] public Task> GetAllForMilestone(long repositoryId, int number) { return GetAllForMilestone(repositoryId, number, ApiOptions.None); @@ -192,7 +192,7 @@ public Task> GetAllForMilestone(long repositoryId, int numb /// The name of the repository /// The number of the milestone /// Options for changing the API response - [ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{number}/labels")] + [ManualRoute("GET", "/repos/{owner}/{repo}/milestones/{milestone_number}/labels")] public Task> GetAllForMilestone(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -211,7 +211,7 @@ public Task> GetAllForMilestone(string owner, string name, /// The Id of the repository /// The number of the milestone /// Options for changing the API response - [ManualRoute("GET", "/repositories/{id}/milestones/{number}/labels")] + [ManualRoute("GET", "/repositories/{id}/milestones/{milestone_number}/labels")] public Task> GetAllForMilestone(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -377,7 +377,7 @@ public Task