Skip to content

Commit

Permalink
move GitHubAppInstallationsClient into root namespace for consistency…
Browse files Browse the repository at this point in the history
…, annotate routes (#2131)
  • Loading branch information
shiftkey authored Mar 6, 2020
1 parent 43d1b8b commit 216e4e3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Octokit.Tests/Clients/GitHubAppInstallationsClientTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using NSubstitute;
using Octokit.Clients;
using Octokit;
using Xunit;

namespace Octokit.Tests.Clients
Expand Down Expand Up @@ -97,4 +97,4 @@ public void GetsFromCorrectUrllWithApiOptions()
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using NSubstitute;
using Octokit.Clients;
using Octokit;
using Octokit.Reactive;
using Xunit;

Expand Down Expand Up @@ -99,4 +99,4 @@ public void GetsFromCorrectUrllWithApiOptions()
}
}
}
}
}
8 changes: 6 additions & 2 deletions Octokit/Clients/GitHubAppInstallationsClient.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq;
using System.Threading.Tasks;

namespace Octokit.Clients
namespace Octokit
{
/// <summary>
/// A client for GitHub Applications Installations API.
Expand All @@ -19,6 +19,7 @@ public GitHubAppInstallationsClient(IApiConnection apiConnection) : base(apiConn
/// List repositories of the authenticated GitHub App Installation (requires GitHubApp Installation-Token auth).
/// </summary>
/// <remarks>https://developer.github.com/v3/apps/installations/#list-repositories</remarks>
[ManualRoute("GET", "/installation/repositories")]
public Task<RepositoriesResponse> GetAllRepositoriesForCurrent()
{
return GetAllRepositoriesForCurrent(ApiOptions.None);
Expand All @@ -29,6 +30,7 @@ public Task<RepositoriesResponse> GetAllRepositoriesForCurrent()
/// </summary>
/// <param name="options">Options for changing the API response</param>
/// <remarks>https://developer.github.com/v3/apps/installations/#list-repositories</remarks>
[ManualRoute("GET", "/installation/repositories")]
public async Task<RepositoriesResponse> GetAllRepositoriesForCurrent(ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
Expand All @@ -45,6 +47,7 @@ public async Task<RepositoriesResponse> GetAllRepositoriesForCurrent(ApiOptions
/// </summary>
/// <param name="installationId">The Id of the installation</param>
/// <remarks>https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation</remarks>
[ManualRoute("GET", "/user/installation/{id}/repositories")]
public Task<RepositoriesResponse> GetAllRepositoriesForCurrentUser(long installationId)
{
return GetAllRepositoriesForCurrentUser(installationId, ApiOptions.None);
Expand All @@ -56,6 +59,7 @@ public Task<RepositoriesResponse> GetAllRepositoriesForCurrentUser(long installa
/// <param name="installationId">The Id of the installation</param>
/// <param name="options">Options for changing the API response</param>
/// <remarks>https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation</remarks>
[ManualRoute("GET", "/user/installation/{id}/repositories")]
public async Task<RepositoriesResponse> GetAllRepositoriesForCurrentUser(long installationId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
Expand All @@ -67,4 +71,4 @@ public async Task<RepositoriesResponse> GetAllRepositoriesForCurrentUser(long in
results.SelectMany(x => x.Repositories).ToList());
}
}
}
}
1 change: 0 additions & 1 deletion Octokit/Clients/GitHubAppsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Octokit.Clients;

namespace Octokit
{
Expand Down

0 comments on commit 216e4e3

Please sign in to comment.