diff --git a/Octokit.Reactive/Clients/IObservableCommitStatusClient.cs b/Octokit.Reactive/Clients/IObservableCommitStatusClient.cs index 6a2efe16..77f1923d 100644 --- a/Octokit.Reactive/Clients/IObservableCommitStatusClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitStatusClient.cs @@ -20,6 +20,16 @@ namespace Octokit.Reactive /// The reference (SHA, branch name, or tag name) to list commits for /// A of es representing commit statuses for specified repository IObservable GetAll(string owner, string name, string reference); + + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of es representing commit statuses for specified repository + IObservable GetAll(int repositoryId, string reference); /// /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or @@ -33,6 +43,17 @@ namespace Octokit.Reactive /// A of es representing commit statuses for specified repository IObservable GetAll(string owner, string name, string reference, ApiOptions options); + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// Options for changing the API response + /// A of es representing commit statuses for specified repository + IObservable GetAll(int repositoryId, string reference, ApiOptions options); + /// /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or /// a tag name. @@ -44,6 +65,16 @@ namespace Octokit.Reactive /// A of representing combined commit status for specified repository IObservable GetCombined(string owner, string name, string reference); + /// + /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of representing combined commit status for specified repository + IObservable GetCombined(int repositoryId, string reference); + /// /// Creates a commit status for the specified ref. /// @@ -53,5 +84,14 @@ namespace Octokit.Reactive /// The commit status to create /// A of representing created commit status for specified repository IObservable Create(string owner, string name, string reference, NewCommitStatus newCommitStatus); + + /// + /// Creates a commit status for the specified ref. + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// The commit status to create + /// A of representing created commit status for specified repository + IObservable Create(int repositoryId, string reference, NewCommitStatus newCommitStatus); } } diff --git a/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs b/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs index 8d00f5f9..1e00e39a 100644 --- a/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitStatusClient.cs @@ -38,7 +38,22 @@ namespace Octokit.Reactive Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - return GetAll(owner, name ,reference, ApiOptions.None); + return GetAll(owner, name ,reference, ApiOptions.None); + } + + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of es representing commit statuses for specified repository + public IObservable GetAll(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return GetAll(repositoryId, reference, ApiOptions.None); } /// @@ -61,6 +76,23 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.CommitStatuses(owner, name, reference), options); } + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// Options for changing the API response + /// A of es representing commit statuses for specified repository + public IObservable GetAll(int repositoryId, string reference, ApiOptions options) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.CommitStatuses(repositoryId, reference), options); + } + /// /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or /// a tag name. @@ -79,6 +111,21 @@ namespace Octokit.Reactive return _client.GetCombined(owner, name, reference).ToObservable(); } + /// + /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// Only users with pull access can see this. + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of representing combined commit status for specified repository + public IObservable GetCombined(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return _client.GetCombined(repositoryId, reference).ToObservable(); + } + /// /// Creates a commit status for the specified ref. /// @@ -92,9 +139,24 @@ namespace Octokit.Reactive Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - Ensure.ArgumentNotNull(newCommitStatus, "commitStatus"); + Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus"); return _client.Create(owner, name, reference, newCommitStatus).ToObservable(); } + + /// + /// Creates a commit status for the specified ref. + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// The commit status to create + /// A of representing created commit status for specified repository + public IObservable Create(int repositoryId, string reference, NewCommitStatus newCommitStatus) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus"); + + return _client.Create(repositoryId, reference, newCommitStatus).ToObservable(); + } } } diff --git a/Octokit/Clients/CommitStatusClient.cs b/Octokit/Clients/CommitStatusClient.cs index 9c3acad3..bac8f264 100644 --- a/Octokit/Clients/CommitStatusClient.cs +++ b/Octokit/Clients/CommitStatusClient.cs @@ -36,7 +36,24 @@ namespace Octokit Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); - return GetAll(owner,name,reference,ApiOptions.None); + return GetAll(owner, name, reference, ApiOptions.None); + } + + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of es representing commit statuses for specified repository + public Task> GetAll(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return GetAll(repositoryId, reference, ApiOptions.None); } /// @@ -54,11 +71,30 @@ namespace Octokit public Task> GetAll(string owner, string name, string reference, ApiOptions options) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); - Ensure.ArgumentNotNullOrEmptyString(name, "name"); + Ensure.ArgumentNotNullOrEmptyString(name, "name"); Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); Ensure.ArgumentNotNull(options, "options"); - return ApiConnection.GetAll(ApiUrls.CommitStatuses(owner, name, reference),options); + return ApiConnection.GetAll(ApiUrls.CommitStatuses(owner, name, reference), options); + } + + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// Options for changing the API response + /// A of es representing commit statuses for specified repository + public Task> GetAll(int repositoryId, string reference, ApiOptions options) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNull(options, "options"); + + return ApiConnection.GetAll(ApiUrls.CommitStatuses(repositoryId, reference), options); } /// @@ -81,6 +117,23 @@ namespace Octokit return ApiConnection.Get(ApiUrls.CombinedCommitStatus(owner, name, reference)); } + /// + /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A representing combined commit status for specified repository + public Task GetCombined(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return ApiConnection.Get(ApiUrls.CombinedCommitStatus(repositoryId, reference)); + } + /// /// Creates a commit status for the specified ref. /// @@ -101,5 +154,23 @@ namespace Octokit return ApiConnection.Post(ApiUrls.CreateCommitStatus(owner, name, reference), newCommitStatus); } + + /// + /// Creates a commit status for the specified ref. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#create-a-status + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// The commit status to create + /// A representing created commit status for specified repository + public Task Create(int repositoryId, string reference, NewCommitStatus newCommitStatus) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + Ensure.ArgumentNotNull(newCommitStatus, "newCommitStatus"); + + return ApiConnection.Post(ApiUrls.CreateCommitStatus(repositoryId, reference), newCommitStatus); + } } -} +} \ No newline at end of file diff --git a/Octokit/Clients/ICommitStatusClient.cs b/Octokit/Clients/ICommitStatusClient.cs index 980c7441..49ca18ca 100644 --- a/Octokit/Clients/ICommitStatusClient.cs +++ b/Octokit/Clients/ICommitStatusClient.cs @@ -24,6 +24,18 @@ namespace Octokit /// A of es representing commit statuses for specified repository Task> GetAll(string owner, string name, string reference); + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A of es representing commit statuses for specified repository + Task> GetAll(int repositoryId, string reference); + /// /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or /// a tag name. @@ -38,6 +50,19 @@ namespace Octokit /// A of es representing commit statuses for specified repository Task> GetAll(string owner, string name, string reference, ApiOptions options); + /// + /// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// Options for changing the API response + /// A of es representing commit statuses for specified repository + Task> GetAll(int repositoryId, string reference, ApiOptions options); + /// /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or /// a tag name. @@ -51,6 +76,18 @@ namespace Octokit /// A representing combined commit status for specified repository Task GetCombined(string owner, string name, string reference); + /// + /// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or + /// a tag name. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// A representing combined commit status for specified repository + Task GetCombined(int repositoryId, string reference); + /// /// Creates a commit status for the specified ref. /// @@ -63,5 +100,17 @@ namespace Octokit /// The commit status to create /// A representing created commit status for specified repository Task Create(string owner, string name, string reference, NewCommitStatus newCommitStatus); + + /// + /// Creates a commit status for the specified ref. + /// + /// + /// https://developer.github.com/v3/repos/statuses/#create-a-status + /// + /// The ID of the repository + /// The reference (SHA, branch name, or tag name) to list commits for + /// The commit status to create + /// A representing created commit status for specified repository + Task Create(int repositoryId, string reference, NewCommitStatus newCommitStatus); } }