-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Approved] Add repository topics #2246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 20 commits
220e9a3
1d0cb56
3fa7807
56295b3
21d3bbd
4b3e57f
697d3d6
efd373e
620cb26
dd518d3
091bff0
cb5a06c
4a178ea
af48670
e68a5b8
ad9b819
52db2ab
fca13f4
0b88b7a
1cd3116
456f431
ebbe318
7d8d0d7
95f102a
67998dc
ca9e8e9
7761dbd
9b126e5
1e7ac1d
1792546
fd7a2be
0d6da2a
327ee27
c9ed7a7
19ea9fd
27d4d68
6068b1b
fe182e1
b7c6901
5dba2fd
e55273b
30b2215
cd0f082
cdbb96b
550f4e3
3e10bc2
a6c49ed
04161cf
4b62ec0
257be14
5fb88ad
8730206
84d6144
fa94465
c5574ed
2bc3df5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Diagnostics.CodeAnalysis; | ||
| using System.Linq; | ||
| using System.Reactive; | ||
| using System.Reactive.Linq; | ||
| using System.Reactive.Threading.Tasks; | ||
| using System.Threading.Tasks; | ||
| using Octokit.Reactive.Clients; | ||
| using Octokit.Reactive.Internal; | ||
|
|
||
|
|
@@ -821,5 +823,96 @@ public IObservable<CompareResult> Compare(string owner, string name, string @bas | |
| /// Refer to the API documentation for more information: https://developer.github.com/v3/repos/projects/ | ||
| /// </remarks> | ||
| public IObservableProjectsClient Project { get; private set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified owner and repository name. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <param name="options">Options for changing the API response</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| public IObservable<string> GetAllTopics(string owner, string name, ApiOptions options) | ||
| { | ||
| var url = ApiUrls.RepositoryTopics(owner, name); | ||
| return _connection.GetAndFlattenAllPages<string>(url, null, AcceptHeaders.RepositoryTopicsPreview, options); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified owner and repository name. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| public IObservable<string> GetAllTopics(string owner, string name) | ||
| { | ||
| return GetAllTopics(owner, name, ApiOptions.None); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified repository ID. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <param name="options">Options for changing the API response</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| public IObservable<string> GetAllTopics(long repositoryId, ApiOptions options) | ||
| { | ||
| var url = ApiUrls.RepositoryTopics(repositoryId); | ||
| return _connection.GetAndFlattenAllPages<string>(url, null, AcceptHeaders.RepositoryTopicsPreview, options); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified repository ID. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| public IObservable<string> GetAllTopics(long repositoryId) | ||
| { | ||
| return GetAllTopics(repositoryId, ApiOptions.None); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Replaces all topics for the specified repository. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics">API documentation</a> for more details | ||
| /// | ||
| /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <param name="topics">The list of topics to associate with the repository</param> | ||
| /// <returns>All topics now associated with the repository.</returns> | ||
| public IObservable<string> ReplaceAllTopics(long repositoryId, IEnumerable<string> topics) | ||
| { | ||
| return _client.ReplaceAllTopics(repositoryId, topics).Result.ToObservable(); | ||
|
||
| } | ||
|
|
||
| /// <summary> | ||
| /// Replaces all topics for the specified repository. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics">API documentation</a> for more details | ||
| /// | ||
| /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <param name="topics">The list of topics to associate with the repository</param> | ||
| /// <returns>All topics now associated with the repository.</returns> | ||
| public IObservable<string> ReplaceAllTopics(string owner, string name, IEnumerable<string> topics) | ||
| { | ||
| return _client.ReplaceAllTopics(owner, name, topics).Result.ToObservable(); | ||
|
||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -621,5 +621,80 @@ public interface IRepositoriesClient | |
| /// Refer to the API documentation for more information: https://developer.github.com/v3/repos/projects/ | ||
| /// </remarks> | ||
| IProjectsClient Project { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified owner and repository name. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <param name="options">Options for changing the API response</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> GetAllTopics(string owner, string name, ApiOptions options); | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified owner and repository name. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> GetAllTopics(string owner, string name); | ||
|
|
||
|
|
||
|
||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified repository ID. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <param name="options">Options for changing the API response</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> GetAllTopics(long repositoryId, ApiOptions options); | ||
|
|
||
| /// <summary> | ||
| /// Gets all topics for the specified repository ID. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#get-all-repository-topics">API documentation</a> for more details | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <returns>All topics associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> GetAllTopics(long repositoryId); | ||
|
|
||
SeanKilleen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Replaces all topics for the specified repository. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics">API documentation</a> for more details | ||
| /// | ||
| /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. | ||
| /// </remarks> | ||
| /// <param name="repositoryId">The ID of the repository</param> | ||
| /// <param name="topics">The list of topics to associate with the repository</param> | ||
| /// <returns>All topics now associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> ReplaceAllTopics(long repositoryId, IEnumerable<string> topics); | ||
|
|
||
| /// <summary> | ||
| /// Replaces all topics for the specified repository. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// See the <a href="https://docs.github.com/en/rest/reference/repos#replace-all-repository-topics">API documentation</a> for more details | ||
| /// | ||
| /// This is a replacement operation; it is not additive. To clear repository topics, for example, you could specify an empty list of topics here. | ||
| /// </remarks> | ||
| /// <param name="owner">The owner of the repository</param> | ||
| /// <param name="name">The name of the repository</param> | ||
| /// <param name="topics">The list of topics to associate with the repository</param> | ||
| /// <returns>All topics now associated with the repository.</returns> | ||
| Task<IReadOnlyList<string>> ReplaceAllTopics(string owner, string name, IEnumerable<string> topics); | ||
|
|
||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.