diff --git a/Octokit.Reactive/Clients/IObservableCommitsClient.cs b/Octokit.Reactive/Clients/IObservableCommitsClient.cs index b559dd65..2c13a031 100644 --- a/Octokit.Reactive/Clients/IObservableCommitsClient.cs +++ b/Octokit.Reactive/Clients/IObservableCommitsClient.cs @@ -25,6 +25,19 @@ namespace Octokit.Reactive Justification = "Method makes a network request")] IObservable Get(string owner, string name, string reference); + /// + /// Gets a commit for a given repository by sha reference + /// + /// + /// http://developer.github.com/v3/git/commits/#get-a-commit + /// + /// The ID of the repository + /// Tha sha reference of the commit + /// A representing commit for specified repository and reference + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + IObservable Get(int repositoryId, string reference); + /// /// Create a commit for a given repository /// @@ -36,5 +49,16 @@ namespace Octokit.Reactive /// The commit to create /// A of representing created commit for specified repository IObservable Create(string owner, string name, NewCommit commit); + + /// + /// Create a commit for a given repository + /// + /// + /// http://developer.github.com/v3/git/commits/#create-a-commit + /// + /// The ID of the repository + /// The commit to create + /// A of representing created commit for specified repository + IObservable Create(int repositoryId, NewCommit commit); } } \ No newline at end of file diff --git a/Octokit.Reactive/Clients/ObservableCommitsClient.cs b/Octokit.Reactive/Clients/ObservableCommitsClient.cs index 7ff8af2c..228681af 100644 --- a/Octokit.Reactive/Clients/ObservableCommitsClient.cs +++ b/Octokit.Reactive/Clients/ObservableCommitsClient.cs @@ -39,6 +39,22 @@ namespace Octokit.Reactive return _client.Get(owner, name, reference).ToObservable(); } + /// + /// Gets a commit for a given repository by sha reference + /// + /// + /// http://developer.github.com/v3/git/commits/#get-a-commit + /// + /// The ID of the repository + /// Tha sha reference of the commit + /// A representing commit for specified repository and reference + public IObservable Get(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return _client.Get(repositoryId, reference).ToObservable(); + } + /// /// Create a commit for a given repository /// @@ -57,5 +73,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, commit).ToObservable(); } + + /// + /// Create a commit for a given repository + /// + /// + /// http://developer.github.com/v3/git/commits/#create-a-commit + /// + /// The ID of the repository + /// The commit to create + /// A of representing created commit for specified repository + public IObservable Create(int repositoryId, NewCommit commit) + { + Ensure.ArgumentNotNull(commit, "commit"); + + return _client.Create(repositoryId, commit).ToObservable(); + } } } \ No newline at end of file diff --git a/Octokit/Clients/CommitsClient.cs b/Octokit/Clients/CommitsClient.cs index c366d2a5..f0eff413 100644 --- a/Octokit/Clients/CommitsClient.cs +++ b/Octokit/Clients/CommitsClient.cs @@ -38,6 +38,22 @@ namespace Octokit return ApiConnection.Get(ApiUrls.Commit(owner, name, reference), null, AcceptHeaders.SignatureVerificationPreview); } + /// + /// Gets a commit for a given repository by sha reference + /// + /// + /// http://developer.github.com/v3/git/commits/#get-a-commit + /// + /// The ID of the repository + /// Tha sha reference of the commit + /// A representing commit for specified repository and reference + public Task Get(int repositoryId, string reference) + { + Ensure.ArgumentNotNullOrEmptyString(reference, "reference"); + + return ApiConnection.Get(ApiUrls.Commit(repositoryId, reference)); + } + /// /// Create a commit for a given repository /// @@ -56,5 +72,21 @@ namespace Octokit return ApiConnection.Post(ApiUrls.CreateCommit(owner, name), commit); } + + /// + /// Create a commit for a given repository + /// + /// + /// http://developer.github.com/v3/git/commits/#create-a-commit + /// + /// The ID of the repository + /// The commit to create + /// A representing created commit for specified repository + public Task Create(int repositoryId, NewCommit commit) + { + Ensure.ArgumentNotNull(commit, "commit"); + + return ApiConnection.Post(ApiUrls.CreateCommit(repositoryId), commit); + } } } \ No newline at end of file diff --git a/Octokit/Clients/ICommitsClient.cs b/Octokit/Clients/ICommitsClient.cs index 6bde299a..62ff94f7 100644 --- a/Octokit/Clients/ICommitsClient.cs +++ b/Octokit/Clients/ICommitsClient.cs @@ -25,6 +25,19 @@ namespace Octokit Justification = "Method makes a network request")] Task Get(string owner, string name, string reference); + /// + /// Gets a commit for a given repository by sha reference + /// + /// + /// http://developer.github.com/v3/git/commits/#get-a-commit + /// + /// The ID of the repository + /// Tha sha reference of the commit + /// A representing commit for specified repository and reference + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", + Justification = "Method makes a network request")] + Task Get(int repositoryId, string reference); + /// /// Create a commit for a given repository /// @@ -36,5 +49,16 @@ namespace Octokit /// The commit to create /// A representing created commit for specified repository Task Create(string owner, string name, NewCommit commit); + + /// + /// Create a commit for a given repository + /// + /// + /// http://developer.github.com/v3/git/commits/#create-a-commit + /// + /// The ID of the repository + /// The commit to create + /// A representing created commit for specified repository + Task Create(int repositoryId, NewCommit commit); } } \ No newline at end of file