Struct octorust::checks::Checks

source ·
pub struct Checks {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

source§

impl Checks

source

pub async fn create( &self, owner: &str, repo: &str, body: &ChecksCreateRequest ) -> Result<Response<CheckRun>, ClientError>

Create a check run.

This function performs a POST to the /repos/{owner}/{repo}/check-runs endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

Creates a new check run for a specific commit in a repository. Your GitHub App must have the checks:write permission to create check runs.

In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.

FROM: https://docs.github.com/rest/reference/checks#create-a-check-run

Parameters:

  • owner: &str
  • repo: &str
source

pub async fn get( &self, owner: &str, repo: &str, check_run_id: i64 ) -> Result<Response<CheckRun>, ClientError>

Get a check run.

This function performs a GET to the /repos/{owner}/{repo}/check-runs/{check_run_id} endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

Gets a single check run using its id. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo scope to get check runs in a private repository.

FROM: https://docs.github.com/rest/reference/checks#get-a-check-run

Parameters:

  • owner: &str
  • repo: &str
  • check_run_id: i64 – check_run_id parameter.
source

pub async fn update( &self, owner: &str, repo: &str, check_run_id: i64, body: &ChecksUpdateRequest ) -> Result<Response<CheckRun>, ClientError>

Update a check run.

This function performs a PATCH to the /repos/{owner}/{repo}/check-runs/{check_run_id} endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

Updates a check run for a specific commit in a repository. Your GitHub App must have the checks:write permission to edit check runs.

FROM: https://docs.github.com/rest/reference/checks#update-a-check-run

Parameters:

  • owner: &str
  • repo: &str
  • check_run_id: i64 – check_run_id parameter.
source

pub async fn list_annotations( &self, owner: &str, repo: &str, check_run_id: i64, per_page: i64, page: i64 ) -> Result<Response<Vec<CheckAnnotation>>, ClientError>

List check run annotations.

This function performs a GET to the /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations endpoint.

Lists annotations for a check run using the annotation id. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the repo scope to get annotations for a check run in a private repository.

FROM: https://docs.github.com/rest/reference/checks#list-check-run-annotations

Parameters:

  • owner: &str
  • repo: &str
  • check_run_id: i64 – check_run_id parameter.
  • per_page: i64 – Results per page (max 100).
  • page: i64 – Page number of the results to fetch.
source

pub async fn list_all_annotations( &self, owner: &str, repo: &str, check_run_id: i64 ) -> Result<Response<Vec<CheckAnnotation>>, ClientError>

List check run annotations.

This function performs a GET to the /repos/{owner}/{repo}/check-runs/{check_run_id}/annotations endpoint.

As opposed to list_annotations, this function returns all the pages of the request at once.

Lists annotations for a check run using the annotation id. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get annotations for a check run. OAuth Apps and authenticated users must have the repo scope to get annotations for a check run in a private repository.

FROM: https://docs.github.com/rest/reference/checks#list-check-run-annotations

source

pub async fn create_suite( &self, owner: &str, repo: &str, body: &ChecksCreateSuiteRequest ) -> Result<Response<CheckSuiteData>, ClientError>

Create a check suite.

This function performs a POST to the /repos/{owner}/{repo}/check-suites endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

By default, check suites are automatically created when you create a check run. You only need to use this endpoint for manually creating check suites when you’ve disabled automatic creation using “Update repository preferences for check suites”. Your GitHub App must have the checks:write permission to create check suites.

FROM: https://docs.github.com/rest/reference/checks#create-a-check-suite

Parameters:

  • owner: &str
  • repo: &str
source

pub async fn set_suites_preferences( &self, owner: &str, repo: &str, body: &Preferences ) -> Result<Response<CheckSuitePreference>, ClientError>

Update repository preferences for check suites.

This function performs a PATCH to the /repos/{owner}/{repo}/check-suites/preferences endpoint.

Changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually Create a check suite. You must have admin permissions in the repository to set preferences for check suites.

FROM: https://docs.github.com/rest/reference/checks#update-repository-preferences-for-check-suites

Parameters:

  • owner: &str
  • repo: &str
source

pub async fn get_suite( &self, owner: &str, repo: &str, check_suite_id: i64 ) -> Result<Response<CheckSuiteData>, ClientError>

Get a check suite.

This function performs a GET to the /repos/{owner}/{repo}/check-suites/{check_suite_id} endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

Gets a single check suite using its id. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get check suites. OAuth Apps and authenticated users must have the repo scope to get check suites in a private repository.

FROM: https://docs.github.com/rest/reference/checks#get-a-check-suite

Parameters:

  • owner: &str
  • repo: &str
  • check_suite_id: i64 – check_suite_id parameter.
source

pub async fn list_for_suite( &self, owner: &str, repo: &str, check_suite_id: i64, check_name: &str, status: JobStatus, filter: ActionsListJobsWorkflowRunFilter, per_page: i64, page: i64 ) -> Result<Response<ChecksListRefResponse>, ClientError>

List check runs in a check suite.

This function performs a GET to the /repos/{owner}/{repo}/check-suites/{check_suite_id}/check-runs endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

Lists check runs for a check suite using its id. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo scope to get check runs in a private repository.

FROM: https://docs.github.com/rest/reference/checks#list-check-runs-in-a-check-suite

Parameters:

  • owner: &str
  • repo: &str
  • check_suite_id: i64 – check_suite_id parameter.
  • check_name: &str – Returns check runs with the specified name.
  • status: crate::types::JobStatus – Returns check runs with the specified status. Can be one of queued, in_progress, or completed.
  • filter: crate::types::ActionsListJobsWorkflowRunFilter – Filters jobs by their completed_at timestamp. Can be one of:
    \* latest: Returns jobs from the most recent execution of the workflow run.
    \* all: Returns all jobs for a workflow run, including from old executions of the workflow run.
  • per_page: i64 – Results per page (max 100).
  • page: i64 – Page number of the results to fetch.
source

pub async fn rerequest_suite( &self, owner: &str, repo: &str, check_suite_id: i64 ) -> Result<Response<()>, ClientError>

Rerequest a check suite.

This function performs a POST to the /repos/{owner}/{repo}/check-suites/{check_suite_id}/rerequest endpoint.

Triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the check_suite webhook event with the action rerequested. When a check suite is rerequested, its status is reset to queued and the conclusion is cleared.

To rerequest a check suite, your GitHub App must have the checks:read permission on a private repository or pull access to a public repository.

FROM: https://docs.github.com/rest/reference/checks#rerequest-a-check-suite

Parameters:

  • owner: &str
  • repo: &str
  • check_suite_id: i64 – check_suite_id parameter.
source

pub async fn list_for_ref( &self, owner: &str, repo: &str, ref_: &str, check_name: &str, status: JobStatus, filter: ActionsListJobsWorkflowRunFilter, per_page: i64, page: i64, app_id: i64 ) -> Result<Response<ChecksListRefResponse>, ClientError>

List check runs for a Git reference.

This function performs a GET to the /repos/{owner}/{repo}/commits/{ref}/check-runs endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array.

Lists check runs for a commit ref. The ref can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to get check runs. OAuth Apps and authenticated users must have the repo scope to get check runs in a private repository.

FROM: https://docs.github.com/rest/reference/checks#list-check-runs-for-a-git-reference

Parameters:

  • owner: &str
  • repo: &str
  • ref_: &str – ref parameter.
  • check_name: &str – Returns check runs with the specified name.
  • status: crate::types::JobStatus – Returns check runs with the specified status. Can be one of queued, in_progress, or completed.
  • filter: crate::types::ActionsListJobsWorkflowRunFilter – Filters jobs by their completed_at timestamp. Can be one of:
    \* latest: Returns jobs from the most recent execution of the workflow run.
    \* all: Returns all jobs for a workflow run, including from old executions of the workflow run.
  • per_page: i64 – Results per page (max 100).
  • page: i64 – Page number of the results to fetch.
  • app_id: i64
source

pub async fn list_suites_for_ref( &self, owner: &str, repo: &str, ref_: &str, app_id: i64, check_name: &str, per_page: i64, page: i64 ) -> Result<Response<ChecksListSuitesRefResponse>, ClientError>

List check suites for a Git reference.

This function performs a GET to the /repos/{owner}/{repo}/commits/{ref}/check-suites endpoint.

Note: The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

Lists check suites for a commit ref. The ref can be a SHA, branch name, or a tag name. GitHub Apps must have the checks:read permission on a private repository or pull access to a public repository to list check suites. OAuth Apps and authenticated users must have the repo scope to get check suites in a private repository.

FROM: https://docs.github.com/rest/reference/checks#list-check-suites-for-a-git-reference

Parameters:

  • owner: &str
  • repo: &str
  • ref_: &str – ref parameter.
  • app_id: i64 – Filters check suites by GitHub App id.
  • check_name: &str – Returns check runs with the specified name.
  • per_page: i64 – Results per page (max 100).
  • page: i64 – Page number of the results to fetch.

Auto Trait Implementations§

§

impl !RefUnwindSafe for Checks

§

impl Send for Checks

§

impl Sync for Checks

§

impl Unpin for Checks

§

impl !UnwindSafe for Checks

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more