/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`actions_slash_add_custom_labels_to_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashAddCustomLabelsToSelfHostedRunnerForOrgError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_add_custom_labels_to_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashAddCustomLabelsToSelfHostedRunnerForRepoError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_add_selected_repo_to_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashAddSelectedRepoToOrgSecretError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_add_selected_repo_to_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashAddSelectedRepoToOrgVariableError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_approve_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashApproveWorkflowRunError {
Status403(models::BasicError),
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_cancel_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCancelWorkflowRunError {
Status409(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_environment_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateEnvironmentVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_or_update_environment_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateOrUpdateEnvironmentSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_or_update_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateOrUpdateOrgSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_or_update_repo_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateOrUpdateRepoSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateOrgVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_registration_token_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateRegistrationTokenForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_registration_token_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateRegistrationTokenForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_remove_token_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateRemoveTokenForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_remove_token_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateRemoveTokenForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_repo_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateRepoVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_create_workflow_dispatch`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashCreateWorkflowDispatchError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_actions_cache_by_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteActionsCacheByIdError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_actions_cache_by_key`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteActionsCacheByKeyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_artifact`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteArtifactError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_environment_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteEnvironmentSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_environment_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteEnvironmentVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteOrgSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteOrgVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_repo_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteRepoSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_repo_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteRepoVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_self_hosted_runner_from_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteSelfHostedRunnerFromOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_self_hosted_runner_from_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteSelfHostedRunnerFromRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteWorkflowRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_delete_workflow_run_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDeleteWorkflowRunLogsError {
Status403(models::BasicError),
Status500(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_disable_selected_repository_github_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDisableSelectedRepositoryGithubActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_disable_workflow`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDisableWorkflowError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_download_artifact`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDownloadArtifactError {
Status410(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_download_job_logs_for_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDownloadJobLogsForWorkflowRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_download_workflow_run_attempt_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDownloadWorkflowRunAttemptLogsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_download_workflow_run_logs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashDownloadWorkflowRunLogsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_enable_selected_repository_github_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashEnableSelectedRepositoryGithubActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_enable_workflow`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashEnableWorkflowError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_force_cancel_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashForceCancelWorkflowRunError {
Status409(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_generate_runner_jitconfig_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGenerateRunnerJitconfigForOrgError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_generate_runner_jitconfig_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGenerateRunnerJitconfigForRepoError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_actions_cache_list`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetActionsCacheListError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_actions_cache_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetActionsCacheUsageError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_actions_cache_usage_by_repo_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetActionsCacheUsageByRepoForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_actions_cache_usage_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetActionsCacheUsageForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_allowed_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetAllowedActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_allowed_actions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetAllowedActionsRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_artifact`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetArtifactError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_custom_oidc_sub_claim_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetCustomOidcSubClaimForRepoError {
Status400(models::BasicError),
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_environment_public_key`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetEnvironmentPublicKeyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_environment_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetEnvironmentSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_environment_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetEnvironmentVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_github_actions_default_workflow_permissions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetGithubActionsDefaultWorkflowPermissionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_github_actions_default_workflow_permissions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetGithubActionsDefaultWorkflowPermissionsRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_github_actions_permissions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetGithubActionsPermissionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_github_actions_permissions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetGithubActionsPermissionsRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_job_for_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetJobForWorkflowRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_org_public_key`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetOrgPublicKeyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetOrgSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetOrgVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_pending_deployments_for_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetPendingDeploymentsForRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_repo_public_key`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetRepoPublicKeyError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_repo_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetRepoSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_repo_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetRepoVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_reviews_for_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetReviewsForRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetSelfHostedRunnerForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetSelfHostedRunnerForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow_access_to_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowAccessToRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow_run_attempt`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowRunAttemptError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow_run_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowRunUsageError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_get_workflow_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashGetWorkflowUsageError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_artifacts_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListArtifactsForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_environment_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListEnvironmentSecretsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_environment_variables`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListEnvironmentVariablesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_jobs_for_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListJobsForWorkflowRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_jobs_for_workflow_run_attempt`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListJobsForWorkflowRunAttemptError {
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_labels_for_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListLabelsForSelfHostedRunnerForOrgError {
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_labels_for_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListLabelsForSelfHostedRunnerForRepoError {
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_org_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListOrgSecretsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_org_variables`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListOrgVariablesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_repo_organization_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRepoOrganizationSecretsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_repo_organization_variables`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRepoOrganizationVariablesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_repo_secrets`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRepoSecretsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_repo_variables`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRepoVariablesError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_repo_workflows`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRepoWorkflowsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_runner_applications_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRunnerApplicationsForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_runner_applications_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListRunnerApplicationsForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_selected_repos_for_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListSelectedReposForOrgSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_selected_repos_for_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListSelectedReposForOrgVariableError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_selected_repositories_enabled_github_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListSelectedRepositoriesEnabledGithubActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_self_hosted_runners_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListSelfHostedRunnersForOrgError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_self_hosted_runners_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListSelfHostedRunnersForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_workflow_run_artifacts`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListWorkflowRunArtifactsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_workflow_runs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListWorkflowRunsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_list_workflow_runs_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashListWorkflowRunsForRepoError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_re_run_job_for_workflow_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashReRunJobForWorkflowRunError {
Status403(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_re_run_workflow`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashReRunWorkflowError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_re_run_workflow_failed_jobs`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashReRunWorkflowFailedJobsError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_all_custom_labels_from_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForOrgError {
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_all_custom_labels_from_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForRepoError {
Status404(models::BasicError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_custom_label_from_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForOrgError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_custom_label_from_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForRepoError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_selected_repo_from_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveSelectedRepoFromOrgSecretError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_remove_selected_repo_from_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashRemoveSelectedRepoFromOrgVariableError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_review_custom_gates_for_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashReviewCustomGatesForRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_review_pending_deployments_for_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashReviewPendingDeploymentsForRunError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_allowed_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetAllowedActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_allowed_actions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetAllowedActionsRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_custom_labels_for_self_hosted_runner_for_org`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetCustomLabelsForSelfHostedRunnerForOrgError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_custom_labels_for_self_hosted_runner_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetCustomLabelsForSelfHostedRunnerForRepoError {
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_custom_oidc_sub_claim_for_repo`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetCustomOidcSubClaimForRepoError {
Status400(models::BasicError),
Status404(models::BasicError),
Status422(models::ValidationErrorSimple),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_github_actions_default_workflow_permissions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetGithubActionsDefaultWorkflowPermissionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_github_actions_default_workflow_permissions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetGithubActionsDefaultWorkflowPermissionsRepositoryError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_github_actions_permissions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetGithubActionsPermissionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_github_actions_permissions_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetGithubActionsPermissionsRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_selected_repos_for_org_secret`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetSelectedReposForOrgSecretError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_selected_repos_for_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetSelectedReposForOrgVariableError {
Status409(),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_selected_repositories_enabled_github_actions_organization`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetSelectedRepositoriesEnabledGithubActionsOrganizationError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_set_workflow_access_to_repository`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashSetWorkflowAccessToRepositoryError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_update_environment_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashUpdateEnvironmentVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_update_org_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashUpdateOrgVariableError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`actions_slash_update_repo_variable`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ActionsSlashUpdateRepoVariableError {
UnknownValue(serde_json::Value),
}
/// Adds custom labels to a self-hosted runner configured in an organization. Authenticated users must have admin access to the organization to use this endpoint. OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_add_custom_labels_to_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32, actions_add_custom_labels_to_self_hosted_runner_for_org_request: models::ActionsAddCustomLabelsToSelfHostedRunnerForOrgRequest) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashAddCustomLabelsToSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_add_custom_labels_to_self_hosted_runner_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashAddCustomLabelsToSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Adds custom labels to a self-hosted runner configured in a repository. Authenticated users must have admin access to the organization to use this endpoint. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_add_custom_labels_to_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32, actions_add_custom_labels_to_self_hosted_runner_for_org_request: models::ActionsAddCustomLabelsToSelfHostedRunnerForOrgRequest) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashAddCustomLabelsToSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_add_custom_labels_to_self_hosted_runner_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashAddCustomLabelsToSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Adds a repository to an organization secret when the `visibility` for repository access is set to `selected`. For more information about setting the visibility, see [Create or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_add_selected_repo_to_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str, repository_id: i32) -> Result<(), Error<ActionsSlashAddSelectedRepoToOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashAddSelectedRepoToOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Adds a repository to an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_add_selected_repo_to_org_variable(configuration: &configuration::Configuration, org: &str, name: &str, repository_id: i32) -> Result<(), Error<ActionsSlashAddSelectedRepoToOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashAddSelectedRepoToOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Approves a workflow run for a pull request from a public fork of a first time contributor. For more information, see [\"Approving workflow runs from public forks](https://docs.github.com/actions/managing-workflow-runs/approving-workflow-runs-from-public-forks).\" OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_approve_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<serde_json::Value, Error<ActionsSlashApproveWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/approve", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashApproveWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Cancels a workflow run using its `id`. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_cancel_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<serde_json::Value, Error<ActionsSlashCancelWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/cancel", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCancelWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Create an environment variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_environment_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, actions_create_repo_variable_request: models::ActionsCreateRepoVariableRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateEnvironmentVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/variables", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_repo_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateEnvironmentVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Creates or updates an environment secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see \"[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api).\" Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_or_update_environment_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, secret_name: &str, actions_create_or_update_environment_secret_request: models::ActionsCreateOrUpdateEnvironmentSecretRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateOrUpdateEnvironmentSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_or_update_environment_secret_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateOrUpdateEnvironmentSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Creates or updates an organization secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `secrets` organization permission to use this endpoint. #### Example encrypting a secret using Node.js Encrypt your secret using the [tweetsodium](https://github.com/github/tweetsodium) library. ``` const sodium = require('tweetsodium'); const key = \"base64-encoded-public-key\"; const value = \"plain-text-secret\"; // Convert the message and key to Uint8Array's (Buffer implements that interface) const messageBytes = Buffer.from(value); const keyBytes = Buffer.from(key, 'base64'); // Encrypt using LibSodium. const encryptedBytes = sodium.seal(messageBytes, keyBytes); // Base64 the encrypted secret const encrypted = Buffer.from(encryptedBytes).toString('base64'); console.log(encrypted); ``` #### Example encrypting a secret using Python Encrypt your secret using [pynacl](https://pynacl.readthedocs.io/en/latest/public/#nacl-public-sealedbox) with Python 3. ``` from base64 import b64encode from nacl import encoding, public def encrypt(public_key: str, secret_value: str) -> str: \"\"\"Encrypt a Unicode string using the public key.\"\"\" public_key = public.PublicKey(public_key.encode(\"utf-8\"), encoding.Base64Encoder()) sealed_box = public.SealedBox(public_key) encrypted = sealed_box.encrypt(secret_value.encode(\"utf-8\")) return b64encode(encrypted).decode(\"utf-8\") ``` #### Example encrypting a secret using C# Encrypt your secret using the [Sodium.Core](https://www.nuget.org/packages/Sodium.Core/) package. ``` var secretValue = System.Text.Encoding.UTF8.GetBytes(\"mySecret\"); var publicKey = Convert.FromBase64String(\"2Sg8iYjAxxmI2LvUXpJjkYrMxURPc8r+dB7TJyvvcCU=\"); var sealedPublicKeyBox = Sodium.SealedPublicKeyBox.Create(secretValue, publicKey); Console.WriteLine(Convert.ToBase64String(sealedPublicKeyBox)); ``` #### Example encrypting a secret using Ruby Encrypt your secret using the [rbnacl](https://github.com/RubyCrypto/rbnacl) gem. ```ruby require \"rbnacl\" require \"base64\" key = Base64.decode64(\"+ZYvJDZMHUfBkJdyq5Zm9SKqeuBQ4sj+6sfjlH4CgG0=\") public_key = RbNaCl::PublicKey.new(key) box = RbNaCl::Boxes::Sealed.from_public_key(public_key) encrypted_secret = box.encrypt(\"my_secret\") # Print the base64 encoded secret puts Base64.strict_encode64(encrypted_secret) ```
pub async fn actions_slash_create_or_update_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str, actions_create_or_update_org_secret_request: models::ActionsCreateOrUpdateOrgSecretRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateOrUpdateOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_or_update_org_secret_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateOrUpdateOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Creates or updates a repository secret with an encrypted value. Encrypt your secret using [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages). For more information, see \"[Encrypting secrets for the REST API](https://docs.github.com/rest/guides/encrypting-secrets-for-the-rest-api).\" Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_or_update_repo_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, secret_name: &str, actions_create_or_update_repo_secret_request: models::ActionsCreateOrUpdateRepoSecretRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateOrUpdateRepoSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_or_update_repo_secret_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateOrUpdateRepoSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Creates an organization variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_org_variable(configuration: &configuration::Configuration, org: &str, actions_create_org_variable_request: models::ActionsCreateOrgVariableRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_org_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Returns a token that you can pass to the `config` script. The token expires after one hour. For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: ``` ./config.sh --url https://github.com/octo-org --token TOKEN ``` Authenticated users must have admin access to the organization to use this endpoint. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_registration_token_for_org(configuration: &configuration::Configuration, org: &str) -> Result<models::AuthenticationToken, Error<ActionsSlashCreateRegistrationTokenForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/registration-token", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateRegistrationTokenForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Returns a token that you can pass to the `config` script. The token expires after one hour. For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner: ``` ./config.sh --url https://github.com/octo-org --token TOKEN ``` Authenticated users must have admin access to the repository to use this endpoint. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_registration_token_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::AuthenticationToken, Error<ActionsSlashCreateRegistrationTokenForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/registration-token", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateRegistrationTokenForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour. For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: ``` ./config.sh remove --token TOKEN ``` Authenticated users must have admin access to the organization to use this endpoint. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_remove_token_for_org(configuration: &configuration::Configuration, org: &str) -> Result<models::AuthenticationToken, Error<ActionsSlashCreateRemoveTokenForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/remove-token", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateRemoveTokenForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour. For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization: ``` ./config.sh remove --token TOKEN ``` Authenticated users must have admin access to the repository to use this endpoint. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_remove_token_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::AuthenticationToken, Error<ActionsSlashCreateRemoveTokenForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/remove-token", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateRemoveTokenForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Creates a repository variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_repo_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_create_repo_variable_request: models::ActionsCreateRepoVariableRequest) -> Result<serde_json::Value, Error<ActionsSlashCreateRepoVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/variables", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_repo_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashCreateRepoVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// You can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see \"[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch).\" OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_create_workflow_dispatch(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter, actions_create_workflow_dispatch_request: models::ActionsCreateWorkflowDispatchRequest) -> Result<(), Error<ActionsSlashCreateWorkflowDispatchError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_create_workflow_dispatch_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashCreateWorkflowDispatchError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a GitHub Actions cache for a repository, using a cache ID. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_actions_cache_by_id(configuration: &configuration::Configuration, owner: &str, repo: &str, cache_id: i32) -> Result<(), Error<ActionsSlashDeleteActionsCacheByIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/caches/{cache_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), cache_id=cache_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteActionsCacheByIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_actions_cache_by_key(configuration: &configuration::Configuration, owner: &str, repo: &str, key: &str, r#ref: Option<&str>) -> Result<models::ActionsCacheList, Error<ActionsSlashDeleteActionsCacheByKeyError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/caches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("key", &key.to_string())]);
if let Some(ref local_var_str) = r#ref {
local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashDeleteActionsCacheByKeyError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes an artifact for a workflow run. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_artifact(configuration: &configuration::Configuration, owner: &str, repo: &str, artifact_id: i32) -> Result<(), Error<ActionsSlashDeleteArtifactError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/artifacts/{artifact_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), artifact_id=artifact_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteArtifactError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a secret in an environment using the secret name. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_environment_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, secret_name: &str) -> Result<(), Error<ActionsSlashDeleteEnvironmentSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteEnvironmentSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes an environment variable using the variable name. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_environment_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str, environment_name: &str) -> Result<(), Error<ActionsSlashDeleteEnvironmentVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteEnvironmentVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a secret in an organization using the secret name. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str) -> Result<(), Error<ActionsSlashDeleteOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes an organization variable using the variable name. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_org_variable(configuration: &configuration::Configuration, org: &str, name: &str) -> Result<(), Error<ActionsSlashDeleteOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a secret in a repository using the secret name. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_repo_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, secret_name: &str) -> Result<(), Error<ActionsSlashDeleteRepoSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteRepoSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a repository variable using the variable name. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_repo_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result<(), Error<ActionsSlashDeleteRepoVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteRepoVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. Authenticated users must have admin access to the organization to use this endpoint. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_self_hosted_runner_from_org(configuration: &configuration::Configuration, org: &str, runner_id: i32) -> Result<(), Error<ActionsSlashDeleteSelfHostedRunnerFromOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteSelfHostedRunnerFromOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists. Authenticated users must have admin access to the repository to use this endpoint. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_self_hosted_runner_from_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32) -> Result<(), Error<ActionsSlashDeleteSelfHostedRunnerFromRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteSelfHostedRunnerFromRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes a specific workflow run. Anyone with write access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<(), Error<ActionsSlashDeleteWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Deletes all logs for a workflow run. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_delete_workflow_run_logs(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<(), Error<ActionsSlashDeleteWorkflowRunLogsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/logs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDeleteWorkflowRunLogsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_disable_selected_repository_github_actions_organization(configuration: &configuration::Configuration, org: &str, repository_id: i32) -> Result<(), Error<ActionsSlashDisableSelectedRepositoryGithubActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDisableSelectedRepositoryGithubActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_disable_workflow(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<(), Error<ActionsSlashDisableWorkflowError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}/disable", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDisableWorkflowError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. The `:archive_format` must be `zip`. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_download_artifact(configuration: &configuration::Configuration, owner: &str, repo: &str, artifact_id: i32, archive_format: &str) -> Result<(), Error<ActionsSlashDownloadArtifactError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/artifacts/{artifact_id}/{archive_format}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), artifact_id=artifact_id, archive_format=crate::apis::urlencode(archive_format));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDownloadArtifactError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_download_job_logs_for_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, job_id: i32) -> Result<(), Error<ActionsSlashDownloadJobLogsForWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/jobs/{job_id}/logs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), job_id=job_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDownloadJobLogsForWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_download_workflow_run_attempt_logs(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, attempt_number: i32) -> Result<(), Error<ActionsSlashDownloadWorkflowRunAttemptLogsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id, attempt_number=attempt_number);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDownloadWorkflowRunAttemptLogsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for `Location:` in the response header to find the URL for the download. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_download_workflow_run_logs(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<(), Error<ActionsSlashDownloadWorkflowRunLogsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/logs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashDownloadWorkflowRunLogsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_enable_selected_repository_github_actions_organization(configuration: &configuration::Configuration, org: &str, repository_id: i32) -> Result<(), Error<ActionsSlashEnableSelectedRepositoryGithubActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashEnableSelectedRepositoryGithubActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_enable_workflow(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<(), Error<ActionsSlashEnableWorkflowError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}/enable", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashEnableWorkflowError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job. You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run). OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_force_cancel_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<serde_json::Value, Error<ActionsSlashForceCancelWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/force-cancel", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashForceCancelWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Generates a configuration that can be passed to the runner application at startup. The authenticated user must have admin access to the organization. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_generate_runner_jitconfig_for_org(configuration: &configuration::Configuration, org: &str, actions_generate_runner_jitconfig_for_org_request: models::ActionsGenerateRunnerJitconfigForOrgRequest) -> Result<models::ActionsGenerateRunnerJitconfigForOrg201Response, Error<ActionsSlashGenerateRunnerJitconfigForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/generate-jitconfig", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_generate_runner_jitconfig_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGenerateRunnerJitconfigForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Generates a configuration that can be passed to the runner application at startup. The authenticated user must have admin access to the repository. OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint.
pub async fn actions_slash_generate_runner_jitconfig_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_generate_runner_jitconfig_for_org_request: models::ActionsGenerateRunnerJitconfigForOrgRequest) -> Result<models::ActionsGenerateRunnerJitconfigForOrg201Response, Error<ActionsSlashGenerateRunnerJitconfigForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/generate-jitconfig", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_generate_runner_jitconfig_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGenerateRunnerJitconfigForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists the GitHub Actions caches for a repository. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_actions_cache_list(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>, r#ref: Option<&str>, key: Option<&str>, sort: Option<&str>, direction: Option<&str>) -> Result<models::ActionsCacheList, Error<ActionsSlashGetActionsCacheListError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/caches", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = r#ref {
local_var_req_builder = local_var_req_builder.query(&[("ref", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = key {
local_var_req_builder = local_var_req_builder.query(&[("key", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = sort {
local_var_req_builder = local_var_req_builder.query(&[("sort", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = direction {
local_var_req_builder = local_var_req_builder.query(&[("direction", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetActionsCacheListError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets GitHub Actions cache usage for a repository. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_actions_cache_usage(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ActionsCacheUsageByRepository, Error<ActionsSlashGetActionsCacheUsageError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/cache/usage", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetActionsCacheUsageError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists repositories and their GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.
pub async fn actions_slash_get_actions_cache_usage_by_repo_for_org(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsGetActionsCacheUsageByRepoForOrg200Response, Error<ActionsSlashGetActionsCacheUsageByRepoForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/cache/usage-by-repository", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetActionsCacheUsageByRepoForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the total GitHub Actions cache usage for an organization. The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated. OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint.
pub async fn actions_slash_get_actions_cache_usage_for_org(configuration: &configuration::Configuration, org: &str) -> Result<models::ActionsCacheUsageOrgEnterprise, Error<ActionsSlashGetActionsCacheUsageForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/cache/usage", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetActionsCacheUsageForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the selected actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_get_allowed_actions_organization(configuration: &configuration::Configuration, org: &str) -> Result<models::SelectedActions, Error<ActionsSlashGetAllowedActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/selected-actions", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetAllowedActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the settings for selected actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\" OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_allowed_actions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::SelectedActions, Error<ActionsSlashGetAllowedActionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/selected-actions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetAllowedActionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific artifact for a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_artifact(configuration: &configuration::Configuration, owner: &str, repo: &str, artifact_id: i32) -> Result<models::Artifact, Error<ActionsSlashGetArtifactError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/artifacts/{artifact_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), artifact_id=artifact_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetArtifactError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the customization template for an OpenID Connect (OIDC) subject claim. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_custom_oidc_sub_claim_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::OidcCustomSubRepo, Error<ActionsSlashGetCustomOidcSubClaimForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/oidc/customization/sub", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetCustomOidcSubClaimForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Get the public key for an environment, which you need to encrypt environment secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_environment_public_key(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str) -> Result<models::ActionsPublicKey, Error<ActionsSlashGetEnvironmentPublicKeyError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/secrets/public-key", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetEnvironmentPublicKeyError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a single environment secret without revealing its encrypted value. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_environment_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, secret_name: &str) -> Result<models::ActionsSecret, Error<ActionsSlashGetEnvironmentSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetEnvironmentSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific variable in an environment. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_environment_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, name: &str) -> Result<models::ActionsVariable, Error<ActionsSlashGetEnvironmentVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetEnvironmentVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, as well as whether GitHub Actions can submit approving pull request reviews. For more information, see \"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization).\" OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_get_github_actions_default_workflow_permissions_organization(configuration: &configuration::Configuration, org: &str) -> Result<models::ActionsGetDefaultWorkflowPermissions, Error<ActionsSlashGetGithubActionsDefaultWorkflowPermissionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/workflow", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetGithubActionsDefaultWorkflowPermissionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, as well as if GitHub Actions can submit approving pull request reviews. For more information, see \"[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository).\" OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_github_actions_default_workflow_permissions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ActionsGetDefaultWorkflowPermissions, Error<ActionsSlashGetGithubActionsDefaultWorkflowPermissionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/workflow", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetGithubActionsDefaultWorkflowPermissionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_get_github_actions_permissions_organization(configuration: &configuration::Configuration, org: &str) -> Result<models::ActionsOrganizationPermissions, Error<ActionsSlashGetGithubActionsPermissionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetGithubActionsPermissionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions and reusable workflows allowed to run in the repository. OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_github_actions_permissions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ActionsRepositoryPermissions, Error<ActionsSlashGetGithubActionsPermissionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetGithubActionsPermissionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific job in a workflow run. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_job_for_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, job_id: i32) -> Result<models::Job, Error<ActionsSlashGetJobForWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/jobs/{job_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), job_id=job_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetJobForWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. The authenticated user must have collaborator access to a repository to create, update, or read secrets. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_org_public_key(configuration: &configuration::Configuration, org: &str) -> Result<models::ActionsPublicKey, Error<ActionsSlashGetOrgPublicKeyError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/public-key", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetOrgPublicKeyError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a single organization secret without revealing its encrypted value. The authenticated user must have collaborator access to a repository to create, update, or read secrets OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str) -> Result<models::OrganizationActionsSecret, Error<ActionsSlashGetOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific variable in an organization. The authenticated user must have collaborator access to a repository to create, update, or read variables. OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_org_variable(configuration: &configuration::Configuration, org: &str, name: &str) -> Result<models::OrganizationActionsVariable, Error<ActionsSlashGetOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Get all deployment environments for a workflow run that are waiting for protection rules to pass. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_pending_deployments_for_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<Vec<models::PendingDeployment>, Error<ActionsSlashGetPendingDeploymentsForRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetPendingDeploymentsForRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets your public key, which you need to encrypt secrets. You need to encrypt a secret before you can create or update secrets. Anyone with read access to the repository can use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_repo_public_key(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ActionsPublicKey, Error<ActionsSlashGetRepoPublicKeyError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/secrets/public-key", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetRepoPublicKeyError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a single repository secret without revealing its encrypted value. The authenticated user must have collaborator access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_repo_secret(configuration: &configuration::Configuration, owner: &str, repo: &str, secret_name: &str) -> Result<models::ActionsSecret, Error<ActionsSlashGetRepoSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/secrets/{secret_name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetRepoSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific variable in a repository. The authenticated user must have collaborator access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_repo_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str) -> Result<models::ActionsVariable, Error<ActionsSlashGetRepoVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetRepoVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_reviews_for_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<Vec<models::EnvironmentApprovals>, Error<ActionsSlashGetReviewsForRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/approvals", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetReviewsForRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific self-hosted runner configured in an organization. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_get_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32) -> Result<models::Runner, Error<ActionsSlashGetSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific self-hosted runner configured in a repository. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32) -> Result<models::Runner, Error<ActionsSlashGetSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_workflow(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<models::Workflow, Error<ActionsSlashGetWorkflowError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to private repositories. For more information, see \"[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository).\" OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_get_workflow_access_to_repository(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<models::ActionsWorkflowAccessToRepository, Error<ActionsSlashGetWorkflowAccessToRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/access", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowAccessToRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific workflow run. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, exclude_pull_requests: Option<bool>) -> Result<models::WorkflowRun, Error<ActionsSlashGetWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = exclude_pull_requests {
local_var_req_builder = local_var_req_builder.query(&[("exclude_pull_requests", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets a specific workflow run attempt. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_workflow_run_attempt(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, attempt_number: i32, exclude_pull_requests: Option<bool>) -> Result<models::WorkflowRun, Error<ActionsSlashGetWorkflowRunAttemptError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id, attempt_number=attempt_number);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = exclude_pull_requests {
local_var_req_builder = local_var_req_builder.query(&[("exclude_pull_requests", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowRunAttemptError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the number of billable minutes and total run time for a specific workflow run. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see \"[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)\". Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_workflow_run_usage(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32) -> Result<models::WorkflowRunUsage, Error<ActionsSlashGetWorkflowRunUsageError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/timing", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowRunUsageError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Gets the number of billable minutes used by a specific workflow during the current billing cycle. Billable minutes only apply to workflows in private repositories that use GitHub-hosted runners. Usage is listed for each GitHub-hosted runner operating system in milliseconds. Any job re-runs are also included in the usage. The usage does not include the multiplier for macOS and Windows runners and is not rounded up to the nearest whole minute. For more information, see \"[Managing billing for GitHub Actions](https://docs.github.com/github/setting-up-and-managing-billing-and-payments-on-github/managing-billing-for-github-actions)\". You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_get_workflow_usage(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter) -> Result<models::WorkflowUsage, Error<ActionsSlashGetWorkflowUsageError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}/timing", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashGetWorkflowUsageError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all artifacts for a repository. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_artifacts_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>, name: Option<&str>) -> Result<models::ActionsListArtifactsForRepo200Response, Error<ActionsSlashListArtifactsForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/artifacts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListArtifactsForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all secrets available in an environment without revealing their encrypted values. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_environment_secrets(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationSecrets200Response, Error<ActionsSlashListEnvironmentSecretsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/secrets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListEnvironmentSecretsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all environment variables. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_environment_variables(configuration: &configuration::Configuration, owner: &str, repo: &str, environment_name: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationVariables200Response, Error<ActionsSlashListEnvironmentVariablesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/variables", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListEnvironmentVariablesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists jobs for a workflow run. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_jobs_for_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, filter: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListJobsForWorkflowRunAttempt200Response, Error<ActionsSlashListJobsForWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/jobs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = filter {
local_var_req_builder = local_var_req_builder.query(&[("filter", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListJobsForWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_jobs_for_workflow_run_attempt(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, attempt_number: i32, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListJobsForWorkflowRunAttempt200Response, Error<ActionsSlashListJobsForWorkflowRunAttemptError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/jobs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id, attempt_number=attempt_number);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListJobsForWorkflowRunAttemptError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all labels for a self-hosted runner configured in an organization. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_labels_for_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashListLabelsForSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListLabelsForSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all labels for a self-hosted runner configured in a repository. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_labels_for_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashListLabelsForSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListLabelsForSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all secrets available in an organization without revealing their encrypted values. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_org_secrets(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListOrgSecrets200Response, Error<ActionsSlashListOrgSecretsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListOrgSecretsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all organization variables. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_org_variables(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListOrgVariables200Response, Error<ActionsSlashListOrgVariablesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListOrgVariablesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all organization secrets shared with a repository without revealing their encrypted values. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_repo_organization_secrets(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationSecrets200Response, Error<ActionsSlashListRepoOrganizationSecretsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/organization-secrets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRepoOrganizationSecretsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all organization variables shared with a repository. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_repo_organization_variables(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationVariables200Response, Error<ActionsSlashListRepoOrganizationVariablesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/organization-variables", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRepoOrganizationVariablesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all secrets available in a repository without revealing their encrypted values. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_repo_secrets(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationSecrets200Response, Error<ActionsSlashListRepoSecretsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/secrets", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRepoSecretsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all repository variables. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_repo_variables(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoOrganizationVariables200Response, Error<ActionsSlashListRepoVariablesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/variables", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRepoVariablesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists the workflows in a repository. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_repo_workflows(configuration: &configuration::Configuration, owner: &str, repo: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListRepoWorkflows200Response, Error<ActionsSlashListRepoWorkflowsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRepoWorkflowsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists binaries for the runner application that you can download and run. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_runner_applications_for_org(configuration: &configuration::Configuration, org: &str) -> Result<Vec<models::RunnerApplication>, Error<ActionsSlashListRunnerApplicationsForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/downloads", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRunnerApplicationsForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists binaries for the runner application that you can download and run. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_runner_applications_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str) -> Result<Vec<models::RunnerApplication>, Error<ActionsSlashListRunnerApplicationsForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/downloads", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListRunnerApplicationsForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all repositories that have been selected when the `visibility` for repository access to a secret is set to `selected`. Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_selected_repos_for_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ActionsListSelectedReposForOrgSecret200Response, Error<ActionsSlashListSelectedReposForOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListSelectedReposForOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all repositories that can access an organization variable that is available to selected repositories. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_selected_repos_for_org_variable(configuration: &configuration::Configuration, org: &str, name: &str, page: Option<i32>, per_page: Option<i32>) -> Result<models::ActionsListSelectedReposForOrgSecret200Response, Error<ActionsSlashListSelectedReposForOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListSelectedReposForOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_list_selected_repositories_enabled_github_actions_organization(configuration: &configuration::Configuration, org: &str, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListSelectedRepositoriesEnabledGithubActionsOrganization200Response, Error<ActionsSlashListSelectedRepositoriesEnabledGithubActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListSelectedRepositoriesEnabledGithubActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all self-hosted runners configured in an organization. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_list_self_hosted_runners_for_org(configuration: &configuration::Configuration, org: &str, name: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListSelfHostedRunnersForOrg200Response, Error<ActionsSlashListSelfHostedRunnersForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListSelfHostedRunnersForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all self-hosted runners configured in a repository. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_list_self_hosted_runners_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, name: Option<&str>, per_page: Option<i32>, page: Option<i32>) -> Result<models::ActionsListSelfHostedRunnersForOrg200Response, Error<ActionsSlashListSelfHostedRunnersForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListSelfHostedRunnersForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists artifacts for a workflow run. Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_workflow_run_artifacts(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, per_page: Option<i32>, page: Option<i32>, name: Option<&str>) -> Result<models::ActionsListArtifactsForRepo200Response, Error<ActionsSlashListWorkflowRunArtifactsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/artifacts", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = name {
local_var_req_builder = local_var_req_builder.query(&[("name", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListWorkflowRunArtifactsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// List all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_list_workflow_runs(configuration: &configuration::Configuration, owner: &str, repo: &str, workflow_id: models::ActionsGetWorkflowWorkflowIdParameter, actor: Option<&str>, branch: Option<&str>, event: Option<&str>, status: Option<&str>, per_page: Option<i32>, page: Option<i32>, created: Option<String>, exclude_pull_requests: Option<bool>, check_suite_id: Option<i32>, head_sha: Option<&str>) -> Result<models::ActionsListWorkflowRunsForRepo200Response, Error<ActionsSlashListWorkflowRunsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/workflows/{workflow_id}/runs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), workflow_id=workflow_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = actor {
local_var_req_builder = local_var_req_builder.query(&[("actor", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = branch {
local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = event {
local_var_req_builder = local_var_req_builder.query(&[("event", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = status {
local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = created {
local_var_req_builder = local_var_req_builder.query(&[("created", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = exclude_pull_requests {
local_var_req_builder = local_var_req_builder.query(&[("exclude_pull_requests", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = check_suite_id {
local_var_req_builder = local_var_req_builder.query(&[("check_suite_id", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = head_sha {
local_var_req_builder = local_var_req_builder.query(&[("head_sha", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListWorkflowRunsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/rest/guides/getting-started-with-the-rest-api#parameters). Anyone with read access to the repository can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`.
pub async fn actions_slash_list_workflow_runs_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, actor: Option<&str>, branch: Option<&str>, event: Option<&str>, status: Option<&str>, per_page: Option<i32>, page: Option<i32>, created: Option<String>, exclude_pull_requests: Option<bool>, check_suite_id: Option<i32>, head_sha: Option<&str>) -> Result<models::ActionsListWorkflowRunsForRepo200Response, Error<ActionsSlashListWorkflowRunsForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = actor {
local_var_req_builder = local_var_req_builder.query(&[("actor", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = branch {
local_var_req_builder = local_var_req_builder.query(&[("branch", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = event {
local_var_req_builder = local_var_req_builder.query(&[("event", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = status {
local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = per_page {
local_var_req_builder = local_var_req_builder.query(&[("per_page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = created {
local_var_req_builder = local_var_req_builder.query(&[("created", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = exclude_pull_requests {
local_var_req_builder = local_var_req_builder.query(&[("exclude_pull_requests", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = check_suite_id {
local_var_req_builder = local_var_req_builder.query(&[("check_suite_id", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = head_sha {
local_var_req_builder = local_var_req_builder.query(&[("head_sha", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashListWorkflowRunsForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Re-run a job and its dependent jobs in a workflow run. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_re_run_job_for_workflow_run(configuration: &configuration::Configuration, owner: &str, repo: &str, job_id: i32, actions_re_run_job_for_workflow_run_request: Option<models::ActionsReRunJobForWorkflowRunRequest>) -> Result<serde_json::Value, Error<ActionsSlashReRunJobForWorkflowRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/jobs/{job_id}/rerun", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), job_id=job_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_re_run_job_for_workflow_run_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashReRunJobForWorkflowRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Re-runs your workflow run using its `id`. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_re_run_workflow(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, actions_re_run_job_for_workflow_run_request: Option<models::ActionsReRunJobForWorkflowRunRequest>) -> Result<serde_json::Value, Error<ActionsSlashReRunWorkflowError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/rerun", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_re_run_job_for_workflow_run_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashReRunWorkflowError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_re_run_workflow_failed_jobs(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, actions_re_run_job_for_workflow_run_request: Option<models::ActionsReRunJobForWorkflowRunRequest>) -> Result<serde_json::Value, Error<ActionsSlashReRunWorkflowFailedJobsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/rerun-failed-jobs", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_re_run_job_for_workflow_run_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashReRunWorkflowFailedJobsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove all custom labels from a self-hosted runner configured in an organization. Returns the remaining read-only labels from the runner. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_remove_all_custom_labels_from_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove all custom labels from a self-hosted runner configured in a repository. Returns the remaining read-only labels from the runner. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_remove_all_custom_labels_from_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashRemoveAllCustomLabelsFromSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove a custom label from a self-hosted runner configured in an organization. Returns the remaining labels from the runner. This endpoint returns a `404 Not Found` status if the custom label is not present on the runner. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_remove_custom_label_from_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32, name: &str) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}/labels/{name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id, name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove a custom label from a self-hosted runner configured in a repository. Returns the remaining labels from the runner. This endpoint returns a `404 Not Found` status if the custom label is not present on the runner. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_remove_custom_label_from_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32, name: &str) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}/labels/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id, name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashRemoveCustomLabelFromSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Removes a repository from an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_remove_selected_repo_from_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str, repository_id: i32) -> Result<(), Error<ActionsSlashRemoveSelectedRepoFromOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashRemoveSelectedRepoFromOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Removes a repository from an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_remove_selected_repo_from_org_variable(configuration: &configuration::Configuration, org: &str, name: &str, repository_id: i32) -> Result<(), Error<ActionsSlashRemoveSelectedRepoFromOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}/repositories/{repository_id}", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name), repository_id=repository_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashRemoveSelectedRepoFromOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see \"[Using environments for deployment](https://docs.github.com/actions/deployment/targeting-different-environments/using-environments-for-deployment).\" **Note:** GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run). OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.
pub async fn actions_slash_review_custom_gates_for_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, actions_review_custom_gates_for_run_request: models::ActionsReviewCustomGatesForRunRequest) -> Result<(), Error<ActionsSlashReviewCustomGatesForRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_rule", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_review_custom_gates_for_run_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashReviewCustomGatesForRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Approve or reject pending deployments that are waiting on approval by a required reviewer. Required reviewers with read access to the repository contents and deployments can use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_review_pending_deployments_for_run(configuration: &configuration::Configuration, owner: &str, repo: &str, run_id: i32, actions_review_pending_deployments_for_run_request: models::ActionsReviewPendingDeploymentsForRunRequest) -> Result<Vec<models::Deployment>, Error<ActionsSlashReviewPendingDeploymentsForRunError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), run_id=run_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_review_pending_deployments_for_run_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashReviewPendingDeploymentsForRunError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the actions and reusable workflows that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_set_allowed_actions_organization(configuration: &configuration::Configuration, org: &str, selected_actions: Option<models::SelectedActions>) -> Result<(), Error<ActionsSlashSetAllowedActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/selected-actions", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&selected_actions);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetAllowedActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the actions and reusable workflows that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository).\" OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_allowed_actions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str, selected_actions: Option<models::SelectedActions>) -> Result<(), Error<ActionsSlashSetAllowedActionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/selected-actions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&selected_actions);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetAllowedActionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in an organization. Authenticated users must have admin access to the organization to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_set_custom_labels_for_self_hosted_runner_for_org(configuration: &configuration::Configuration, org: &str, runner_id: i32, actions_set_custom_labels_for_self_hosted_runner_for_org_request: models::ActionsSetCustomLabelsForSelfHostedRunnerForOrgRequest) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashSetCustomLabelsForSelfHostedRunnerForOrgError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, org=crate::apis::urlencode(org), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_custom_labels_for_self_hosted_runner_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashSetCustomLabelsForSelfHostedRunnerForOrgError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Remove all previous custom labels and set the new custom labels for a specific self-hosted runner configured in a repository. Authenticated users must have admin access to the repository to use this endpoint. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_custom_labels_for_self_hosted_runner_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, runner_id: i32, actions_set_custom_labels_for_self_hosted_runner_for_org_request: models::ActionsSetCustomLabelsForSelfHostedRunnerForOrgRequest) -> Result<models::ActionsListLabelsForSelfHostedRunnerForOrg200Response, Error<ActionsSlashSetCustomLabelsForSelfHostedRunnerForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/runners/{runner_id}/labels", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), runner_id=runner_id);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_custom_labels_for_self_hosted_runner_for_org_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashSetCustomLabelsForSelfHostedRunnerForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_custom_oidc_sub_claim_for_repo(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_oidc_subject_customization_for_a_repository: models::ActionsOidcSubjectCustomizationForARepository) -> Result<serde_json::Value, Error<ActionsSlashSetCustomOidcSubClaimForRepoError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/oidc/customization/sub", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_oidc_subject_customization_for_a_repository);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<ActionsSlashSetCustomOidcSubClaimForRepoError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actions can submit approving pull request reviews. For more information, see \"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization).\" OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_set_github_actions_default_workflow_permissions_organization(configuration: &configuration::Configuration, org: &str, actions_set_default_workflow_permissions: Option<models::ActionsSetDefaultWorkflowPermissions>) -> Result<(), Error<ActionsSlashSetGithubActionsDefaultWorkflowPermissionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/workflow", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_default_workflow_permissions);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetGithubActionsDefaultWorkflowPermissionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actions can submit approving pull request reviews. For more information, see \"[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository).\" OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_github_actions_default_workflow_permissions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_set_default_workflow_permissions: models::ActionsSetDefaultWorkflowPermissions) -> Result<(), Error<ActionsSlashSetGithubActionsDefaultWorkflowPermissionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/workflow", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_default_workflow_permissions);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetGithubActionsDefaultWorkflowPermissionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the GitHub Actions permissions policy for repositories and allowed actions and reusable workflows in an organization. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_set_github_actions_permissions_organization(configuration: &configuration::Configuration, org: &str, actions_set_github_actions_permissions_organization_request: models::ActionsSetGithubActionsPermissionsOrganizationRequest) -> Result<(), Error<ActionsSlashSetGithubActionsPermissionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_github_actions_permissions_organization_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetGithubActionsPermissionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions and reusable workflows in the repository. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_github_actions_permissions_repository(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_set_github_actions_permissions_repository_request: models::ActionsSetGithubActionsPermissionsRepositoryRequest) -> Result<(), Error<ActionsSlashSetGithubActionsPermissionsRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_github_actions_permissions_repository_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetGithubActionsPermissionsRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Replaces all repositories for an organization secret when the `visibility` for repository access is set to `selected`. The visibility is set when you [Create or update an organization secret](https://docs.github.com/rest/actions/secrets#create-or-update-an-organization-secret). Authenticated users must have collaborator access to a repository to create, update, or read secrets. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_set_selected_repos_for_org_secret(configuration: &configuration::Configuration, org: &str, secret_name: &str, actions_set_selected_repos_for_org_secret_request: models::ActionsSetSelectedReposForOrgSecretRequest) -> Result<(), Error<ActionsSlashSetSelectedReposForOrgSecretError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/secrets/{secret_name}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), secret_name=crate::apis::urlencode(secret_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_selected_repos_for_org_secret_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetSelectedReposForOrgSecretError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Replaces all repositories for an organization variable that is available to selected repositories. Organization variables that are available to selected repositories have their `visibility` field set to `selected`. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_set_selected_repos_for_org_variable(configuration: &configuration::Configuration, org: &str, name: &str, actions_set_selected_repos_for_org_variable_request: models::ActionsSetSelectedReposForOrgVariableRequest) -> Result<(), Error<ActionsSlashSetSelectedReposForOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_selected_repos_for_org_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetSelectedReposForOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see \"[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).\" OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint.
pub async fn actions_slash_set_selected_repositories_enabled_github_actions_organization(configuration: &configuration::Configuration, org: &str, actions_set_selected_repositories_enabled_github_actions_organization_request: models::ActionsSetSelectedRepositoriesEnabledGithubActionsOrganizationRequest) -> Result<(), Error<ActionsSlashSetSelectedRepositoriesEnabledGithubActionsOrganizationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/permissions/repositories", local_var_configuration.base_path, org=crate::apis::urlencode(org));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_set_selected_repositories_enabled_github_actions_organization_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetSelectedRepositoriesEnabledGithubActionsOrganizationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository. This endpoint only applies to private repositories. For more information, see \"[Allowing access to components in a private repository](https://docs.github.com/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)\". OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_set_workflow_access_to_repository(configuration: &configuration::Configuration, owner: &str, repo: &str, actions_workflow_access_to_repository: models::ActionsWorkflowAccessToRepository) -> Result<(), Error<ActionsSlashSetWorkflowAccessToRepositoryError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/permissions/access", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_workflow_access_to_repository);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashSetWorkflowAccessToRepositoryError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Updates an environment variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_update_environment_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str, environment_name: &str, actions_update_repo_variable_request: models::ActionsUpdateRepoVariableRequest) -> Result<(), Error<ActionsSlashUpdateEnvironmentVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/environments/{environment_name}/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name), environment_name=crate::apis::urlencode(environment_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_update_repo_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashUpdateEnvironmentVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Updates an organization variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required.
pub async fn actions_slash_update_org_variable(configuration: &configuration::Configuration, org: &str, name: &str, actions_update_org_variable_request: models::ActionsUpdateOrgVariableRequest) -> Result<(), Error<ActionsSlashUpdateOrgVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/orgs/{org}/actions/variables/{name}", local_var_configuration.base_path, org=crate::apis::urlencode(org), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_update_org_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashUpdateOrgVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Updates a repository variable that you can reference in a GitHub Actions workflow. Authenticated users must have collaborator access to a repository to create, update, or read variables. OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint.
pub async fn actions_slash_update_repo_variable(configuration: &configuration::Configuration, owner: &str, repo: &str, name: &str, actions_update_repo_variable_request: models::ActionsUpdateRepoVariableRequest) -> Result<(), Error<ActionsSlashUpdateRepoVariableError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/repos/{owner}/{repo}/actions/variables/{name}", local_var_configuration.base_path, owner=crate::apis::urlencode(owner), repo=crate::apis::urlencode(repo), name=crate::apis::urlencode(name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&actions_update_repo_variable_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<ActionsSlashUpdateRepoVariableError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}