Copy comments from base

This commit is contained in:
=
2013-11-08 13:30:17 +00:00
parent feeefd8ba7
commit d95e8a4798
4 changed files with 107 additions and 0 deletions

View File

@@ -13,6 +13,16 @@ namespace Octokit.Reactive
_client = client.GitDatabase.Commit; _client = client.GitDatabase.Commit;
} }
/// <summary>
/// Gets a commit for a given repository by sha reference
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/commits/#get-a-commit
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">Tha sha reference of the commit</param>
/// <returns></returns>
public IObservable<Commit> Get(string owner, string name, string reference) public IObservable<Commit> Get(string owner, string name, string reference)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -22,6 +32,16 @@ namespace Octokit.Reactive
return _client.Get(owner, name, reference).ToObservable(); return _client.Get(owner, name, reference).ToObservable();
} }
/// <summary>
/// Create a commit for a given repository
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/commits/#create-a-commit
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="commit">The commit to create</param>
/// <returns></returns>
public IObservable<Commit> Create(string owner, string name, NewCommit commit) public IObservable<Commit> Create(string owner, string name, NewCommit commit)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");

View File

@@ -64,6 +64,12 @@ namespace Octokit.Reactive
return _client.Delete(owner, name).ToObservable(); return _client.Delete(owner, name).ToObservable();
} }
/// <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>
public IObservable<Repository> Get(string owner, string name) public IObservable<Repository> Get(string owner, string name)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -72,11 +78,26 @@ namespace Octokit.Reactive
return _client.Get(owner, name).ToObservable(); return _client.Get(owner, name).ToObservable();
} }
/// <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>
public IObservable<Repository> GetAllForCurrent() public IObservable<Repository> GetAllForCurrent()
{ {
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.Repositories()); return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.Repositories());
} }
/// <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>
public IObservable<Repository> GetAllForUser(string login) public IObservable<Repository> GetAllForUser(string login)
{ {
Ensure.ArgumentNotNullOrEmptyString(login, "login"); Ensure.ArgumentNotNullOrEmptyString(login, "login");
@@ -84,6 +105,13 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.Repositories(login)); return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.Repositories(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>
public IObservable<Repository> GetAllForOrg(string organization) public IObservable<Repository> GetAllForOrg(string organization)
{ {
Ensure.ArgumentNotNullOrEmptyString(organization, "organization"); Ensure.ArgumentNotNullOrEmptyString(organization, "organization");
@@ -91,6 +119,12 @@ namespace Octokit.Reactive
return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.OrganizationRepositories(organization)); return _connection.GetAndFlattenAllPages<Repository>(ApiUrls.OrganizationRepositories(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>
public IObservable<Readme> GetReadme(string owner, string name) public IObservable<Readme> GetReadme(string owner, string name)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -99,6 +133,12 @@ namespace Octokit.Reactive
return _client.GetReadme(owner, name).ToObservable(); return _client.GetReadme(owner, name).ToObservable();
} }
/// <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>
public IObservable<string> GetReadmeHtml(string owner, string name) public IObservable<string> GetReadmeHtml(string owner, string name)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -107,6 +147,14 @@ namespace Octokit.Reactive
return _client.GetReadmeHtml(owner, name).ToObservable(); return _client.GetReadmeHtml(owner, name).ToObservable();
} }
/// <summary>
/// A client for GitHub's Commit Status API.
/// </summary>
/// <remarks>
/// See the <a href="http://developer.github.com/v3/repos/statuses/">Commit Status API documentation</a> for more
/// details. Also check out the <a href="https://github.com/blog/1227-commit-status-api">blog post</a>
/// that announced this feature.
/// </remarks>
public IObservableCommitStatusClient CommitStatus { get; private set; } public IObservableCommitStatusClient CommitStatus { get; private set; }
} }
} }

View File

@@ -14,6 +14,16 @@ namespace Octokit.Reactive
_client = client.GitDatabase.Tag; _client = client.GitDatabase.Tag;
} }
/// <summary>
/// Gets a tag for a given repository by sha reference
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/tags/#get-a-tag
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">Tha sha reference of the tag</param>
/// <returns></returns>
public IObservable<GitTag> Get(string owner, string name, string reference) public IObservable<GitTag> Get(string owner, string name, string reference)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -23,6 +33,16 @@ namespace Octokit.Reactive
return _client.Get(owner, name, reference).ToObservable(); return _client.Get(owner, name, reference).ToObservable();
} }
/// <summary>
/// Create a tag for a given repository
/// </summary>
/// <remarks>
/// http://developer.github.com/v3/git/tags/#create-a-tag-object
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="tag">The tag to create</param>
/// <returns></returns>
public IObservable<GitTag> Create(string owner, string name, NewTag tag) public IObservable<GitTag> Create(string owner, string name, NewTag tag)
{ {
Ensure.ArgumentNotNullOrEmptyString(owner, "owner"); Ensure.ArgumentNotNullOrEmptyString(owner, "owner");

View File

@@ -17,6 +17,10 @@ namespace Octokit.Reactive
_connection = client.Connection; _connection = client.Connection;
} }
/// <summary>
/// Returns the user specified by the login.
/// </summary>
/// <param name="login">The login name for the user</param>
public IObservable<User> Get(string login) public IObservable<User> Get(string login)
{ {
Ensure.ArgumentNotNull(login, "login"); Ensure.ArgumentNotNull(login, "login");
@@ -24,11 +28,22 @@ namespace Octokit.Reactive
return _client.Get(login).ToObservable(); return _client.Get(login).ToObservable();
} }
/// <summary>
/// Returns a <see cref="User"/> for the current authenticated user.
/// </summary>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns>
public IObservable<User> Current() public IObservable<User> Current()
{ {
return _client.Current().ToObservable(); return _client.Current().ToObservable();
} }
/// <summary>
/// Update the specified <see cref="UserUpdate"/>.
/// </summary>
/// <param name="user">The login for the user</param>
/// <exception cref="AuthorizationException">Thrown if the client is not authenticated.</exception>
/// <returns>A <see cref="User"/></returns>
public IObservable<User> Update(UserUpdate user) public IObservable<User> Update(UserUpdate user)
{ {
Ensure.ArgumentNotNull(user, "user"); Ensure.ArgumentNotNull(user, "user");
@@ -36,6 +51,10 @@ namespace Octokit.Reactive
return _client.Update(user).ToObservable(); return _client.Update(user).ToObservable();
} }
/// <summary>
/// Returns emails for the current user.
/// </summary>
/// <returns></returns>
public IObservable<EmailAddress> GetEmails() public IObservable<EmailAddress> GetEmails()
{ {
return _connection.GetAndFlattenAllPages<EmailAddress>(ApiUrls.Emails()); return _connection.GetAndFlattenAllPages<EmailAddress>(ApiUrls.Emails());