diff --git a/Octokit.Reactive/Clients/IObservableMilestonesClient.cs b/Octokit.Reactive/Clients/IObservableMilestonesClient.cs index 13491cc7..e7a208ca 100644 --- a/Octokit.Reactive/Clients/IObservableMilestonesClient.cs +++ b/Octokit.Reactive/Clients/IObservableMilestonesClient.cs @@ -22,6 +22,17 @@ namespace Octokit.Reactive [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] IObservable Get(string owner, string name, int number); + + /// + /// Gets a single Milestone by number. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#get-a-single-milestone + /// + /// + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + IObservable Get(int repositoryId, int number); /// /// Gets all open milestones for the repository. @@ -33,6 +44,16 @@ namespace Octokit.Reactive /// The name of the repository /// IObservable GetAllForRepository(string owner, string name); + + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// + IObservable GetAllForRepository(int repositoryId); /// /// Gets all open milestones for the repository. @@ -46,6 +67,17 @@ namespace Octokit.Reactive /// IObservable GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// + IObservable GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets all open milestones for the repository. /// @@ -58,6 +90,17 @@ namespace Octokit.Reactive /// IObservable GetAllForRepository(string owner, string name, MilestoneRequest request); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// + IObservable GetAllForRepository(int repositoryId, MilestoneRequest request); + /// /// Gets all open milestones for the repository. /// @@ -71,6 +114,18 @@ namespace Octokit.Reactive /// IObservable GetAllForRepository(string owner, string name, MilestoneRequest request, ApiOptions options); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// Options for changing the API response + /// + IObservable GetAllForRepository(int repositoryId, MilestoneRequest request, ApiOptions options); + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create a /// Milestone. @@ -82,6 +137,16 @@ namespace Octokit.Reactive /// IObservable Create(string owner, string name, NewMilestone newMilestone); + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create a + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#create-a-milestone + /// The ID of the repository + /// A instance describing the new Milestone to create + /// + IObservable Create(int repositoryId, NewMilestone newMilestone); + /// /// Updates a milestone for the specified repository. Any user with pull access to a repository can create a /// Milestone. @@ -95,6 +160,18 @@ namespace Octokit.Reactive /// IObservable Update(string owner, string name, int number, MilestoneUpdate milestoneUpdate); + /// + /// Updates a milestone for the specified repository. Any user with pull access to a repository can create a + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#update-a-milestone + /// The ID of the repository + /// The Milestone number + /// An instance describing the changes to make to the Milestone + /// + /// + IObservable Update(int repositoryId, int number, MilestoneUpdate milestoneUpdate); + /// /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -105,5 +182,15 @@ namespace Octokit.Reactive /// The milestone number /// IObservable Delete(string owner, string name, int number); + + /// + /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#delete-a-milestone + /// The ID of the repository + /// The milestone number + /// + IObservable Delete(int repositoryId, int number); } } diff --git a/Octokit.Reactive/Clients/ObservableMilestonesClient.cs b/Octokit.Reactive/Clients/ObservableMilestonesClient.cs index bba87cf2..9fa9b876 100644 --- a/Octokit.Reactive/Clients/ObservableMilestonesClient.cs +++ b/Octokit.Reactive/Clients/ObservableMilestonesClient.cs @@ -39,6 +39,18 @@ namespace Octokit.Reactive return _client.Get(owner, name, number).ToObservable(); } + /// + /// Gets a single Milestone by number. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#get-a-single-milestone + /// + /// + public IObservable Get(int repositoryId, int number) + { + return _client.Get(repositoryId, number).ToObservable(); + } + /// /// Gets all open milestones for the repository. /// @@ -56,6 +68,19 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, ApiOptions.None); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// + public IObservable GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, ApiOptions.None); + } + /// /// Gets all open milestones for the repository. /// @@ -75,6 +100,22 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Milestones(owner, name), options); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// + public IObservable GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Milestones(repositoryId), options); + } + /// /// Gets all open milestones for the repository. /// @@ -94,6 +135,22 @@ namespace Octokit.Reactive return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// + public IObservable GetAllForRepository(int repositoryId, MilestoneRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets all open milestones for the repository. /// @@ -116,6 +173,25 @@ namespace Octokit.Reactive request.ToParametersDictionary(), options); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// Options for changing the API response + /// + public IObservable GetAllForRepository(int repositoryId, MilestoneRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Milestones(repositoryId), + request.ToParametersDictionary(), options); + } + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create a /// Milestone. @@ -134,6 +210,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, newMilestone).ToObservable(); } + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create a + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#create-a-milestone + /// The ID of the repository + /// A instance describing the new Milestone to create + /// + public IObservable Create(int repositoryId, NewMilestone newMilestone) + { + Ensure.ArgumentNotNull(newMilestone, "newMilestone"); + + return _client.Create(repositoryId, newMilestone).ToObservable(); + } + /// /// Updates a milestone for the specified repository. Any user with pull access to a repository can create a /// Milestone. @@ -154,6 +245,23 @@ namespace Octokit.Reactive return _client.Update(owner, name, number, milestoneUpdate).ToObservable(); } + /// + /// Updates a milestone for the specified repository. Any user with pull access to a repository can create a + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#update-a-milestone + /// The ID of the repository + /// The Milestone number + /// An instance describing the changes to make to the Milestone + /// + /// + public IObservable Update(int repositoryId, int number, MilestoneUpdate milestoneUpdate) + { + Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate"); + + return _client.Update(repositoryId, number, milestoneUpdate).ToObservable(); + } + /// /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -170,5 +278,18 @@ namespace Octokit.Reactive return _client.Delete(owner, name, number).ToObservable(); } + + /// + /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#delete-a-milestone + /// The ID of the repository + /// The milestone number + /// + public IObservable Delete(int repositoryId, int number) + { + return _client.Delete(repositoryId, number).ToObservable(); + } } -} \ No newline at end of file +} diff --git a/Octokit/Clients/IMilestonesClient.cs b/Octokit/Clients/IMilestonesClient.cs index 475d6d31..3318b921 100644 --- a/Octokit/Clients/IMilestonesClient.cs +++ b/Octokit/Clients/IMilestonesClient.cs @@ -20,9 +20,20 @@ namespace Octokit /// /// [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 Milestone by number. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#get-a-single-milestone + /// + /// + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + Task Get(int repositoryId, int number); + /// /// Gets all open milestones for the repository. /// @@ -34,6 +45,16 @@ namespace Octokit /// Task> GetAllForRepository(string owner, string name); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// + Task> GetAllForRepository(int repositoryId); + /// /// Gets all open milestones for the repository. /// @@ -46,6 +67,17 @@ namespace Octokit /// Task> GetAllForRepository(string owner, string name, ApiOptions options); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// + Task> GetAllForRepository(int repositoryId, ApiOptions options); + /// /// Gets all open milestones for the repository. /// @@ -58,6 +90,17 @@ namespace Octokit /// Task> GetAllForRepository(string owner, string name, MilestoneRequest request); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// + Task> GetAllForRepository(int repositoryId, MilestoneRequest request); + /// /// Gets all open milestones for the repository. /// @@ -71,6 +114,18 @@ namespace Octokit /// Task> GetAllForRepository(string owner, string name, MilestoneRequest request, ApiOptions options); + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// Options for changing the API response + /// + Task> GetAllForRepository(int repositoryId, MilestoneRequest request, ApiOptions options); + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -82,6 +137,16 @@ namespace Octokit /// Task Create(string owner, string name, NewMilestone newMilestone); + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#create-a-milestone + /// The ID of the repository + /// A instance describing the new Milestone to create + /// + Task Create(int repositoryId, NewMilestone newMilestone); + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -95,6 +160,18 @@ namespace Octokit /// Task Update(string owner, string name, int number, MilestoneUpdate milestoneUpdate); + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#update-a-milestone + /// The ID of the repository + /// The Milestone number + /// An instance describing the changes to make to the Milestone + /// + /// + Task Update(int repositoryId, int number, MilestoneUpdate milestoneUpdate); + /// /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -105,5 +182,15 @@ namespace Octokit /// The milestone number /// Task Delete(string owner, string name, int number); + + /// + /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#delete-a-milestone + /// The ID of the repository + /// The milestone number + /// + Task Delete(int repositoryId, int number); } } diff --git a/Octokit/Clients/MilestonesClient.cs b/Octokit/Clients/MilestonesClient.cs index 0690b067..feb7f530 100644 --- a/Octokit/Clients/MilestonesClient.cs +++ b/Octokit/Clients/MilestonesClient.cs @@ -34,6 +34,18 @@ namespace Octokit return ApiConnection.Get(ApiUrls.Milestone(owner, name, number)); } + /// + /// Gets a single Milestone by number. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#get-a-single-milestone + /// + /// + public Task Get(int repositoryId, int number) + { + return ApiConnection.Get(ApiUrls.Milestone(repositoryId, number)); + } + /// /// Gets all open milestones for the repository. /// @@ -51,6 +63,19 @@ namespace Octokit return GetAllForRepository(owner, name, new MilestoneRequest()); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// + public Task> GetAllForRepository(int repositoryId) + { + return GetAllForRepository(repositoryId, new MilestoneRequest()); + } + /// /// Gets all open milestones for the repository. /// @@ -70,6 +95,22 @@ namespace Octokit return GetAllForRepository(owner, name, new MilestoneRequest(), options); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Options for changing the API response + /// + public Task> GetAllForRepository(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return GetAllForRepository(repositoryId, new MilestoneRequest(), options); + } + /// /// Gets all open milestones for the repository. /// @@ -89,6 +130,22 @@ namespace Octokit return GetAllForRepository(owner, name, request, ApiOptions.None); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// + public Task> GetAllForRepository(int repositoryId, MilestoneRequest request) + { + Ensure.ArgumentNotNull(request, "request"); + + return GetAllForRepository(repositoryId, request, ApiOptions.None); + } + /// /// Gets all open milestones for the repository. /// @@ -111,6 +168,25 @@ namespace Octokit request.ToParametersDictionary(), options); } + /// + /// Gets all open milestones for the repository. + /// + /// + /// http://developer.github.com/v3/issues/milestones/#list-milestones-for-a-repository + /// + /// The ID of the repository + /// Used to filter and sort the list of Milestones returned + /// Options for changing the API response + /// + public Task> GetAllForRepository(int repositoryId, MilestoneRequest request, ApiOptions options) + { + Ensure.ArgumentNotNull(request, "request"); + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.Milestones(repositoryId), + request.ToParametersDictionary(), options); + } + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -129,6 +205,21 @@ namespace Octokit return ApiConnection.Post(ApiUrls.Milestones(owner, name), newMilestone); } + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#create-a-milestone + /// The ID of the repository + /// A instance describing the new Milestone to create + /// + public Task Create(int repositoryId, NewMilestone newMilestone) + { + Ensure.ArgumentNotNull(newMilestone, "newMilestone"); + + return ApiConnection.Post(ApiUrls.Milestones(repositoryId), newMilestone); + } + /// /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -149,6 +240,23 @@ namespace Octokit return ApiConnection.Patch(ApiUrls.Milestone(owner, name, number), milestoneUpdate); } + /// + /// Creates a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#update-a-milestone + /// The ID of the repository + /// The Milestone number + /// An instance describing the changes to make to the Milestone + /// + /// + public Task Update(int repositoryId, int number, MilestoneUpdate milestoneUpdate) + { + Ensure.ArgumentNotNull(milestoneUpdate, "milestoneUpdate"); + + return ApiConnection.Patch(ApiUrls.Milestone(repositoryId, number), milestoneUpdate); + } + /// /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an /// Milestone. @@ -165,5 +273,18 @@ namespace Octokit return ApiConnection.Delete(ApiUrls.Milestone(owner, name, number)); } + + /// + /// Deletes a milestone for the specified repository. Any user with pull access to a repository can create an + /// Milestone. + /// + /// http://developer.github.com/v3/issues/milestones/#delete-a-milestone + /// The ID of the repository + /// The milestone number + /// + public Task Delete(int repositoryId, int number) + { + return ApiConnection.Delete(ApiUrls.Milestone(repositoryId, number)); + } } }