mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-18 05:05:14 +00:00
The old implementation would actually retrieve the entire HTML page where the README is located. We want to simply make the same request with a different ACCEPT header so we can retrieve the portion of the README html that we'd actually want to display.
76 lines
3.5 KiB
C#
76 lines
3.5 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
namespace Octokit.Reactive
|
|
{
|
|
public interface IObservableRepositoriesClient
|
|
{
|
|
/// <summary>
|
|
/// Creates a new repository for the current user.
|
|
/// </summary>
|
|
/// <param name="newRepository">A <see cref="NewRepository"/> instance describing the new repository to create</param>
|
|
/// <returns>An <see cref="IObservable{Repository}"/> instance for the created repository</returns>
|
|
IObservable<Repository> Create(NewRepository newRepository);
|
|
|
|
/// <summary>
|
|
/// Retrieves the <see cref="Repository"/> for the specified owner and name.
|
|
/// </summary>
|
|
/// <param name="owner">The owner of the repository.</param>
|
|
/// <param name="name">The name of the repository.</param>
|
|
/// <returns>A <see cref="Repository"/></returns>
|
|
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")]
|
|
IObservable<Repository> Get(string owner, string name);
|
|
|
|
/// <summary>
|
|
/// Retrieves every <see cref="Repository"/> that belongs to the current user.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The default page size on GitHub.com is 30.
|
|
/// </remarks>
|
|
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
|
|
/// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
|
|
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
|
|
Justification = "Makes a network request")]
|
|
IObservable<IReadOnlyList<Repository>> GetAllForCurrent();
|
|
|
|
/// <summary>
|
|
/// Retrieves every <see cref="Repository"/> that belongs to the specified user.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The default page size on GitHub.com is 30.
|
|
/// </remarks>
|
|
/// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
|
|
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
|
|
Justification = "Makes a network request")]
|
|
IObservable<IReadOnlyList<Repository>> GetAllForUser(string login);
|
|
|
|
/// <summary>
|
|
/// Retrieves every <see cref="Repository"/> that belongs to the specified organization.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// The default page size on GitHub.com is 30.
|
|
/// </remarks>
|
|
/// <returns>A <see cref="IReadOnlyPagedCollection{Repository}"/> of <see cref="Repository"/>.</returns>
|
|
[SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",
|
|
Justification = "Makes a network request")]
|
|
IObservable<IReadOnlyList<Repository>> GetAllForOrg(string organization);
|
|
|
|
/// <summary>
|
|
/// Returns the HTML rendered README.
|
|
/// </summary>
|
|
/// <param name="owner">The owner of the repository.</param>
|
|
/// <param name="name">The name of the repository.</param>
|
|
/// <returns></returns>
|
|
IObservable<Readme> GetReadme(string owner, string name);
|
|
|
|
/// <summary>
|
|
/// Returns just the HTML portion of the README without the surrounding HTML document.
|
|
/// </summary>
|
|
/// <param name="owner">The owner of the repository.</param>
|
|
/// <param name="name">The name of the repository.</param>
|
|
/// <returns></returns>
|
|
IObservable<string> GetReadmeHtml(string owner, string name);
|
|
}
|
|
}
|