Files
octokit.net/Octokit.Reactive/Clients/IObservableRepositoryContentsClient.cs
Ryan Gribble 3c818934b8 Release v0.24 - A Sight For Sore Eyes (#1539)
* Add release notes and bump version to 0.24

* run "build FormatCode" to fix up whitespace/formatting issues

* Fix failing Ssh key tests due to "validation exception".  This key must be in use on github (under another user, most likely from these tests failing).  Changed to a new SSH key and tweaked tests to reduce chance of a key being created and not destroyed

* Assignee and Assignees cant both be specified on NewIssue.  We missed this one in the PR.  Marked Assignee as [Obsolete] and fixed tests to use Assignees

* Fix a couple of Reactions tests that were calling the wrong client methods

* Fix timeline tests - looks like the response class has changed shape a bit, it now has an Issue object in the payload and Id field isnt present (leaving Id field there in case other timeline events do use it)

* Fix some following tests that require the test user to follow more than 1 other user

* Unskip these Event tests now because apparently they work!

* add breaking changes notes

* Update ApiErrorMessageSafe to return null for empty and whitespace strings (#1540)

* return null if ApiError.Message is empty or whitespace

* Uncomment test, which now passes

* update release notes to include PR1540

* Add "Bot" AccountType, was causing a deserialization exception when running the integration test "SearchForExcludedLanguage" (#1541)

* Update to include PR1541

* add bullets to make release notes easier to read

* markup additional code mentions in notes

* Fix grammar

fields => field
2017-01-17 18:56:55 +10:00

237 lines
13 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Reactive;
namespace Octokit.Reactive
{
/// <summary>
/// Client for accessing contents of files within a repository as base64 encoded content.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/repos/contents/">Repository Contents API documentation</a> for more information.
/// </remarks>
public interface IObservableRepositoryContentsClient
{
/// <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>
IObservable<Readme> GetReadme(string owner, string name);
/// <summary>
/// Returns the HTML rendered README.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
IObservable<Readme> GetReadme(long repositoryId);
/// <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>
IObservable<string> GetReadmeHtml(string owner, string name);
/// <summary>
/// Returns just the HTML portion of the README without the surrounding HTML document.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
IObservable<string> GetReadmeHtml(long repositoryId);
/// <summary>
/// Get an archive of a given repository's contents
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
IObservable<byte[]> GetArchive(string owner, string name);
/// <summary>
/// Get an archive of a given repository's contents
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="repositoryId">The Id of the repository</param>
IObservable<byte[]> GetArchive(long repositoryId);
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat);
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
IObservable<byte[]> GetArchive(long repositoryId, ArchiveFormat archiveFormat);
/// <summary>
/// Get an archive of a given repository's contents, using a specific format and reference
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference);
/// <summary>
/// Get an archive of a given repository's contents, using a specific format and reference
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
IObservable<byte[]> GetArchive(long repositoryId, ArchiveFormat archiveFormat, string reference);
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <param name="timeout"> Time span until timeout </param>
IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, TimeSpan timeout);
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <param name="timeout"> Time span until timeout </param>
IObservable<byte[]> GetArchive(long repositoryId, ArchiveFormat archiveFormat, string reference, TimeSpan timeout);
/// <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>
IObservable<RepositoryContent> GetAllContents(string owner, string name, string path);
/// <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="repositoryId">The Id of the repository</param>
/// <param name="path">The content path</param>
IObservable<RepositoryContent> GetAllContents(long repositoryId, string path);
/// <summary>
/// Returns the contents of the root directory in a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
IObservable<RepositoryContent> GetAllContents(string owner, string name);
/// <summary>
/// Returns the contents of the root directory in a repository.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
IObservable<RepositoryContent> GetAllContents(long repositoryId);
/// <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.
/// See the <a href="https://developer.github.com/v3/repos/contents/#get-contents">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The name of the commit/branch/tag. Default: the repositorys default branch (usually master)</param>
/// <param name="path">The content path</param>
IObservable<RepositoryContent> GetAllContentsByRef(string owner, string name, string reference, string path);
/// <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.
/// See the <a href="https://developer.github.com/v3/repos/contents/#get-contents">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The name of the commit/branch/tag. Default: the repositorys default branch (usually master)</param>
/// <param name="path">The content path</param>
IObservable<RepositoryContent> GetAllContentsByRef(long repositoryId, string reference, string path);
/// <summary>
/// Returns the contents of the home directory in a repository.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The name of the commit/branch/tag. Default: the repositorys default branch (usually master)</param>
IObservable<RepositoryContent> GetAllContentsByRef(string owner, string name, string reference);
/// <summary>
/// Returns the contents of the home directory in a repository.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The name of the commit/branch/tag. Default: the repositorys default branch (usually master)</param>
IObservable<RepositoryContent> GetAllContentsByRef(long repositoryId, string reference);
/// <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>
IObservable<RepositoryContentChangeSet> CreateFile(string owner, string name, string path, CreateFileRequest request);
/// <summary>
/// Creates a commit that creates a new file in a repository.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="path">The path to the file</param>
/// <param name="request">Information about the file to create</param>
IObservable<RepositoryContentChangeSet> CreateFile(long repositoryId, 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>
IObservable<RepositoryContentChangeSet> UpdateFile(string owner, string name, string path, UpdateFileRequest request);
/// <summary>
/// Creates a commit that updates the contents of a file in a repository.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="path">The path to the file</param>
/// <param name="request">Information about the file to update</param>
IObservable<RepositoryContentChangeSet> UpdateFile(long repositoryId, 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);
/// <summary>
/// Creates a commit that deletes a file in a repository.
/// </summary>
/// <param name="repositoryId">The Id 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(long repositoryId, string path, DeleteFileRequest request);
}
}