1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! # Bitbucket Server API
//!
//! This module contains implementations for various Bitbucket Server REST API endpoints.
//! Each submodule represents a specific API endpoint or group of related endpoints.
//!
//! ## API Structure
//!
//! The API is organized into the following modules:
//!
//! - `build_status`: Common types and utilities for build status operations
//! - `build_status_get`: API for retrieving build status information
//! - `build_status_post`: API for posting build status updates
//! - `pull_request_changes_get`: API for retrieving pull request changes
//!
//! ## Usage Pattern
//!
//! All API endpoints follow a similar pattern:
//!
//! 1. Start with a client instance
//! 2. Call the appropriate API method
//! 3. Set any required parameters
//! 4. Build the request
//! 5. Send the request
//! 6. Process the response
//!
//! For example:
//!
//! ```no_run
//! use bitbucket_server_rs::client::{new, ApiRequest};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = new("https://bitbucket-server/rest", "API_TOKEN");
//!
//! let response = client
//! .api()
//! .build_status_get("PROJECT", "COMMIT", "REPO")
//! .key("build-123")
//! .build()?
//! .send()
//! .await?;
//!
//! Ok(())
//! }
//! ```
use crateClient;
/// Bitbucket's `api` API. i.e. `https://bitbucket-server/rest/api`
///
/// This struct serves as the entry point for all API operations.
/// It holds a reference to the HTTP client that will be used for making requests.