diff --git a/.vscode/settings.json b/.vscode/settings.json index 06b02b053a..91f78ee477 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,8 @@ "**/obj": true, "**/packaging": true, "**/coverage-results": true - } + }, + "files.trimTrailingWhitespace": true, + "files.trimFinalNewlines": true, + "files.insertFinalNewline": true } diff --git a/Octokit.Tests.Conventions/ClientRouteTests.cs b/Octokit.Tests.Conventions/ClientRouteTests.cs new file mode 100644 index 0000000000..3ded0c28d8 --- /dev/null +++ b/Octokit.Tests.Conventions/ClientRouteTests.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using Xunit; + +namespace Octokit.Tests.Conventions +{ + public class ClientRouteTests + { + [Theory] + [MemberData(nameof(GetClientClasses))] + public void ClassMethodsAreMarkedAsGeneratedManualOrDotNetSpecific(Type clientClass) + { + var methodFailures = new List(); + + foreach (var method in clientClass.GetMethodsOrdered().Where(IsNotBoilerplateMethod)) + { + var success = MethodIsMarkedGeneratedManualOrDotNetSpecific(method); + if (!success) + { + methodFailures.Add(method); + } + } + + if (methodFailures.Count > 0) + { + var methodNames = string.Join(", ", methodFailures.Select(m => m.Name)); + throw new Xunit.Sdk.XunitException($"These methods on {clientClass.Name} are not marked with one of ManualRouteAttribute, GeneratedRouteAttribute or DotNetSpecificRouteAttribute: '{methodNames}'"); + } + } + + static bool MethodIsMarkedGeneratedManualOrDotNetSpecific(MethodInfo method) + { + var manualRoute = method.GetCustomAttribute(); + if (manualRoute != null) + { + return true; + } + + var generatedRoute = method.GetCustomAttribute(); + if (generatedRoute != null) + { + return true; + } + + var dotnetSpecificRoute = method.GetCustomAttribute(); + if (dotnetSpecificRoute != null) + { + return true; + } + + var obsolete = method.GetCustomAttribute(); + if (obsolete != null) + { + return true; + } + + return false; + } + + static bool IsNotBoilerplateMethod(MethodInfo method) + { + if (method.IsSpecialName) + { + return false; + } + + if (method.Name == "GetType" || method.Name == "ToString" || method.Name == "GetHashCode" || method.Name == "Equals") + { + return false; + } + + return true; + } + + public static IEnumerable GetClientClasses() + { + return typeof(IGitHubClient) + .GetTypeInfo() + .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 }); + } + } +} diff --git a/Octokit.Tests.Conventions/TypeExtensions.cs b/Octokit.Tests.Conventions/TypeExtensions.cs index 8deef34478..ed20ff6a33 100644 --- a/Octokit.Tests.Conventions/TypeExtensions.cs +++ b/Octokit.Tests.Conventions/TypeExtensions.cs @@ -74,6 +74,11 @@ public static bool IsClientInterface(this Type type) return type.GetTypeInfo().IsInterface && type.Name.EndsWith(ClientSuffix) && type.Namespace == typeof(IGitHubClient).Namespace; } + public static bool IsClientClass(this Type type) + { + return type.GetTypeInfo().IsClass && type.Name.EndsWith(ClientSuffix) && type.Namespace == typeof(IGitHubClient).Namespace; + } + public static Type GetObservableClientInterface(this Type type) { var observableClient = typeof(IObservableEventsClient); @@ -124,4 +129,4 @@ public struct CustomTypeInfo public Type Type { get; set; } public TypeCategory TypeCategory { get; set; } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/AssigneesClient.cs b/Octokit/Clients/AssigneesClient.cs index 8c8c4e808f..62841500e1 100644 --- a/Octokit/Clients/AssigneesClient.cs +++ b/Octokit/Clients/AssigneesClient.cs @@ -24,6 +24,7 @@ public AssigneesClient(IApiConnection apiConnection) : base(apiConnection) /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/assignees")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -36,6 +37,7 @@ public Task> GetAllForRepository(string owner, string name) /// Gets all the available assignees (owner + collaborators) to which issues may be assigned. /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/assignees")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, ApiOptions.None); @@ -47,6 +49,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// The options to change API's response. + [ManualRoute("GET", "/repos/{owner}/{name}/assignees")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -63,6 +66,7 @@ public Task> GetAllForRepository(string owner, string name, /// /// The Id of the repository /// The options to change API's response. + [ManualRoute("GET", "/repositories/{id}/assignees")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -78,6 +82,7 @@ public Task> GetAllForRepository(long repositoryId, ApiOptio /// The owner of the repository /// The name of the repository /// Username of the prospective assignee + [ManualRoute("GET", "/repos/{owner}/{name}/assignees/{username}")] public async Task CheckAssignee(string owner, string name, string assignee) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -103,6 +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}/{name}/issues/{number}/assignees")] public Task AddAssignees(string owner, string name, int number, AssigneesUpdate assignees) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -120,6 +126,7 @@ public Task AddAssignees(string owner, string name, int number, Assignees /// The issue number /// List of assignees to remove /// + [ManualRoute("DELETE", "/repos/{owner}/{name}/issues/{number}/assignees")] public Task RemoveAssignees(string owner, string name, int number, AssigneesUpdate assignees) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -134,6 +141,7 @@ public Task RemoveAssignees(string owner, string name, int number, Assign /// /// The Id of the repository /// Username of the prospective assignee + [ManualRoute("GET", "/repositories/{id}/assignees/{username}")] public async Task CheckAssignee(long repositoryId, string assignee) { Ensure.ArgumentNotNullOrEmptyString(assignee, nameof(assignee)); diff --git a/Octokit/Clients/AuthorizationsClient.cs b/Octokit/Clients/AuthorizationsClient.cs index d2cdf15844..0c25517df8 100644 --- a/Octokit/Clients/AuthorizationsClient.cs +++ b/Octokit/Clients/AuthorizationsClient.cs @@ -32,6 +32,7 @@ public AuthorizationsClient(IApiConnection apiConnection) : base(apiConnection) /// /// Thrown when a general API error occurs. /// A list of s for the authenticated user. + [ManualRoute("GET", "/authorizations")] public Task> GetAll() { return GetAll(ApiOptions.None); @@ -50,6 +51,7 @@ public Task> GetAll() /// /// Thrown when a general API error occurs. /// A list of s for the authenticated user. + [ManualRoute("GET", "/authorizations")] public Task> GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -70,6 +72,7 @@ public Task> GetAll(ApiOptions options) /// /// Thrown when a general API error occurs. /// The specified . + [ManualRoute("GET", "/authorizations/{id}")] public Task Get(int id) { return ApiConnection.Get(ApiUrls.Authorizations(id), null); @@ -92,6 +95,7 @@ public Task Get(int id) /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("POST", "/authorizations")] public Task Create(NewAuthorization newAuthorization) { Ensure.ArgumentNotNull(newAuthorization, nameof(newAuthorization)); @@ -126,6 +130,7 @@ public Task Create(NewAuthorization newAuthorization) /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("POST", "/authorizations")] public Task Create( NewAuthorization newAuthorization, string twoFactorAuthenticationCode) @@ -164,6 +169,7 @@ public Task Create( /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("POST", "/authorizations")] public Task Create( string clientId, string clientSecret, @@ -208,6 +214,7 @@ public Task Create( /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("POST", "/authorizations")] public Task Create( string clientId, string clientSecret, @@ -234,7 +241,7 @@ public Task Create( } /// - /// Creates a new authorization for the specified OAuth application if an authorization for that application doesn’t already + /// Creates a new authorization for the specified OAuth application if an authorization for that application doesn’t already /// exist for the user; otherwise, returns the user’s existing authorization for that application. /// /// @@ -252,6 +259,7 @@ public Task Create( /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("PUT", "/authorizations/clients/{id}")] public Task GetOrCreateApplicationAuthentication( string clientId, string clientSecret, @@ -275,7 +283,7 @@ public Task GetOrCreateApplicationAuthentication( } /// - /// Creates a new authorization for the specified OAuth application if an authorization for that application doesn’t already + /// Creates a new authorization for the specified OAuth application if an authorization for that application doesn’t already /// exist for the user; otherwise, returns the user’s existing authorization for that application. /// /// @@ -294,6 +302,7 @@ public Task GetOrCreateApplicationAuthentication( /// /// Thrown when a general API error occurs. /// The created . + [ManualRoute("PUT", "/authorizations/clients/{id}")] public async Task GetOrCreateApplicationAuthentication( string clientId, string clientSecret, @@ -336,6 +345,7 @@ public async Task GetOrCreateApplicationAuthentication /// Client Id of the OAuth application for the token /// The OAuth token to check /// The valid . + [ManualRoute("POST", "/applications/{id}/token")] public Task CheckApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); @@ -360,6 +370,7 @@ public Task CheckApplicationAuthentication(string clie /// ClientID of the OAuth application for the token /// The OAuth token to reset /// The valid with a new OAuth token + [ManualRoute("PATCH", "/applications/{id}/token")] public Task ResetApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); @@ -384,6 +395,7 @@ public Task ResetApplicationAuthentication(string clie /// ClientID of the OAuth application for the token /// The OAuth token to revoke /// A for the request's execution. + [ManualRoute("DELETE", "/applications/{id}/token")] public Task RevokeApplicationAuthentication(string clientId, string accessToken) { Ensure.ArgumentNotNullOrEmptyString(clientId, nameof(clientId)); @@ -403,7 +415,7 @@ public Task RevokeApplicationAuthentication(string clientId, string accessToken) /// /// /// This method requires authentication. - /// See the API + /// See the API /// documentation for more details. /// /// Id of the to update @@ -413,6 +425,7 @@ public Task RevokeApplicationAuthentication(string clientId, string accessToken) /// /// Thrown when a general API error occurs. /// The updated . + [ManualRoute("PATCH", "/authorizations/{id}")] public Task Update(int id, AuthorizationUpdate authorizationUpdate) { Ensure.ArgumentNotNull(authorizationUpdate, nameof(authorizationUpdate)); @@ -427,7 +440,7 @@ public Task Update(int id, AuthorizationUpdate authorizationUpdat /// /// /// This method requires authentication. - /// See the API + /// See the API /// documentation for more details. /// /// The system-wide Id of the authorization to delete @@ -436,6 +449,7 @@ public Task Update(int id, AuthorizationUpdate authorizationUpdat /// /// Thrown when a general API error occurs. /// A for the request's execution. + [ManualRoute("DELETE", "/authorizations/{id}")] public Task Delete(int id) { return ApiConnection.Delete(ApiUrls.Authorizations(id)); @@ -446,7 +460,7 @@ public Task Delete(int id) /// /// /// This method requires authentication. - /// See the API + /// See the API /// documentation for more details. /// /// The system-wide Id of the authorization to delete @@ -456,6 +470,7 @@ public Task Delete(int id) /// /// Thrown when a general API error occurs. /// A for the request's execution. + [ManualRoute("DELETE", "/authorizations/{id}")] public Task Delete(int id, string twoFactorAuthenticationCode) { return ApiConnection.Delete(ApiUrls.Authorizations(id), twoFactorAuthenticationCode); diff --git a/Octokit/Clients/BlobsClient.cs b/Octokit/Clients/BlobsClient.cs index 8cc69ab3e1..0e1b8d1674 100644 --- a/Octokit/Clients/BlobsClient.cs +++ b/Octokit/Clients/BlobsClient.cs @@ -28,6 +28,7 @@ public BlobsClient(IApiConnection apiConnection) /// The owner of the repository /// The name of the repository /// The SHA of the blob + [ManualRoute("GET", "/repos/{owner}/{name}/git/blobs/{file_sha}")] public Task Get(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -45,6 +46,7 @@ public Task Get(string owner, string name, string reference) /// /// The Id of the repository /// The SHA of the blob + [ManualRoute("GET", "/repositories/{id}/git/blobs/{file_sha}")] public Task Get(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -61,6 +63,7 @@ public Task Get(long repositoryId, string reference) /// The owner of the repository /// The name of the repository /// The new Blob + [ManualRoute("POST", "/repos/{owner}/{name}/git/blobs")] public Task Create(string owner, string name, NewBlob newBlob) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -78,6 +81,7 @@ public Task Create(string owner, string name, NewBlob newBlob) /// /// The Id of the repository /// The new Blob + [ManualRoute("POST", "/repositories/{id}/git/blobs")] public Task Create(long repositoryId, NewBlob newBlob) { Ensure.ArgumentNotNull(newBlob, nameof(newBlob)); diff --git a/Octokit/Clients/CheckRunsClient.cs b/Octokit/Clients/CheckRunsClient.cs index 2bbae335a0..f65f5f571e 100644 --- a/Octokit/Clients/CheckRunsClient.cs +++ b/Octokit/Clients/CheckRunsClient.cs @@ -30,6 +30,7 @@ public CheckRunsClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// Details of the Check Run to create + [ManualRoute("POST", "/repos/{owner}/{name}/check-runs")] public Task Create(string owner, string name, NewCheckRun newCheckRun) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -47,6 +48,7 @@ public Task Create(string owner, string name, NewCheckRun newCheckRun) /// /// The Id of the repository /// Details of the Check Run to create + [ManualRoute("POST", "/repositories/{id}/check-runs")] public Task Create(long repositoryId, NewCheckRun newCheckRun) { Ensure.ArgumentNotNull(newCheckRun, nameof(newCheckRun)); @@ -64,6 +66,7 @@ public Task Create(long repositoryId, NewCheckRun newCheckRun) /// The name of the repository /// The Id of the check run /// The updates to the check run + [ManualRoute("PATCH", "/repos/{owner}/{name}/check-runs/{check_run_id}")] public Task Update(string owner, string name, long checkRunId, CheckRunUpdate checkRunUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -82,6 +85,7 @@ public Task Update(string owner, string name, long checkRunId, CheckRu /// The Id of the repository /// The Id of the check run /// The updates to the check run + [ManualRoute("PATCH", "/repositories/{id}/check-runs/{check_run_id}")] public Task Update(long repositoryId, long checkRunId, CheckRunUpdate checkRunUpdate) { Ensure.ArgumentNotNull(checkRunUpdate, nameof(checkRunUpdate)); @@ -98,6 +102,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/{sha}/check-runs")] public Task GetAllForReference(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -115,6 +120,7 @@ public Task GetAllForReference(string owner, string name, str /// /// The Id of the repository /// The commit reference (can be a SHA, branch name, or a tag name) + [ManualRoute("GET", "/repositories/{id}/commits/{sha}/check-runs")] public Task GetAllForReference(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -132,6 +138,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/{sha}/check-runs")] public Task GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -151,6 +158,7 @@ public Task GetAllForReference(string owner, string name, str /// The Id 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", "/repositories/{id}/commits/{sha}/check-runs")] public Task GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -170,6 +178,7 @@ public Task GetAllForReference(long repositoryId, string refe /// The commit reference (can be a SHA, branch name, or a tag name) /// Details to filter the request, such as by check name /// Options to change the API response + [ManualRoute("GET", "repos/{owner}/{name}/commits/{sha}/check-runs")] public async Task GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -195,6 +204,7 @@ public async Task GetAllForReference(string owner, string nam /// The commit reference (can be a SHA, branch name, or a tag name) /// Details to filter the request, such as by check name /// Options to change the API response + [ManualRoute("GET", "/repositories/{id}/commits/{sha}/check-runs")] public async Task GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -217,6 +227,7 @@ public async Task GetAllForReference(long repositoryId, strin /// The owner of the repository /// The name of the repository /// The Id of the check suite + [ManualRoute("GET", "/repos/{owner}/{name}/check-suite/{check_suite_id}/check-runs")] public Task GetAllForCheckSuite(string owner, string name, long checkSuiteId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -233,6 +244,7 @@ public Task GetAllForCheckSuite(string owner, string name, lo /// /// The Id of the repository /// The Id of the check suite + [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}/check-runs")] public Task GetAllForCheckSuite(long repositoryId, long checkSuiteId) { return GetAllForCheckSuite(repositoryId, checkSuiteId, new CheckRunRequest(), ApiOptions.None); @@ -248,6 +260,7 @@ public Task GetAllForCheckSuite(long repositoryId, long check /// The name of the repository /// The Id of the check suite /// Details to filter the request, such as by check name + [ManualRoute("GET", "/repos/{owner}/{name}/check-suite/{check_suite_id}/check-runs")] public Task GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -266,6 +279,7 @@ public Task GetAllForCheckSuite(string owner, string name, lo /// The Id of the repository /// The Id of the check suite /// Details to filter the request, such as by check name + [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}/check-runs")] public Task GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest) { Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); @@ -284,6 +298,7 @@ public Task GetAllForCheckSuite(long repositoryId, long check /// The Id of the check suite /// Details to filter the request, such as by check name /// Options to change the API response + [ManualRoute("GET", "/repos/{owner}/{name}/check-suite/{check_suite_id}/check-runs")] public async Task GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -308,6 +323,7 @@ public async Task GetAllForCheckSuite(string owner, string na /// The Id of the check suite /// Details to filter the request, such as by check name /// Options to change the API response + [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}/check-runs")] public async Task GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options) { Ensure.ArgumentNotNull(checkRunRequest, nameof(checkRunRequest)); @@ -329,6 +345,7 @@ public async Task GetAllForCheckSuite(long repositoryId, long /// The owner of the repository /// The name of the repository /// The Id of the check run + [ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}")] public Task Get(string owner, string name, long checkRunId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -345,6 +362,7 @@ public Task Get(string owner, string name, long checkRunId) /// /// The Id of the repository /// The Id of the check run + [ManualRoute("GET", "/repositories/{id}/check-runs/{check_run_id}")] public Task Get(long repositoryId, long checkRunId) { return ApiConnection.Get(ApiUrls.CheckRun(repositoryId, checkRunId), null, AcceptHeaders.ChecksApiPreview); @@ -359,6 +377,7 @@ public Task Get(long repositoryId, long checkRunId) /// The owner of the repository /// The name of the repository /// The Id of the check run + [ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(string owner, string name, long checkRunId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -376,6 +395,7 @@ public Task> GetAllAnnotations(string owner, s /// The Id of the repository /// The Id of the check run /// + [ManualRoute("GET", "/repositories/{id}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(long repositoryId, long checkRunId) { return GetAllAnnotations(repositoryId, checkRunId, ApiOptions.None); @@ -391,6 +411,7 @@ public Task> GetAllAnnotations(long repository /// The name of the repository /// The Id of the check run /// Options to change the API response + [ManualRoute("GET", "/repos/{owner}/{name}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(string owner, string name, long checkRunId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -409,6 +430,7 @@ public Task> GetAllAnnotations(string owner, s /// The Id of the repository /// The Id of the check run /// Options to change the API response + [ManualRoute("GET", "/repositories/{id}/check-runs/{check_run_id}/annotations")] public Task> GetAllAnnotations(long repositoryId, long checkRunId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); diff --git a/Octokit/Clients/CheckSuitesClient.cs b/Octokit/Clients/CheckSuitesClient.cs index 26275dc0ce..a3d1863371 100644 --- a/Octokit/Clients/CheckSuitesClient.cs +++ b/Octokit/Clients/CheckSuitesClient.cs @@ -30,6 +30,7 @@ public CheckSuitesClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The Id of the check suite + [ManualRoute("GET", "/repos/{owner}/{name}/check-suites/{id}")] public Task Get(string owner, string name, long checkSuiteId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -46,6 +47,7 @@ public Task Get(string owner, string name, long checkSuiteId) /// /// The Id of the repository /// The Id of the check suite + [ManualRoute("GET", "/repositories/{id}/check-suites/{check_suite_id}")] public Task Get(long repositoryId, long checkSuiteId) { return ApiConnection.Get(ApiUrls.CheckSuite(repositoryId, checkSuiteId), null, AcceptHeaders.ChecksApiPreview); @@ -60,6 +62,7 @@ public Task Get(long repositoryId, long checkSuiteId) /// The owner of the repository /// The name of the repository /// The reference (SHA, branch name or tag name) to list check suites for + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{ref}/check-suites")] public Task GetAllForReference(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -77,6 +80,7 @@ public Task GetAllForReference(string owner, string name, s /// /// The Id of the repository /// The reference (SHA, branch name or tag name) to list check suites for + [ManualRoute("GET", "/repositories/{id}/commits/{ref}/check-suites")] public Task GetAllForReference(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -94,6 +98,7 @@ public Task GetAllForReference(long repositoryId, string re /// The name of the repository /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{ref}/check-suites")] public Task GetAllForReference(string owner, string name, string reference, CheckSuiteRequest request) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -113,6 +118,7 @@ public Task GetAllForReference(string owner, string name, s /// The Id of the repository /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name + [ManualRoute("GET", "/repositories/{id}/commits/{ref}/check-suites")] public Task GetAllForReference(long repositoryId, string reference, CheckSuiteRequest request) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -132,6 +138,7 @@ public Task GetAllForReference(long repositoryId, string re /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name /// Options to change the API response + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{ref}/check-suites")] public async Task GetAllForReference(string owner, string name, string reference, CheckSuiteRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -157,6 +164,7 @@ public async Task GetAllForReference(string owner, string n /// The reference (SHA, branch name or tag name) to list check suites for /// Details to filter the request, such as by App Id or Check Name /// Options to change the API response + [ManualRoute("GET", "/repositories/{id}/commits/{ref}/check-suites")] public async Task GetAllForReference(long repositoryId, string reference, CheckSuiteRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -179,6 +187,7 @@ public async Task GetAllForReference(long repositoryId, str /// The owner of the repository /// The name of the repository /// The check suite preferences + [ManualRoute("PATCH", "/repos/{owner}/{name}/check-suites/preferences")] public Task UpdatePreferences(string owner, string name, CheckSuitePreferences preferences) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -196,6 +205,7 @@ public Task UpdatePreferences(string owner, strin /// /// The Id of the repository /// The check suite preferences + [ManualRoute("GET", "/repositories/{id}/check-suites/preferences")] public Task UpdatePreferences(long repositoryId, CheckSuitePreferences preferences) { Ensure.ArgumentNotNull(preferences, nameof(preferences)); @@ -212,6 +222,7 @@ public Task UpdatePreferences(long repositoryId, /// The owner of the repository /// The name of the repository /// Details of the Check Suite to create + [ManualRoute("POST", "/repos/{owner}/{name}/check-suites")] public Task Create(string owner, string name, NewCheckSuite newCheckSuite) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -229,6 +240,7 @@ public Task Create(string owner, string name, NewCheckSuite newCheck /// /// The Id of the repository /// Details of the Check Suite to create + [ManualRoute("GET", "/repositories/{id}/check-suites")] public Task Create(long repositoryId, NewCheckSuite newCheckSuite) { Ensure.ArgumentNotNull(newCheckSuite, nameof(newCheckSuite)); @@ -294,6 +306,7 @@ public async Task Request(long repositoryId, CheckSuiteTriggerRequest requ /// The owner of the repository /// The name of the repository /// The Id of the check suite + [ManualRoute("GET", "/repos/{owner}/{name}/check-suites/{2}/rerequest")] public async Task Rerequest(string owner, string name, long checkSuiteId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -317,6 +330,7 @@ public async Task Rerequest(string owner, string name, long checkSuiteId) /// /// The Id of the repository /// The Id of the check suite + [ManualRoute("GET", "/repositories/{id}/check-suites/{2}/rerequest")] public async Task Rerequest(long repositoryId, long checkSuiteId) { var httpStatusCode = await Connection.Post(ApiUrls.CheckSuiteRerequest(repositoryId, checkSuiteId), null, AcceptHeaders.ChecksApiPreview).ConfigureAwait(false); @@ -329,4 +343,4 @@ public async Task Rerequest(long repositoryId, long checkSuiteId) return httpStatusCode == HttpStatusCode.Created; } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/CommitCommentReactionsClient.cs b/Octokit/Clients/CommitCommentReactionsClient.cs index 7b97705b39..f9b1520c37 100644 --- a/Octokit/Clients/CommitCommentReactionsClient.cs +++ b/Octokit/Clients/CommitCommentReactionsClient.cs @@ -25,6 +25,7 @@ public CommitCommentReactionsClient(IApiConnection apiConnection) /// The comment id /// The reaction to create /// + [ManualRoute("POST", "/repos/{owner}/{name}/comments/{comment_id}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -42,6 +43,7 @@ public Task Create(string owner, string name, int number, NewReaction /// The comment id /// The reaction to create /// + [ManualRoute("POST", "/repositories/{id}/comments/{comment_id}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); @@ -57,6 +59,7 @@ public Task Create(long repositoryId, int number, NewReaction reaction /// The name of the repository /// The comment id /// + [ManualRoute("GET", "/repos/{owner}/{name}/comments/{comment_id}/reactions")] public Task> GetAll(string owner, string name, int number) { return GetAll(owner, name, number, ApiOptions.None); @@ -71,6 +74,7 @@ public Task> GetAll(string owner, string name, int numbe /// The comment id /// Options for changing the API response /// + [ManualRoute("GET", "/repos/{owner}/{name}/comments/{comment_id}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -87,6 +91,7 @@ public Task> GetAll(string owner, string name, int numbe /// The owner of the repository /// The comment id /// + [ManualRoute("GET", "/repositories/{id}/comments/{comment_id}/reactions")] public Task> GetAll(long repositoryId, int number) { return GetAll(repositoryId, number, ApiOptions.None); @@ -100,6 +105,7 @@ public Task> GetAll(long repositoryId, int number) /// The comment id /// Options for changing the API response /// + [ManualRoute("GET", "/repositories/{id}/comments/{comment_id}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); diff --git a/Octokit/Clients/CommitStatusClient.cs b/Octokit/Clients/CommitStatusClient.cs index c2d9f3c191..88f80ab12e 100644 --- a/Octokit/Clients/CommitStatusClient.cs +++ b/Octokit/Clients/CommitStatusClient.cs @@ -29,6 +29,7 @@ public CommitStatusClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The reference (SHA, branch name, or tag name) to list commits for + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}/statuses")] public Task> GetAll(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -47,6 +48,7 @@ public Task> GetAll(string owner, string name, strin /// /// The Id of the repository /// The reference (SHA, branch name, or tag name) to list commits for + [ManualRoute("GET", "/repositories/{id}/commits/{sha}/statuses")] public Task> GetAll(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -65,6 +67,7 @@ public Task> GetAll(long repositoryId, string refere /// The name of the repository /// The reference (SHA, branch name, or tag name) to list commits for /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}/statuses")] public Task> GetAll(string owner, string name, string reference, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -85,6 +88,7 @@ public Task> GetAll(string owner, string name, strin /// The Id of the repository /// The reference (SHA, branch name, or tag name) to list commits for /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/commits/{sha}/statuses")] public Task> GetAll(long repositoryId, string reference, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -103,6 +107,7 @@ public Task> GetAll(long repositoryId, string refere /// The owner of the repository /// The name of the repository /// The reference (SHA, branch name, or tag name) to list commits for + [ManualRoute("GET", "/repos/{owner}/{name}/commits/{sha}/status")] public Task GetCombined(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -121,6 +126,7 @@ public Task GetCombined(string owner, string name, string /// /// The Id of the repository /// The reference (SHA, branch name, or tag name) to list commits for + [ManualRoute("GET", "/repositories/{id}/commits/{sha}/status")] public Task GetCombined(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -138,6 +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}/{name}/statuses/{sha}")] public Task Create(string owner, string name, string reference, NewCommitStatus newCommitStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -157,6 +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/{sha}")] public Task Create(long repositoryId, string reference, NewCommitStatus newCommitStatus) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -165,4 +173,4 @@ public Task Create(long repositoryId, string reference, NewCommitS return ApiConnection.Post(ApiUrls.CreateCommitStatus(repositoryId, reference), newCommitStatus); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/CommitsClient.cs b/Octokit/Clients/CommitsClient.cs index 0d1661ac65..f127817499 100644 --- a/Octokit/Clients/CommitsClient.cs +++ b/Octokit/Clients/CommitsClient.cs @@ -28,6 +28,7 @@ public CommitsClient(IApiConnection apiConnection) : /// The owner of the repository /// The name of the repository /// Tha sha reference of the commit + [ManualRoute("GET", "/repos/{owner}/{name}/git/commits/{commit_sha}")] public Task Get(string owner, string name, string reference) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -45,6 +46,7 @@ public Task Get(string owner, string name, string reference) /// /// The Id of the repository /// Tha sha reference of the commit + [ManualRoute("GET", "/repositories/{id}/git/commits/{commit_sha}")] public Task Get(long repositoryId, string reference) { Ensure.ArgumentNotNullOrEmptyString(reference, nameof(reference)); @@ -61,6 +63,7 @@ public Task Get(long repositoryId, string reference) /// The owner of the repository /// The name of the repository /// The commit to create + [ManualRoute("POST", "/repos/{owner}/{name}/git/commits")] public Task Create(string owner, string name, NewCommit commit) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -78,6 +81,7 @@ public Task Create(string owner, string name, NewCommit commit) /// /// The Id of the repository /// The commit to create + [ManualRoute("POST", "/repositories/{id}/git/commits")] public Task Create(long repositoryId, NewCommit commit) { Ensure.ArgumentNotNull(commit, nameof(commit)); @@ -85,4 +89,4 @@ public Task Create(long repositoryId, NewCommit commit) return ApiConnection.Post(ApiUrls.CreateCommit(repositoryId), commit); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/DeploymentStatusClient.cs b/Octokit/Clients/DeploymentStatusClient.cs index 61735e8d2a..c328a04bff 100644 --- a/Octokit/Clients/DeploymentStatusClient.cs +++ b/Octokit/Clients/DeploymentStatusClient.cs @@ -27,6 +27,7 @@ public DeploymentStatusClient(IApiConnection apiConnection) /// The owner of the repository. /// The name of the repository. /// The id of the deployment. + [ManualRoute("GET", "/repos/{owner}/{name}/deployments/{deployment_id}/statuses")] public Task> GetAll(string owner, string name, int deploymentId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -44,6 +45,7 @@ public Task> GetAll(string owner, string name, i /// /// The Id of the repository. /// The id of the deployment. + [ManualRoute("GET", "/repositories/{id}/deployments/{deployment_id}/statuses")] public Task> GetAll(long repositoryId, int deploymentId) { return GetAll(repositoryId, deploymentId, ApiOptions.None); @@ -60,6 +62,7 @@ public Task> GetAll(long repositoryId, int deplo /// The name of the repository. /// The id of the deployment. /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/deployments/{deployment_id}/statuses")] public Task> GetAll(string owner, string name, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -82,6 +85,7 @@ public Task> GetAll(string owner, string name, i /// The Id of the repository. /// The id of the deployment. /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/deployments/{deployment_id}/statuses")] public Task> GetAll(long repositoryId, int deploymentId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -103,6 +107,7 @@ public Task> GetAll(long repositoryId, int deplo /// The name of the repository. /// The id of the deployment. /// The new deployment status to create. + [ManualRoute("POST", "/repos/{owner}/{name}/deployments/{deployment_id}/statuses")] public Task Create(string owner, string name, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -124,6 +129,7 @@ public Task Create(string owner, string name, int deploymentId /// The Id of the repository. /// The id of the deployment. /// The new deployment status to create. + [ManualRoute("POST", "/repositories/{id}/deployments/{deployment_id}/statuses")] public Task Create(long repositoryId, int deploymentId, NewDeploymentStatus newDeploymentStatus) { Ensure.ArgumentNotNull(newDeploymentStatus, nameof(newDeploymentStatus)); diff --git a/Octokit/Clients/DeploymentsClient.cs b/Octokit/Clients/DeploymentsClient.cs index d93380a340..f3020fae11 100644 --- a/Octokit/Clients/DeploymentsClient.cs +++ b/Octokit/Clients/DeploymentsClient.cs @@ -31,6 +31,7 @@ public DeploymentsClient(IApiConnection apiConnection) /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/deployments")] public Task> GetAll(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -47,6 +48,7 @@ public Task> GetAll(string owner, string name) /// http://developer.github.com/v3/repos/deployments/#list-deployments /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/deployments")] public Task> GetAll(long repositoryId) { return GetAll(repositoryId, ApiOptions.None); @@ -62,6 +64,7 @@ public Task> GetAll(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/deployments")] public Task> GetAll(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -83,6 +86,7 @@ public Task> GetAll(string owner, string name, ApiOpti /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/deployments")] public Task> GetAll(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -100,6 +104,7 @@ public Task> GetAll(long repositoryId, ApiOptions opti /// The owner of the repository /// The name of the repository /// A instance describing the new deployment to create + [ManualRoute("POST", "/repos/{owner}/{name}/deployments")] public Task Create(string owner, string name, NewDeployment newDeployment) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -120,6 +125,7 @@ public Task Create(string owner, string name, NewDeployment newDeplo /// /// The Id of the repository /// A instance describing the new deployment to create + [ManualRoute("POST", "/repositories/{id}/deployments")] public Task Create(long repositoryId, NewDeployment newDeployment) { Ensure.ArgumentNotNull(newDeployment, nameof(newDeployment)); diff --git a/Octokit/Clients/Enterprise/EnterpriseAdminStatsClient.cs b/Octokit/Clients/Enterprise/EnterpriseAdminStatsClient.cs index cdbbd7de87..ece2d4b577 100644 --- a/Octokit/Clients/Enterprise/EnterpriseAdminStatsClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseAdminStatsClient.cs @@ -21,6 +21,7 @@ public EnterpriseAdminStatsClient(IApiConnection apiConnection) /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/issues")] public Task GetStatisticsIssues() { var endpoint = ApiUrls.EnterpriseAdminStatsIssues(); @@ -35,6 +36,7 @@ public Task GetStatisticsIssues() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/hooks")] public Task GetStatisticsHooks() { var endpoint = ApiUrls.EnterpriseAdminStatsHooks(); @@ -49,6 +51,7 @@ public Task GetStatisticsHooks() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/milestones")] public Task GetStatisticsMilestones() { var endpoint = ApiUrls.EnterpriseAdminStatsMilestones(); @@ -63,6 +66,7 @@ public Task GetStatisticsMilestones() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/orgs")] public Task GetStatisticsOrgs() { var endpoint = ApiUrls.EnterpriseAdminStatsOrgs(); @@ -77,6 +81,7 @@ public Task GetStatisticsOrgs() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/comments")] public Task GetStatisticsComments() { var endpoint = ApiUrls.EnterpriseAdminStatsComments(); @@ -91,6 +96,7 @@ public Task GetStatisticsComments() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/pages")] public Task GetStatisticsPages() { var endpoint = ApiUrls.EnterpriseAdminStatsPages(); @@ -105,6 +111,7 @@ public Task GetStatisticsPages() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/users")] public Task GetStatisticsUsers() { var endpoint = ApiUrls.EnterpriseAdminStatsUsers(); @@ -119,6 +126,7 @@ public Task GetStatisticsUsers() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/comments")] public Task GetStatisticsGists() { var endpoint = ApiUrls.EnterpriseAdminStatsGists(); @@ -133,6 +141,7 @@ public Task GetStatisticsGists() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/pulls")] public Task GetStatisticsPulls() { var endpoint = ApiUrls.EnterpriseAdminStatsPulls(); @@ -147,6 +156,7 @@ public Task GetStatisticsPulls() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The statistics. + [ManualRoute("GET", "/enterprise/stats/repos")] public Task GetStatisticsRepos() { var endpoint = ApiUrls.EnterpriseAdminStatsRepos(); @@ -161,6 +171,7 @@ public Task GetStatisticsRepos() /// https://developer.github.com/v3/enterprise/admin_stats/#get-statistics /// /// The collection of statistics. + [ManualRoute("GET", "/enterprise/stats/all")] public Task GetStatisticsAll() { var endpoint = ApiUrls.EnterpriseAdminStatsAll(); diff --git a/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs b/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs index f9fde1d31c..c89e1f61c5 100644 --- a/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseLdapClient.cs @@ -24,6 +24,7 @@ public EnterpriseLdapClient(IApiConnection apiConnection) /// The username to update LDAP mapping /// The /// The object. + [ManualRoute("PATCH", "/admin/ldap/users/{username}/mapping")] public Task UpdateUserMapping(string userName, NewLdapMapping newLdapMapping) { Ensure.ArgumentNotNull(userName, nameof(userName)); @@ -42,6 +43,7 @@ public Task UpdateUserMapping(string userName, NewLdapMapping newLdapMappi /// /// The userName to sync LDAP mapping /// The of the queue request. + [ManualRoute("POST", "/admin/ldap/users/{username}/sync")] public async Task QueueSyncUserMapping(string userName) { Ensure.ArgumentNotNull(userName, nameof(userName)); @@ -66,6 +68,7 @@ public async Task QueueSyncUserMapping(string userName) /// The teamId to update LDAP mapping /// The /// The object. + [ManualRoute("PATCH", "/admin/ldap/teams/{team_id}/mapping")] public Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) { Ensure.ArgumentNotNull(teamId, nameof(teamId)); @@ -84,6 +87,7 @@ public Task UpdateTeamMapping(int teamId, NewLdapMapping newLdapMapping) /// /// The teamId to update LDAP mapping /// The of the queue request. + [ManualRoute("POST", "/admin/ldap/teams/{team_id}/sync")] public async Task QueueSyncTeamMapping(int teamId) { Ensure.ArgumentNotNull(teamId, nameof(teamId)); diff --git a/Octokit/Clients/Enterprise/EnterpriseLicenseClient.cs b/Octokit/Clients/Enterprise/EnterpriseLicenseClient.cs index 4efab54ba3..f88af7d162 100644 --- a/Octokit/Clients/Enterprise/EnterpriseLicenseClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseLicenseClient.cs @@ -21,6 +21,7 @@ public EnterpriseLicenseClient(IApiConnection apiConnection) /// https://developer.github.com/v3/enterprise/license/#get-license-information /// /// The statistics. + [ManualRoute("GET", "/enterprise/settings/license")] public Task Get() { var endpoint = ApiUrls.EnterpriseLicense(); diff --git a/Octokit/Clients/Enterprise/EnterpriseManagementConsoleClient.cs b/Octokit/Clients/Enterprise/EnterpriseManagementConsoleClient.cs index 7a3ada73cd..fae4a2448a 100644 --- a/Octokit/Clients/Enterprise/EnterpriseManagementConsoleClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseManagementConsoleClient.cs @@ -21,6 +21,7 @@ public EnterpriseManagementConsoleClient(IApiConnection apiConnection) /// https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status /// /// The . + [ManualRoute("GET", "/setup/api/maintenance")] public Task GetMaintenanceMode(string managementConsolePassword) { Ensure.ArgumentNotNullOrEmptyString(managementConsolePassword, "managementConsolePassword"); @@ -37,6 +38,7 @@ public Task GetMaintenanceMode(string managementConsole /// https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status /// /// The . + [ManualRoute("POST", "/setup/api/maintenance")] public Task EditMaintenanceMode(UpdateMaintenanceRequest maintenance, string managementConsolePassword) { Ensure.ArgumentNotNull(maintenance, "maintenance"); diff --git a/Octokit/Clients/Enterprise/EnterpriseOrganizationClient.cs b/Octokit/Clients/Enterprise/EnterpriseOrganizationClient.cs index 1392509065..d0323a8ba6 100644 --- a/Octokit/Clients/Enterprise/EnterpriseOrganizationClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseOrganizationClient.cs @@ -22,6 +22,7 @@ public EnterpriseOrganizationClient(IApiConnection apiConnection) /// /// A instance describing the organization to be created /// The created. + [ManualRoute("POST", "/admin/organizations")] public Task Create(NewOrganization newOrganization) { Ensure.ArgumentNotNull(newOrganization, nameof(newOrganization)); diff --git a/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs b/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs index 39584ca8b8..013f2fe23f 100644 --- a/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs +++ b/Octokit/Clients/Enterprise/EnterprisePreReceiveEnvironmentsClient.cs @@ -26,6 +26,7 @@ public EnterprisePreReceiveEnvironmentsClient(IApiConnection apiConnection) /// See the API documentation for more information. /// /// Thrown when a general API error occurs. + [ManualRoute("GET", "/admin/pre-receive-environments")] public Task> GetAll() { return GetAll(ApiOptions.None); @@ -39,6 +40,7 @@ public Task> GetAll() /// /// Options for changing the API response /// Thrown when a general API error occurs. + [ManualRoute("GET", "/admin/pre-receive-environments")] public Task> GetAll(ApiOptions options) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(); @@ -54,6 +56,7 @@ public Task> GetAll(ApiOptions options) /// The id of the pre-receive environment /// Thrown when the specified does not exist. /// Thrown when a general API error occurs. + [ManualRoute("GET", "/admin/pre-receive-environments/{pre_receive_environment_id}")] public Task Get(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(environmentId); @@ -68,6 +71,7 @@ public Task Get(long environmentId) /// /// A description of the pre-receive environment to create /// Thrown when a general API error occurs. + [ManualRoute("POST", "/admin/pre-receive-environments")] public Task Create(NewPreReceiveEnvironment newPreReceiveEnvironment) { Ensure.ArgumentNotNull(newPreReceiveEnvironment, nameof(newPreReceiveEnvironment)); @@ -86,6 +90,7 @@ public Task Create(NewPreReceiveEnvironment newPreReceive /// A description of the pre-receive environment to edit /// Thrown when the specified does not exist. /// Thrown when a general API error occurs. + [ManualRoute("PATCH", "/admin/pre-receive-environments/{pre_receive_environment_id}")] public Task Edit(long environmentId, UpdatePreReceiveEnvironment updatePreReceiveEnvironment) { Ensure.ArgumentNotNull(updatePreReceiveEnvironment, nameof(updatePreReceiveEnvironment)); @@ -103,6 +108,7 @@ public Task Edit(long environmentId, UpdatePreReceiveEnvi /// The id of the pre-receive environment /// Thrown when the specified does not exist. /// Thrown when a general API error occurs. + [ManualRoute("DELETE", "/admin/pre-receive-environments/{pre_receive_environment_id}")] public Task Delete(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironments(environmentId); @@ -118,6 +124,7 @@ public Task Delete(long environmentId) /// The id of the pre-receive environment /// Thrown when the specified does not exist. /// Thrown when a general API error occurs. + [ManualRoute("GET", "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest")] public Task DownloadStatus(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironmentDownloadStatus(environmentId); @@ -134,6 +141,7 @@ public Task DownloadStatus(long environmentId) /// The id of the pre-receive environment /// Thrown when the specified does not exist. /// Thrown when a general API error occurs. + [ManualRoute("POST", "/admin/pre-receive-environments/{pre_receive_environment_id}/downloads")] public Task TriggerDownload(long environmentId) { var endpoint = ApiUrls.AdminPreReceiveEnvironmentDownload(environmentId); diff --git a/Octokit/Clients/Enterprise/EnterpriseSearchIndexingClient.cs b/Octokit/Clients/Enterprise/EnterpriseSearchIndexingClient.cs index d041e57e77..07de7d61ab 100644 --- a/Octokit/Clients/Enterprise/EnterpriseSearchIndexingClient.cs +++ b/Octokit/Clients/Enterprise/EnterpriseSearchIndexingClient.cs @@ -23,6 +23,7 @@ public EnterpriseSearchIndexingClient(IApiConnection apiConnection) /// /// A user or organization account /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task Queue(string owner) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -42,6 +43,7 @@ public Task Queue(string owner) /// A user or organization account /// A repository /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task Queue(string owner, string repository) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -61,6 +63,7 @@ public Task Queue(string owner, string repository) /// /// A user or organization account /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task QueueAll(string owner) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -80,6 +83,7 @@ public Task QueueAll(string owner) /// A user or organization account /// A repository /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task QueueAllIssues(string owner, string repository) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -99,6 +103,7 @@ public Task QueueAllIssues(string owner, string reposito /// /// A user or organization account /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task QueueAllIssues(string owner) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -118,6 +123,7 @@ public Task QueueAllIssues(string owner) /// A user or organization account /// A repository /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task QueueAllCode(string owner, string repository) { Ensure.ArgumentNotNull(owner, nameof(owner)); @@ -137,6 +143,7 @@ public Task QueueAllCode(string owner, string repository /// /// A user or organization account /// The message. + [ManualRoute("POST", "/staff/indexing_jobs")] public Task QueueAllCode(string owner) { Ensure.ArgumentNotNull(owner, nameof(owner)); diff --git a/Octokit/Clients/EventsClient.cs b/Octokit/Clients/EventsClient.cs index d7be186e9c..83dfa282b3 100644 --- a/Octokit/Clients/EventsClient.cs +++ b/Octokit/Clients/EventsClient.cs @@ -26,6 +26,7 @@ public EventsClient(IApiConnection apiConnection) /// /// http://developer.github.com/v3/activity/events/#list-public-events /// + [ManualRoute("GET", "/events")] public Task> GetAll() { return GetAll(ApiOptions.None); @@ -38,7 +39,8 @@ public Task> GetAll() /// http://developer.github.com/v3/activity/events/#list-public-events /// /// Options for changing the API response - /// All the public s for the particular user. + /// All the public s for the particular user. + [ManualRoute("GET", "/events")] public Task> GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -54,6 +56,7 @@ public Task> GetAll(ApiOptions options) /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/events")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -69,6 +72,7 @@ public Task> GetAllForRepository(string owner, string na /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/events")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, ApiOptions.None); @@ -83,6 +87,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/events")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -100,6 +105,7 @@ public Task> GetAllForRepository(string owner, string na /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/events")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -115,6 +121,7 @@ public Task> GetAllForRepository(long repositoryId, ApiO /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/issues/events")] public Task> GetAllIssuesForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -130,6 +137,7 @@ public Task> GetAllIssuesForRepository(string owner, s /// http://developer.github.com/v3/activity/events/#list-issue-events-for-a-repository /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/issues/events")] public Task> GetAllIssuesForRepository(long repositoryId) { return GetAllIssuesForRepository(repositoryId, ApiOptions.None); @@ -144,6 +152,7 @@ public Task> GetAllIssuesForRepository(long repository /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/events")] public Task> GetAllIssuesForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -161,6 +170,7 @@ public Task> GetAllIssuesForRepository(string owner, s /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/events")] public Task> GetAllIssuesForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -176,6 +186,7 @@ public Task> GetAllIssuesForRepository(long repository /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/networks/{owner}/{name}/events")] public Task> GetAllForRepositoryNetwork(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -193,6 +204,7 @@ public Task> GetAllForRepositoryNetwork(string owner, st /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/networks/{owner}/{name}/events")] public Task> GetAllForRepositoryNetwork(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -209,6 +221,7 @@ public Task> GetAllForRepositoryNetwork(string owner, st /// http://developer.github.com/v3/activity/events/#list-public-events-for-an-organization /// /// The name of the organization + [ManualRoute("GET", "/orgs/{org}/events")] public Task> GetAllForOrganization(string organization) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -224,6 +237,7 @@ public Task> GetAllForOrganization(string organization) /// /// The name of the organization /// Options for changing the API response + [ManualRoute("GET", "/orgs/{org}/events")] public Task> GetAllForOrganization(string organization, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -239,6 +253,7 @@ public Task> GetAllForOrganization(string organization, /// http://developer.github.com/v3/activity/events/#list-events-that-a-user-has-received /// /// The login of the user + [ManualRoute("GET", "/users/{username}/received_events")] public Task> GetAllUserReceived(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -254,6 +269,7 @@ public Task> GetAllUserReceived(string user) /// /// The login of the user /// Options for changing the API response + [ManualRoute("GET", "/users/{username}/received_events")] public Task> GetAllUserReceived(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -269,6 +285,7 @@ public Task> GetAllUserReceived(string user, ApiOptions /// http://developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received /// /// The login of the user + [ManualRoute("GET", "/users/{username}/received_events/public")] public Task> GetAllUserReceivedPublic(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -284,6 +301,7 @@ public Task> GetAllUserReceivedPublic(string user) /// /// The login of the user /// Options for changing the API response + [ManualRoute("GET", "/users/{username}/received_events/public")] public Task> GetAllUserReceivedPublic(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -299,6 +317,7 @@ public Task> GetAllUserReceivedPublic(string user, ApiOp /// http://developer.github.com/v3/activity/events/#list-events-performed-by-a-user /// /// The login of the user + [ManualRoute("GET", "/users/{username}/events")] public Task> GetAllUserPerformed(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -314,6 +333,7 @@ public Task> GetAllUserPerformed(string user) /// /// The login of the user /// Options for changing the API response + [ManualRoute("GET", "/users/{username}/events")] public Task> GetAllUserPerformed(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -329,6 +349,7 @@ public Task> GetAllUserPerformed(string user, ApiOptions /// http://developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user /// /// The login of the user + [ManualRoute("GET", "/users/{username}/events/public")] public Task> GetAllUserPerformedPublic(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -344,6 +365,7 @@ public Task> GetAllUserPerformedPublic(string user) /// /// The login of the user /// Options for changing the API response + [ManualRoute("GET", "/users/{username}/events/public")] public Task> GetAllUserPerformedPublic(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -360,6 +382,7 @@ public Task> GetAllUserPerformedPublic(string user, ApiO /// /// The login of the user /// The name of the organization + [ManualRoute("GET", "/users/{username}/events/orgs/{org}")] public Task> GetAllForAnOrganization(string user, string organization) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -377,6 +400,7 @@ public Task> GetAllForAnOrganization(string user, string /// The login of the user /// The name of the organization /// Options for changing the API response + [ManualRoute("GET", "/users/{username}/events/orgs/{org}")] public Task> GetAllForAnOrganization(string user, string organization, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); diff --git a/Octokit/Clients/FeedsClient.cs b/Octokit/Clients/FeedsClient.cs index b9d2531b16..0732c365fe 100644 --- a/Octokit/Clients/FeedsClient.cs +++ b/Octokit/Clients/FeedsClient.cs @@ -26,10 +26,11 @@ public FeedsClient(IApiConnection apiConnection) /// http://developer.github.com/v3/activity/feeds/#list-feeds /// /// All the public s for the particular user. + [ManualRoute("GET", "/feeds")] [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] public Task GetFeeds() { return ApiConnection.Get(ApiUrls.Feeds()); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/FollowersClient.cs b/Octokit/Clients/FollowersClient.cs index f4bb34cc6e..60b819fc30 100644 --- a/Octokit/Clients/FollowersClient.cs +++ b/Octokit/Clients/FollowersClient.cs @@ -27,6 +27,7 @@ public FollowersClient(IApiConnection apiConnection) : base(apiConnection) /// See the API documentation for more information. /// /// A of s that follow the authenticated user. + [ManualRoute("GET", "/user/followers")] public Task> GetAllForCurrent() { return GetAllForCurrent(ApiOptions.None); @@ -40,6 +41,7 @@ public Task> GetAllForCurrent() /// See the API documentation for more information. /// /// A of s that follow the authenticated user. + [ManualRoute("GET", "/user/followers")] public Task> GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -55,6 +57,7 @@ public Task> GetAllForCurrent(ApiOptions options) /// See the API documentation for more information. /// /// A of s that follow the passed user. + [ManualRoute("GET", "/user/{username}/followers")] public Task> GetAll(string login) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -71,6 +74,7 @@ public Task> GetAll(string login) /// See the API documentation for more information. /// /// A of s that follow the passed user. + [ManualRoute("GET", "/user/{username}/followers")] public Task> GetAll(string login, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -86,6 +90,7 @@ public Task> GetAll(string login, ApiOptions options) /// See the API documentation for more information. /// /// A of s that the authenticated user follows. + [ManualRoute("GET", "/user/following")] public Task> GetAllFollowingForCurrent() { return GetAllFollowingForCurrent(ApiOptions.None); @@ -99,6 +104,7 @@ public Task> GetAllFollowingForCurrent() /// See the API documentation for more information. /// /// A of s that the authenticated user follows. + [ManualRoute("GET", "/user/following")] public Task> GetAllFollowingForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -114,6 +120,7 @@ public Task> GetAllFollowingForCurrent(ApiOptions options) /// See the API documentation for more information. /// /// A of s that the passed user follows. + [ManualRoute("GET", "/users/{username}/following")] public Task> GetAllFollowing(string login) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -130,6 +137,7 @@ public Task> GetAllFollowing(string login) /// See the API documentation for more information. /// /// A of s that the passed user follows. + [ManualRoute("GET", "/users/{username}/following")] public Task> GetAllFollowing(string login, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -146,6 +154,7 @@ public Task> GetAllFollowing(string login, ApiOptions option /// See the API documentation for more information. /// /// A bool representing the success of the operation. + [ManualRoute("GET", "/user/following/{username}")] public async Task IsFollowingForCurrent(string following) { Ensure.ArgumentNotNullOrEmptyString(following, nameof(following)); @@ -170,6 +179,7 @@ public async Task IsFollowingForCurrent(string following) /// See the API documentation for more information. /// /// A bool representing the success of the operation. + [ManualRoute("GET", "/users/{login}/following/{username}")] public async Task IsFollowing(string login, string following) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -194,6 +204,7 @@ public async Task IsFollowing(string login, string following) /// See the API documentation for more information. /// /// A bool representing the success of the operation. + [ManualRoute("PUT", "/user/following/{username}")] public async Task Follow(string login) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); @@ -222,6 +233,7 @@ public async Task Follow(string login) /// See the API documentation for more information. /// /// + [ManualRoute("DELETE", "/user/following/{username}")] public Task Unfollow(string login) { Ensure.ArgumentNotNullOrEmptyString(login, nameof(login)); diff --git a/Octokit/Clients/GistCommentsClient.cs b/Octokit/Clients/GistCommentsClient.cs index 1bcbae37bc..f645692a18 100644 --- a/Octokit/Clients/GistCommentsClient.cs +++ b/Octokit/Clients/GistCommentsClient.cs @@ -26,6 +26,7 @@ public GistCommentsClient(IApiConnection apiConnection) : base(apiConnection) /// The id of the gist /// The id of the comment /// Task{GistComment}. + [ManualRoute("GET", "/gists/{gist_id}/comments/{comment_id}")] public Task Get(string gistId, int commentId) { return ApiConnection.Get(ApiUrls.GistComment(gistId, commentId)); @@ -37,6 +38,7 @@ public Task Get(string gistId, int commentId) /// http://developer.github.com/v3/gists/comments/#list-comments-on-a-gist /// The id of the gist /// Task{IReadOnlyList{GistComment}}. + [ManualRoute("GET", "/gists/{gist_id}/comments")] public Task> GetAllForGist(string gistId) { Ensure.ArgumentNotNullOrEmptyString(gistId, nameof(gistId)); @@ -51,6 +53,7 @@ public Task> GetAllForGist(string gistId) /// The id of the gist /// Options for changing the API response /// Task{IReadOnlyList{GistComment}}. + [ManualRoute("GET", "/gists/{gist_id}/comments")] public Task> GetAllForGist(string gistId, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(gistId, nameof(gistId)); @@ -66,6 +69,7 @@ public Task> GetAllForGist(string gistId, ApiOptions /// The id of the gist /// The body of the comment /// Task{GistComment}. + [ManualRoute("POST", "/gists/{gist_id}/comments")] public Task Create(string gistId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, nameof(comment)); @@ -81,6 +85,7 @@ public Task Create(string gistId, string comment) /// The id of the comment /// The updated body of the comment /// Task{GistComment}. + [ManualRoute("PATCH", "/gists/{gist_id}/comments/{comment_id}")] public Task Update(string gistId, int commentId, string comment) { Ensure.ArgumentNotNullOrEmptyString(comment, nameof(comment)); @@ -95,9 +100,10 @@ public Task Update(string gistId, int commentId, string comment) /// The id of the gist /// The id of the comment /// Task. + [ManualRoute("DELETE", "/gists/{gist_id}/comments/{comment_id}")] public Task Delete(string gistId, int commentId) { return ApiConnection.Delete(ApiUrls.GistComment(gistId, commentId)); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/GistsClient.cs b/Octokit/Clients/GistsClient.cs index 331a0600d6..facf8f2db5 100644 --- a/Octokit/Clients/GistsClient.cs +++ b/Octokit/Clients/GistsClient.cs @@ -31,6 +31,7 @@ public GistsClient(IApiConnection apiConnection) : /// http://developer.github.com/v3/gists/#get-a-single-gist /// /// The id of the gist + [ManualRoute("GET", "/gists/{gist_id}")] public Task Get(string id) { return ApiConnection.Get(ApiUrls.Gist(id)); @@ -43,6 +44,7 @@ public Task Get(string id) /// http://developer.github.com/v3/gists/#create-a-gist /// /// The new gist to create + [ManualRoute("GET", "/gists")] public Task Create(NewGist newGist) { Ensure.ArgumentNotNull(newGist, nameof(newGist)); @@ -73,6 +75,7 @@ public Task Create(NewGist newGist) /// http://developer.github.com/v3/gists/#fork-a-gist /// /// The id of the gist to fork + [ManualRoute("POST", "/gists/{gist_id}/forks")] public Task Fork(string id) { return ApiConnection.Post(ApiUrls.ForkGist(id), new object()); @@ -85,6 +88,7 @@ public Task Fork(string id) /// http://developer.github.com/v3/gists/#delete-a-gist /// /// The id of the gist + [ManualRoute("DELETE", "/gists/{gist_id}")] public Task Delete(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -99,6 +103,7 @@ public Task Delete(string id) /// /// http://developer.github.com/v3/gists/#list-gists /// + [ManualRoute("GET", "/gists")] public Task> GetAll() { return GetAll(ApiOptions.None); @@ -112,6 +117,7 @@ public Task> GetAll() /// http://developer.github.com/v3/gists/#list-gists /// /// Options for changing the API response + [ManualRoute("GET", "/gists")] public Task> GetAll(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -127,6 +133,7 @@ public Task> GetAll(ApiOptions options) /// http://developer.github.com/v3/gists/#list-gists /// /// Only gists updated at or after this time are returned + [ManualRoute("GET", "/gists")] public Task> GetAll(DateTimeOffset since) { return GetAll(since, ApiOptions.None); @@ -141,6 +148,7 @@ public Task> GetAll(DateTimeOffset since) /// /// Only gists updated at or after this time are returned /// Options for changing the API response + [ManualRoute("GET", "/gists")] public Task> GetAll(DateTimeOffset since, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -155,6 +163,7 @@ public Task> GetAll(DateTimeOffset since, ApiOptions options /// /// http://developer.github.com/v3/gists/#list-gists /// + [ManualRoute("GET", "/gists/public")] public Task> GetAllPublic() { return GetAllPublic(ApiOptions.None); @@ -167,6 +176,7 @@ public Task> GetAllPublic() /// http://developer.github.com/v3/gists/#list-gists /// /// Options for changing the API response + [ManualRoute("GET", "/gists/public")] public Task> GetAllPublic(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -181,6 +191,7 @@ public Task> GetAllPublic(ApiOptions options) /// http://developer.github.com/v3/gists/#list-gists /// /// Only gists updated at or after this time are returned + [ManualRoute("GET", "/gists/public")] public Task> GetAllPublic(DateTimeOffset since) { return GetAllPublic(since, ApiOptions.None); @@ -194,6 +205,7 @@ public Task> GetAllPublic(DateTimeOffset since) /// /// Only gists updated at or after this time are returned /// Options for changing the API response + [ManualRoute("GET", "/gists/public")] public Task> GetAllPublic(DateTimeOffset since, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -208,6 +220,7 @@ public Task> GetAllPublic(DateTimeOffset since, ApiOptions o /// /// http://developer.github.com/v3/gists/#list-gists /// + [ManualRoute("GET", "/gists/starred")] public Task> GetAllStarred() { return GetAllStarred(ApiOptions.None); @@ -220,6 +233,7 @@ public Task> GetAllStarred() /// http://developer.github.com/v3/gists/#list-gists /// /// Options for changing the API response + [ManualRoute("GET", "/gists/starred")] public Task> GetAllStarred(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -234,6 +248,7 @@ public Task> GetAllStarred(ApiOptions options) /// http://developer.github.com/v3/gists/#list-gists /// /// Only gists updated at or after this time are returned + [ManualRoute("GET", "/gists/starred")] public Task> GetAllStarred(DateTimeOffset since) { return GetAllStarred(since, ApiOptions.None); @@ -247,6 +262,7 @@ public Task> GetAllStarred(DateTimeOffset since) /// /// Only gists updated at or after this time are returned /// Options for changing the API response + [ManualRoute("GET", "/gists/starred")] public Task> GetAllStarred(DateTimeOffset since, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -262,6 +278,7 @@ public Task> GetAllStarred(DateTimeOffset since, ApiOptions /// http://developer.github.com/v3/gists/#list-gists /// /// The user + [ManualRoute("GET", "/users/{user}/gists")] public Task> GetAllForUser(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -277,6 +294,7 @@ public Task> GetAllForUser(string user) /// /// The user /// Options for changing the API response + [ManualRoute("GET", "/users/{user}/gists")] public Task> GetAllForUser(string user, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -293,6 +311,7 @@ public Task> GetAllForUser(string user, ApiOptions options) /// /// The user /// Only gists updated at or after this time are returned + [ManualRoute("GET", "/users/{user}/gists")] public Task> GetAllForUser(string user, DateTimeOffset since) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -309,6 +328,7 @@ public Task> GetAllForUser(string user, DateTimeOffset since /// The user /// Only gists updated at or after this time are returned /// Options for changing the API response + [ManualRoute("GET", "/users/{user}/gists")] public Task> GetAllForUser(string user, DateTimeOffset since, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -325,6 +345,7 @@ public Task> GetAllForUser(string user, DateTimeOffset since /// http://developer.github.com/v3/gists/#list-gists-commits /// /// The id of the gist + [ManualRoute("GET", "/gists/{gist_id}/commits")] public Task> GetAllCommits(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -340,6 +361,7 @@ public Task> GetAllCommits(string id) /// /// The id of the gist /// Options for changing the API response + [ManualRoute("GET", "/gists/{gist_id}/commits")] public Task> GetAllCommits(string id, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -355,6 +377,7 @@ public Task> GetAllCommits(string id, ApiOptions opti /// http://developer.github.com/v3/gists/#list-gists-forks /// /// The id of the gist + [ManualRoute("GET", "/gists/{gist_id}/forks")] public Task> GetAllForks(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -370,6 +393,7 @@ public Task> GetAllForks(string id) /// /// The id of the gist /// Options for changing the API response + [ManualRoute("GET", "/gists/{gist_id}/forks")] public Task> GetAllForks(string id, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -386,6 +410,7 @@ public Task> GetAllForks(string id, ApiOptions options) /// /// The id of the gist /// The update to the gist + [ManualRoute("PATCH", "/gists/{gist_id}")] public Task Edit(string id, GistUpdate gistUpdate) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -413,6 +438,7 @@ public Task Edit(string id, GistUpdate gistUpdate) /// http://developer.github.com/v3/gists/#star-a-gist /// /// The id of the gist + [ManualRoute("PUT", "/gists/{gist_id}/star")] public Task Star(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -427,6 +453,7 @@ public Task Star(string id) /// http://developer.github.com/v3/gists/#unstar-a-gist /// /// The id of the gist + [ManualRoute("DELETE", "/gists/{gist_id}/star")] public Task Unstar(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -441,6 +468,7 @@ public Task Unstar(string id) /// http://developer.github.com/v3/gists/#check-if-a-gist-is-starred /// /// The id of the gist + [ManualRoute("GET", "/gists/{gist_id}/star")] public async Task IsStarred(string id) { Ensure.ArgumentNotNullOrEmptyString(id, nameof(id)); @@ -456,4 +484,4 @@ public async Task IsStarred(string id) } } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/GitHubAppsClient.cs b/Octokit/Clients/GitHubAppsClient.cs index ad33ae385c..d9920c3629 100644 --- a/Octokit/Clients/GitHubAppsClient.cs +++ b/Octokit/Clients/GitHubAppsClient.cs @@ -34,6 +34,7 @@ public GitHubAppsClient(IApiConnection apiConnection) : base(apiConnection) /// /// https://developer.github.com/v3/apps/#get-a-single-github-app /// The URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App. + [ManualRoute("GET", "/apps/{slug}")] public Task Get(string slug) { Ensure.ArgumentNotNullOrEmptyString(slug, nameof(slug)); @@ -45,6 +46,7 @@ public Task Get(string slug) /// Returns the GitHub App associated with the authentication credentials used (requires GitHubApp auth). /// /// https://developer.github.com/v3/apps/#get-the-authenticated-github-app + [ManualRoute("GET", "/app")] public Task GetCurrent() { return ApiConnection.Get(ApiUrls.App(), null, AcceptHeaders.GitHubAppsPreview); @@ -54,6 +56,7 @@ public Task GetCurrent() /// List installations of the authenticated GitHub App (requires GitHubApp auth). /// /// https://developer.github.com/v3/apps/#find-installations + [ManualRoute("GET", "/app/installations")] public Task> GetAllInstallationsForCurrent() { return GetAllInstallationsForCurrent(ApiOptions.None); @@ -64,6 +67,7 @@ public Task> GetAllInstallationsForCurrent() /// /// Options for changing the API response /// https://developer.github.com/v3/apps/#find-installations + [ManualRoute("GET", "/app/installations")] public Task> GetAllInstallationsForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -87,6 +91,7 @@ public Task GetInstallation(long installationId) /// /// https://developer.github.com/v3/apps/#get-a-single-installation /// The Id of the GitHub App Installation + [ManualRoute("GET", "/app/installations/{id}")] public Task GetInstallationForCurrent(long installationId) { return ApiConnection.Get(ApiUrls.Installation(installationId), null, AcceptHeaders.GitHubAppsPreview); @@ -96,6 +101,7 @@ public Task GetInstallationForCurrent(long installationId) /// List installations for the currently authenticated user (requires GitHubApp User-To-Server Auth). /// /// https://developer.github.com/v3/apps/#list-installations-for-user + [ManualRoute("GET", "/user/installations")] public async Task GetAllInstallationsForCurrentUser() { var results = await ApiConnection.GetAll(ApiUrls.UserInstallations(), null, AcceptHeaders.GitHubAppsPreview).ConfigureAwait(false); @@ -109,6 +115,7 @@ public async Task GetAllInstallationsForCurrentUser() /// List installations for the currently authenticated user (requires GitHubApp User-To-Server Auth). /// /// https://developer.github.com/v3/apps/#list-installations-for-user + [ManualRoute("GET", "/user/installations")] public async Task GetAllInstallationsForCurrentUser(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -129,6 +136,7 @@ public async Task GetAllInstallationsForCurrentUser(ApiOp /// https://developer.github.com/v3/apps/available-endpoints/ /// /// The Id of the GitHub App Installation + [ManualRoute("GET", "/app/installations/{id}/access_tokens")] public Task CreateInstallationToken(long installationId) { return ApiConnection.Post(ApiUrls.AccessTokens(installationId), string.Empty, AcceptHeaders.GitHubAppsPreview); @@ -139,6 +147,7 @@ public Task CreateInstallationToken(long installationId) /// /// https://developer.github.com/v3/apps/#find-organization-installation /// The name of the organization + [ManualRoute("GET", "/orgs/{org}/installation")] public Task GetOrganizationInstallationForCurrent(string organization) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -152,6 +161,7 @@ public Task GetOrganizationInstallationForCurrent(string organizat /// https://developer.github.com/v3/apps/#find-repository-installation /// The owner of the repo /// The name of the repo + [ManualRoute("GET", "/repos/{owner}/{name}/installation")] public Task GetRepositoryInstallationForCurrent(string owner, string repo) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -165,6 +175,7 @@ public Task GetRepositoryInstallationForCurrent(string owner, stri /// /// https://developer.github.com/v3/apps/#find-repository-installation /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/installation")] public Task GetRepositoryInstallationForCurrent(long repositoryId) { return ApiConnection.Get(ApiUrls.RepoInstallation(repositoryId), null, AcceptHeaders.GitHubAppsPreview); @@ -175,6 +186,7 @@ public Task GetRepositoryInstallationForCurrent(long repositoryId) /// /// https://developer.github.com/v3/apps/#find-user-installation /// The name of the user + [ManualRoute("GET", "/users/{user}/installation")] public Task GetUserInstallationForCurrent(string user) { Ensure.ArgumentNotNullOrEmptyString(user, nameof(user)); @@ -182,4 +194,4 @@ public Task GetUserInstallationForCurrent(string user) return ApiConnection.Get(ApiUrls.UserInstallation(user), null, AcceptHeaders.GitHubAppsPreview); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/IssueCommentReactionsClient.cs b/Octokit/Clients/IssueCommentReactionsClient.cs index b8c552959d..cdacda60ac 100644 --- a/Octokit/Clients/IssueCommentReactionsClient.cs +++ b/Octokit/Clients/IssueCommentReactionsClient.cs @@ -24,6 +24,7 @@ public IssueCommentReactionsClient(IApiConnection apiConnection) /// The name of the repository /// The comment id /// The reaction to create + [ManualRoute("POST", "/repos/{owner}/{name}/issues/comments/{number}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -40,6 +41,7 @@ public Task Create(string owner, string name, int number, NewReaction /// The Id of the repository /// The comment id /// The reaction to create + [ManualRoute("POST", "/repositories/{0}/issues/comments/{number}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); @@ -53,7 +55,8 @@ public Task Create(long repositoryId, int number, NewReaction reaction /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment /// The owner of the repository /// The name of the repository - /// The comment id + /// The comment id + [ManualRoute("POST", "/repos/{owner}/{name}/issues/comments/{number}/reactions")] public Task> GetAll(string owner, string name, int number) { return GetAll(owner, name, number, ApiOptions.None); @@ -66,7 +69,8 @@ public Task> GetAll(string owner, string name, int numbe /// The owner of the repository /// The name of the repository /// The comment id - /// Options for changing the API response + /// Options for changing the API response + [ManualRoute("POST", "/repos/{owner}/{name}/issues/comments/{number}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -81,7 +85,8 @@ public Task> GetAll(string owner, string name, int numbe /// /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment /// The Id of the repository - /// The comment id + /// The comment id + [ManualRoute("GET", "/repositories/{0}/issues/comments/{number}/reactions")] public Task> GetAll(long repositoryId, int number) { return GetAll(repositoryId, number, ApiOptions.None); @@ -93,7 +98,8 @@ public Task> GetAll(long repositoryId, int number) /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment /// The Id of the repository /// The comment id - /// Options for changing the API response + /// Options for changing the API response + [ManualRoute("GET", "/repositories/{0}/issues/comments/{number}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); diff --git a/Octokit/Clients/IssueCommentsClient.cs b/Octokit/Clients/IssueCommentsClient.cs index 41fda35ab9..eaecae764c 100644 --- a/Octokit/Clients/IssueCommentsClient.cs +++ b/Octokit/Clients/IssueCommentsClient.cs @@ -26,6 +26,7 @@ public IssueCommentsClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue comment id + [ManualRoute("GET", "/repos/{owner}/{name}/issues/comments/{comment_id}")] public Task Get(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -40,6 +41,7 @@ public Task Get(string owner, string name, int id) /// http://developer.github.com/v3/issues/comments/#get-a-single-comment /// The Id of the repository /// The issue comment id + [ManualRoute("GET", "/repositories/{id}/issues/comments/{comment_id}")] public Task Get(long repositoryId, int id) { return ApiConnection.Get(ApiUrls.IssueComment(repositoryId, id), null, AcceptHeaders.ReactionsPreview); @@ -51,6 +53,7 @@ public Task Get(long repositoryId, int id) /// http://developer.github.com/v3/issues/comments/#list-comments-in-a-repository /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/issues/comments")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -64,6 +67,7 @@ public Task> GetAllForRepository(string owner, strin /// /// http://developer.github.com/v3/issues/comments/#list-comments-in-a-repository /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/issues/comments")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, new IssueCommentRequest(), ApiOptions.None); @@ -76,6 +80,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/comments")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -91,6 +96,7 @@ public Task> GetAllForRepository(string owner, strin /// http://developer.github.com/v3/issues/comments/#list-comments-in-a-repository /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/comments")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -105,6 +111,7 @@ public Task> GetAllForRepository(long repositoryId, /// The owner of the repository /// The name of the repository /// The sorting parameters + [ManualRoute("GET", "/repos/{owner}/{name}/issues/comments")] public Task> GetAllForRepository(string owner, string name, IssueCommentRequest request) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -120,6 +127,7 @@ public Task> GetAllForRepository(string owner, strin /// http://developer.github.com/v3/issues/comments/#list-comments-in-a-repository /// The Id of the repository /// The sorting parameters + [ManualRoute("GET", "/repositories/{id}/issues/comments")] public Task> GetAllForRepository(long repositoryId, IssueCommentRequest request) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -135,6 +143,7 @@ public Task> GetAllForRepository(long repositoryId, /// The name of the repository /// The sorting parameters /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/comments")] public Task> GetAllForRepository(string owner, string name, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -152,6 +161,7 @@ public Task> GetAllForRepository(string owner, strin /// The Id of the repository /// The sorting parameters /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/comments")] public Task> GetAllForRepository(long repositoryId, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -167,6 +177,7 @@ public Task> GetAllForRepository(long repositoryId, /// The owner of the repository /// The name of the repository /// The issue number + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number]/comments")] public Task> GetAllForIssue(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -181,6 +192,7 @@ public Task> GetAllForIssue(string owner, string nam /// http://developer.github.com/v3/issues/comments/#list-comments-on-an-issue /// The Id of the repository /// The issue number + [ManualRoute("GET", "/repositories/{id}/issues/{number}/comments")] public Task> GetAllForIssue(long repositoryId, int number) { return GetAllForIssue(repositoryId, number, ApiOptions.None); @@ -194,6 +206,7 @@ public Task> GetAllForIssue(long repositoryId, int n /// The name of the repository /// The issue number /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number]/comments")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -210,6 +223,7 @@ public Task> GetAllForIssue(string owner, string nam /// The Id of the repository /// The issue number /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/comments")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -225,6 +239,7 @@ public Task> GetAllForIssue(long repositoryId, int n /// The name of the repository /// The issue number /// The sorting parameters + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number]/comments")] public Task> GetAllForIssue(string owner, string name, int number, IssueCommentRequest request) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -241,6 +256,7 @@ public Task> GetAllForIssue(string owner, string nam /// The Id of the repository /// The issue number /// The sorting parameters + [ManualRoute("GET", "/repositories/{id}/issues/{number}/comments")] public Task> GetAllForIssue(long repositoryId, int number, IssueCommentRequest request) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -257,6 +273,7 @@ public Task> GetAllForIssue(long repositoryId, int n /// The issue number /// The sorting parameters /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number]/comments")] public Task> GetAllForIssue(string owner, string name, int number, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -275,6 +292,7 @@ public Task> GetAllForIssue(string owner, string nam /// The issue number /// The sorting parameters /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/comments")] public Task> GetAllForIssue(long repositoryId, int number, IssueCommentRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -291,6 +309,7 @@ public Task> GetAllForIssue(long repositoryId, int n /// The name of the repository /// The number of the issue /// The new comment to add to the issue + [ManualRoute("POST", "/repos/{owner}/{name}/issues/{number]/comments")] public Task Create(string owner, string name, int number, string newComment) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -307,6 +326,7 @@ public Task Create(string owner, string name, int number, string n /// The Id of the repository /// The number of the issue /// The new comment to add to the issue + [ManualRoute("POST", "/repositories/{id}/issues/{number}/comments")] public Task Create(long repositoryId, int number, string newComment) { Ensure.ArgumentNotNull(newComment, nameof(newComment)); @@ -322,6 +342,7 @@ public Task Create(long repositoryId, int number, string newCommen /// The name of the repository /// The comment id /// The modified comment + [ManualRoute("PATCH", "/repos/{owner}/{name}/issues/comments/{id}")] public Task Update(string owner, string name, int id, string commentUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -338,6 +359,7 @@ public Task Update(string owner, string name, int id, string comme /// The Id of the repository /// The comment id /// The modified comment + [ManualRoute("PATCH", "/repositories/{id}/issues/comments/{number}")] public Task Update(long repositoryId, int id, string commentUpdate) { Ensure.ArgumentNotNull(commentUpdate, nameof(commentUpdate)); @@ -352,6 +374,7 @@ public Task Update(long repositoryId, int id, string commentUpdate /// The owner of the repository /// The name of the repository /// The comment id + [ManualRoute("DELETE", "/repos/{owner}/{name}/issues/comments/{id}")] public Task Delete(string owner, string name, int id) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -366,6 +389,7 @@ public Task Delete(string owner, string name, int id) /// http://developer.github.com/v3/issues/comments/#delete-a-comment /// The Id of the repository /// The comment id + [ManualRoute("DELETE", "/repositories/{id}/issues/comments/{number}")] public Task Delete(long repositoryId, int id) { return ApiConnection.Delete(ApiUrls.IssueComment(repositoryId, id)); diff --git a/Octokit/Clients/IssueReactionsClient.cs b/Octokit/Clients/IssueReactionsClient.cs index 02b826d26c..a2763783a1 100644 --- a/Octokit/Clients/IssueReactionsClient.cs +++ b/Octokit/Clients/IssueReactionsClient.cs @@ -22,7 +22,8 @@ public IssueReactionsClient(IApiConnection apiConnection) /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue /// The owner of the repository /// The name of the repository - /// The issue id + /// The issue id + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number}/reactions")] public Task> GetAll(string owner, string name, int number) { return GetAll(owner, name, number, ApiOptions.None); @@ -35,7 +36,8 @@ public Task> GetAll(string owner, string name, int numbe /// The owner of the repository /// The name of the repository /// The issue id - /// Options for changing the API response + /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number}/reactions")] public Task> GetAll(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -50,7 +52,8 @@ public Task> GetAll(string owner, string name, int numbe /// /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue /// The Id of the repository - /// The issue id + /// The issue id + [ManualRoute("GET", "/repositories/{id}/issues/{number}/reactions")] public Task> GetAll(long repositoryId, int number) { return GetAll(repositoryId, number, ApiOptions.None); @@ -62,7 +65,8 @@ public Task> GetAll(long repositoryId, int number) /// https://developer.github.com/v3/reactions/#list-reactions-for-an-issue /// The Id of the repository /// The issue id - /// Options for changing the API response + /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/reactions")] public Task> GetAll(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -78,6 +82,7 @@ public Task> GetAll(long repositoryId, int number, ApiOp /// The name of the repository /// The issue id /// The reaction to create + [ManualRoute("POST", "/repos/{owner}/{name}/issues/{number}/reactions")] public Task Create(string owner, string name, int number, NewReaction reaction) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -94,6 +99,7 @@ public Task Create(string owner, string name, int number, NewReaction /// The Id of the repository /// The issue id /// The reaction to create + [ManualRoute("POST", "/repositories/{id}/issues/{number}/reactions")] public Task Create(long repositoryId, int number, NewReaction reaction) { Ensure.ArgumentNotNull(reaction, nameof(reaction)); diff --git a/Octokit/Clients/IssueTimelineClient.cs b/Octokit/Clients/IssueTimelineClient.cs index c3fc6556cd..86e6ef49b0 100644 --- a/Octokit/Clients/IssueTimelineClient.cs +++ b/Octokit/Clients/IssueTimelineClient.cs @@ -24,6 +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}/{name}/issues/{number}/timeline")] public Task> GetAllForIssue(string owner, string repo, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -42,6 +43,7 @@ public Task> GetAllForIssue(string owner, strin /// The name of the repository /// The issue number /// Options for changing the API repsonse + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number}/timeline")] public Task> GetAllForIssue(string owner, string repo, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -62,6 +64,7 @@ public Task> GetAllForIssue(string owner, strin /// /// The Id of the repository /// The issue number + [ManualRoute("GET", "/repositories/{id}/issues/{number}/timeline")] public Task> GetAllForIssue(long repositoryId, int number) { return GetAllForIssue(repositoryId, number, ApiOptions.None); @@ -76,6 +79,7 @@ public Task> GetAllForIssue(long repositoryId, /// The Id of the repository /// The issue number /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/timeline")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); diff --git a/Octokit/Clients/IssuesClient.cs b/Octokit/Clients/IssuesClient.cs index 3574a9f1e5..9ad98b2a54 100644 --- a/Octokit/Clients/IssuesClient.cs +++ b/Octokit/Clients/IssuesClient.cs @@ -31,8 +31,8 @@ public IssuesClient(IApiConnection apiConnection) : base(apiConnection) public IAssigneesClient Assignee { get; private set; } /// - /// Client for reading various event information associated with issues/pull requests. - /// This is useful both for display on issue/pull request information pages and also to + /// Client for reading various event information associated with issues/pull requests. + /// This is useful both for display on issue/pull request information pages and also to /// determine who should be notified of comments. /// public IIssuesEventsClient Events { get; private set; } @@ -66,6 +66,7 @@ public IssuesClient(IApiConnection apiConnection) : base(apiConnection) /// The owner of the repository /// The name of the repository /// The issue number + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number}")] public Task Get(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -82,6 +83,7 @@ public Task Get(string owner, string name, int number) /// /// The Id of the repository /// The issue number + [ManualRoute("GET", "/repositories/{id}/issues/{number}")] public Task Get(long repositoryId, int number) { return ApiConnection.Get(ApiUrls.Issue(repositoryId, number), null, AcceptHeaders.ReactionsPreview); @@ -95,6 +97,7 @@ public Task Get(long repositoryId, int number) /// Issues are sorted by the create date descending. /// http://developer.github.com/v3/issues/#list-issues /// + [ManualRoute("GET", "/issues")] public Task> GetAllForCurrent() { return GetAllForCurrent(ApiOptions.None); @@ -109,6 +112,7 @@ public Task> GetAllForCurrent() /// Issues are sorted by the create date descending. /// http://developer.github.com/v3/issues/#list-issues /// + [ManualRoute("GET", "/issues")] public Task> GetAllForCurrent(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -117,13 +121,14 @@ public Task> GetAllForCurrent(ApiOptions options) } /// - /// Gets all issues across all the authenticated user’s visible repositories including owned repositories, + /// Gets all issues across all the authenticated user’s visible repositories including owned repositories, /// member repositories, and organization repositories. /// /// /// http://developer.github.com/v3/issues/#list-issues /// /// Used to filter and sort the list of issues returned + [ManualRoute("GET", "/issues")] public Task> GetAllForCurrent(IssueRequest request) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -132,7 +137,7 @@ public Task> GetAllForCurrent(IssueRequest request) } /// - /// Gets all issues across all the authenticated user’s visible repositories including owned repositories, + /// Gets all issues across all the authenticated user’s visible repositories including owned repositories, /// member repositories, and organization repositories. /// /// @@ -140,6 +145,7 @@ public Task> GetAllForCurrent(IssueRequest request) /// /// Used to filter and sort the list of issues returned /// Options for changing the API response + [ManualRoute("GET", "/issues")] public Task> GetAllForCurrent(IssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -156,6 +162,7 @@ public Task> GetAllForCurrent(IssueRequest request, ApiOpti /// Issues are sorted by the create date descending. /// http://developer.github.com/v3/issues/#list-issues /// + [ManualRoute("GET", "/user/issues")] public Task> GetAllForOwnedAndMemberRepositories() { return GetAllForOwnedAndMemberRepositories(ApiOptions.None); @@ -170,6 +177,7 @@ public Task> GetAllForOwnedAndMemberRepositories() /// Issues are sorted by the create date descending. /// http://developer.github.com/v3/issues/#list-issues /// + [ManualRoute("GET", "/user/issues")] public Task> GetAllForOwnedAndMemberRepositories(ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -184,6 +192,7 @@ public Task> GetAllForOwnedAndMemberRepositories(ApiOptions /// http://developer.github.com/v3/issues/#list-issues /// /// Used to filter and sort the list of issues returned + [ManualRoute("GET", "/user/issues")] public Task> GetAllForOwnedAndMemberRepositories(IssueRequest request) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -199,6 +208,7 @@ public Task> GetAllForOwnedAndMemberRepositories(IssueReque /// /// Used to filter and sort the list of issues returned /// Options for changing the API response + [ManualRoute("GET", "/user/issues")] public Task> GetAllForOwnedAndMemberRepositories(IssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -214,6 +224,7 @@ public Task> GetAllForOwnedAndMemberRepositories(IssueReque /// http://developer.github.com/v3/issues/#list-issues /// /// The name of the organization + [ManualRoute("GET", "/orgs/{org}/issues")] public Task> GetAllForOrganization(string organization) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -229,6 +240,7 @@ public Task> GetAllForOrganization(string organization) /// /// The name of the organization /// Options for changing the API response + [ManualRoute("GET", "/orgs/{org}/issues")] public Task> GetAllForOrganization(string organization, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -245,6 +257,7 @@ public Task> GetAllForOrganization(string organization, Api /// /// The name of the organization /// Used to filter and sort the list of issues returned + [ManualRoute("GET", "/orgs/{org}/issues")] public Task> GetAllForOrganization(string organization, IssueRequest request) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -262,6 +275,7 @@ public Task> GetAllForOrganization(string organization, Iss /// The name of the organization /// Used to filter and sort the list of issues returned /// Options for changing the API response + [ManualRoute("GET", "/orgs/{org}/issues")] public Task> GetAllForOrganization(string organization, IssueRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization)); @@ -279,6 +293,7 @@ public Task> GetAllForOrganization(string organization, Iss /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/issues")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -294,6 +309,7 @@ public Task> GetAllForRepository(string owner, string name) /// http://developer.github.com/v3/issues/#list-issues-for-a-repository /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/issues")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, new RepositoryIssueRequest()); @@ -308,6 +324,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -325,6 +342,7 @@ public Task> GetAllForRepository(string owner, string name, /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -341,6 +359,7 @@ public Task> GetAllForRepository(long repositoryId, ApiOpti /// The owner of the repository /// The name of the repository /// Used to filter and sort the list of issues returned + [ManualRoute("GET", "/repos/{owner}/{name}/issues")] public Task> GetAllForRepository(string owner, string name, RepositoryIssueRequest request) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -358,6 +377,7 @@ public Task> GetAllForRepository(string owner, string name, /// /// The Id of the repository /// Used to filter and sort the list of issues returned + [ManualRoute("GET", "/repositories/{id}/issues")] public Task> GetAllForRepository(long repositoryId, RepositoryIssueRequest request) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -375,6 +395,7 @@ public Task> GetAllForRepository(long repositoryId, Reposit /// The name of the repository /// Used to filter and sort the list of issues returned /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues")] public Task> GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -394,6 +415,7 @@ public Task> GetAllForRepository(string owner, string name, /// The Id of the repository /// Used to filter and sort the list of issues returned /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues")] public Task> GetAllForRepository(long repositoryId, RepositoryIssueRequest request, ApiOptions options) { Ensure.ArgumentNotNull(request, nameof(request)); @@ -410,6 +432,7 @@ public Task> GetAllForRepository(long repositoryId, Reposit /// The owner of the repository /// The name of the repository /// A instance describing the new issue to create + [ManualRoute("POST", "/repos/{owner}/{name}/issues")] public Task Create(string owner, string name, NewIssue newIssue) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -426,6 +449,7 @@ public Task Create(string owner, string name, NewIssue newIssue) /// http://developer.github.com/v3/issues/#create-an-issue /// The Id of the repository /// A instance describing the new issue to create + [ManualRoute("POST", "/repositories/{id}/issues")] public Task Create(long repositoryId, NewIssue newIssue) { Ensure.ArgumentNotNull(newIssue, nameof(newIssue)); @@ -442,6 +466,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}/{name}/issues/{number}")] public Task Update(string owner, string name, int number, IssueUpdate issueUpdate) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -460,6 +485,7 @@ public Task Update(string owner, string name, int number, IssueUpdate iss /// The issue number /// An instance describing the changes to make to the issue /// + [ManualRoute("PATCH", "/repositories/{id}/issues/{number}")] public Task Update(long repositoryId, int number, IssueUpdate issueUpdate) { Ensure.ArgumentNotNull(issueUpdate, nameof(issueUpdate)); @@ -474,6 +500,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}/{name}/issues/{number}/lock")] public Task Lock(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -488,6 +515,7 @@ public Task Lock(string owner, string name, int number) /// https://developer.github.com/v3/issues/#lock-an-issue /// The Id of the repository /// The issue number + [ManualRoute("PUT", "/repositories/{id}/issues/{number}/lock")] public Task Lock(long repositoryId, int number) { return ApiConnection.Put(ApiUrls.IssueLock(repositoryId, number), new object(), null, AcceptHeaders.IssueLockingUnlockingApiPreview); @@ -500,6 +528,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}/{name}/issues/{number}/lock")] public Task Unlock(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -514,9 +543,10 @@ public Task Unlock(string owner, string name, int number) /// https://developer.github.com/v3/issues/#unlock-an-issue /// The Id of the repository /// The issue number + [ManualRoute("DELETE", "/repositories/{id}/issues/{number}/lock")] public Task Unlock(long repositoryId, int number) { return ApiConnection.Delete(ApiUrls.IssueLock(repositoryId, number), new object(), AcceptHeaders.IssueLockingUnlockingApiPreview); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/IssuesEventsClient.cs b/Octokit/Clients/IssuesEventsClient.cs index e5e5f879df..d88c685f0a 100644 --- a/Octokit/Clients/IssuesEventsClient.cs +++ b/Octokit/Clients/IssuesEventsClient.cs @@ -24,6 +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}/{name}/issues/{number}/events")] public Task> GetAllForIssue(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -40,6 +41,7 @@ public Task> GetAllForIssue(string owner, string name, /// /// The Id of the repository /// The issue number + [ManualRoute("GET", "/repositories/{id}/issues/{number}/events")] public Task> GetAllForIssue(long repositoryId, int number) { return GetAllForIssue(repositoryId, number, ApiOptions.None); @@ -55,6 +57,7 @@ public Task> GetAllForIssue(long repositoryId, int num /// The name of the repository /// The issue number /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/{number}/events")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -76,6 +79,7 @@ public Task> GetAllForIssue(string owner, string name, /// The Id of the repository /// The issue number /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/events")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -94,6 +98,7 @@ public Task> GetAllForIssue(long repositoryId, int num /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/issues/events")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -109,6 +114,7 @@ public Task> GetAllForRepository(string owner, string /// http://developer.github.com/v3/issues/events/#list-events-for-a-repository /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/issues/events")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, ApiOptions.None); @@ -123,6 +129,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/issues/events")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -143,6 +150,7 @@ public Task> GetAllForRepository(string owner, string /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/events")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -162,6 +170,7 @@ public Task> GetAllForRepository(long repositoryId, Ap /// The owner of the repository /// The name of the repository /// The event id + [ManualRoute("GET", "/repos/{owner}/{name}/issues/events/{event_id}")] public Task Get(string owner, string name, long eventId) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -180,6 +189,7 @@ public Task Get(string owner, string name, long eventId) /// /// The Id of the repository /// The event id + [ManualRoute("GET", "/repositories/{id}/issues/events/{event_id}")] public Task Get(long repositoryId, long eventId) { return ApiConnection.Get(ApiUrls.IssuesEvent(repositoryId, eventId), @@ -187,4 +197,4 @@ public Task Get(long repositoryId, long eventId) AcceptHeaders.IssueEventsApiPreview); } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/IssuesLabelsClient.cs b/Octokit/Clients/IssuesLabelsClient.cs index 15a51be6c7..f7aacba8f4 100644 --- a/Octokit/Clients/IssuesLabelsClient.cs +++ b/Octokit/Clients/IssuesLabelsClient.cs @@ -25,6 +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}/{name}/issues/{number}/labels")] public Task> GetAllForIssue(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -41,6 +42,7 @@ public Task> GetAllForIssue(string owner, string name, int /// /// The Id of the repository /// The number of the issue + [ManualRoute("GET", "/repositories/{id}/issues/{number}/labels")] public Task> GetAllForIssue(long repositoryId, int number) { return GetAllForIssue(repositoryId, number, ApiOptions.None); @@ -56,6 +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}/{name}/issues/{number}/labels")] public Task> GetAllForIssue(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -74,6 +77,7 @@ public Task> GetAllForIssue(string owner, string name, int /// The Id of the repository /// The number of the issue /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/issues/{number}/labels")] public Task> GetAllForIssue(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -89,6 +93,7 @@ public Task> GetAllForIssue(long repositoryId, int number, /// /// The owner of the repository /// The name of the repository + [ManualRoute("GET", "/repos/{owner}/{name}/labels")] public Task> GetAllForRepository(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -104,6 +109,7 @@ public Task> GetAllForRepository(string owner, string name) /// See the API documentation for more information. /// /// The Id of the repository + [ManualRoute("GET", "/repositories/{id}/labels")] public Task> GetAllForRepository(long repositoryId) { return GetAllForRepository(repositoryId, ApiOptions.None); @@ -118,6 +124,7 @@ public Task> GetAllForRepository(long repositoryId) /// The owner of the repository /// The name of the repository /// Options for changing the API response + [ManualRoute("GET", "/repos/{owner}/{name}/labels")] public Task> GetAllForRepository(string owner, string name, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -135,6 +142,7 @@ public Task> GetAllForRepository(string owner, string name, /// /// The Id of the repository /// Options for changing the API response + [ManualRoute("GET", "/repositories/{id}/labels")] public Task> GetAllForRepository(long repositoryId, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -151,6 +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}/{name}/milestones/{number}/labels")] public Task> GetAllForMilestone(string owner, string name, int number) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -167,6 +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")] public Task> GetAllForMilestone(long repositoryId, int number) { return GetAllForMilestone(repositoryId, number, ApiOptions.None); @@ -182,6 +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}/{name}/milestones/{number}/labels")] public Task> GetAllForMilestone(string owner, string name, int number, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner)); @@ -200,6 +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")] public Task> GetAllForMilestone(long repositoryId, int number, ApiOptions options) { Ensure.ArgumentNotNull(options, nameof(options)); @@ -216,6 +228,7 @@ public Task> GetAllForMilestone(long repositoryId, int numb /// The owner of the repository /// The name of the repository /// The name of the label + [ManualRoute("GET", "/repos/{owner}/{name}/labels/{name}")] public Task