mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-18 21:25:12 +00:00
added new overloads
This commit is contained in:
@@ -37,6 +37,20 @@ namespace Octokit.Reactive
|
||||
return GetAllForIssue(owner, name, number, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the issue.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#list-labels-on-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <returns>The list of labels</returns>
|
||||
public IObservable<Label> GetAllForIssue(int repositoryId, int number)
|
||||
{
|
||||
return GetAllForIssue(repositoryId, number, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the issue.
|
||||
/// </summary>
|
||||
@@ -57,6 +71,23 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.IssueLabels(owner, name, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the issue.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#list-labels-on-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>The list of labels</returns>
|
||||
public IObservable<Label> GetAllForIssue(int repositoryId, int number, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.IssueLabels(repositoryId, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the repository.
|
||||
/// </summary>
|
||||
@@ -74,6 +105,19 @@ namespace Octokit.Reactive
|
||||
return GetAllForRepository(owner, name, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <returns>The list of labels</returns>
|
||||
public IObservable<Label> GetAllForRepository(int repositoryId)
|
||||
{
|
||||
return GetAllForRepository(repositoryId, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the repository.
|
||||
/// </summary>
|
||||
@@ -93,6 +137,22 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.Labels(owner, name), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets all labels for the repository.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns>The list of labels</returns>
|
||||
public IObservable<Label> GetAllForRepository(int repositoryId, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.Labels(repositoryId), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets labels for every issue in a milestone
|
||||
/// </summary>
|
||||
@@ -111,6 +171,20 @@ namespace Octokit.Reactive
|
||||
return GetAllForMilestone(owner, name, number, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets labels for every issue in a milestone
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the milestone</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Label> GetAllForMilestone(int repositoryId, int number)
|
||||
{
|
||||
return GetAllForMilestone(repositoryId, number, ApiOptions.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets labels for every issue in a milestone
|
||||
/// </summary>
|
||||
@@ -131,6 +205,23 @@ namespace Octokit.Reactive
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.MilestoneLabels(owner, name, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets labels for every issue in a milestone
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#get-labels-for-every-issue-in-a-milestone">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the milestone</param>
|
||||
/// <param name="options">Options for changing the API response</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Label> GetAllForMilestone(int repositoryId, int number, ApiOptions options)
|
||||
{
|
||||
Ensure.ArgumentNotNull(options, "options");
|
||||
|
||||
return _connection.GetAndFlattenAllPages<Label>(ApiUrls.MilestoneLabels(repositoryId, number), options);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single Label by name.
|
||||
/// </summary>
|
||||
@@ -150,6 +241,22 @@ namespace Octokit.Reactive
|
||||
return _client.Get(owner, name, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single Label by name.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#get-a-single-label">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="labelName">The name of the label</param>
|
||||
/// <returns>The label</returns>
|
||||
public IObservable<Label> Get(int repositoryId, string labelName)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(labelName, "labelName");
|
||||
|
||||
return _client.Get(repositoryId, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a label.
|
||||
/// </summary>
|
||||
@@ -169,6 +276,22 @@ namespace Octokit.Reactive
|
||||
return _client.Delete(owner, name, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deletes a label.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#delete-a-label">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="labelName">The name of the label</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> Delete(int repositoryId, string labelName)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(labelName, "labelName");
|
||||
|
||||
return _client.Delete(repositoryId, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a label.
|
||||
/// </summary>
|
||||
@@ -188,6 +311,22 @@ namespace Octokit.Reactive
|
||||
return _client.Create(owner, name, newLabel).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a label.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#create-a-label">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="newLabel">The data for the label to be created</param>
|
||||
/// <returns>The created label</returns>
|
||||
public IObservable<Label> Create(int repositoryId, NewLabel newLabel)
|
||||
{
|
||||
Ensure.ArgumentNotNull(newLabel, "newLabel");
|
||||
|
||||
return _client.Create(repositoryId, newLabel).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates a label.
|
||||
/// </summary>
|
||||
@@ -209,6 +348,24 @@ namespace Octokit.Reactive
|
||||
return _client.Update(owner, name, labelName, labelUpdate).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates a label.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#update-a-label">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="labelName">The name of the label</param>
|
||||
/// <param name="labelUpdate">The data for the label to be updated</param>
|
||||
/// <returns>The updated label</returns>
|
||||
public IObservable<Label> Update(int repositoryId, string labelName, LabelUpdate labelUpdate)
|
||||
{
|
||||
Ensure.ArgumentNotNull(labelName, "labelName");
|
||||
Ensure.ArgumentNotNull(labelUpdate, "labelUpdate");
|
||||
|
||||
return _client.Update(repositoryId, labelName, labelUpdate).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a label to an issue
|
||||
/// </summary>
|
||||
@@ -231,6 +388,22 @@ namespace Octokit.Reactive
|
||||
.SelectMany(x => x); // HACK: POST is not compatible with GetAndFlattenPages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a label to an issue
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#add-labels-to-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <param name="labels">The names of the labels to add</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Label> AddToIssue(int repositoryId, int number, string[] labels)
|
||||
{
|
||||
return _client.AddToIssue(repositoryId, number, labels)
|
||||
.ToObservable()
|
||||
.SelectMany(x => x); // HACK: POST is not compatible with GetAndFlattenPages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a label from an issue
|
||||
@@ -252,6 +425,23 @@ namespace Octokit.Reactive
|
||||
return _client.RemoveFromIssue(owner, name, number, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a label from an issue
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <param name="labelName">The name of the label to remove</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> RemoveFromIssue(int repositoryId, int number, string labelName)
|
||||
{
|
||||
Ensure.ArgumentNotNullOrEmptyString(labelName, "labelName");
|
||||
|
||||
return _client.RemoveFromIssue(repositoryId, number, labelName).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces all labels on the specified issues with the provided labels
|
||||
/// </summary>
|
||||
@@ -274,6 +464,25 @@ namespace Octokit.Reactive
|
||||
.SelectMany(x => x); // HACK: PUT is not compatible with GetAndFlattenPages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces all labels on the specified issues with the provided labels
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#replace-all-labels-for-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <param name="labels">The names of the labels to set</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Label> ReplaceAllForIssue(int repositoryId, int number, string[] labels)
|
||||
{
|
||||
Ensure.ArgumentNotNull(labels, "labels");
|
||||
|
||||
return _client.ReplaceAllForIssue(repositoryId, number, labels)
|
||||
.ToObservable()
|
||||
.SelectMany(x => x); // HACK: PUT is not compatible with GetAndFlattenPages
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all labels from an issue
|
||||
/// </summary>
|
||||
@@ -291,5 +500,19 @@ namespace Octokit.Reactive
|
||||
|
||||
return _client.RemoveAllFromIssue(owner, name, number).ToObservable();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes all labels from an issue
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// See the <a href="http://developer.github.com/v3/issues/labels/#remove-all-labels-from-an-issue">API documentation</a> for more information.
|
||||
/// </remarks>
|
||||
/// <param name="repositoryId">The ID of the repository</param>
|
||||
/// <param name="number">The number of the issue</param>
|
||||
/// <returns></returns>
|
||||
public IObservable<Unit> RemoveAllFromIssue(int repositoryId, int number)
|
||||
{
|
||||
return _client.RemoveAllFromIssue(repositoryId, number).ToObservable();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user