diff --git a/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseClient.cs b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseClient.cs
index 72e2d25efe..74186a8f67 100644
--- a/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseClient.cs
+++ b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseClient.cs
@@ -31,5 +31,13 @@ public interface IObservableEnterpriseClient
/// See the Enterprise Organization API documentation for more information.
///
IObservableEnterpriseOrganizationClient Organization { get; }
+
+ ///
+ /// A client for GitHub's Enterprise Search Indexing API
+ ///
+ ///
+ /// See the Enterprise Search Indexing API documentation for more information.
+ ///
+ IObservableEnterpriseSearchIndexingClient SearchIndexing { get; }
}
}
diff --git a/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseSearchIndexingClient.cs b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseSearchIndexingClient.cs
new file mode 100644
index 0000000000..89b7d3fe6f
--- /dev/null
+++ b/Octokit.Reactive/Clients/Enterprise/IObservableEnterpriseSearchIndexingClient.cs
@@ -0,0 +1,88 @@
+using System;
+using System.Diagnostics.CodeAnalysis;
+using System.Reactive.Threading.Tasks;
+
+namespace Octokit.Reactive
+{
+ ///
+ /// A client for GitHub's Enterprise Search Indexing API
+ ///
+ ///
+ /// See the Enterprise Search Indexing API documentation for more information.
+ ///
+ public interface IObservableEnterpriseSearchIndexingClient
+ {
+ ///
+ /// Queue an indexing job for a user or organization account (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ IObservable Queue(string owner);
+
+ ///
+ /// Queue an indexing job for a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ IObservable Queue(string owner, string repository);
+
+ ///
+ /// Queue an indexing job for all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ IObservable QueueAll(string owner);
+
+ ///
+ /// Queue an indexing job for all the issues in a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ IObservable QueueAllIssues(string owner, string repository);
+
+ ///
+ /// Queue an indexing job for all the issues in all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ IObservable QueueAllIssues(string owner);
+
+ ///
+ /// Queue an indexing job for all the source code in a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ IObservable QueueAllCode(string owner, string repository);
+
+ ///
+ /// Queue an indexing job for all the source code in all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ IObservable QueueAllCode(string owner);
+ }
+}
diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs
index 7a52afcd5b..0aa4c9201f 100644
--- a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs
+++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseClient.cs
@@ -15,6 +15,7 @@ public ObservableEnterpriseClient(IGitHubClient client)
AdminStats = new ObservableEnterpriseAdminStatsClient(client);
License = new ObservableEnterpriseLicenseClient(client);
Organization = new ObservableEnterpriseOrganizationClient(client);
+ SearchIndexing = new ObservableEnterpriseSearchIndexingClient(client);
}
///
@@ -40,5 +41,13 @@ public ObservableEnterpriseClient(IGitHubClient client)
/// See the Enterprise Organization API documentation for more information.
///
public IObservableEnterpriseOrganizationClient Organization { get; private set; }
+
+ ///
+ /// A client for GitHub's Enterprise Search Indexing API
+ ///
+ ///
+ /// See the Enterprise Search Indexing API documentation for more information.
+ ///
+ public IObservableEnterpriseSearchIndexingClient SearchIndexing { get; private set; }
}
}
diff --git a/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs
new file mode 100644
index 0000000000..feb093db73
--- /dev/null
+++ b/Octokit.Reactive/Clients/Enterprise/ObservableEnterpriseSearchIndexingClient.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Reactive.Threading.Tasks;
+using Octokit;
+
+namespace Octokit.Reactive
+{
+ ///
+ /// A client for GitHub's Enterprise Search Indexing API
+ ///
+ ///
+ /// See the Enterprise Search Indexing API documentation for more information.
+ ///
+ public class ObservableEnterpriseSearchIndexingClient : IObservableEnterpriseSearchIndexingClient
+ {
+ readonly IEnterpriseSearchIndexingClient _client;
+
+ public ObservableEnterpriseSearchIndexingClient(IGitHubClient client)
+ {
+ Ensure.ArgumentNotNull(client, "client");
+
+ _client = client.Enterprise.SearchIndexing;
+ }
+
+ ///
+ /// Queue an indexing job for a user or organization account (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ public IObservable Queue(string owner)
+ {
+ return _client.Queue(owner).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ public IObservable Queue(string owner, string repository)
+ {
+ return _client.Queue(owner, repository).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ public IObservable QueueAll(string owner)
+ {
+ return _client.QueueAll(owner).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for all the issues in a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ public IObservable QueueAllIssues(string owner, string repository)
+ {
+ return _client.QueueAllIssues(owner, repository).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for all the issues in all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ public IObservable QueueAllIssues(string owner)
+ {
+ return _client.QueueAllIssues(owner).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for all the source code in a repository (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// A repository
+ /// The message.
+ public IObservable QueueAllCode(string owner, string repository)
+ {
+ return _client.QueueAllCode(owner, repository).ToObservable();
+ }
+
+ ///
+ /// Queue an indexing job for all the source code in all of a user or organization's repositories (must be Site Admin user).
+ ///
+ ///
+ /// https://developer.github.com/v3/enterprise/search_indexing/#queue-an-indexing-job
+ ///
+ /// A user or organization account
+ /// The message.
+ public IObservable QueueAllCode(string owner)
+ {
+ return _client.QueueAllCode(owner).ToObservable();
+ }
+ }
+}
diff --git a/Octokit.Reactive/Octokit.Reactive-Mono.csproj b/Octokit.Reactive/Octokit.Reactive-Mono.csproj
index 3c0f28aa59..10d634574d 100644
--- a/Octokit.Reactive/Octokit.Reactive-Mono.csproj
+++ b/Octokit.Reactive/Octokit.Reactive-Mono.csproj
@@ -169,6 +169,8 @@
+
+
diff --git a/Octokit.Reactive/Octokit.Reactive-MonoAndroid.csproj b/Octokit.Reactive/Octokit.Reactive-MonoAndroid.csproj
index a808ba9188..d0f878da13 100644
--- a/Octokit.Reactive/Octokit.Reactive-MonoAndroid.csproj
+++ b/Octokit.Reactive/Octokit.Reactive-MonoAndroid.csproj
@@ -177,6 +177,8 @@
+
+
diff --git a/Octokit.Reactive/Octokit.Reactive-Monotouch.csproj b/Octokit.Reactive/Octokit.Reactive-Monotouch.csproj
index 616d3ad0d3..ce3efdbed0 100644
--- a/Octokit.Reactive/Octokit.Reactive-Monotouch.csproj
+++ b/Octokit.Reactive/Octokit.Reactive-Monotouch.csproj
@@ -173,6 +173,8 @@
+
+
diff --git a/Octokit.Reactive/Octokit.Reactive.csproj b/Octokit.Reactive/Octokit.Reactive.csproj
index 0841fbb46e..607a71eb74 100644
--- a/Octokit.Reactive/Octokit.Reactive.csproj
+++ b/Octokit.Reactive/Octokit.Reactive.csproj
@@ -75,12 +75,14 @@
Properties\SolutionInfo.cs
+
+
diff --git a/Octokit.Tests.Integration/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs b/Octokit.Tests.Integration/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs
new file mode 100644
index 0000000000..2180397598
--- /dev/null
+++ b/Octokit.Tests.Integration/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs
@@ -0,0 +1,106 @@
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using Octokit;
+using Octokit.Tests.Integration;
+using Octokit.Tests.Integration.Helpers;
+using Xunit;
+
+public class EnterpriseSearchIndexingClientTests
+{
+ readonly IGitHubClient _github;
+
+ public EnterpriseSearchIndexingClientTests()
+ {
+ _github = EnterpriseHelper.GetAuthenticatedClient();
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueOwner()
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.Queue(EnterpriseHelper.UserName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.Queue(EnterpriseHelper.UserName, context.RepositoryName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAll()
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.QueueAll(EnterpriseHelper.UserName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllCodeOwner()
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.QueueAllCode(EnterpriseHelper.UserName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllCodeRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.QueueAllCode(EnterpriseHelper.UserName, context.RepositoryName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllIssuesOwner()
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.QueueAllIssues(EnterpriseHelper.UserName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("were added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllIssuesRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var response = await
+ _github.Enterprise.SearchIndexing.QueueAllIssues(EnterpriseHelper.UserName, context.RepositoryName);
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("were added to the indexing queue")));
+ }
+ }
+}
diff --git a/Octokit.Tests.Integration/Helpers/ObservableGithubClientExtensions.cs b/Octokit.Tests.Integration/Helpers/ObservableGithubClientExtensions.cs
new file mode 100644
index 0000000000..8a5919ade6
--- /dev/null
+++ b/Octokit.Tests.Integration/Helpers/ObservableGithubClientExtensions.cs
@@ -0,0 +1,31 @@
+using Octokit.Reactive;
+using System.Threading.Tasks;
+using System.Reactive.Linq;
+
+namespace Octokit.Tests.Integration.Helpers
+{
+ internal static class ObservableGithubClientExtensions
+ {
+ internal async static Task CreateRepositoryContext(this IObservableGitHubClient client, string repositoryName)
+ {
+ var repoName = Helper.MakeNameWithTimestamp(repositoryName);
+ var repo = await client.Repository.Create(new NewRepository(repoName) { AutoInit = true });
+
+ return new RepositoryContext(repo);
+ }
+
+ internal async static Task CreateRepositoryContext(this IObservableGitHubClient client, string organizationLogin, NewRepository newRepository)
+ {
+ var repo = await client.Repository.Create(organizationLogin, newRepository);
+
+ return new RepositoryContext(repo);
+ }
+
+ internal async static Task CreateRepositoryContext(this IObservableGitHubClient client, NewRepository newRepository)
+ {
+ var repo = await client.Repository.Create(newRepository);
+
+ return new RepositoryContext(repo);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
index 7781ebbcaf..d8df0040de 100644
--- a/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
+++ b/Octokit.Tests.Integration/Octokit.Tests.Integration.csproj
@@ -79,6 +79,7 @@
+
@@ -111,6 +112,7 @@
+
@@ -126,6 +128,7 @@
+
diff --git a/Octokit.Tests.Integration/Reactive/Enterprise/ObservableEnterpriseSearchIndexingClientTests.cs b/Octokit.Tests.Integration/Reactive/Enterprise/ObservableEnterpriseSearchIndexingClientTests.cs
new file mode 100644
index 0000000000..b741fec91d
--- /dev/null
+++ b/Octokit.Tests.Integration/Reactive/Enterprise/ObservableEnterpriseSearchIndexingClientTests.cs
@@ -0,0 +1,108 @@
+using System.Linq;
+using System.Reactive.Linq;
+using System.Threading.Tasks;
+using Octokit.Reactive;
+using Octokit.Tests.Integration.Helpers;
+using Xunit;
+
+namespace Octokit.Tests.Integration
+{
+ public class ObservableEnterpriseSearchIndexingClientTests
+ {
+ readonly IObservableGitHubClient _github;
+
+ public ObservableEnterpriseSearchIndexingClientTests()
+ {
+ _github = new ObservableGitHubClient(EnterpriseHelper.GetAuthenticatedClient());
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueOwner()
+ {
+ var observable = _github.Enterprise.SearchIndexing.Queue(EnterpriseHelper.UserName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var observable = _github.Enterprise.SearchIndexing.Queue(EnterpriseHelper.UserName, context.RepositoryName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAll()
+ {
+ var observable = _github.Enterprise.SearchIndexing.QueueAll(EnterpriseHelper.UserName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllCodeOwner()
+ {
+ var observable = _github.Enterprise.SearchIndexing.QueueAllCode(EnterpriseHelper.UserName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllCodeRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var observable = _github.Enterprise.SearchIndexing.QueueAllCode(EnterpriseHelper.UserName, context.RepositoryName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("was added to the indexing queue")));
+ }
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllIssuesOwner()
+ {
+ var observable = _github.Enterprise.SearchIndexing.QueueAllIssues(EnterpriseHelper.UserName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("were added to the indexing queue")));
+ }
+
+ [GitHubEnterpriseTest]
+ public async Task CanQueueAllIssuesRepository()
+ {
+ var newRepository = new NewRepository(Helper.MakeNameWithTimestamp("public-repo"));
+ using (var context = await _github.CreateRepositoryContext(newRepository))
+ {
+ var observable = _github.Enterprise.SearchIndexing.QueueAllIssues(EnterpriseHelper.UserName, context.RepositoryName);
+ var response = await observable;
+
+ Assert.NotNull(response);
+ Assert.NotNull(response.Message);
+ Assert.True(response.Message.All(m => m.Contains("were added to the indexing queue")));
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Octokit.Tests/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs b/Octokit.Tests/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs
new file mode 100644
index 0000000000..e347c005ed
--- /dev/null
+++ b/Octokit.Tests/Clients/Enterprise/EnterpriseSearchIndexingClientTests.cs
@@ -0,0 +1,198 @@
+using System;
+using System.Threading.Tasks;
+using NSubstitute;
+using Xunit;
+
+namespace Octokit.Tests.Clients
+{
+ public class EnterpriseSearchIndexingClientTests
+ {
+ public class TheQueueMethod
+ {
+ [Fact]
+ public void RequestsCorrectUrl()
+ {
+ var connection = Substitute.For();
+ var client = new EnterpriseSearchIndexingClient(connection);
+
+ string expectedUri = "staff/indexing_jobs";
+
+ client.Queue("org");
+ connection.Received().Post(Arg.Is(u => u.ToString() == expectedUri), Arg.Any
\ No newline at end of file
diff --git a/Octokit/Octokit-MonoAndroid.csproj b/Octokit/Octokit-MonoAndroid.csproj
index d865a56ae1..ca3641e9d8 100644
--- a/Octokit/Octokit-MonoAndroid.csproj
+++ b/Octokit/Octokit-MonoAndroid.csproj
@@ -450,6 +450,11 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Octokit/Octokit-Monotouch.csproj b/Octokit/Octokit-Monotouch.csproj
index 0788df85b4..9b911c8719 100644
--- a/Octokit/Octokit-Monotouch.csproj
+++ b/Octokit/Octokit-Monotouch.csproj
@@ -446,6 +446,11 @@
+
+
+
+
+
diff --git a/Octokit/Octokit-Portable.csproj b/Octokit/Octokit-Portable.csproj
index 974475ebf5..54301735c3 100644
--- a/Octokit/Octokit-Portable.csproj
+++ b/Octokit/Octokit-Portable.csproj
@@ -439,7 +439,11 @@
-
+
+
+
+
+
diff --git a/Octokit/Octokit-netcore45.csproj b/Octokit/Octokit-netcore45.csproj
index 359b023b97..4727643229 100644
--- a/Octokit/Octokit-netcore45.csproj
+++ b/Octokit/Octokit-netcore45.csproj
@@ -446,7 +446,11 @@
-
+
+
+
+
+
diff --git a/Octokit/Octokit.csproj b/Octokit/Octokit.csproj
index bc8fea372d..d293cab7a5 100644
--- a/Octokit/Octokit.csproj
+++ b/Octokit/Octokit.csproj
@@ -62,10 +62,12 @@
+
+
@@ -110,13 +112,14 @@
-
+
+
@@ -147,6 +150,7 @@
+