diff --git a/Octokit.Reactive/Clients/IObservableIssuesClient.cs b/Octokit.Reactive/Clients/IObservableIssuesClient.cs index e4c675e0..c2a08f12 100644 --- a/Octokit.Reactive/Clients/IObservableIssuesClient.cs +++ b/Octokit.Reactive/Clients/IObservableIssuesClient.cs @@ -50,9 +50,22 @@ namespace Octokit.Reactive /// The issue number /// A signal containing the requested s. [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", - Justification = "Method makes a network request")] + Justification = "Method makes a network request")] IObservable Get(string owner, string name, int number); + /// + /// Gets a single Issue by number. + /// + /// + /// http://developer.github.com/v3/issues/#get-a-single-issue + /// + /// The ID of the repository + /// The issue number + /// A signal containing the requested s. + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + IObservable Get(int repositoryId, int number); + /// /// Gets all open issues assigned to the authenticated user across all the authenticated user’s visible /// repositories including owned repositories, member repositories, and organization repositories. @@ -198,6 +211,16 @@ namespace Octokit.Reactive /// A signal containing one or more s. IObservable GetAllForRepository(string owner, string name); + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// A signal containing one or more s. + IObservable GetAllForRepository(int repositoryId); + /// /// Gets all open issues assigned to the authenticated user for the repository. /// @@ -210,6 +233,17 @@ namespace Octokit.Reactive /// A signal containing one or more s. IObservable GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// A signal containing one or more s. + IObservable GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets issues for a repository. /// @@ -222,6 +256,17 @@ namespace Octokit.Reactive /// A signal containing one or more s. IObservable GetAllForRepository(string owner, string name, RepositoryIssueRequest request); + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// A signal containing one or more s. + IObservable GetAllForRepository(int repositoryId, RepositoryIssueRequest request); + /// /// Gets issues for a repository. /// @@ -235,6 +280,18 @@ namespace Octokit.Reactive /// A signal containing one or more s. IObservable GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options); + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// Options for changing the API response + /// A signal containing one or more s. + IObservable GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options); + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -246,6 +303,16 @@ namespace Octokit.Reactive /// A signal containing the new . IObservable Create(string owner, string name, NewIssue newIssue); + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// A instance describing the new issue to create + /// A signal containing the new . + IObservable Create(int repositoryId, NewIssue newIssue); + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -259,6 +326,18 @@ namespace Octokit.Reactive /// A signal containing the updated . IObservable Update(string owner, string name, int number, IssueUpdate issueUpdate); + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// The issue number + /// An instance describing the changes to make to the issue + /// + /// A signal containing the updated . + IObservable Update(int repositoryId, int number, IssueUpdate issueUpdate); + /// /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. /// @@ -268,15 +347,33 @@ namespace Octokit.Reactive /// The issue number /// A signal indicating completion. IObservable Lock(string owner, string name, int number); - - /// - /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. - /// - /// https://developer.github.com/v3/issues/#unlock-an-issue - /// The owner of the repository - /// The name of the repository - /// The issue number - /// A signal indicating completion. - IObservable Unlock(string owner, string name, int number); + + /// + /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. + /// + /// https://developer.github.com/v3/issues/#lock-an-issue + /// The ID of the repository + /// The issue number + /// A signal indicating completion. + IObservable Lock(int repositoryId, int number); + + /// + /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. + /// + /// https://developer.github.com/v3/issues/#unlock-an-issue + /// The owner of the repository + /// The name of the repository + /// The issue number + /// A signal indicating completion. + IObservable Unlock(string owner, string name, int number); + + /// + /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. + /// + /// https://developer.github.com/v3/issues/#unlock-an-issue + /// The ID of the repository + /// The issue number + /// A signal indicating completion. + IObservable Unlock(int repositoryId, int number); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableIssuesClient.cs b/Octokit.Reactive/Clients/ObservableIssuesClient.cs index 762f3b0c..0c206c9d 100644 --- a/Octokit.Reactive/Clients/ObservableIssuesClient.cs +++ b/Octokit.Reactive/Clients/ObservableIssuesClient.cs @@ -1,7 +1,7 @@ using System; +using System.Reactive; using System.Reactive.Threading.Tasks; using Octokit.Reactive.Internal; -using System.Reactive; namespace Octokit.Reactive { @@ -74,6 +74,20 @@ namespace Octokit.Reactive return _client.Get(owner, name, number).ToObservable(); } + /// + /// Gets a single Issue by number. + /// + /// + /// http://developer.github.com/v3/issues/#get-a-single-issue + /// + /// The ID of the repository + /// The issue number + /// A signal containing the requested s. + public IObservable Get(int repositoryId, int number) + { + return _client.Get(repositoryId, number).ToObservable(); + } + /// /// Gets all open issues assigned to the authenticated user across all the authenticated user’s visible /// repositories including owned repositories, member repositories, and organization repositories. @@ -287,6 +301,19 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, ApiOptions.None); } + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// A signal containing one or more s. + public IObservable GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, ApiOptions.None); + } + /// /// Gets all open issues assigned to the authenticated user for the repository. /// @@ -306,6 +333,22 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, new RepositoryIssueRequest(), options); } + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// A signal containing one or more s. + public IObservable GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options); + } + /// /// Gets issues for a repository. /// @@ -325,6 +368,22 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// A signal containing one or more s. + public IObservable GetAllForRepository(int repositoryId, RepositoryIssueRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets issues for a repository. /// @@ -346,6 +405,24 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options); } + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// Options for changing the API response + /// A signal containing one or more s. + public IObservable GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options); + } + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -364,6 +441,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, newIssue).ToObservable(); } + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// A instance describing the new issue to create + /// A signal containing the new . + public IObservable Create(int repositoryId, NewIssue newIssue) + { + Ensure.ArgumentNotNull(newIssue, "newIssue"); + + return _client.Create(repositoryId, newIssue).ToObservable(); + } + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -384,6 +476,23 @@ namespace Octokit.Reactive return _client.Update(owner, name, number, issueUpdate).ToObservable(); } + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// The issue number + /// An instance describing the changes to make to the issue + /// + /// A signal containing the updated . + public IObservable Update(int repositoryId, int number, IssueUpdate issueUpdate) + { + Ensure.ArgumentNotNull(issueUpdate, "issueUpdate"); + + return _client.Update(repositoryId, number, issueUpdate).ToObservable(); + } + /// /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. /// @@ -393,12 +502,24 @@ namespace Octokit.Reactive /// The issue number /// A signal indicating completion. public IObservable Lock(string owner, string name, int number) - { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - - return _client.Lock(owner, name, number).ToObservable(); - } + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + + return _client.Lock(owner, name, number).ToObservable(); + } + + /// + /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. + /// + /// https://developer.github.com/v3/issues/#lock-an-issue + /// The ID of the repository + /// The issue number + /// A signal indicating completion. + public IObservable Lock(int repositoryId, int number) + { + return _client.Lock(repositoryId, number).ToObservable(); + } /// /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. @@ -409,11 +530,23 @@ namespace Octokit.Reactive /// The issue number /// A signal indicating completion. public IObservable Unlock(string owner, string name, int number) - { - Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); - - return _client.Unlock(owner, name, number).ToObservable(); - } + { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + + return _client.Unlock(owner, name, number).ToObservable(); + } + + /// + /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. + /// + /// https://developer.github.com/v3/issues/#unlock-an-issue + /// The ID of the repository + /// The issue number + /// A signal indicating completion. + public IObservable Unlock(int repositoryId, int number) + { + return _client.Unlock(repositoryId, number).ToObservable(); + } } } diff --git a/Octokit/Clients/IIssuesClient.cs b/Octokit/Clients/IIssuesClient.cs index 045c34e6..d471d1b7 100644 --- a/Octokit/Clients/IIssuesClient.cs +++ b/Octokit/Clients/IIssuesClient.cs @@ -50,9 +50,22 @@ namespace Octokit /// The issue number /// The created representing requesting the issue from the API. [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", - Justification = "Method makes a network request")] + Justification = "Method makes a network request")] Task Get(string owner, string name, int number); + /// + /// Gets a single Issue by number. + /// + /// + /// http://developer.github.com/v3/issues/#get-a-single-issue + /// + /// The ID of the repository + /// The issue number + /// The created representing requesting the issue from the API. + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + Task Get(int repositoryId, int number); + /// /// Gets all open issues assigned to the authenticated user across all the authenticated user’s visible /// repositories including owned repositories, member repositories, and organization repositories. @@ -198,6 +211,16 @@ namespace Octokit /// The created representing requesting a list of issue from the API. Task> GetAllForRepository(string owner, string name); + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// The created representing requesting a list of issue from the API. + Task> GetAllForRepository(int repositoryId); + /// /// Gets all open issues assigned to the authenticated user for the repository. /// @@ -210,6 +233,17 @@ namespace Octokit /// The created representing requesting a list of issue from the API. Task> GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// The created representing requesting a list of issue from the API. + Task> GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets issues for a repository. /// @@ -222,6 +256,17 @@ namespace Octokit /// The created representing requesting a list of issue from the API. Task> GetAllForRepository(string owner, string name, RepositoryIssueRequest request); + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// The created representing requesting a list of issue from the API. + Task> GetAllForRepository(int repositoryId, RepositoryIssueRequest request); + /// /// Gets issues for a repository. /// @@ -235,6 +280,18 @@ namespace Octokit /// The created representing requesting a list of issue from the API. Task> GetAllForRepository(string owner, string name, RepositoryIssueRequest request, ApiOptions options); + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// Options for changing the API response + /// The created representing requesting a list of issue from the API. + Task> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options); + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -246,6 +303,16 @@ namespace Octokit /// The created representing the new issue from the API. Task Create(string owner, string name, NewIssue newIssue); + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// A instance describing the new issue to create + /// The created representing the new issue from the API. + Task Create(int repositoryId, NewIssue newIssue); + /// /// Updates an issue for the specified repository. Any user with pull access to a repository can update an /// issue. @@ -259,6 +326,18 @@ namespace Octokit /// The created representing the updated issue from the API. Task Update(string owner, string name, int number, IssueUpdate issueUpdate); + /// + /// Updates an issue for the specified repository. Any user with pull access to a repository can update an + /// issue. + /// + /// http://developer.github.com/v3/issues/#edit-an-issue + /// The ID of the repository + /// The issue number + /// An instance describing the changes to make to the issue + /// + /// The created representing the updated issue from the API. + Task Update(int repositoryId, int number, IssueUpdate issueUpdate); + /// /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. /// @@ -269,6 +348,15 @@ namespace Octokit /// The created representing accessing the API. Task Lock(string owner, string name, int number); + /// + /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. + /// + /// https://developer.github.com/v3/issues/#lock-an-issue + /// The ID of the repository + /// The issue number + /// The created representing accessing the API. + Task Lock(int repositoryId, int number); + /// /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. /// @@ -278,5 +366,14 @@ namespace Octokit /// The issue number /// The created representing accessing the API. Task Unlock(string owner, string name, int number); + + /// + /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. + /// + /// https://developer.github.com/v3/issues/#unlock-an-issue + /// The ID of the repository + /// The issue number + /// The created representing accessing the API. + Task Unlock(int repositoryId, int number); } -} +} \ No newline at end of file diff --git a/Octokit/Clients/IssuesClient.cs b/Octokit/Clients/IssuesClient.cs index 5c61427b..7a4ff3c4 100644 --- a/Octokit/Clients/IssuesClient.cs +++ b/Octokit/Clients/IssuesClient.cs @@ -40,12 +40,12 @@ namespace Octokit /// Client for managing labels. /// public IIssuesLabelsClient Labels { get; private set; } - + /// /// Client for managing milestones. /// public IMilestonesClient Milestone { get; private set; } - + /// /// Client for managing comments. /// @@ -69,6 +69,20 @@ namespace Octokit return ApiConnection.Get(ApiUrls.Issue(owner, name, number)); } + /// + /// Gets a single Issue by number. + /// + /// + /// http://developer.github.com/v3/issues/#get-a-single-issue + /// + /// The ID of the repository + /// The issue number + /// The created representing requesting the issue from the API. + public Task Get(int repositoryId, int number) + { + return ApiConnection.Get(ApiUrls.Issue(repositoryId, number)); + } + /// /// Gets all open issues assigned to the authenticated user across all the authenticated user’s visible /// repositories including owned repositories, member repositories, and organization repositories. @@ -276,9 +290,25 @@ namespace Octokit /// The created representing requesting a list of issue from the API. public Task> GetAllForRepository(string owner, string name) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + return GetAllForRepository(owner, name, new RepositoryIssueRequest()); } + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// The created representing requesting a list of issue from the API. + public Task> GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, new RepositoryIssueRequest()); + } + /// /// Gets all open issues assigned to the authenticated user for the repository. /// @@ -291,9 +321,29 @@ namespace Octokit /// The created representing requesting a list of issue from the API. public Task> GetAllForRepository(string owner, string name, ApiOptions options) { + Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNull(options, "options"); + return GetAllForRepository(owner, name, new RepositoryIssueRequest(), options); } + /// + /// Gets all open issues assigned to the authenticated user for the repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// The created representing requesting a list of issue from the API. + public Task> GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return GetAllForRepository(repositoryId, new RepositoryIssueRequest(), options); + } + /// /// Gets issues for a repository. /// @@ -313,6 +363,22 @@ namespace Octokit return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// The created representing requesting a list of issue from the API. + public Task> GetAllForRepository(int repositoryId, RepositoryIssueRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets issues for a repository. /// @@ -334,6 +400,24 @@ namespace Octokit return ApiConnection.GetAll(ApiUrls.Issues(owner, name), request.ToParametersDictionary(), options); } + /// + /// Gets issues for a repository. + /// + /// + /// http://developer.github.com/v3/issues/#list-issues-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of issues returned + /// Options for changing the API response + /// The created representing requesting a list of issue from the API. + public Task> GetAllForRepository(int repositoryId, RepositoryIssueRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.Issues(repositoryId), request.ToParametersDictionary(), options); + } + /// /// Creates an issue for the specified repository. Any user with pull access to a repository can create an /// issue. @@ -352,6 +436,21 @@ namespace Octokit return ApiConnection.Post(ApiUrls.Issues(owner, name), newIssue); } + /// + /// Creates an issue for the specified repository. Any user with pull access to a repository can create an + /// issue. + /// + /// http://developer.github.com/v3/issues/#create-an-issue + /// The ID of the repository + /// A instance describing the new issue to create + /// The created representing the new issue from the API. + public Task Create(int repositoryId, NewIssue newIssue) + { + Ensure.ArgumentNotNull(newIssue, "newIssue"); + + return ApiConnection.Post(ApiUrls.Issues(repositoryId), newIssue); + } + /// /// Updates an issue for the specified repository. Issue owners and users with push access can edit an issue. /// @@ -371,6 +470,23 @@ namespace Octokit return ApiConnection.Patch(ApiUrls.Issue(owner, name, number), issueUpdate); } + /// + /// Updates an issue for the specified repository. Any user with pull access to a repository can update an + /// issue. + /// + /// http://developer.github.com/v3/issues/#edit-an-issue + /// The ID of the repository + /// The issue number + /// An instance describing the changes to make to the issue + /// + /// The created representing the updated issue from the API. + public Task Update(int repositoryId, int number, IssueUpdate issueUpdate) + { + Ensure.ArgumentNotNull(issueUpdate, "issueUpdate"); + + return ApiConnection.Patch(ApiUrls.Issue(repositoryId, number), issueUpdate); + } + /// /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. /// @@ -387,6 +503,18 @@ namespace Octokit return ApiConnection.Put(ApiUrls.IssueLock(owner, name, number), new object(), null, AcceptHeaders.IssueLockingUnlockingApiPreview); } + /// + /// Locks an issue for the specified repository. Issue owners and users with push access can lock an issue. + /// + /// https://developer.github.com/v3/issues/#lock-an-issue + /// The ID of the repository + /// The issue number + /// The created representing accessing the API. + public Task Lock(int repositoryId, int number) + { + return ApiConnection.Put(ApiUrls.IssueLock(repositoryId, number), new object(), null, AcceptHeaders.IssueLockingUnlockingApiPreview); + } + /// /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. /// @@ -402,5 +530,17 @@ namespace Octokit return ApiConnection.Delete(ApiUrls.IssueLock(owner, name, number), new object(), AcceptHeaders.IssueLockingUnlockingApiPreview); } + + /// + /// Unlocks an issue for the specified repository. Issue owners and users with push access can unlock an issue. + /// + /// https://developer.github.com/v3/issues/#unlock-an-issue + /// The ID of the repository + /// The issue number + /// The created representing accessing the API. + public Task Unlock(int repositoryId, int number) + { + return ApiConnection.Delete(ApiUrls.IssueLock(repositoryId, number), new object(), AcceptHeaders.IssueLockingUnlockingApiPreview); + } } -} +} \ No newline at end of file