using System.Collections.Generic;
using System.Threading.Tasks;
namespace Octokit
{
///
/// A client for GitHub's Repository Pages API.
///
///
/// See the Repository Pages API documentation for more information.
///
public class RepositoryPagesClient : ApiClient, IRepositoryPagesClient
{
///
/// Initializes a new GitHub Repository Pages API client.
///
/// An API connection.
public RepositoryPagesClient(IApiConnection apiConnection) : base(apiConnection)
{
}
///
/// Gets the page metadata for a given repository
///
/// The owner of the repository
/// The name of the repository
///
/// See the API documentation for more information.
///
///
public Task Get(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return ApiConnection.Get(ApiUrls.RepositoryPage(owner, repositoryName));
}
///
/// Gets all build metadata for a given repository
///
/// The owner of the repository
/// The name of the repository
///
/// See the API documentation for more information.
///
///
public Task> GetAll(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return ApiConnection.GetAll(ApiUrls.RepositoryPageBuilds(owner, repositoryName));
}
///
/// Gets the build metadata for the last build for a given repository
///
/// The owner of the repository
/// The name of the repository
///
/// See the API documentation for more information.
///
///
public Task GetLatest(string owner, string repositoryName)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(repositoryName, "repositoryName");
return ApiConnection.Get(ApiUrls.RepositoryPageBuildsLatest(owner, repositoryName));
}
}
}