Merge pull request #200 from fffej/DocComments

Start the process of Doc Comment the entire API (Issue #196)
This commit is contained in:
Phil Haack
2013-11-08 08:56:15 -08:00
6 changed files with 147 additions and 0 deletions
@@ -13,6 +13,16 @@ namespace Octokit.Reactive
_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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -22,6 +32,16 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -64,6 +64,12 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -72,11 +78,26 @@ namespace Octokit.Reactive
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()
{
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)
{
Ensure.ArgumentNotNullOrEmptyString(login, "login");
@@ -84,6 +105,13 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(organization, "organization");
@@ -91,6 +119,12 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -99,6 +133,12 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -107,6 +147,14 @@ namespace Octokit.Reactive
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; }
}
}
@@ -14,6 +14,16 @@ namespace Octokit.Reactive
_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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -23,6 +33,16 @@ namespace Octokit.Reactive
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)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -17,6 +17,10 @@ namespace Octokit.Reactive
_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)
{
Ensure.ArgumentNotNull(login, "login");
@@ -24,11 +28,22 @@ namespace Octokit.Reactive
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()
{
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)
{
Ensure.ArgumentNotNull(user, "user");
@@ -36,6 +51,10 @@ namespace Octokit.Reactive
return _client.Update(user).ToObservable();
}
/// <summary>
/// Returns emails for the current user.
/// </summary>
/// <returns></returns>
public IObservable<EmailAddress> GetEmails()
{
return _connection.GetAndFlattenAllPages<EmailAddress>(ApiUrls.Emails());
+20
View File
@@ -9,6 +9,16 @@ namespace Octokit
{
}
/// <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 Task<Commit> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -18,6 +28,16 @@ namespace Octokit
return ApiConnection.Get<Commit>(ApiUrls.Commit(owner, name, reference));
}
/// <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 Task<Commit> Create(string owner, string name, NewCommit commit)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
+20
View File
@@ -9,6 +9,16 @@ namespace Octokit
{
}
/// <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 Task<GitTag> Get(string owner, string name, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
@@ -18,6 +28,16 @@ namespace Octokit
return ApiConnection.Get<GitTag>(ApiUrls.Tag(owner, name, reference));
}
/// <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 Task<GitTag> Create(string owner, string name, NewTag tag)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");