pub struct PullRequestManager { /* private fields */ }Expand description
Pull request manager for Bitbucket operations
Implementations§
Source§impl PullRequestManager
impl PullRequestManager
Sourcepub fn new(client: BitbucketClient) -> Self
pub fn new(client: BitbucketClient) -> Self
Create a new pull request manager
Sourcepub async fn create_pull_request(
&self,
request: CreatePullRequestRequest,
) -> Result<PullRequest>
pub async fn create_pull_request( &self, request: CreatePullRequestRequest, ) -> Result<PullRequest>
Create a new pull request
Sourcepub async fn get_pull_request(&self, pr_id: u64) -> Result<PullRequest>
pub async fn get_pull_request(&self, pr_id: u64) -> Result<PullRequest>
Get a pull request by ID
Sourcepub async fn update_pull_request(
&self,
pr_id: u64,
title: Option<String>,
description: Option<String>,
version: u64,
) -> Result<PullRequest>
pub async fn update_pull_request( &self, pr_id: u64, title: Option<String>, description: Option<String>, version: u64, ) -> Result<PullRequest>
Update a pull request (title, description, etc)
Sourcepub async fn list_pull_requests(
&self,
state: Option<PullRequestState>,
) -> Result<PullRequestPage>
pub async fn list_pull_requests( &self, state: Option<PullRequestState>, ) -> Result<PullRequestPage>
List pull requests with optional filters
Sourcepub async fn update_source_branch(
&self,
old_pr_id: u64,
new_request: CreatePullRequestRequest,
close_reason: Option<String>,
) -> Result<PullRequest>
pub async fn update_source_branch( &self, old_pr_id: u64, new_request: CreatePullRequestRequest, close_reason: Option<String>, ) -> Result<PullRequest>
Update a pull request’s source branch by closing the old PR and creating a new one This is needed because Bitbucket doesn’t allow changing PR source branches
Sourcepub async fn decline_pull_request(&self, pr_id: u64, reason: &str) -> Result<()>
pub async fn decline_pull_request(&self, pr_id: u64, reason: &str) -> Result<()>
Decline a pull request with a reason
Sourcepub async fn add_comment(&self, pr_id: u64, comment: &str) -> Result<()>
pub async fn add_comment(&self, pr_id: u64, comment: &str) -> Result<()>
Add a comment to a pull request explaining the branch update
Sourcepub async fn get_pull_request_status(
&self,
pr_id: u64,
) -> Result<PullRequestStatus>
pub async fn get_pull_request_status( &self, pr_id: u64, ) -> Result<PullRequestStatus>
Get comprehensive status information for a pull request
Sourcepub async fn get_pull_request_participants(
&self,
pr_id: u64,
) -> Result<Vec<Participant>>
pub async fn get_pull_request_participants( &self, pr_id: u64, ) -> Result<Vec<Participant>>
Get all participants (including reviewers) for a PR
Sourcepub async fn check_mergeable_detailed(
&self,
pr_id: u64,
) -> Result<MergeabilityDetails>
pub async fn check_mergeable_detailed( &self, pr_id: u64, ) -> Result<MergeabilityDetails>
Check if PR is mergeable and get detailed blocking reasons
Sourcepub async fn check_mergeable(&self, pr_id: u64) -> Result<bool>
pub async fn check_mergeable(&self, pr_id: u64) -> Result<bool>
Check if PR is mergeable (legacy method - kept for backward compatibility)
Sourcepub async fn get_build_status(&self, pr_id: u64) -> Result<BuildStatus>
pub async fn get_build_status(&self, pr_id: u64) -> Result<BuildStatus>
Get build status for a PR
Sourcepub async fn get_conflicts(&self, pr_id: u64) -> Result<Vec<String>>
pub async fn get_conflicts(&self, pr_id: u64) -> Result<Vec<String>>
Get conflict information for a PR
NOTE: Currently unimplemented - always returns empty list.
Proper implementation would parse diff for conflict markers or use
Bitbucket’s merge API to detect conflicts. In practice, the mergeable
field from check_mergeable_detailed() is more reliable for detecting conflicts.
Sourcepub async fn merge_pull_request(
&self,
pr_id: u64,
merge_strategy: MergeStrategy,
) -> Result<PullRequest>
pub async fn merge_pull_request( &self, pr_id: u64, merge_strategy: MergeStrategy, ) -> Result<PullRequest>
Merge a pull request using Bitbucket Server API
Sourcepub async fn auto_merge_if_ready(
&self,
pr_id: u64,
conditions: &AutoMergeConditions,
) -> Result<AutoMergeResult>
pub async fn auto_merge_if_ready( &self, pr_id: u64, conditions: &AutoMergeConditions, ) -> Result<AutoMergeResult>
Auto-merge a pull request if conditions are met
Auto Trait Implementations§
impl Freeze for PullRequestManager
impl !RefUnwindSafe for PullRequestManager
impl Send for PullRequestManager
impl Sync for PullRequestManager
impl Unpin for PullRequestManager
impl !UnwindSafe for PullRequestManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more