Module bitbucket

Source
Expand description

The deployment_changelog::api::bitbucket module provides a high-level API for interacting with the Bitbucket REST API, making it easy to retrieve information related to commits, pull requests, and issues.

This module provides the BitbucketClient struct for interacting with the Bitbucket API, as well as various structs for representing Bitbucket objects, such as BitbucketCommit, BitbucketPullRequest, and BitbucketPullRequestIssue.

§Examples

Creating a new BitbucketClient with a base URL and fetching commits between two revisions:

use deployment_changelog::api::bitbucket::BitbucketClient;

let bitbucket_client = BitbucketClient::new("https://api.bitbucket.org")
    .unwrap();

let mut commits = bitbucket_client.compare_commits("MY_PROJECT", "MY_REPO", "abcdef123456", "fedcba654321");

let all_commits = commits.all().await.unwrap();

for commit in all_commits {
    println!("{}", commit);
}

Fetching pull requests for a specific commit:

use deployment_changelog::api::bitbucket::BitbucketClient;

let bitbucket_client = BitbucketClient::new("https://api.bitbucket.org")
    .unwrap();

let mut pull_requests = bitbucket_client.get_pull_requests("MY_PROJECT", "MY_REPO", "abcdef123456");

let all_pull_requests = pull_requests.all().await.unwrap();

for pr in all_pull_requests {
    println!("{}", pr);
}

Fetching issues associated with a pull request:

use deployment_changelog::api::bitbucket::BitbucketClient;

let bitbucket_client = BitbucketClient::new("https://api.bitbucket.org")
    .unwrap();

let issues = bitbucket_client.get_pull_request_issues("MY_PROJECT", "MY_REPO", 42).await.unwrap();

for issue in issues {
    println!("{}", issue);
}

Structs§

BitbucketAuthor
The BitbucketAuthor struct represents an author or committer of a commit returned by the Bitbucket API.
BitbucketClient
The BitbucketClient struct is a high-level API client for working with the Bitbucket API.
BitbucketCommit
The BitbucketCommit struct represents a single commit returned by the Bitbucket API.
BitbucketPage
The BitbucketPage struct represents a single page of results returned by the Bitbucket API.
BitbucketPaginated
The BitbucketPaginated struct represents an iterator for paginated results returned by the Bitbucket API.
BitbucketPullRequest
The BitbucketPullRequest struct represents a pull request returned by the Bitbucket API.
BitbucketPullRequestAuthor
The BitbucketPullRequestAuthor struct represents the author of a pull request returned by the Bitbucket API.
BitbucketPullRequestIssue
The BitbucketPullRequestIssue struct represents an issue associated with a pull request returned by the Bitbucket API.