A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.rs/octocrab/latest/octocrab/pulls/struct.PullRequestHandler.html below:

PullRequestHandler in octocrab::pulls - Rust

Struct PullRequestHandlerSource
pub struct PullRequestHandler<'octo> {  }
Expand description Source§ Source

Set the media type for this request.

let pr = octocrab::instance()
    .pulls("owner", "repo")
    .media_type(octocrab::params::pulls::MediaType::Full)
    .get(404)
    .await?;
Source

Checks if a given pull request has been merged.

octocrab.pulls("owner", "repo").is_merged(101).await?;
Source

Update the branch of a pull request.

octocrab.pulls("owner", "repo").update_branch(101).await?;
Source

Get’s a given pull request with by its pr number.

let pr = octocrab::instance().pulls("owner", "repo").get(101).await?;
Source

Get’s a given pull request’s diff.

let diff = octocrab::instance().pulls("owner", "repo").get_diff(101).await?;
Source

Get’s a given pull request’s patch.

let diff = octocrab::instance().pulls("owner", "repo").get_patch(101).await?;
Source

Create a new pull request.

let pr = octocrab
    .pulls("owner", "repo")
    .create("title", "head", "base")
    .body("hello world!")
    .send()
    .await?;
Source

Update a new pull request.

let pr = octocrab
    .pulls("owner", "repo")
    .update(1)
    .body("hello world!")
    .send()
    .await?;
Source

Creates a new ListPullRequestsBuilder that can be configured to filter listing pulling requests.

use octocrab::params;

let page = octocrab.pulls("owner", "repo").list()
    .state(params::State::Open)
    .head("master")
    .base("branch")
    .sort(params::pulls::Sort::Popularity)
    .direction(params::Direction::Ascending)
    .per_page(100)
    .page(5u32)
    .send()
    .await?;
Source

Lists all of the Reviews associated with the pull request.

let reviews = octocrab::instance()
    .pulls("owner", "repo")
    .list_reviews(21u64.into())
    .per_page(100)
    .page(2u32)
    .send()
    .await?;
Source

Request a review from users or teams.

let review = octocrab::instance().pulls("owner", "repo")
   .request_reviews(101, ["user1".to_string(), "user2".to_string()], ["team1".to_string(), "team2".to_string()])
 .await?;
Source

Remove a requested reviewer from users or teams.

let review = octocrab::instance().pulls("owner", "repo")
   .remove_requested_reviewers(101, ["user1".to_string(), "user2".to_string()], ["team1".to_string(), "team2".to_string()])
 .await?;
Source

List all DiffEntrys associated with the pull request.

let files = octocrab::instance().pulls("owner", "repo").list_files(101).await?;

Creates a new ListCommentsBuilder that can be configured to list and filter Comments for a particular pull request. If no pull request is specified, lists comments for the whole repo.

use octocrab::params;

let page = octocrab.pulls("owner", "repo").list_comments(Some(5))
    .sort(params::pulls::comments::Sort::Created)
    .direction(params::Direction::Ascending)
    .per_page(100)
    .page(5u32)
    .since(chrono::Utc::now() - chrono::Duration::days(1))
    .send()
    .await?;

creates a new CommentBuilder for GET/PATCH/DELETE requests to the /repos/{owner}/{repo}/pulls/{pr}/comments/{comment_id} endpoint

 use octocrab::models::CommentId;
use octocrab::models::pulls::Comment;
 async fn run() -> octocrab::Result<Comment> {
    let octocrab = octocrab::Octocrab::default();
    let _ = octocrab.pulls("owner", "repo").comment(CommentId(21)).delete();
    let _ = octocrab.pulls("owner", "repo").comment(CommentId(42)).update("new comment");
    let comment = octocrab.pulls("owner", "repo").comment(CommentId(42)).get().await;

    comment
 }
Source

👎Deprecated since 0.34.4: specific PR builder transitioned to pr_review_actions, pr_commits, reply_to_comment

creates a builder for the /repos/{owner}/{repo}/pulls/{pull_number}/...... endpoint working with particular pull request, e.g.

Source Source

Lists a maximum of 250 commits for a pull request.

To receive a complete commit list for pull requests with more than 250 commits, use the List commits endpoint.

let commits = octocrab::instance()
    .pulls("owner", "repo")
    .pr_commits(21u64)
    .per_page(100)
    .page(2u32)
    .send()
    .await?;

Creates a reply to a specific comment of a pull request specified in the first argument

 async fn run() -> octocrab::Result<()> {
use octocrab::params;

let page = octocrab.pulls("owner", "repo").reply_to_comment(142, CommentId(24), "This is my reply")
    .await?;
Source

Creates a new MergePullRequestsBuilder that can be configured used to merge a pull request.

use octocrab::params;

let page = octocrab.pulls("owner", "repo").merge(20)
    .title("cool title")
    .message("a message")
    .sha("0123456")
    .method(params::pulls::MergeMethod::Squash)
    .send()
    .await?;

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4