added new overloads

This commit is contained in:
aedampir@gmail.com
2016-06-09 17:43:08 +07:00
parent 9859faeb0e
commit 36d7d2cf24
4 changed files with 195 additions and 0 deletions
@@ -23,6 +23,17 @@ namespace Octokit.Reactive
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<Page> Get(string owner, string name);
/// <summary>
/// Gets the page metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{Page}"/> of <see cref="Page"/> representing page metadata of specified repository.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
IObservable<Page> Get(int repositoryId);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -34,6 +45,16 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetAll(string owner, string name);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetAll(int repositoryId);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -46,6 +67,17 @@ namespace Octokit.Reactive
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetAll(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options to change the API response</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetAll(int repositoryId, ApiOptions options);
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
@@ -56,5 +88,15 @@ namespace Octokit.Reactive
/// </remarks>
/// <returns>A <see cref="IObservable{Page}"/> of <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetLatest(string owner, string name);
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-latest-pages-build">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{Page}"/> of <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
IObservable<PagesBuild> GetLatest(int repositoryId);
}
}
@@ -42,6 +42,19 @@ namespace Octokit.Reactive
return _client.Get(owner, name).ToObservable();
}
/// <summary>
/// Gets the page metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{Page}"/> of <see cref="Page"/> representing page metadata of specified repository.</returns>
public IObservable<Page> Get(int repositoryId)
{
return _client.Get(repositoryId).ToObservable();
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -59,6 +72,19 @@ namespace Octokit.Reactive
return GetAll(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
public IObservable<PagesBuild> GetAll(int repositoryId)
{
return GetAll(repositoryId, ApiOptions.None);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -78,6 +104,22 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<PagesBuild>(ApiUrls.RepositoryPageBuilds(owner, name), options);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options to change the API response</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
public IObservable<PagesBuild> GetAll(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
return _connection.GetAndFlattenAllPages<PagesBuild>(ApiUrls.RepositoryPageBuilds(repositoryId), options);
}
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
@@ -94,5 +136,18 @@ namespace Octokit.Reactive
return _client.GetLatest(owner, name).ToObservable();
}
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-latest-pages-build">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IObservable{Page}"/> of <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
public IObservable<PagesBuild> GetLatest(int repositoryId)
{
return _client.GetLatest(repositoryId).ToObservable();
}
}
}
+42
View File
@@ -24,6 +24,17 @@ namespace Octokit
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
Task<Page> Get(string owner, string name);
/// <summary>
/// Gets the page metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="Page"/> representing page metadata of specified repository.</returns>
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
Task<Page> Get(int repositoryId);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -35,6 +46,16 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
Task<IReadOnlyList<PagesBuild>> GetAll(string owner, string name);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
Task<IReadOnlyList<PagesBuild>> GetAll(int repositoryId);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -47,6 +68,17 @@ namespace Octokit
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
Task<IReadOnlyList<PagesBuild>> GetAll(string owner, string name, ApiOptions options);
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options to change the API response</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
Task<IReadOnlyList<PagesBuild>> GetAll(int repositoryId, ApiOptions options);
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
@@ -57,5 +89,15 @@ namespace Octokit
/// </remarks>
/// <returns>A <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
Task<PagesBuild> GetLatest(string owner, string name);
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-latest-pages-build">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
Task<PagesBuild> GetLatest(int repositoryId);
}
}
+56
View File
@@ -36,6 +36,19 @@ namespace Octokit
return ApiConnection.Get<Page>(ApiUrls.RepositoryPage(owner, name));
}
/// <summary>
/// Gets the page metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#get-information-about-a-pages-site">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="Page"/> representing page metadata of specified repository.</returns>
public Task<Page> Get(int repositoryId)
{
return ApiConnection.Get<Page>(ApiUrls.RepositoryPage(repositoryId));
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -53,6 +66,19 @@ namespace Octokit
return GetAll(owner, name, ApiOptions.None);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
public Task<IReadOnlyList<PagesBuild>> GetAll(int repositoryId)
{
return GetAll(repositoryId, ApiOptions.None);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
@@ -73,6 +99,23 @@ namespace Octokit
return ApiConnection.GetAll<PagesBuild>(endpoint, options);
}
/// <summary>
/// Gets all build metadata for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <param name="options">Options to change the API response</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-pages-builds">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="IReadOnlyList{PagesBuild}"/> of <see cref="PagesBuild"/>s representing pages build metadata of specified repository.</returns>
public Task<IReadOnlyList<PagesBuild>> GetAll(int repositoryId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, "options");
var endpoint = ApiUrls.RepositoryPageBuilds(repositoryId);
return ApiConnection.GetAll<PagesBuild>(endpoint, options);
}
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
@@ -89,5 +132,18 @@ namespace Octokit
return ApiConnection.Get<PagesBuild>(ApiUrls.RepositoryPageBuildsLatest(owner, name));
}
/// <summary>
/// Gets the build metadata for the last build for a given repository
/// </summary>
/// <param name="repositoryId">The ID of the repository</param>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/pages/#list-latest-pages-build">API documentation</a> for more information.
/// </remarks>
/// <returns>A <see cref="Page"/> representing latest pages build metadata of specified repository.</returns>
public Task<PagesBuild> GetLatest(int repositoryId)
{
return ApiConnection.Get<PagesBuild>(ApiUrls.RepositoryPageBuildsLatest(repositoryId));
}
}
}