diff --git a/Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs b/Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs
index f48901a470..3efb8e7be1 100644
--- a/Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs
+++ b/Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs
@@ -16,7 +16,7 @@ public interface IObservableGitHubAppsClient
///
/// Refer to the API documentation for more information: https://developer.github.com/v3/apps/installations/
///
- IObservableGitHubAppsInstallationsClient Installations { get; }
+ IObservableGitHubAppsInstallationsClient Installation { get; }
///
/// Get a single GitHub App.
@@ -80,15 +80,21 @@ public interface IObservableGitHubAppsClient
/// https://developer.github.com/v3/apps/#find-repository-installation
/// The owner of the repo
/// The name of the repo
- IObservable GetRepositoryInstallation(string owner, string repo);
+ IObservable GetRepositoryInstallationForCurrent(string owner, string repo);
///
- /// Enables an authenticated GitHub App to find the repository's installation information.
+ /// Enables an authenticated GitHub App to find the organizations's installation information.
+ ///
+ /// https://developer.github.com/v3/apps/#find-repository-installation
+ /// The Id of the repository
+ IObservable GetRepositoryInstallationForCurrent(long repositoryId);
+
+ ///
+ /// Enables an authenticated GitHub App to find the organization's installation information.
///
/// https://developer.github.com/v3/apps/#find-organization-installation
- /// The owner of the repo
- /// The name of the repo
- IObservable GetOrganizationInstallation(string organization);
+ /// The name of the organization
+ IObservable GetOrganizationInstallationForCurrent(string organization);
///
/// Enables an authenticated GitHub App to find the users's installation information.
diff --git a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
index 934fa03033..3318c9f74e 100644
--- a/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
+++ b/Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
@@ -19,13 +19,13 @@ public ObservableGitHubAppsClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, "client");
- Installations = new ObservableGitHubAppsInstallationsClient(client);
+ Installation = new ObservableGitHubAppsInstallationsClient(client);
_client = client.GitHubApps;
_connection = client.Connection;
}
- public IObservableGitHubAppsInstallationsClient Installations { get; private set; }
+ public IObservableGitHubAppsInstallationsClient Installation { get; private set; }
public IObservable Get(string slug)
{
@@ -110,18 +110,29 @@ public IObservable GetAllInstallationsForUser(ApiOptions
/// https://developer.github.com/v3/apps/#find-repository-installation
/// The owner of the repo
/// The name of the repo
- public IObservable GetRepositoryInstallation(string owner, string repo)
+ public IObservable GetRepositoryInstallationForCurrent(string owner, string repo)
{
return _client.GetRepositoryInstallation(owner, repo).ToObservable();
}
+
+ ///
+ /// Enables an authenticated GitHub App to find the organizations's installation information.
+ ///
+ /// https://developer.github.com/v3/apps/#find-repository-installation
+ /// The id of the repo
+ public IObservable GetRepositoryInstallationForCurrent(long repositoryId)
+ {
+ return _client.GetRepositoryInstallation(repositoryId).ToObservable();
+ }
+
///
/// Enables an authenticated GitHub App to find the repository's installation information.
///
/// https://developer.github.com/v3/apps/#find-organization-installation
/// The owner of the repo
/// The name of the repo
- public IObservable GetOrganizationInstallation(string organization)
+ public IObservable GetOrganizationInstallationForCurrent(string organization)
{
return _client.GetOrganizationInstallation(organization).ToObservable();
}
diff --git a/Octokit.Reactive/Clients/IObservableGitHubClient.cs b/Octokit.Reactive/IObservableGitHubClient.cs
similarity index 100%
rename from Octokit.Reactive/Clients/IObservableGitHubClient.cs
rename to Octokit.Reactive/IObservableGitHubClient.cs
diff --git a/Octokit.Reactive/Clients/ObservableGitHubClient.cs b/Octokit.Reactive/ObservableGitHubClient.cs
similarity index 100%
rename from Octokit.Reactive/Clients/ObservableGitHubClient.cs
rename to Octokit.Reactive/ObservableGitHubClient.cs
diff --git a/Octokit/Clients/GitHubAppsClient.cs b/Octokit/Clients/GitHubAppsClient.cs
index f6aa24e43a..0fbeaf9b81 100644
--- a/Octokit/Clients/GitHubAppsClient.cs
+++ b/Octokit/Clients/GitHubAppsClient.cs
@@ -79,6 +79,16 @@ public Task GetRepositoryInstallation(string owner, string repo)
return ApiConnection.Get(ApiUrls.RepoInstallation(owner, repo), null, AcceptHeaders.GitHubAppsPreview);
}
+ ///
+ /// Enables an authenticated GitHub App to find the organizations's installation information.
+ ///
+ /// https://developer.github.com/v3/apps/#find-repository-installation
+ /// The id of the repo
+ public Task GetRepositoryInstallation(long repositoryId)
+ {
+ return ApiConnection.Get(ApiUrls.RepoInstallation(repositoryId), null, AcceptHeaders.GitHubAppsPreview);
+ }
+
///
/// Enables an authenticated GitHub App to find the repository's installation information.
///
diff --git a/Octokit/Clients/IGitHubAppsClient.cs b/Octokit/Clients/IGitHubAppsClient.cs
index a8e85ce36d..af5160b6f9 100644
--- a/Octokit/Clients/IGitHubAppsClient.cs
+++ b/Octokit/Clients/IGitHubAppsClient.cs
@@ -84,6 +84,13 @@ public interface IGitHubAppsClient
/// The name of the repo
Task GetRepositoryInstallation(string owner, string repo);
+ ///
+ /// Enables an authenticated GitHub App to find the organizations's installation information.
+ ///
+ /// https://developer.github.com/v3/apps/#find-repository-installation
+ /// The id of the repo
+ Task GetRepositoryInstallation(long repositoryId);
+
///
/// Enables an authenticated GitHub App to find the repository's installation information.
///
diff --git a/Octokit/Helpers/ApiUrls.cs b/Octokit/Helpers/ApiUrls.cs
index cad3bb2d33..86a6f24b9c 100644
--- a/Octokit/Helpers/ApiUrls.cs
+++ b/Octokit/Helpers/ApiUrls.cs
@@ -332,6 +332,15 @@ public static Uri RepoInstallation(string owner, string repo)
return "repos/{0}/{1}/installation".FormatUri(owner, repo);
}
+ ///
+ /// Returns the that returns the repository's installation information.
+ ///
+ ///
+ public static Uri RepoInstallation(long repositoryId)
+ {
+ return "repositories/{0}/installation".FormatUri(repositoryId);
+ }
+
///
/// Returns the that returns the repository's installation information.
///