Skip to content
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

Implement Check Runs API #1847

Merged
merged 14 commits into from
Jul 18, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
207 changes: 207 additions & 0 deletions Octokit.Reactive/Clients/IObservableCheckRunsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
using System;

namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Check Runs API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/">Check Runs API documentation</a> for more information.
/// </remarks>
public interface IObservableCheckRunsClient
{
/// <summary>
/// Creates a new check run for a specific commit in a repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/#create-a-check-run">Check Runs API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="newCheckRun">Details of the Check Run to create</param>
IObservable<CheckRun> Create(string owner, string name, NewCheckRun newCheckRun);

/// <summary>
/// Creates a new check run for a specific commit in a repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/#create-a-check-run">Check Runs API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="newCheckRun">Details of the Check Run to create</param>
IObservable<CheckRun> Create(long repositoryId, NewCheckRun newCheckRun);

/// <summary>
/// Updates a check run for a specific commit in a repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/#update-a-check-run">Check Runs API documentation</a> for more information.
/// </remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="checkRunUpdate">The updates to the check run</param>
IObservable<CheckRun> Update(string owner, string name, long checkRunId, CheckRunUpdate checkRunUpdate);

/// <summary>
/// Updates a check run for a specific commit in a repository.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/#update-a-check-run">Check Runs API documentation</a> for more information.
/// </remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="checkRunUpdate">The updates to the check run</param>
IObservable<CheckRun> Update(long repositoryId, long checkRunId, CheckRunUpdate checkRunUpdate);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
IObservable<CheckRunsResponse> GetAllForReference(string owner, string name, string reference);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
IObservable<CheckRunsResponse> GetAllForReference(long repositoryId, string reference);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
IObservable<CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
IObservable<CheckRunsResponse> GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunsResponse> GetAllForReference(string owner, string name, string reference, CheckRunRequest checkRunRequest, ApiOptions options);

/// <summary>
/// Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="reference">The commit reference (can be a SHA, branch name, or a tag name)</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunsResponse> GetAllForReference(long repositoryId, string reference, CheckRunRequest checkRunRequest, ApiOptions options);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long checkSuiteId);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(string owner, string name, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options);

/// <summary>
/// Lists check runs for a check suite using its Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkSuiteId">The Id of the check suite</param>
/// <param name="checkRunRequest">Details to filter the request, such as by check name</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunsResponse> GetAllForCheckSuite(long repositoryId, long checkSuiteId, CheckRunRequest checkRunRequest, ApiOptions options);

/// <summary>
/// Gets a single check run using its Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
IObservable<CheckRun> Get(string owner, string name, long checkRunId);

/// <summary>
/// Gets a single check run using its Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
IObservable<CheckRun> Get(long repositoryId, long checkRunId);

/// <summary>
/// Lists annotations for a check run using the check run Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
IObservable<CheckRunAnnotation> GetAllAnnotations(string owner, string name, long checkRunId);

/// <summary>
/// Lists annotations for a check run using the check run Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
/// <returns></returns>
IObservable<CheckRunAnnotation> GetAllAnnotations(long repositoryId, long checkRunId);

/// <summary>
/// Lists annotations for a check run using the check run Id.
/// </summary>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunAnnotation> GetAllAnnotations(string owner, string name, long checkRunId, ApiOptions options);

/// <summary>
/// Lists annotations for a check run using the check run Id.
/// </summary>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="checkRunId">The Id of the check run</param>
/// <param name="options">Options to change the API response</param>
IObservable<CheckRunAnnotation> GetAllAnnotations(long repositoryId, long checkRunId, ApiOptions options);
}
}
8 changes: 8 additions & 0 deletions Octokit.Reactive/Clients/IObservableChecksClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
/// </remarks>
public interface IObservableChecksClient
{
/// <summary>
/// A client for GitHub's Check Runs API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/checks/runs/">Check Runs API documentation</a> for more information.
/// </remarks>
IObservableCheckRunsClient Run { get; }

/// <summary>
/// A client for GitHub's Check Suites API.
/// </summary>
Expand Down
Loading