mirror of
https://github.com/zoriya/octokit.net.git
synced 2026-06-03 11:05:56 +00:00
added new overloads
This commit is contained in:
@@ -24,6 +24,17 @@ namespace Octokit.Reactive
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
IObservable<Release> GetAll(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
IObservable<Release> GetAll(int repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
@@ -37,6 +48,18 @@ namespace Octokit.Reactive
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
IObservable<Release> GetAll(string owner, string name, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
IObservable<Release> GetAll(int repositoryId, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -51,6 +74,19 @@ namespace Octokit.Reactive
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
|
||||
IObservable<Release> Get(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The <see cref="Release"/> specified by the id</returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
|
||||
IObservable<Release> Get(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -63,6 +99,17 @@ namespace Octokit.Reactive
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
IObservable<Release> GetLatest(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
IObservable<Release> GetLatest(int repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -76,6 +123,18 @@ namespace Octokit.Reactive
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
IObservable<Release> Create(string owner, string name, NewRelease data);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="data">A description of the release to create</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
IObservable<Release> Create(int repositoryId, NewRelease data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -90,6 +149,19 @@ namespace Octokit.Reactive
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
IObservable<Release> Edit(string owner, string name, int id, ReleaseUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <param name="data">A description of the release to edit</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
IObservable<Release> Edit(int repositoryId, int id, ReleaseUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -103,6 +175,18 @@ namespace Octokit.Reactive
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release to delete</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> Delete(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -116,6 +200,18 @@ namespace Octokit.Reactive
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
IObservable<ReleaseAsset> GetAllAssets(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
IObservable<ReleaseAsset> GetAllAssets(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -130,6 +226,19 @@ namespace Octokit.Reactive
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
IObservable<ReleaseAsset> GetAllAssets(string owner, string name, int id, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
IObservable<ReleaseAsset> GetAllAssets(int repositoryId, int id, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Uploads a <see cref="ReleaseAsset"/> for the specified release.
|
||||
/// </summary>
|
||||
@@ -141,7 +250,7 @@ namespace Octokit.Reactive
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="ReleaseAsset"/>.</returns>
|
||||
IObservable<ReleaseAsset> UploadAsset(Release release, ReleaseAssetUpload data);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -154,6 +263,17 @@ namespace Octokit.Reactive
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
IObservable<ReleaseAsset> GetAsset(string owner, string name, int assetId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
IObservable<ReleaseAsset> GetAsset(int repositoryId, int assetId);
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -167,6 +287,18 @@ namespace Octokit.Reactive
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
IObservable<ReleaseAsset> EditAsset(string owner, string name, int assetId, ReleaseAssetUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <param name="data">Description of the asset with its amended data</param>
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
IObservable<ReleaseAsset> EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
@@ -178,5 +310,16 @@ namespace Octokit.Reactive
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> DeleteAsset(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
IObservable<Unit> DeleteAsset(int repositoryId, int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,20 @@ namespace Octokit.Reactive
|
||||
return GetAll(owner, name, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
public IObservable<Release> GetAll(int repositoryId)
|
||||
{
|
||||
return GetAll(repositoryId, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
@@ -62,6 +76,23 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Release>(ApiUrls.Releases(owner, name), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
public IObservable<Release> GetAll(int repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Release>(ApiUrls.Releases(repositoryId), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -81,6 +112,21 @@ namespace Octokit.Reactive
|
||||
return _client.Get(owner, name, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The <see cref="Release"/> specified by the id</returns>
|
||||
public IObservable<Release> Get(int repositoryId, int id)
|
||||
{
|
||||
return _client.Get(repositoryId, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -98,6 +144,21 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.GetLatest(owner, name).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
public IObservable<Release> GetLatest(int repositoryId)
|
||||
{
|
||||
return _client.GetLatest(repositoryId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -118,6 +179,21 @@ namespace Octokit.Reactive
|
||||
return _client.Create(owner, name, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="data">A description of the release to create</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
public IObservable<Release> Create(int repositoryId, NewRelease data)
|
||||
{
|
||||
return _client.Create(repositoryId, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -139,6 +215,24 @@ namespace Octokit.Reactive
|
||||
return _client.Edit(owner, name, id, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <param name="data">A description of the release to edit</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
public IObservable<Release> Edit(int repositoryId, int id, ReleaseUpdate data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
return _client.Edit(repositoryId, id, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -158,6 +252,21 @@ namespace Octokit.Reactive
|
||||
return _client.Delete(owner, name, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release to delete</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(int repositoryId, int id)
|
||||
{
|
||||
return _client.Delete(repositoryId, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -177,6 +286,21 @@ namespace Octokit.Reactive
|
||||
return GetAllAssets(owner, name, id, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
public IObservable<ReleaseAsset> GetAllAssets(int repositoryId, int id)
|
||||
{
|
||||
return GetAllAssets(repositoryId, id, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -198,6 +322,24 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<ReleaseAsset>(ApiUrls.ReleaseAssets(owner, name, id), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
public IObservable<ReleaseAsset> GetAllAssets(int repositoryId, int id, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<ReleaseAsset>(ApiUrls.ReleaseAssets(repositoryId, id), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -217,6 +359,22 @@ namespace Octokit.Reactive
|
||||
return _client.GetAsset(owner, name, assetId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
public IObservable<ReleaseAsset> GetAsset(int repositoryId, int assetId)
|
||||
{
|
||||
Ensure.ArgumentNotNull(assetId, "assetId");
|
||||
|
||||
return _client.GetAsset(repositoryId, assetId).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uploads a <see cref="ReleaseAsset"/> for the specified release.
|
||||
/// </summary>
|
||||
@@ -250,12 +408,28 @@ namespace Octokit.Reactive
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
|
||||
Ensure.ArgumentNotNullOrEmptyString(name, "name");
|
||||
Ensure.ArgumentNotNull(assetId, "assetId");
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
return _client.EditAsset(owner, name, assetId, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <param name="data">Description of the asset with its amended data</param>
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
public IObservable<ReleaseAsset> EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
return _client.EditAsset(repositoryId, assetId, data).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
@@ -273,5 +447,19 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.DeleteAsset(owner, name, id).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> DeleteAsset(int repositoryId, int id)
|
||||
{
|
||||
return _client.DeleteAsset(repositoryId, id).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#if NET_45
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
#endif
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Threading.Tasks;
|
||||
#endif
|
||||
|
||||
namespace Octokit
|
||||
{
|
||||
@@ -26,6 +26,17 @@ namespace Octokit
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
Task<IReadOnlyList<Release>> GetAll(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
Task<IReadOnlyList<Release>> GetAll(int repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
@@ -39,6 +50,18 @@ namespace Octokit
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
Task<IReadOnlyList<Release>> GetAll(string owner, string name, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
Task<IReadOnlyList<Release>> GetAll(int repositoryId, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -53,6 +76,19 @@ namespace Octokit
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
|
||||
Task<Release> Get(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The <see cref="Release"/> specified by the id</returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")]
|
||||
Task<Release> Get(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -65,6 +101,17 @@ namespace Octokit
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
Task<Release> GetLatest(string owner, string name);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
Task<Release> GetLatest(int repositoryId);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -78,6 +125,18 @@ namespace Octokit
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
Task<Release> Create(string owner, string name, NewRelease data);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="data">A description of the release to create</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
Task<Release> Create(int repositoryId, NewRelease data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -92,6 +151,19 @@ namespace Octokit
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
Task<Release> Edit(string owner, string name, int id, ReleaseUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <param name="data">A description of the release to edit</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
Task<Release> Edit(int repositoryId, int id, ReleaseUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -105,6 +177,18 @@ namespace Octokit
|
||||
/// <returns></returns>
|
||||
Task Delete(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release to delete</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
Task Delete(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -118,6 +202,18 @@ namespace Octokit
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(int repositoryId, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -132,6 +228,19 @@ namespace Octokit
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(string owner, string name, int id, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(int repositoryId, int id, ApiOptions options);
|
||||
|
||||
/// <summary>
|
||||
/// Uploads a <see cref="ReleaseAsset"/> for the specified release.
|
||||
/// </summary>
|
||||
@@ -156,6 +265,17 @@ namespace Octokit
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
Task<ReleaseAsset> GetAsset(string owner, string name, int assetId);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
Task<ReleaseAsset> GetAsset(int repositoryId, int assetId);
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -169,6 +289,18 @@ namespace Octokit
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
Task<ReleaseAsset> EditAsset(string owner, string name, int assetId, ReleaseAssetUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <param name="data">Description of the asset with its amended data</param>
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
Task<ReleaseAsset> EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
@@ -180,5 +312,16 @@ namespace Octokit
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
Task DeleteAsset(string owner, string name, int id);
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
Task DeleteAsset(int repositoryId, int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,20 @@ namespace Octokit
|
||||
return GetAll(owner, name, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
public Task<IReadOnlyList<Release>> GetAll(int repositoryId)
|
||||
{
|
||||
return GetAll(repositoryId, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
@@ -60,6 +74,24 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<Release>(endpoint, null, AcceptHeaders.StableVersion, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="Release"/>s for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-releases-for-a-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="Release"/>s for the specified repository.</returns>
|
||||
public Task<IReadOnlyList<Release>> GetAll(int repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
var endpoint = ApiUrls.Releases(repositoryId);
|
||||
return ApiConnection.GetAll<Release>(endpoint, null, AcceptHeaders.StableVersion, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -80,6 +112,22 @@ namespace Octokit
|
||||
return ApiConnection.Get<Release>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The <see cref="Release"/> specified by the id</returns>
|
||||
public Task<Release> Get(int repositoryId, int id)
|
||||
{
|
||||
var endpoint = ApiUrls.Releases(repositoryId, id);
|
||||
return ApiConnection.Get<Release>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -99,6 +147,21 @@ namespace Octokit
|
||||
return ApiConnection.Get<Release>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the latest <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The latest <see cref="Release"/> specified by the repository</returns>
|
||||
public Task<Release> GetLatest(int repositoryId)
|
||||
{
|
||||
var endpoint = ApiUrls.LatestRelease(repositoryId);
|
||||
return ApiConnection.Get<Release>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -120,6 +183,24 @@ namespace Octokit
|
||||
return ApiConnection.Post<Release>(endpoint, data, AcceptHeaders.StableVersion);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#create-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="data">A description of the release to create</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The created <see cref="Release"/>.</returns>
|
||||
public Task<Release> Create(int repositoryId, NewRelease data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
var endpoint = ApiUrls.Releases(repositoryId);
|
||||
return ApiConnection.Post<Release>(endpoint, data, AcceptHeaders.StableVersion);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -142,6 +223,25 @@ namespace Octokit
|
||||
return ApiConnection.Patch<Release>(endpoint, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release</param>
|
||||
/// <param name="data">A description of the release to edit</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The updated <see cref="Release"/>.</returns>
|
||||
public Task<Release> Edit(int repositoryId, int id, ReleaseUpdate data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
var endpoint = ApiUrls.Releases(repositoryId, id);
|
||||
return ApiConnection.Patch<Release>(endpoint, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
@@ -162,6 +262,22 @@ namespace Octokit
|
||||
return ApiConnection.Delete(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes an existing <see cref="Release"/> for the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the release to delete</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns></returns>
|
||||
public Task Delete(int repositoryId, int id)
|
||||
{
|
||||
var endpoint = ApiUrls.Releases(repositoryId, id);
|
||||
return ApiConnection.Delete(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -181,6 +297,21 @@ namespace Octokit
|
||||
return GetAllAssets(owner, name, id, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
public Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(int repositoryId, int id)
|
||||
{
|
||||
return GetAllAssets(repositoryId, id, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -203,6 +334,25 @@ namespace Octokit
|
||||
return ApiConnection.GetAll<ReleaseAsset>(endpoint, null, AcceptHeaders.StableVersion, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#list-assets-for-a-release">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="Release"/>.</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
|
||||
/// <returns>The list of <see cref="ReleaseAsset"/> for the specified release of the specified repository.</returns>
|
||||
public Task<IReadOnlyList<ReleaseAsset>> GetAllAssets(int repositoryId, int id, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
var endpoint = ApiUrls.ReleaseAssets(repositoryId, id);
|
||||
return ApiConnection.GetAll<ReleaseAsset>(endpoint, null, AcceptHeaders.StableVersion, options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Uploads a <see cref="ReleaseAsset"/> for the specified release.
|
||||
/// </summary>
|
||||
@@ -256,6 +406,21 @@ namespace Octokit
|
||||
return ApiConnection.Get<ReleaseAsset>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the specified <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#get-a-single-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <returns>The <see cref="ReleaseAsset"/> specified by the asset id.</returns>
|
||||
public Task<ReleaseAsset> GetAsset(int repositoryId, int assetId)
|
||||
{
|
||||
var endpoint = ApiUrls.Asset(repositoryId, assetId);
|
||||
return ApiConnection.Get<ReleaseAsset>(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
@@ -277,6 +442,24 @@ namespace Octokit
|
||||
return ApiConnection.Patch<ReleaseAsset>(endpoint, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits the <see cref="ReleaseAsset"/> for the specified release of the specified repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#edit-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="assetId">The id of the <see cref="ReleaseAsset"/></param>
|
||||
/// <param name="data">Description of the asset with its amended data</param>
|
||||
/// <returns>The edited <see cref="ReleaseAsset"/>.</returns>
|
||||
public Task<ReleaseAsset> EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data)
|
||||
{
|
||||
Ensure.ArgumentNotNull(data, "data");
|
||||
|
||||
var endpoint = ApiUrls.Asset(repositoryId, assetId);
|
||||
return ApiConnection.Patch<ReleaseAsset>(endpoint, data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
@@ -295,5 +478,20 @@ namespace Octokit
|
||||
var endpoint = ApiUrls.Asset(owner, name, id);
|
||||
return ApiConnection.Delete(endpoint);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes the specified <see cref="ReleaseAsset"/> from the specified repository
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release-asset">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The repository's ID</param>
|
||||
/// <param name="id">The id of the <see cref="ReleaseAsset"/>.</param>
|
||||
/// <returns></returns>
|
||||
public Task DeleteAsset(int repositoryId, int id)
|
||||
{
|
||||
var endpoint = ApiUrls.Asset(repositoryId, id);
|
||||
return ApiConnection.Delete(endpoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user