Skip to content

Commit

Permalink
[feat]: Adds Actions workflow API clients
Browse files Browse the repository at this point in the history
  • Loading branch information
martincostello authored Nov 23, 2022
1 parent b0e02e9 commit 8f01a31
Show file tree
Hide file tree
Showing 108 changed files with 9,575 additions and 84 deletions.
12 changes: 12 additions & 0 deletions Octokit.Reactive/Clients/IObservableActionsArtifactsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Artifacts API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/artifacts/">Actions Artifacts API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsArtifactsClient
{
}
}
12 changes: 12 additions & 0 deletions Octokit.Reactive/Clients/IObservableActionsCacheClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Cache API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/cache/">Actions Cache API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsCacheClient
{
}
}
41 changes: 41 additions & 0 deletions Octokit.Reactive/Clients/IObservableActionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/">Actions API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsClient
{
/// <summary>
/// Client for the Artifacts API.
/// </summary>
IObservableActionsArtifactsClient Artifacts { get; }

/// <summary>
/// Client for the Cache API.
/// </summary>
IObservableActionsCacheClient Cache { get; }

/// <summary>
/// Client for the Permissions API.
/// </summary>
IObservableActionsPermissionsClient Permissions { get; }

/// <summary>
/// Client for the Self-hosted runner groups API.
/// </summary>
IObservableActionsSelfHostedRunnerGroupsClient SelfHostedRunnerGroups { get; }

/// <summary>
/// Client for the Self-hosted runners API.
/// </summary>
IObservableActionsSelfHostedRunnersClient SelfHostedRunners { get; }

/// <summary>
/// Client for the Workflows API.
/// </summary>
IObservableActionsWorkflowsClient Workflows { get; }
}
}
12 changes: 12 additions & 0 deletions Octokit.Reactive/Clients/IObservableActionsPermissionsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Permissions API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/permissions/">Actions Permissions API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsPermissionsClient
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Self-hosted runner groups API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/self-hosted-runner-groups/">Actions Self-hosted runner groups API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsSelfHostedRunnerGroupsClient
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Self-hosted runners API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/self-hosted-runners/">Actions Self-hosted runners API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsSelfHostedRunnersClient
{
}
}
108 changes: 108 additions & 0 deletions Octokit.Reactive/Clients/IObservableActionsWorkflowJobsClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using System;
using System.Reactive;

namespace Octokit.Reactive
{
/// <summary>
/// A client for GitHub's Actions Workflows jobs API.
/// </summary>
/// <remarks>
/// See the <a href="https://developer.github.com/v3/actions/workflow-jobs/">Actions Workflows jobs API documentation</a> for more information.
/// </remarks>
public interface IObservableActionsWorkflowJobsClient
{
/// <summary>
/// Re-runs a specific workflow job in a repository.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#re-run-a-job-from-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="jobId">The Id of the workflow job.</param>
IObservable<Unit> Rerun(string owner, string name, long jobId);

/// <summary>
/// Gets a specific job in a workflow run.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-jobs/#get-a-job-for-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="jobId">The unique identifier of the job.</param>
IObservable<WorkflowJob> Get(string owner, string name, long jobId);

/// <summary>
/// Gets the plain text log file for a workflow job.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-jobs/#download-job-logs-for-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="jobId">The Id of the workflow job.</param>
IObservable<string> GetLogs(string owner, string name, long jobId);

/// <summary>
/// Lists jobs for a specific workflow run.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#list-jobs-for-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runId">The Id of the workflow run.</param>
IObservable<WorkflowJobsResponse> List(string owner, string name, long runId);

/// <summary>
/// Lists jobs for a specific workflow run.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#list-jobs-for-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runId">The Id of the workflow run.</param>
/// <param name="workflowRunJobsRequest">Details to filter the request, such as by when completed.</param>
IObservable<WorkflowJobsResponse> List(string owner, string name, long runId, WorkflowRunJobsRequest workflowRunJobsRequest);

/// <summary>
/// Lists jobs for a specific workflow run.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#list-jobs-for-a-workflow-run
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runId">The Id of the workflow run.</param>
/// <param name="workflowRunJobsRequest">Details to filter the request, such as by when completed.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<WorkflowJobsResponse> List(string owner, string name, long runId, WorkflowRunJobsRequest workflowRunJobsRequest, ApiOptions options);

/// <summary>
/// Lists jobs for a specific workflow run attempt.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#list-jobs-for-a-workflow-run-attempt
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runId">The Id of the workflow run.</param>
/// <param name="attemptNumber">The attempt number of the workflow run.</param>
IObservable<WorkflowJobsResponse> List(string owner, string name, long runId, int attemptNumber);

/// <summary>
/// Lists jobs for a specific workflow run attempt.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/workflow-runs/#list-jobs-for-a-workflow-run-attempt
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runId">The Id of the workflow run.</param>
/// <param name="attemptNumber">The attempt number of the workflow run.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<WorkflowJobsResponse> List(string owner, string name, long runId, int attemptNumber, ApiOptions options);
}
}
Loading

0 comments on commit 8f01a31

Please sign in to comment.