[Bug] Fixes ActionsSelfHostedRunnersClient Delete Calls where no API options are passed would throw errors

This commit is contained in:
Liam Neville
2023-07-05 13:06:32 -07:00
committed by GitHub
parent ccae892e20
commit 0c901dc6c5
5 changed files with 625 additions and 892 deletions

View File

@@ -1,258 +1,197 @@
using System;
using System.Collections.Generic;
using System.Reactive;
using System.Threading;
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
{
/// <summary>
/// A client for GitHub's Actions Self-hosted runners API.
/// Gets a list of all self-hosted runners for an enterprise.
/// </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.
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
public interface IObservableActionsSelfHostedRunnersClient
{
/// <summary>
/// Gets a list of all self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise);
/// <param name="enterprise">The enterprise.</param>
IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise);
/// <summary>
/// Gets a list of all self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// Gets a list of all self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// Gets a list of all self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization);
/// <summary>
/// Gets a list of all self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization);
/// <summary>
/// Gets a list of all self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options);
/// <summary>
/// Gets a list of all self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options);
/// <summary>
/// Gets a list of all self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name);
/// <summary>
/// Gets a list of all self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name);
/// <summary>
/// Gets a list of all self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Gets a list of all self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long runnerId);
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long runnerId);
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long runnerId, ApiOptions options);
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId);
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId);
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId);
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId, ApiOptions options);
/// <summary>
/// Create a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId);
/// <summary>
/// Create a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization, CancellationToken cancellationToken = default);
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId, ApiOptions options);
/// <summary>
/// Create a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise);
/// <summary>
/// Create a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, CancellationToken cancellationToken = default);
/// <summary>
/// Create a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, ApiOptions options);
/// <summary>
/// Create a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization);
/// <summary>
/// Create a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization, ApiOptions options);
/// <summary>
/// Create a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name);
/// <summary>
/// Create a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, ApiOptions options);
}
}
}

View File

@@ -1,371 +1,278 @@
using System;
using System.Collections.Generic;
using System.Reactive;
using System.Reactive.Threading.Tasks;
using System.Threading;
using Octokit.Reactive.Internal;
namespace Octokit.Reactive
{
public class ObservableActionsSelfHostedRunnersClient : IObservableActionsSelfHostedRunnersClient
public class ObservableActionsSelfHostedRunnersClient : IObservableActionsSelfHostedRunnersClient
{
readonly IActionsSelfHostedRunnersClient _client;
readonly IConnection _connection;
/// <summary>
/// Instantiate a new GitHub Actions Self-hosted runners API client.
/// </summary>
/// <param name="client">A GitHub client.</param>
public ObservableActionsSelfHostedRunnersClient(IGitHubClient client)
{
readonly IActionsSelfHostedRunnersClient _client;
readonly IConnection _connection;
Ensure.ArgumentNotNull(client, nameof(client));
/// <summary>
/// Instantiate a new GitHub Actions Self-hosted runners API client.
/// </summary>
/// <param name="client">A GitHub client.</param>
public ObservableActionsSelfHostedRunnersClient(IGitHubClient client)
{
Ensure.ArgumentNotNull(client, nameof(client));
_client = client.Actions.SelfHostedRunners;
_connection = client.Connection;
}
/// <summary>
/// Lists self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
public IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise)
{
return ListAllRunnersForEnterprise(enterprise, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForEnterprise(enterprise, options).ToObservable();
}
/// <summary>
/// Lists self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
public IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization)
{
return ListAllRunnersForOrganization(organization, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForOrganization(organization, options).ToObservable();
}
/// <summary>
/// Lists self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
public IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name)
{
return ListAllRunnersForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
/// </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>
public IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForRepository(owner, name, options).ToObservable();
}
/// <summary>
/// Lists all runner applications for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise)
{
return ListAllRunnerApplicationsForEnterprise(enterprise, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForEnterprise(enterprise));
}
/// <summary>
/// Lists all runner applications for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization)
{
return ListAllRunnerApplicationsForOrganization(organization, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForOrganization(organization));
}
/// <summary>
/// Lists all runner applications for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name)
{
return ListAllRunnerApplicationsForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </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>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForRepository(owner, name));
}
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long runnerId)
{
return DeleteEnterpriseRunner(enterprise, runnerId, ApiOptions.None);
}
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long groupId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.DeleteEnterpriseRunner(enterprise, groupId, options).ToObservable();
}
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId)
{
return DeleteOrganizationRunner(organization, runnerId, ApiOptions.None);
}
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.DeleteOrganizationRunner(organization, runnerId, options).ToObservable();
}
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId)
{
return DeleteRepositoryRunner(owner, name, runnerId, ApiOptions.None);
}
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.DeleteRepositoryRunner(owner, name, runnerId, options).ToObservable();
}
/// <summary>
/// Creates a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
public IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise)
{
return CreateEnterpriseRegistrationToken(enterprise, ApiOptions.None);
}
/// <summary>
/// Creates a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.CreateEnterpriseRegistrationToken(enterprise, options).ToObservable();
}
/// <summary>
/// Creates a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
public IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization)
{
return CreateOrganizationRegistrationToken(organization, ApiOptions.None);
}
/// <summary>
/// Creates a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.CreateOrganizationRegistrationToken(organization, options).ToObservable();
}
/// <summary>
/// Creates a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
public IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name)
{
return CreateRepositoryRegistrationToken(owner, name, ApiOptions.None);
}
/// <summary>
/// Creates a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </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>
public IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.CreateRepositoryRegistrationToken(owner, name, options).ToObservable();
}
_client = client.Actions.SelfHostedRunners;
_connection = client.Connection;
}
/// <summary>
/// Lists self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
public IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise)
{
return ListAllRunnersForEnterprise(enterprise, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForEnterprise(enterprise, options).ToObservable();
}
/// <summary>
/// Lists self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
public IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization)
{
return ListAllRunnersForOrganization(organization, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForOrganization(organization, options).ToObservable();
}
/// <summary>
/// Lists self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
public IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name)
{
return ListAllRunnersForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Lists self-hosted runners for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-a-repository
/// </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>
public IObservable<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));
return _client.ListAllRunnersForRepository(owner, name, options).ToObservable();
}
/// <summary>
/// Lists all runner applications for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise)
{
return ListAllRunnerApplicationsForEnterprise(enterprise, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options)
{
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForEnterprise(enterprise));
}
/// <summary>
/// Lists all runner applications for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization)
{
return ListAllRunnerApplicationsForOrganization(organization, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForOrganization(organization));
}
/// <summary>
/// Lists all runner applications for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name)
{
return ListAllRunnerApplicationsForRepository(owner, name, ApiOptions.None);
}
/// <summary>
/// Lists all runner applications for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </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>
public IObservable<RunnerApplication> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
Ensure.ArgumentNotNull(options, nameof(options));
return _connection.GetAndFlattenAllPages<RunnerApplication>(ApiUrls.ActionsListRunnerApplicationsForRepository(owner, name));
}
/// <summary>
/// Deletes a self-hosted runner from an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteEnterpriseRunner(string enterprise, long runnerId)
{
return _client.DeleteEnterpriseRunner(enterprise, runnerId).ToObservable();
}
/// <summary>
/// Deletes a self-hosted runner from an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteOrganizationRunner(string organization, long runnerId)
{
return _client.DeleteOrganizationRunner(organization, runnerId).ToObservable();
}
/// <summary>
/// Deletes a self-hosted runner from a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner id.</param>
public IObservable<Unit> DeleteRepositoryRunner(string owner, string name, long runnerId)
{
return _client.DeleteRepositoryRunner(owner, name, runnerId).ToObservable();
}
/// <summary>
/// Creates a registration token for an enterprise.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
public IObservable<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, CancellationToken cancellationToken = default)
{
return _client.CreateEnterpriseRegistrationToken(enterprise, cancellationToken).ToObservable();
}
/// <summary>
/// Creates a registration token for an organization.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
public IObservable<AccessToken> CreateOrganizationRegistrationToken(string organization, CancellationToken cancellationToken = default)
{
return _client.CreateOrganizationRegistrationToken(organization, cancellationToken).ToObservable();
}
/// <summary>
/// Creates a registration token for a repository.
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
public IObservable<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, CancellationToken cancellationToken = default)
{
return _client.CreateRepositoryRegistrationToken(owner, name, cancellationToken).ToObservable();
}
}
}

View File

@@ -238,8 +238,7 @@ namespace Octokit.Tests.Clients
await client.DeleteEnterpriseRunner("fake", 1);
connection.Received().Delete(
Arg.Is<Uri>(u => u.ToString() == "enterprises/fake/actions/runners/1"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "enterprises/fake/actions/runners/1"));
}
[Fact]
@@ -272,8 +271,7 @@ namespace Octokit.Tests.Clients
await client.DeleteOrganizationRunner("fake", 1);
connection.Received().Delete(
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/actions/runners/1"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/actions/runners/1"));
}
[Fact]
@@ -306,8 +304,7 @@ namespace Octokit.Tests.Clients
await client.DeleteRepositoryRunner("fake", "repo", 1);
connection.Received().Delete(
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/actions/runners/1"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/actions/runners/1"));
}
[Fact]
@@ -342,8 +339,7 @@ namespace Octokit.Tests.Clients
await client.CreateEnterpriseRegistrationToken("fake");
connection.Received().Post<AccessToken>(
Arg.Is<Uri>(u => u.ToString() == "enterprises/fake/actions/runners/registration-token"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "enterprises/fake/actions/runners/registration-token"));
}
[Fact]
@@ -376,8 +372,7 @@ namespace Octokit.Tests.Clients
await client.CreateOrganizationRegistrationToken("fake");
connection.Received().Post<AccessToken>(
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/actions/runners/registration-token"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "orgs/fake/actions/runners/registration-token"));
}
[Fact]
@@ -410,8 +405,7 @@ namespace Octokit.Tests.Clients
await client.CreateRepositoryRegistrationToken("fake", "repo");
connection.Received().Post<AccessToken>(
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/actions/runners/registration-token"),
ApiOptions.None);
Arg.Is<Uri>(u => u.ToString() == "repos/fake/repo/actions/runners/registration-token"));
}
[Fact]

View File

@@ -1,6 +1,7 @@
using System.Threading.Tasks;
using System.Linq;
using System.Collections.Generic;
using System.Threading;
namespace Octokit
{
@@ -228,25 +229,10 @@ namespace Octokit
/// <param name="runnerId">The runner id.</param>
[ManualRoute("DELETE", "/enterprises/{enterprise}/actions/runners/{runner_id}")]
public Task DeleteEnterpriseRunner(string enterprise, long runnerId)
{
return DeleteEnterpriseRunner(enterprise, runnerId, ApiOptions.None);
}
/// <summary>
/// Delete a self-hosted runner from an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("DELETE", "/enterprises/{enterprise}/actions/runners/{runner_id}")]
public Task DeleteEnterpriseRunner(string enterprise, long runnerId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(enterprise, nameof(enterprise));
return ApiConnection.Delete(ApiUrls.ActionsDeleteEnterpriseRunner(enterprise, runnerId), options);
return ApiConnection.Delete(ApiUrls.ActionsDeleteEnterpriseRunner(enterprise, runnerId));
}
/// <summary>
@@ -259,28 +245,12 @@ namespace Octokit
/// <param name="runnerId">The runner id.</param>
[ManualRoute("DELETE", "/orgs/{org}/actions/runners/{runner_id}")]
public Task DeleteOrganizationRunner(string organization, long runnerId)
{
return DeleteOrganizationRunner(organization, runnerId, ApiOptions.None);
}
/// <summary>
/// Delete a self-hosted runner from an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("DELETE", "/orgs/{org}/actions/runners/{runner_id}")]
public Task DeleteOrganizationRunner(string organization, long runnerId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
return ApiConnection.Delete(ApiUrls.ActionsDeleteOrganizationRunner(organization, runnerId), options);
return ApiConnection.Delete(ApiUrls.ActionsDeleteOrganizationRunner(organization, runnerId));
}
/// <summary>
/// Delete a self-hosted runner from a repository
/// </summary>
@@ -292,27 +262,11 @@ namespace Octokit
/// <param name="runnerId">The runner id.</param>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/actions/runners/{runner_id}")]
public Task DeleteRepositoryRunner(string owner, string repo, long runnerId)
{
return DeleteRepositoryRunner(owner, repo, runnerId, ApiOptions.None);
}
/// <summary>
/// Delete a self-hosted runner from a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner.</param>
/// <param name="repo">The repo.</param>
/// <param name="runnerId">The runner id.</param>
/// <param name="options">Options for changing the API response</param>
[ManualRoute("DELETE", "/repos/{owner}/{repo}/actions/runners/{runner_id}")]
public Task DeleteRepositoryRunner(string owner, string repo, long runnerId, ApiOptions options)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo));
return ApiConnection.Delete(ApiUrls.ActionsDeleteRepositoryRunner(owner, repo, runnerId), options);
return ApiConnection.Delete(ApiUrls.ActionsDeleteRepositoryRunner(owner, repo, runnerId));
}
/// <summary>
@@ -325,7 +279,7 @@ namespace Octokit
[ManualRoute("POST", "/enterprises/{enterprise}/actions/runners/registration-token")]
public Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise)
{
return CreateEnterpriseRegistrationToken(enterprise, ApiOptions.None);
return CreateEnterpriseRegistrationToken(enterprise, CancellationToken.None);
}
/// <summary>
@@ -335,13 +289,13 @@ namespace Octokit
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-self-hosted-runner-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options for changing the API response</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
[ManualRoute("POST", "/enterprises/{enterprise}/actions/runners/registration-token")]
public Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, ApiOptions options)
public Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, CancellationToken cancellationToken = default)
{
Ensure.ArgumentNotNullOrEmptyString(enterprise, nameof(enterprise));
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateEnterpriseRegistrationToken(enterprise), options);
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateEnterpriseRegistrationToken(enterprise), cancellationToken);
}
/// <summary>
@@ -354,7 +308,7 @@ namespace Octokit
[ManualRoute("POST", "/orgs/{org}/actions/runners/registration-token")]
public Task<AccessToken> CreateOrganizationRegistrationToken(string organization)
{
return CreateOrganizationRegistrationToken(organization, ApiOptions.None);
return CreateOrganizationRegistrationToken(organization, CancellationToken.None);
}
/// <summary>
@@ -364,13 +318,13 @@ namespace Octokit
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-self-hosted-runner-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options for changing the API response</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
[ManualRoute("POST", "/orgs/{org}/actions/runners/registration-token")]
public Task<AccessToken> CreateOrganizationRegistrationToken(string organization, ApiOptions options)
public Task<AccessToken> CreateOrganizationRegistrationToken(string organization, CancellationToken cancellationToken)
{
Ensure.ArgumentNotNullOrEmptyString(organization, nameof(organization));
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateOrganizationRegistrationToken(organization), options);
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateOrganizationRegistrationToken(organization), cancellationToken);
}
/// <summary>
@@ -384,7 +338,7 @@ namespace Octokit
[ManualRoute("POST", "/repos/{owner}/{repo}/actions/runners/registration-token")]
public Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string repo)
{
return CreateRepositoryRegistrationToken(owner, repo, ApiOptions.None);
return CreateRepositoryRegistrationToken(owner, repo, CancellationToken.None);
}
/// <summary>
@@ -395,14 +349,14 @@ namespace Octokit
/// </remarks>
/// <param name="owner">The owner.</param>
/// <param name="repo">The repo.</param>
/// <param name="options">Options for changing the API response</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
[ManualRoute("POST", "/repos/{owner}/{repo}/actions/runners/registration-token")]
public Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string repo, ApiOptions options)
public Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string repo, CancellationToken cancellationToken)
{
Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
Ensure.ArgumentNotNullOrEmptyString(repo, nameof(repo));
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateRepositoryRegistrationToken(owner, repo), options);
return ApiConnection.Post<AccessToken>(ApiUrls.ActionsCreateRepositoryRegistrationToken(owner, repo), cancellationToken);
}
}
}

View File

@@ -1,257 +1,196 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace Octokit
{
/// <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 IActionsSelfHostedRunnersClient
{
/// <summary>
/// A client for GitHub's Actions Self-hosted runners API.
/// List self-hosted runners for an enterprise
/// </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.
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
public interface IActionsSelfHostedRunnersClient
{
/// <summary>
/// List self-hosted runners for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
Task<RunnerResponse> ListAllRunnersForEnterprise(string enterprise);
/// <param name="enterprise">The enterprise.</param>
Task<RunnerResponse> ListAllRunnersForEnterprise(string enterprise);
/// <summary>
/// List self-hosted runners for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List self-hosted runners for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List self-hosted runners for an organization
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
Task<RunnerResponse> ListAllRunnersForOrganization(string organization);
/// <summary>
/// List self-hosted runners for an organization
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
Task<RunnerResponse> ListAllRunnersForOrganization(string organization);
/// <summary>
/// List self-hosted runners for an organization
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options);
/// <summary>
/// List self-hosted runners for an organization
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForOrganization(string organization, ApiOptions options);
/// <summary>
/// List self-hosted runners for a repository
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
Task<RunnerResponse> ListAllRunnersForRepository(string owner, string name);
/// <summary>
/// List self-hosted runners for a repository
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
Task<RunnerResponse> ListAllRunnersForRepository(string owner, string name);
/// <summary>
/// List self-hosted runners for a repository
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// List self-hosted runners for a repository
/// </summary>
/// <remarks>
/// https://developer.github.com/v3/actions/self-hosted-runners/#list-self-hosted-runners-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
Task<RunnerResponse> ListAllRunnersForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForEnterprise(string enterprise);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForEnterprise(string enterprise);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List runner applications for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForEnterprise(string enterprise, ApiOptions options);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForOrganization(string organization);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForOrganization(string organization);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options);
/// <summary>
/// List runner applications for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForOrganization(string organization, ApiOptions options);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForRepository(string owner, string name);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForRepository(string owner, string name);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// List runner applications for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
Task<IReadOnlyList<RunnerApplication>> ListAllRunnerApplicationsForRepository(string owner, string name, ApiOptions options);
/// <summary>
/// Delete a self-hosted runner from an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteEnterpriseRunner(string enterprise, long runnerId);
/// <summary>
/// Delete a self-hosted runner from an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteEnterpriseRunner(string enterprise, long runnerId);
/// <summary>
/// Delete a self-hosted runner from an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
Task DeleteEnterpriseRunner(string enterprise, long runnerId, ApiOptions options);
/// <summary>
/// Delete a self-hosted runner from an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteOrganizationRunner(string organization, long runnerId);
/// <summary>
/// Delete a self-hosted runner from an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteOrganizationRunner(string organization, long runnerId);
/// <summary>
/// Delete a self-hosted runner from a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteRepositoryRunner(string owner, string name, long runnerId);
/// <summary>
/// Delete a self-hosted runner from an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
Task DeleteOrganizationRunner(string organization, long runnerId, ApiOptions options);
/// <summary>
/// Create a registration token for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, CancellationToken cancellationToken = default);
/// <summary>
/// Delete a self-hosted runner from a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
Task DeleteRepositoryRunner(string owner, string name, long runnerId);
/// <summary>
/// Create a registration token for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
Task<AccessToken> CreateOrganizationRegistrationToken(string organization, CancellationToken cancellationToken = default);
/// <summary>
/// Delete a self-hosted runner from a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="runnerId">The runner ID.</param>
/// <param name="options">Options to change the API response.</param>
Task DeleteRepositoryRunner(string owner, string name, long runnerId, ApiOptions options);
/// <summary>
/// Create a registration token for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="cancellationToken">A token used to cancel this potentially long running request</param>
Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, CancellationToken cancellationToken = default);
/// <summary>
/// Create a registration token for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise);
/// <summary>
/// Create a registration token for an enterprise
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-enterprise
/// </remarks>
/// <param name="enterprise">The enterprise.</param>
/// <param name="options">Options to change the API response.</param>
Task<AccessToken> CreateEnterpriseRegistrationToken(string enterprise, ApiOptions options);
/// <summary>
/// Create a registration token for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
Task<AccessToken> CreateOrganizationRegistrationToken(string organization);
/// <summary>
/// Create a registration token for an organization
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-an-organization
/// </remarks>
/// <param name="organization">The organization.</param>
/// <param name="options">Options to change the API response.</param>
Task<AccessToken> CreateOrganizationRegistrationToken(string organization, ApiOptions options);
/// <summary>
/// Create a registration token for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string name);
/// <summary>
/// Create a registration token for a repository
/// </summary>
/// <remarks>
/// https://docs.github.com/en/enterprise-cloud@latest/rest/actions/self-hosted-runners?apiVersion=2022-11-28#create-a-registration-token-for-a-repository
/// </remarks>
/// <param name="owner">The owner of the repository.</param>
/// <param name="name">The name of the repository.</param>
/// <param name="options">Options to change the API response.</param>
Task<AccessToken> CreateRepositoryRegistrationToken(string owner, string name, ApiOptions options);
}
}
}