From 4ab2075d8c7cb7a5257ec2b69cce684c5c4ee8de Mon Sep 17 00:00:00 2001 From: Alexander Efremov Date: Sun, 12 Jun 2016 18:59:31 +0700 Subject: [PATCH] added new overloads --- .../Clients/IObservableReleasesClient.cs | 145 ++++++++++++- .../Clients/ObservableReleasesClient.cs | 190 ++++++++++++++++- Octokit/Clients/IReleasesClient.cs | 147 ++++++++++++- Octokit/Clients/ReleasesClient.cs | 198 ++++++++++++++++++ 4 files changed, 676 insertions(+), 4 deletions(-) diff --git a/Octokit.Reactive/Clients/IObservableReleasesClient.cs b/Octokit.Reactive/Clients/IObservableReleasesClient.cs index 8cb095c9..14be22cd 100644 --- a/Octokit.Reactive/Clients/IObservableReleasesClient.cs +++ b/Octokit.Reactive/Clients/IObservableReleasesClient.cs @@ -24,6 +24,17 @@ namespace Octokit.Reactive /// The list of s for the specified repository. IObservable GetAll(string owner, string name); + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + IObservable GetAll(int repositoryId); + /// /// Gets all s for the specified repository. /// @@ -37,6 +48,18 @@ namespace Octokit.Reactive /// The list of s for the specified repository. IObservable GetAll(string owner, string name, ApiOptions options); + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + IObservable GetAll(int repositoryId, ApiOptions options); + /// /// Gets a single for the specified repository. /// @@ -51,6 +74,19 @@ namespace Octokit.Reactive [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] IObservable Get(string owner, string name, int id); + /// + /// Gets a single for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// Thrown when a general API error occurs. + /// The specified by the id + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] + IObservable Get(int repositoryId, int id); + /// /// Gets the latest for the specified repository. /// @@ -63,6 +99,17 @@ namespace Octokit.Reactive /// The latest specified by the repository IObservable GetLatest(string owner, string name); + /// + /// Gets the latest for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The latest specified by the repository + IObservable GetLatest(int repositoryId); + /// /// Creates a new for the specified repository. /// @@ -76,6 +123,18 @@ namespace Octokit.Reactive /// The created . IObservable Create(string owner, string name, NewRelease data); + /// + /// Creates a new for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// A description of the release to create + /// Thrown when a general API error occurs. + /// The created . + IObservable Create(int repositoryId, NewRelease data); + /// /// Edits an existing for the specified repository. /// @@ -90,6 +149,19 @@ namespace Octokit.Reactive /// The updated . IObservable Edit(string owner, string name, int id, ReleaseUpdate data); + /// + /// Edits an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// A description of the release to edit + /// Thrown when a general API error occurs. + /// The updated . + IObservable Edit(int repositoryId, int id, ReleaseUpdate data); + /// /// Deletes an existing for the specified repository. /// @@ -103,6 +175,18 @@ namespace Octokit.Reactive /// IObservable Delete(string owner, string name, int id); + /// + /// Deletes an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release to delete + /// Thrown when a general API error occurs. + /// + IObservable Delete(int repositoryId, int id); + /// /// Gets all for the specified release of the specified repository. /// @@ -116,6 +200,18 @@ namespace Octokit.Reactive /// The list of for the specified release of the specified repository. IObservable GetAllAssets(string owner, string name, int id); + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + IObservable GetAllAssets(int repositoryId, int id); + /// /// Gets all for the specified release of the specified repository. /// @@ -130,6 +226,19 @@ namespace Octokit.Reactive /// The list of for the specified release of the specified repository. IObservable GetAllAssets(string owner, string name, int id, ApiOptions options); + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + IObservable GetAllAssets(int repositoryId, int id, ApiOptions options); + /// /// Uploads a for the specified release. /// @@ -141,7 +250,7 @@ namespace Octokit.Reactive /// Thrown when a general API error occurs. /// The created . IObservable UploadAsset(Release release, ReleaseAssetUpload data); - + /// /// Gets the specified for the specified release of the specified repository. /// @@ -154,6 +263,17 @@ namespace Octokit.Reactive /// The specified by the asset id. IObservable GetAsset(string owner, string name, int assetId); + /// + /// Gets the specified for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// The specified by the asset id. + IObservable GetAsset(int repositoryId, int assetId); + /// /// Edits the for the specified release of the specified repository. /// @@ -167,6 +287,18 @@ namespace Octokit.Reactive /// The edited . IObservable EditAsset(string owner, string name, int assetId, ReleaseAssetUpdate data); + /// + /// Edits the for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// Description of the asset with its amended data + /// The edited . + IObservable EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data); + /// /// Deletes the specified from the specified repository /// @@ -178,5 +310,16 @@ namespace Octokit.Reactive /// The id of the . /// IObservable DeleteAsset(string owner, string name, int id); + + /// + /// Deletes the specified from the specified repository + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// + IObservable DeleteAsset(int repositoryId, int id); } } diff --git a/Octokit.Reactive/Clients/ObservableReleasesClient.cs b/Octokit.Reactive/Clients/ObservableReleasesClient.cs index 482538f7..a2e61749 100644 --- a/Octokit.Reactive/Clients/ObservableReleasesClient.cs +++ b/Octokit.Reactive/Clients/ObservableReleasesClient.cs @@ -42,6 +42,20 @@ namespace Octokit.Reactive return GetAll(owner, name, ApiOptions.None); } + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + public IObservable GetAll(int repositoryId) + { + return GetAll(repositoryId, ApiOptions.None); + } + /// /// Gets all s for the specified repository. /// @@ -62,6 +76,23 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.Releases(owner, name), options); } + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + public IObservable GetAll(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.Releases(repositoryId), options); + } + /// /// Gets a single for the specified repository. /// @@ -81,6 +112,21 @@ namespace Octokit.Reactive return _client.Get(owner, name, id).ToObservable(); } + /// + /// Gets a single for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// Thrown when a general API error occurs. + /// The specified by the id + public IObservable Get(int repositoryId, int id) + { + return _client.Get(repositoryId, id).ToObservable(); + } + /// /// Gets the latest for the specified repository. /// @@ -98,6 +144,21 @@ namespace Octokit.Reactive return _client.GetLatest(owner, name).ToObservable(); } + + /// + /// Gets the latest for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The latest specified by the repository + public IObservable GetLatest(int repositoryId) + { + return _client.GetLatest(repositoryId).ToObservable(); + } + /// /// Creates a new for the specified repository. /// @@ -118,6 +179,21 @@ namespace Octokit.Reactive return _client.Create(owner, name, data).ToObservable(); } + /// + /// Creates a new for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// A description of the release to create + /// Thrown when a general API error occurs. + /// The created . + public IObservable Create(int repositoryId, NewRelease data) + { + return _client.Create(repositoryId, data).ToObservable(); + } + /// /// Edits an existing for the specified repository. /// @@ -139,6 +215,24 @@ namespace Octokit.Reactive return _client.Edit(owner, name, id, data).ToObservable(); } + /// + /// Edits an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// A description of the release to edit + /// Thrown when a general API error occurs. + /// The updated . + public IObservable Edit(int repositoryId, int id, ReleaseUpdate data) + { + Ensure.ArgumentNotNull(data, "data"); + + return _client.Edit(repositoryId, id, data).ToObservable(); + } + /// /// Deletes an existing for the specified repository. /// @@ -158,6 +252,21 @@ namespace Octokit.Reactive return _client.Delete(owner, name, id).ToObservable(); } + /// + /// Deletes an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release to delete + /// Thrown when a general API error occurs. + /// + public IObservable Delete(int repositoryId, int id) + { + return _client.Delete(repositoryId, id).ToObservable(); + } + /// /// Gets all for the specified release of the specified repository. /// @@ -177,6 +286,21 @@ namespace Octokit.Reactive return GetAllAssets(owner, name, id, ApiOptions.None); } + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + public IObservable GetAllAssets(int repositoryId, int id) + { + return GetAllAssets(repositoryId, id, ApiOptions.None); + } + /// /// Gets all for the specified release of the specified repository. /// @@ -198,6 +322,24 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.ReleaseAssets(owner, name, id), options); } + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + public IObservable GetAllAssets(int repositoryId, int id, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.ReleaseAssets(repositoryId, id), options); + } + /// /// Gets the specified for the specified release of the specified repository. /// @@ -217,6 +359,22 @@ namespace Octokit.Reactive return _client.GetAsset(owner, name, assetId).ToObservable(); } + /// + /// Gets the specified for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// The specified by the asset id. + public IObservable GetAsset(int repositoryId, int assetId) + { + Ensure.ArgumentNotNull(assetId, "assetId"); + + return _client.GetAsset(repositoryId, assetId).ToObservable(); + } + /// /// Uploads a for the specified release. /// @@ -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(); } + /// + /// Edits the for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// Description of the asset with its amended data + /// The edited . + public IObservable EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data) + { + Ensure.ArgumentNotNull(data, "data"); + + return _client.EditAsset(repositoryId, assetId, data).ToObservable(); + } + /// /// Deletes the specified from the specified repository /// @@ -273,5 +447,19 @@ namespace Octokit.Reactive return _client.DeleteAsset(owner, name, id).ToObservable(); } + + /// + /// Deletes the specified from the specified repository + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// + public IObservable DeleteAsset(int repositoryId, int id) + { + return _client.DeleteAsset(repositoryId, id).ToObservable(); + } } } diff --git a/Octokit/Clients/IReleasesClient.cs b/Octokit/Clients/IReleasesClient.cs index 4ad51784..72a2b560 100644 --- a/Octokit/Clients/IReleasesClient.cs +++ b/Octokit/Clients/IReleasesClient.cs @@ -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 /// The list of s for the specified repository. Task> GetAll(string owner, string name); + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + Task> GetAll(int repositoryId); + /// /// Gets all s for the specified repository. /// @@ -39,6 +50,18 @@ namespace Octokit /// The list of s for the specified repository. Task> GetAll(string owner, string name, ApiOptions options); + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + Task> GetAll(int repositoryId, ApiOptions options); + /// /// Gets a single for the specified repository. /// @@ -53,6 +76,19 @@ namespace Octokit [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] Task Get(string owner, string name, int id); + /// + /// Gets a single for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// Thrown when a general API error occurs. + /// The specified by the id + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get", Justification = "Method makes a network request")] + Task Get(int repositoryId, int id); + /// /// Gets the latest for the specified repository. /// @@ -65,6 +101,17 @@ namespace Octokit /// The latest specified by the repository Task GetLatest(string owner, string name); + /// + /// Gets the latest for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The latest specified by the repository + Task GetLatest(int repositoryId); + /// /// Creates a new for the specified repository. /// @@ -78,6 +125,18 @@ namespace Octokit /// The created . Task Create(string owner, string name, NewRelease data); + /// + /// Creates a new for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// A description of the release to create + /// Thrown when a general API error occurs. + /// The created . + Task Create(int repositoryId, NewRelease data); + /// /// Edits an existing for the specified repository. /// @@ -92,6 +151,19 @@ namespace Octokit /// The updated . Task Edit(string owner, string name, int id, ReleaseUpdate data); + /// + /// Edits an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// A description of the release to edit + /// Thrown when a general API error occurs. + /// The updated . + Task Edit(int repositoryId, int id, ReleaseUpdate data); + /// /// Deletes an existing for the specified repository. /// @@ -105,6 +177,18 @@ namespace Octokit /// Task Delete(string owner, string name, int id); + /// + /// Deletes an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release to delete + /// Thrown when a general API error occurs. + /// + Task Delete(int repositoryId, int id); + /// /// Gets all for the specified release of the specified repository. /// @@ -118,6 +202,18 @@ namespace Octokit /// The list of for the specified release of the specified repository. Task> GetAllAssets(string owner, string name, int id); + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + Task> GetAllAssets(int repositoryId, int id); + /// /// Gets all for the specified release of the specified repository. /// @@ -132,6 +228,19 @@ namespace Octokit /// The list of for the specified release of the specified repository. Task> GetAllAssets(string owner, string name, int id, ApiOptions options); + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + Task> GetAllAssets(int repositoryId, int id, ApiOptions options); + /// /// Uploads a for the specified release. /// @@ -156,6 +265,17 @@ namespace Octokit /// The specified by the asset id. Task GetAsset(string owner, string name, int assetId); + /// + /// Gets the specified for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// The specified by the asset id. + Task GetAsset(int repositoryId, int assetId); + /// /// Edits the for the specified release of the specified repository. /// @@ -169,6 +289,18 @@ namespace Octokit /// The edited . Task EditAsset(string owner, string name, int assetId, ReleaseAssetUpdate data); + /// + /// Edits the for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// Description of the asset with its amended data + /// The edited . + Task EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data); + /// /// Deletes the specified from the specified repository /// @@ -180,5 +312,16 @@ namespace Octokit /// The id of the . /// Task DeleteAsset(string owner, string name, int id); + + /// + /// Deletes the specified from the specified repository + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// + Task DeleteAsset(int repositoryId, int id); } } diff --git a/Octokit/Clients/ReleasesClient.cs b/Octokit/Clients/ReleasesClient.cs index e5e14204..994126e9 100644 --- a/Octokit/Clients/ReleasesClient.cs +++ b/Octokit/Clients/ReleasesClient.cs @@ -39,6 +39,20 @@ namespace Octokit return GetAll(owner, name, ApiOptions.None); } + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + public Task> GetAll(int repositoryId) + { + return GetAll(repositoryId, ApiOptions.None); + } + /// /// Gets all s for the specified repository. /// @@ -60,6 +74,24 @@ namespace Octokit return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); } + /// + /// Gets all s for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of s for the specified repository. + public Task> GetAll(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + var endpoint = ApiUrls.Releases(repositoryId); + return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); + } + /// /// Gets a single for the specified repository. /// @@ -80,6 +112,22 @@ namespace Octokit return ApiConnection.Get(endpoint); } + /// + /// Gets a single for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// Thrown when a general API error occurs. + /// The specified by the id + public Task Get(int repositoryId, int id) + { + var endpoint = ApiUrls.Releases(repositoryId, id); + return ApiConnection.Get(endpoint); + } + /// /// Gets the latest for the specified repository. /// @@ -99,6 +147,21 @@ namespace Octokit return ApiConnection.Get(endpoint); } + /// + /// Gets the latest for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// Thrown when a general API error occurs. + /// The latest specified by the repository + public Task GetLatest(int repositoryId) + { + var endpoint = ApiUrls.LatestRelease(repositoryId); + return ApiConnection.Get(endpoint); + } + /// /// Creates a new for the specified repository. /// @@ -120,6 +183,24 @@ namespace Octokit return ApiConnection.Post(endpoint, data, AcceptHeaders.StableVersion); } + /// + /// Creates a new for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// A description of the release to create + /// Thrown when a general API error occurs. + /// The created . + public Task Create(int repositoryId, NewRelease data) + { + Ensure.ArgumentNotNull(data, "data"); + + var endpoint = ApiUrls.Releases(repositoryId); + return ApiConnection.Post(endpoint, data, AcceptHeaders.StableVersion); + } + /// /// Edits an existing for the specified repository. /// @@ -142,6 +223,25 @@ namespace Octokit return ApiConnection.Patch(endpoint, data); } + /// + /// Edits an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release + /// A description of the release to edit + /// Thrown when a general API error occurs. + /// The updated . + public Task Edit(int repositoryId, int id, ReleaseUpdate data) + { + Ensure.ArgumentNotNull(data, "data"); + + var endpoint = ApiUrls.Releases(repositoryId, id); + return ApiConnection.Patch(endpoint, data); + } + /// /// Deletes an existing for the specified repository. /// @@ -162,6 +262,22 @@ namespace Octokit return ApiConnection.Delete(endpoint); } + /// + /// Deletes an existing for the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the release to delete + /// Thrown when a general API error occurs. + /// + public Task Delete(int repositoryId, int id) + { + var endpoint = ApiUrls.Releases(repositoryId, id); + return ApiConnection.Delete(endpoint); + } + /// /// Gets all for the specified release of the specified repository. /// @@ -181,6 +297,21 @@ namespace Octokit return GetAllAssets(owner, name, id, ApiOptions.None); } + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + public Task> GetAllAssets(int repositoryId, int id) + { + return GetAllAssets(repositoryId, id, ApiOptions.None); + } + /// /// Gets all for the specified release of the specified repository. /// @@ -203,6 +334,25 @@ namespace Octokit return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); } + /// + /// Gets all for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// Options for changing the API response + /// Thrown when a general API error occurs. + /// The list of for the specified release of the specified repository. + public Task> GetAllAssets(int repositoryId, int id, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + var endpoint = ApiUrls.ReleaseAssets(repositoryId, id); + return ApiConnection.GetAll(endpoint, null, AcceptHeaders.StableVersion, options); + } + /// /// Uploads a for the specified release. /// @@ -256,6 +406,21 @@ namespace Octokit return ApiConnection.Get(endpoint); } + /// + /// Gets the specified for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// The specified by the asset id. + public Task GetAsset(int repositoryId, int assetId) + { + var endpoint = ApiUrls.Asset(repositoryId, assetId); + return ApiConnection.Get(endpoint); + } + /// /// Edits the for the specified release of the specified repository. /// @@ -277,6 +442,24 @@ namespace Octokit return ApiConnection.Patch(endpoint, data); } + /// + /// Edits the for the specified release of the specified repository. + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the + /// Description of the asset with its amended data + /// The edited . + public Task EditAsset(int repositoryId, int assetId, ReleaseAssetUpdate data) + { + Ensure.ArgumentNotNull(data, "data"); + + var endpoint = ApiUrls.Asset(repositoryId, assetId); + return ApiConnection.Patch(endpoint, data); + } + /// /// Deletes the specified from the specified repository /// @@ -295,5 +478,20 @@ namespace Octokit var endpoint = ApiUrls.Asset(owner, name, id); return ApiConnection.Delete(endpoint); } + + /// + /// Deletes the specified from the specified repository + /// + /// + /// See the API documentation for more information. + /// + /// The repository's ID + /// The id of the . + /// + public Task DeleteAsset(int repositoryId, int id) + { + var endpoint = ApiUrls.Asset(repositoryId, id); + return ApiConnection.Delete(endpoint); + } } }