Implement observable repository content client

This commit is contained in:
Haacked
2014-12-31 10:53:09 -08:00
parent 2b98962c80
commit 0876fd3902
7 changed files with 160 additions and 2 deletions

View File

@@ -1,7 +1,11 @@
using System;
using System.Reactive;
namespace Octokit.Reactive
{
/// <summary>
/// Client for accessing contents of files within a repository as base64 encoded content.
/// </summary>
public interface IObservableRepositoryContentsClient
{
/// <summary>
@@ -19,5 +23,48 @@ namespace Octokit.Reactive
/// <param name="name">The name of the repository</param>
/// <returns></returns>
IObservable<string> GetReadmeHtml(string owner, string name);
/// <summary>
/// Returns the contents of a file or directory in a repository.
/// </summary>
/// <remarks>
/// If given a path to a single file, this method returns a collection containing only that file.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="path">The content path</param>
/// <returns>
/// A collection of <see cref="RepositoryContent"/> representing the content at the specified path
/// </returns>
IObservable<RepositoryContent> GetContents(string owner, string name, string path);
/// <summary>
/// Creates a commit that creates a new file in a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="path">The path to the file</param>
/// <param name="request">Information about the file to create</param>
/// <returns></returns>
IObservable<RepositoryContentChangeSet> CreateFile(string owner, string name, string path, CreateFileRequest request);
/// <summary>
/// Creates a commit that updates the contents of a file in a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="path">The path to the file</param>
/// <param name="request">Information about the file to update</param>
/// <returns>The updated content</returns>
IObservable<RepositoryContentChangeSet> UpdateFile(string owner, string name, string path, UpdateFileRequest request);
/// <summary>
/// Creates a commit that deletes a file in a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="path">The path to the file</param>
/// <param name="request">Information about the file to delete</param>
IObservable<Unit> DeleteFile(string owner, string name, string path, DeleteFileRequest request);
}
}