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
+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));
}
}
}