[Releases]Added support for generating release notes (#2563)

This commit is contained in:
Rares Iova
2022-09-07 19:01:32 +03:00
committed by GitHub
parent d88a9071d8
commit b3d2096766
8 changed files with 295 additions and 0 deletions

View File

@@ -13,6 +13,29 @@ namespace Octokit.Reactive
/// </remarks>
public interface IObservableReleasesClient
{
/// <summary>
/// Generates a <see cref="GeneratedReleaseNotes"/>s for the specified repository with auto generated notes.
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="data">The request for generating release notes</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
IObservable<GeneratedReleaseNotes> GenerateReleaseNotes(string owner, string name, GenerateReleaseNotesRequest data);
/// <summary>
/// Generates a <see cref="GeneratedReleaseNotes"/>s for the specified repository with auto generated notes.
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="data">The request for generating release notes</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
IObservable<GeneratedReleaseNotes> GenerateReleaseNotes(long repositoryId, GenerateReleaseNotesRequest data);
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>

View File

@@ -25,6 +25,41 @@ namespace Octokit.Reactive
_connection = client.Connection;
}
/// <summary>
/// Generates a <see cref="GeneratedReleaseNotes"/>s for the specified repository with auto generated notes.
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The repository's owner</param>
/// <param name="name">The repository's name</param>
/// <param name="data">The request for generating release notes</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
public IObservable<GeneratedReleaseNotes> GenerateReleaseNotes(string owner, string name, GenerateReleaseNotesRequest data)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(data, nameof(data));
return _client.GenerateReleaseNotes(owner, name, data).ToObservable();
}
/// <summary>
/// Generates a <see cref="GeneratedReleaseNotes"/>s for the specified repository with auto generated notes.
/// </summary>
/// <remarks>
/// See the <a href="https://docs.github.com/en/rest/releases/releases#generate-release-notes-content-for-a-release">API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="data">The request for generating release notes</param>
/// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
public IObservable<GeneratedReleaseNotes> GenerateReleaseNotes(long repositoryId, GenerateReleaseNotesRequest data)
{
Ensure.ArgumentNotNull(data, nameof(data));
return _client.GenerateReleaseNotes(repositoryId, data).ToObservable();
}
/// <summary>
/// Gets all <see cref="Release"/>s for the specified repository.
/// </summary>