From 36d7d2cf241518411bfd3ca6d07985c6112dfcf7 Mon Sep 17 00:00:00 2001 From: "aedampir@gmail.com" Date: Thu, 9 Jun 2016 17:43:08 +0700 Subject: [PATCH] added new overloads --- .../IObservableRepositoryPagesClient.cs | 42 ++++++++++++++ .../ObservableRepositoryPagesClient.cs | 55 ++++++++++++++++++ Octokit/Clients/IRepositoryPagesClient.cs | 42 ++++++++++++++ Octokit/Clients/RepositoryPagesClient.cs | 56 +++++++++++++++++++ 4 files changed, 195 insertions(+) diff --git a/Octokit.Reactive/Clients/IObservableRepositoryPagesClient.cs b/Octokit.Reactive/Clients/IObservableRepositoryPagesClient.cs index 0de69772..e639eb5e 100644 --- a/Octokit.Reactive/Clients/IObservableRepositoryPagesClient.cs +++ b/Octokit.Reactive/Clients/IObservableRepositoryPagesClient.cs @@ -23,6 +23,17 @@ namespace Octokit.Reactive [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] IObservable Get(string owner, string name); + /// + /// Gets the page metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of representing page metadata of specified repository. + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] + IObservable Get(int repositoryId); + /// /// Gets all build metadata for a given repository /// @@ -34,6 +45,16 @@ namespace Octokit.Reactive /// A of s representing pages build metadata of specified repository. IObservable GetAll(string owner, string name); + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + IObservable GetAll(int repositoryId); + /// /// Gets all build metadata for a given repository /// @@ -46,6 +67,17 @@ namespace Octokit.Reactive /// A of s representing pages build metadata of specified repository. IObservable GetAll(string owner, string name, ApiOptions options); + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// Options to change the API response + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + IObservable GetAll(int repositoryId, ApiOptions options); + /// /// Gets the build metadata for the last build for a given repository /// @@ -56,5 +88,15 @@ namespace Octokit.Reactive /// /// A of representing latest pages build metadata of specified repository. IObservable GetLatest(string owner, string name); + + /// + /// Gets the build metadata for the last build for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of representing latest pages build metadata of specified repository. + IObservable GetLatest(int repositoryId); } } diff --git a/Octokit.Reactive/Clients/ObservableRepositoryPagesClient.cs b/Octokit.Reactive/Clients/ObservableRepositoryPagesClient.cs index 432abd48..ca921c58 100644 --- a/Octokit.Reactive/Clients/ObservableRepositoryPagesClient.cs +++ b/Octokit.Reactive/Clients/ObservableRepositoryPagesClient.cs @@ -42,6 +42,19 @@ namespace Octokit.Reactive return _client.Get(owner, name).ToObservable(); } + /// + /// Gets the page metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of representing page metadata of specified repository. + public IObservable Get(int repositoryId) + { + return _client.Get(repositoryId).ToObservable(); + } + /// /// Gets all build metadata for a given repository /// @@ -59,6 +72,19 @@ namespace Octokit.Reactive return GetAll(owner, name, ApiOptions.None); } + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + public IObservable GetAll(int repositoryId) + { + return GetAll(repositoryId, ApiOptions.None); + } + /// /// Gets all build metadata for a given repository /// @@ -78,6 +104,22 @@ namespace Octokit.Reactive return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryPageBuilds(owner, name), options); } + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// Options to change the API response + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + public IObservable GetAll(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + return _connection.GetAndFlattenAllPages(ApiUrls.RepositoryPageBuilds(repositoryId), options); + } + /// /// Gets the build metadata for the last build for a given repository /// @@ -94,5 +136,18 @@ namespace Octokit.Reactive return _client.GetLatest(owner, name).ToObservable(); } + + /// + /// Gets the build metadata for the last build for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of representing latest pages build metadata of specified repository. + public IObservable GetLatest(int repositoryId) + { + return _client.GetLatest(repositoryId).ToObservable(); + } } } diff --git a/Octokit/Clients/IRepositoryPagesClient.cs b/Octokit/Clients/IRepositoryPagesClient.cs index f58aa82e..cc962032 100644 --- a/Octokit/Clients/IRepositoryPagesClient.cs +++ b/Octokit/Clients/IRepositoryPagesClient.cs @@ -24,6 +24,17 @@ namespace Octokit [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] Task Get(string owner, string name); + /// + /// Gets the page metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A representing page metadata of specified repository. + [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Get")] + Task Get(int repositoryId); + /// /// Gets all build metadata for a given repository /// @@ -35,6 +46,16 @@ namespace Octokit /// A of s representing pages build metadata of specified repository. Task> GetAll(string owner, string name); + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + Task> GetAll(int repositoryId); + /// /// Gets all build metadata for a given repository /// @@ -47,6 +68,17 @@ namespace Octokit /// A of s representing pages build metadata of specified repository. Task> GetAll(string owner, string name, ApiOptions options); + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// Options to change the API response + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + Task> GetAll(int repositoryId, ApiOptions options); + /// /// Gets the build metadata for the last build for a given repository /// @@ -57,5 +89,15 @@ namespace Octokit /// /// A representing latest pages build metadata of specified repository. Task GetLatest(string owner, string name); + + /// + /// Gets the build metadata for the last build for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A representing latest pages build metadata of specified repository. + Task GetLatest(int repositoryId); } } diff --git a/Octokit/Clients/RepositoryPagesClient.cs b/Octokit/Clients/RepositoryPagesClient.cs index 87c4c79b..12ebb24d 100644 --- a/Octokit/Clients/RepositoryPagesClient.cs +++ b/Octokit/Clients/RepositoryPagesClient.cs @@ -36,6 +36,19 @@ namespace Octokit return ApiConnection.Get(ApiUrls.RepositoryPage(owner, name)); } + /// + /// Gets the page metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A representing page metadata of specified repository. + public Task Get(int repositoryId) + { + return ApiConnection.Get(ApiUrls.RepositoryPage(repositoryId)); + } + /// /// Gets all build metadata for a given repository /// @@ -53,6 +66,19 @@ namespace Octokit return GetAll(owner, name, ApiOptions.None); } + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + public Task> GetAll(int repositoryId) + { + return GetAll(repositoryId, ApiOptions.None); + } + /// /// Gets all build metadata for a given repository /// @@ -73,6 +99,23 @@ namespace Octokit return ApiConnection.GetAll(endpoint, options); } + /// + /// Gets all build metadata for a given repository + /// + /// The ID of the repository + /// Options to change the API response + /// + /// See the API documentation for more information. + /// + /// A of s representing pages build metadata of specified repository. + public Task> GetAll(int repositoryId, ApiOptions options) + { + Ensure.ArgumentNotNull(options, "options"); + + var endpoint = ApiUrls.RepositoryPageBuilds(repositoryId); + return ApiConnection.GetAll(endpoint, options); + } + /// /// Gets the build metadata for the last build for a given repository /// @@ -89,5 +132,18 @@ namespace Octokit return ApiConnection.Get(ApiUrls.RepositoryPageBuildsLatest(owner, name)); } + + /// + /// Gets the build metadata for the last build for a given repository + /// + /// The ID of the repository + /// + /// See the API documentation for more information. + /// + /// A representing latest pages build metadata of specified repository. + public Task GetLatest(int repositoryId) + { + return ApiConnection.Get(ApiUrls.RepositoryPageBuildsLatest(repositoryId)); + } } }