using System.Threading.Tasks; namespace Octokit { public class RepositoryContentsClient : ApiClient, IRepositoryContentsClient { public RepositoryContentsClient(IApiConnection apiConnection) : base(apiConnection) { } /// /// Gets the preferred README for the specified repository. /// /// /// See the API documentation for more information. /// /// The owner of the repository /// The name of the repository /// Thrown when a general API error occurs. /// public async Task GetReadme(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); var endpoint = ApiUrls.RepositoryReadme(owner, name); var readmeInfo = await ApiConnection.Get(endpoint, null).ConfigureAwait(false); return new Readme(readmeInfo, ApiConnection); } /// /// Gets the perferred README's HTML for the specified repository. /// /// /// See the API documentation for more information. /// /// The owner of the repository /// The name of the repository /// Thrown when a general API error occurs. /// public Task GetReadmeHtml(string owner, string name) { Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(name, "name"); return ApiConnection.GetHtml(ApiUrls.RepositoryReadme(owner, name), null); } } }