Create now returns blob reference.

This commit is contained in:
pltaylor
2013-11-13 19:59:17 -05:00
parent cf31e1da02
commit c6807ce418
6 changed files with 16 additions and 5 deletions
@@ -27,6 +27,6 @@ namespace Octokit.Reactive
/// <param name="name">The name of the repository</param>
/// <param name="newBlob">The new Blob</param>
/// <returns>The <see cref="Blob"/> that was just created.</returns>
IObservable<Blob> Create(string owner, string name, NewBlob newBlob);
IObservable<BlobReference> Create(string owner, string name, NewBlob newBlob);
}
}
@@ -43,7 +43,7 @@ namespace Octokit.Reactive
/// <param name="name">The name of the repository</param>
/// <param name="newBlob">The new Blob</param>
/// <returns>The <see cref="Blob"/> that was just created.</returns>
public IObservable<Blob> Create(string owner, string name, NewBlob newBlob)
public IObservable<BlobReference> Create(string owner, string name, NewBlob newBlob)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
+2 -2
View File
@@ -38,13 +38,13 @@ namespace Octokit
/// <param name="name">The name of the repository</param>
/// <param name="newBlob">The new Blob</param>
/// <returns>The <see cref="Blob"/> that was just created.</returns>
public Task<Blob> Create(string owner, string name, NewBlob newBlob)
public Task<BlobReference> Create(string owner, string name, NewBlob newBlob)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.ArgumentNotNull(newBlob, "newBlob");
return ApiConnection.Post<Blob>(ApiUrls.Blob(owner, name), newBlob);
return ApiConnection.Post<BlobReference>(ApiUrls.Blob(owner, name), newBlob);
}
}
}
+1 -1
View File
@@ -27,6 +27,6 @@ namespace Octokit
/// <param name="name">The name of the repository</param>
/// <param name="newBlob">The new Blob</param>
/// <returns>The <see cref="Blob"/> that was just created.</returns>
Task<Blob> Create(string owner, string name, NewBlob newBlob);
Task<BlobReference> Create(string owner, string name, NewBlob newBlob);
}
}
+10
View File
@@ -0,0 +1,10 @@
namespace Octokit
{
public class BlobReference
{
/// <summary>
/// The SHA of the blob.
/// </summary>
public string Sha { get; set; }
}
}
+1
View File
@@ -53,6 +53,7 @@
<Link>Properties\SolutionInfo.cs</Link>
</Compile>
<Compile Include="Clients\ActivitiesClient.cs" />
<Compile Include="Models\Response\BlobReference.cs" />
<Compile Include="Clients\IBlobsClient.cs" />
<Compile Include="Models\Request\NewBlob.cs" />
<Compile Include="Models\Response\Blob.cs" />