mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-08 20:45:51 +00:00
Removes integer overload
Plus extra ensures
This commit is contained in:
@@ -96,18 +96,6 @@ namespace Octokit.Reactive
|
||||
/// <returns>A promise, containing the binary contents of the archive</returns>
|
||||
IObservable<byte[]> GetArchive(string owner, string name, 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"> Timeout in minutes </param>
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, int timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Get an archive of a given repository's contents, in a specific format
|
||||
/// </summary>
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace Octokit.Reactive
|
||||
/// <returns>A promise, containing the binary contents of the archive</returns>
|
||||
public IObservable<byte[]> GetArchive(string owner, string name)
|
||||
{
|
||||
return _client.Repository.Content.GetArchive(owner, name).ToObservable();
|
||||
return GetArchive(owner, name, ArchiveFormat.Tarball);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -104,7 +104,7 @@ namespace Octokit.Reactive
|
||||
/// <returns>A promise, containing the binary contents of the archive</returns>
|
||||
public IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat)
|
||||
{
|
||||
return _client.Repository.Content.GetArchive(owner, name, archiveFormat).ToObservable();
|
||||
return GetArchive(owner, name, archiveFormat, string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -139,7 +139,7 @@ namespace Octokit.Reactive
|
||||
/// <returns>A promise, containing the binary contents of the archive</returns>
|
||||
public IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference)
|
||||
{
|
||||
return _client.Repository.Content.GetArchive(owner, name, archiveFormat, reference).ToObservable();
|
||||
return GetArchive(owner, name, archiveFormat, reference, TimeSpan.FromMinutes(60));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -165,21 +165,6 @@ namespace Octokit.Reactive
|
||||
.GetAndFlattenAllPages<RepositoryContent>(ApiUrls.RepositoryContent(owner, name, path));
|
||||
}
|
||||
|
||||
/// <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"> Timeout in minutes </param>
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
public IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, int timeout)
|
||||
{
|
||||
return _client.Repository.Content.GetArchive(owner, name, archiveFormat, reference, timeout).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get an archive of a given repository's contents, in a specific format
|
||||
/// </summary>
|
||||
@@ -192,6 +177,10 @@ namespace Octokit.Reactive
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
public IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, TimeSpan timeout)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.GreaterThanZero(timeout, "timeout");
|
||||
|
||||
return _client.Repository.Content.GetArchive(owner, name, archiveFormat, reference, timeout).ToObservable();
|
||||
}
|
||||
|
||||
|
||||
@@ -137,18 +137,6 @@ namespace Octokit
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
Task<byte[]> GetArchive(string owner, string name, 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"> Timeout in minutes </param>
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, int timeout);
|
||||
|
||||
/// <summary>
|
||||
/// Get an archive of a given repository's contents, in a specific format
|
||||
/// </summary>
|
||||
|
||||
@@ -188,21 +188,6 @@ namespace Octokit
|
||||
/// <param name="reference">A valid Git reference.</param>
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
public Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference)
|
||||
{
|
||||
return GetArchive(owner, name, archiveFormat, string.Empty, 60);
|
||||
}
|
||||
|
||||
/// <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"> Timeout in minutes </param>
|
||||
/// <returns>The binary contents of the archive</returns>
|
||||
public Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, int timeout)
|
||||
{
|
||||
return GetArchive(owner, name, archiveFormat, string.Empty, TimeSpan.FromMinutes(60));
|
||||
}
|
||||
@@ -221,6 +206,7 @@ namespace Octokit
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.GreaterThanZero(timeout, "timeout");
|
||||
|
||||
var endpoint = ApiUrls.RepositoryArchiveLink(owner, name, archiveFormat, reference);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user