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§
- Bitbucket
Author - The
BitbucketAuthor
struct represents an author or committer of a commit returned by the Bitbucket API. - Bitbucket
Client - The
BitbucketClient
struct is a high-level API client for working with the Bitbucket API. - Bitbucket
Commit - The
BitbucketCommit
struct represents a single commit returned by the Bitbucket API. - Bitbucket
Page - The
BitbucketPage
struct represents a single page of results returned by the Bitbucket API. - Bitbucket
Paginated - The
BitbucketPaginated
struct represents an iterator for paginated results returned by the Bitbucket API. - Bitbucket
Pull Request - The
BitbucketPullRequest
struct represents a pull request returned by the Bitbucket API. - Bitbucket
Pull Request Author - The
BitbucketPullRequestAuthor
struct represents the author of a pull request returned by the Bitbucket API. - Bitbucket
Pull Request Issue - The
BitbucketPullRequestIssue
struct represents an issue associated with a pull request returned by the Bitbucket API.