Skip to content

Commit

Permalink
first pass at cleaning up attributes (octokit#2157)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey authored Mar 18, 2020
1 parent 3270207 commit dc2f6ff
Show file tree
Hide file tree
Showing 54 changed files with 402 additions and 383 deletions.
1 change: 0 additions & 1 deletion Octokit.Tests.Conventions/ClientRouteTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public static IEnumerable<object[]> GetClientClasses()
.Assembly
.ExportedTypes
.Where(TypeExtensions.IsClientClass)
.Where(t => t != typeof(StatisticsClient)) // This convention doesn't apply to this one type.
.Where(t => t != typeof(GitHubClient))
.Select(type => new[] { type });
}
Expand Down
10 changes: 5 additions & 5 deletions Octokit/Clients/AssigneesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AssigneesClient(IApiConnection apiConnection) : base(apiConnection)
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
[ManualRoute("GET", "/repos/{owner}/{name}/assignees")]
[ManualRoute("GET", "/repos/{owner}/{repo}/assignees")]
public Task<IReadOnlyList<User>> GetAllForRepository(string owner, string name)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -49,7 +49,7 @@ public Task<IReadOnlyList<User>> GetAllForRepository(long repositoryId)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="options">The options to change API's response.</param>
[ManualRoute("GET", "/repos/{owner}/{name}/assignees")]
[ManualRoute("GET", "/repos/{owner}/{repo}/assignees")]
public Task<IReadOnlyList<User>> GetAllForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -82,7 +82,7 @@ public Task<IReadOnlyList<User>> GetAllForRepository(long repositoryId, ApiOptio
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="assignee">Username of the prospective assignee</param>
[ManualRoute("GET", "/repos/{owner}/{name}/assignees/{username}")]
[ManualRoute("GET", "/repos/{owner}/{repo}/assignees/{username}")]
public async Task<bool> CheckAssignee(string owner, string name, string assignee)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -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}/{name}/issues/{number}/assignees")]
[ManualRoute("POST", "/repos/{owner}/{repo}/issues/{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}/{name}/issues/{number}/assignees")]
[ManualRoute("DELETE", "/repos/{owner}/{repo}/issues/{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/AuthorizationsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ public async Task<ApplicationAuthorization> GetOrCreateApplicationAuthentication
/// <param name="clientId">Client Id of the OAuth application for the token</param>
/// <param name="accessToken">The OAuth token to check</param>
/// <returns>The valid <see cref="ApplicationAuthorization"/>.</returns>
[ManualRoute("POST", "/applications/{id}/token")]
[ManualRoute("POST", "/applications/{client_id}/token")]
public Task<ApplicationAuthorization> CheckApplicationAuthentication(string clientId, string accessToken)
{
Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId));
Expand All @@ -370,7 +370,7 @@ public Task<ApplicationAuthorization> CheckApplicationAuthentication(string clie
/// <param name="clientId">ClientID of the OAuth application for the token</param>
/// <param name="accessToken">The OAuth token to reset</param>
/// <returns>The valid <see cref="ApplicationAuthorization"/> with a new OAuth token</returns>
[ManualRoute("PATCH", "/applications/{id}/token")]
[ManualRoute("PATCH", "/applications/{client_id}/token")]
public Task<ApplicationAuthorization> ResetApplicationAuthentication(string clientId, string accessToken)
{
Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId));
Expand All @@ -395,7 +395,7 @@ public Task<ApplicationAuthorization> ResetApplicationAuthentication(string clie
/// <param name="clientId">ClientID of the OAuth application for the token</param>
/// <param name="accessToken">The OAuth token to revoke</param>
/// <returns>A <see cref="Task"/> for the request's execution.</returns>
[ManualRoute("DELETE", "/applications/{id}/token")]
[ManualRoute("DELETE", "/applications/{client_id}/token")]
public Task RevokeApplicationAuthentication(string clientId, string accessToken)
{
Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId));
Expand Down
4 changes: 2 additions & 2 deletions Octokit/Clients/BlobsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public BlobsClient(IApiConnection apiConnection)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The SHA of the blob</param>
[ManualRoute("GET", "/repos/{owner}/{name}/git/blobs/{file_sha}")]
[ManualRoute("GET", "/repos/{owner}/{repo}/git/blobs/{file_sha}")]
public Task<Blob> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -63,7 +63,7 @@ public Task<Blob> Get(long repositoryId, string reference)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="newBlob">The new Blob</param>
[ManualRoute("POST", "/repos/{owner}/{name}/git/blobs")]
[ManualRoute("POST", "/repos/{owner}/{repo}/git/blobs")]
public Task<BlobReference> Create(string owner, string name, NewBlob newBlob)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
28 changes: 14 additions & 14 deletions Octokit/Clients/CheckRunsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public CheckRunsClient(IApiConnection apiConnection) : base(apiConnection)
/// <param name="name">The name of the repository</param>
/// <param name="newCheckRun">Details of the Check Run to create</param>
[Preview("antiope")]
[ManualRoute("POST", "/repos/{owner}/{name}/check-runs")]
[ManualRoute("POST", "/repos/{owner}/{repo}/check-runs")]
public Task<CheckRun> Create(string owner, string name, NewCheckRun newCheckRun)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -69,7 +69,7 @@ public Task<CheckRun> Create(long repositoryId, NewCheckRun newCheckRun)
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="checkRunUpdate">The updates to the check run</param>
[Preview("antiope")]
[ManualRoute("PATCH", "/repos/{owner}/{name}/check-runs/{check_run_id}")]
[ManualRoute("PATCH", "/repos/{owner}/{repo}/check-runs/{check_run_id}")]
public Task<CheckRun> Update(string owner, string name, long checkRunId, CheckRunUpdate checkRunUpdate)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down 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/{sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -124,7 +124,7 @@ public Task<CheckRunsResponse> GetAllForReference(string owner, string name, str
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
[ManualRoute("GET", "/repositories/{id}/commits/{sha}/check-runs")]
[ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(long repositoryId, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
Expand All @@ -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/{sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{name}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand All @@ -162,7 +162,7 @@ public Task<CheckRunsResponse> GetAllForReference(string owner, string name, str
/// <param name="repositoryId">The Id 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", "/repositories/{id}/commits/{sha}/check-runs")]
[ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/check-runs")]
public Task<CheckRunsResponse> GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest)
{
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
Expand All @@ -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/{sha}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{name}/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 All @@ -210,7 +210,7 @@ public async Task<CheckRunsResponse> GetAllForReference(string owner, string nam
/// <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", "/repositories/{id}/commits/{sha}/check-runs")]
[ManualRoute("GET", "/repositories/{id}/commits/{commit_sha}/check-runs")]
public async Task<CheckRunsResponse> GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference));
Expand All @@ -233,7 +233,7 @@ public async Task<CheckRunsResponse> GetAllForReference(long repositoryId, strin
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
[ManualRoute("GET", "/repos/{owner}/{name}/check-suite/{check_suite_id}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-suite/{check_suite_id}/check-runs")]
public Task<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -266,7 +266,7 @@ public Task<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long check
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
[ManualRoute("GET", "/repos/{owner}/{name}/check-suite/{check_suite_id}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-suite/{check_suite_id}/check-runs")]
public Task<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -305,7 +305,7 @@ public Task<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long check
/// <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}/check-suite/{check_suite_id}/check-runs")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-suite/{check_suite_id}/check-runs")]
public async Task<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -354,7 +354,7 @@ public async Task<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
[Preview("antiope")]
[ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-runs/{check_run_id}")]
public Task<CheckRun> Get(string owner, string name, long checkRunId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -387,7 +387,7 @@ public Task<CheckRun> Get(long repositoryId, long checkRunId)
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
[ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}/annotations")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations")]
public Task<IReadOnlyList<CheckRunAnnotation>> GetAllAnnotations(string owner, string name, long checkRunId)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down Expand Up @@ -422,7 +422,7 @@ public Task<IReadOnlyList<CheckRunAnnotation>> GetAllAnnotations(long repository
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="options">Options to change the API response</param>
[Preview("antiope")]
[ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}/annotations")]
[ManualRoute("GET", "/repos/{owner}/{repo}/check-runs/{check_run_id}/annotations")]
public Task<IReadOnlyList<CheckRunAnnotation>> GetAllAnnotations(string owner, string name, long checkRunId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Expand Down
Loading

0 comments on commit dc2f6ff

Please sign in to comment.