Skip to content

Commit

Permalink
Undoing unintentional changes and cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
StanleyGoldman committed Aug 13, 2018
1 parent 9f72740 commit e3e1ade
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 10 deletions.
18 changes: 12 additions & 6 deletions Octokit.Reactive/Clients/IObservableGitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface IObservableGitHubAppsClient
/// <remarks>
/// Refer to the API documentation for more information: https://developer.github.com/v3/apps/installations/
/// </remarks>
IObservableGitHubAppsInstallationsClient Installations { get; }
IObservableGitHubAppsInstallationsClient Installation { get; }

/// <summary>
/// Get a single GitHub App.
Expand Down Expand Up @@ -80,15 +80,21 @@ public interface IObservableGitHubAppsClient
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="owner">The owner of the repo</param>
/// <param name="repo">The name of the repo</param>
IObservable<Installation> GetRepositoryInstallation(string owner, string repo);
IObservable<Installation> GetRepositoryInstallationForCurrent(string owner, string repo);

/// <summary>
/// Enables an authenticated GitHub App to find the repository's installation information.
/// Enables an authenticated GitHub App to find the organizations's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="repositoryId">The Id of the repository</param>
IObservable<Installation> GetRepositoryInstallationForCurrent(long repositoryId);

/// <summary>
/// Enables an authenticated GitHub App to find the organization's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-organization-installation</remarks>
/// <param name="owner">The owner of the repo</param>
/// <param name="repo">The name of the repo</param>
IObservable<Installation> GetOrganizationInstallation(string organization);
/// <param name="organization">The name of the organization</param>
IObservable<Installation> GetOrganizationInstallationForCurrent(string organization);

/// <summary>
/// Enables an authenticated GitHub App to find the users's installation information.
Expand Down
19 changes: 15 additions & 4 deletions Octokit.Reactive/Clients/ObservableGitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitHubApp> Get(string slug)
{
Expand Down Expand Up @@ -110,18 +110,29 @@ public IObservable<InstallationsResponse> GetAllInstallationsForUser(ApiOptions
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="owner">The owner of the repo</param>
/// <param name="repo">The name of the repo</param>
public IObservable<Installation> GetRepositoryInstallation(string owner, string repo)
public IObservable<Installation> GetRepositoryInstallationForCurrent(string owner, string repo)
{
return _client.GetRepositoryInstallation(owner, repo).ToObservable();
}


/// <summary>
/// Enables an authenticated GitHub App to find the organizations's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="repositoryId">The id of the repo</param>
public IObservable<Installation> GetRepositoryInstallationForCurrent(long repositoryId)
{
return _client.GetRepositoryInstallation(repositoryId).ToObservable();
}

/// <summary>
/// Enables an authenticated GitHub App to find the repository's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-organization-installation</remarks>
/// <param name="owner">The owner of the repo</param>
/// <param name="repo">The name of the repo</param>
public IObservable<Installation> GetOrganizationInstallation(string organization)
public IObservable<Installation> GetOrganizationInstallationForCurrent(string organization)
{
return _client.GetOrganizationInstallation(organization).ToObservable();
}
Expand Down
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions Octokit/Clients/GitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,16 @@ public Task<Installation> GetRepositoryInstallation(string owner, string repo)
return ApiConnection.Get<Installation>(ApiUrls.RepoInstallation(owner, repo), null, AcceptHeaders.GitHubAppsPreview);
}

/// <summary>
/// Enables an authenticated GitHub App to find the organizations's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="repositoryId">The id of the repo</param>
public Task<Installation> GetRepositoryInstallation(long repositoryId)
{
return ApiConnection.Get<Installation>(ApiUrls.RepoInstallation(repositoryId), null, AcceptHeaders.GitHubAppsPreview);
}

/// <summary>
/// Enables an authenticated GitHub App to find the repository's installation information.
/// </summary>
Expand Down
7 changes: 7 additions & 0 deletions Octokit/Clients/IGitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ public interface IGitHubAppsClient
/// <param name="repo">The name of the repo</param>
Task<Installation> GetRepositoryInstallation(string owner, string repo);

/// <summary>
/// Enables an authenticated GitHub App to find the organizations's installation information.
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/#find-repository-installation</remarks>
/// <param name="repositoryId">The id of the repo</param>
Task<Installation> GetRepositoryInstallation(long repositoryId);

/// <summary>
/// Enables an authenticated GitHub App to find the repository's installation information.
/// </summary>
Expand Down
9 changes: 9 additions & 0 deletions Octokit/Helpers/ApiUrls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ public static Uri RepoInstallation(string owner, string repo)
return "repos/{0}/{1}/installation".FormatUri(owner, repo);
}

/// <summary>
/// Returns the <see cref="Uri"/> that returns the repository's installation information.
/// </summary>
/// <returns></returns>
public static Uri RepoInstallation(long repositoryId)
{
return "repositories/{0}/installation".FormatUri(repositoryId);
}

/// <summary>
/// Returns the <see cref="Uri"/> that returns the repository's installation information.
/// </summary>
Expand Down

0 comments on commit e3e1ade

Please sign in to comment.