Removed legacy URL, minor XML-doc tweaks

This commit is contained in:
Kristian Hellang
2014-12-10 01:08:29 +01:00
parent ebdd19fea4
commit e76df1c40c
5 changed files with 36 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ namespace Octokit.Reactive
/// <returns></returns>
public IObservable<CommitStatus> GetAll(string owner, string name, string reference)
{
return _connection.GetAndFlattenAllPages<CommitStatus>(ApiUrls.CommitStatus(owner, name, reference));
return _connection.GetAndFlattenAllPages<CommitStatus>(ApiUrls.CommitStatuses(owner, name, reference));
}
/// <summary>

View File

@@ -20,7 +20,7 @@ namespace Octokit.Tests.Clients
client.GetAll("fake", "repo", "sha");
connection.Received()
.GetAll<CommitStatus>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/statuses/sha"), null);
.GetAll<CommitStatus>(Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/commits/sha/statuses"));
}
[Fact]

View File

@@ -23,7 +23,9 @@ namespace Octokit
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
@@ -34,18 +36,16 @@ namespace Octokit
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
// This is currently a preview feature of the API and is subject to change
// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
return ApiConnection.GetAll<CommitStatus>(
ApiUrls.CommitStatus(owner, name, reference),
null);
return ApiConnection.GetAll<CommitStatus>(ApiUrls.CommitStatuses(owner, name, reference));
}
/// <summary>
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
@@ -62,6 +62,9 @@ namespace Octokit
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#create-a-status
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
@@ -74,11 +77,7 @@ namespace Octokit
Ensure.ArgumentNotNullOrEmptyString(reference, "reference");
Ensure.ArgumentNotNull(commitStatus, "commitStatus");
// This is currently a preview feature of the API and is subject to change
// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
return ApiConnection.Post<CommitStatus>(
ApiUrls.CommitStatus(owner, name, reference),
commitStatus);
return ApiConnection.Post<CommitStatus>(ApiUrls.CreateCommitStatus(owner, name, reference), commitStatus);
}
}
}

View File

@@ -15,7 +15,9 @@ namespace Octokit
/// Retrieves commit statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
@@ -26,7 +28,9 @@ namespace Octokit
/// Retrieves a combined view of statuses for the specified reference. A reference can be a commit SHA, a branch name, or
/// a tag name.
/// </summary>
/// <remarks>Only users with pull access can see this.</remarks>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
@@ -36,6 +40,9 @@ namespace Octokit
/// <summary>
/// Creates a commit status for the specified ref.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/repos/statuses/#create-a-status
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>

View File

@@ -543,6 +543,18 @@ namespace Octokit
return "repos/{0}/{1}/milestones/{2}/labels".FormatUri(owner, repo, number);
}
/// <summary>
/// Returns the <see cref="Uri"/> to use when creating a commit status for the specified reference.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
public static Uri CreateCommitStatus(string owner, string name, string reference)
{
return "repos/{0}/{1}/statuses/{2}".FormatUri(owner, name, reference);
}
/// <summary>
/// Returns the <see cref="Uri"/> that lists the commit statuses for the specified reference.
/// </summary>
@@ -550,9 +562,9 @@ namespace Octokit
/// <param name="name">The name of the repository</param>
/// <param name="reference">The reference (SHA, branch name, or tag name) to list commits for</param>
/// <returns></returns>
public static Uri CommitStatus(string owner, string name, string reference)
public static Uri CommitStatuses(string owner, string name, string reference)
{
return "repos/{0}/{1}/statuses/{2}".FormatUri(owner, name, reference);
return "repos/{0}/{1}/commits/{2}/statuses".FormatUri(owner, name, reference);
}
/// <summary>