gitea_sdk/api/pulls/reviews/mod.rs
1pub mod get;
2
3pub struct Reviews {
4 pub(crate) owner: String,
5 pub(crate) repo: String,
6}
7
8impl Reviews {
9 pub fn new(owner: impl ToString, repo: impl ToString) -> Self {
10 Self {
11 owner: owner.to_string(),
12 repo: repo.to_string(),
13 }
14 }
15
16 /// List a review's [Pull Request](crate::model::reviews::PullReview).
17 ///
18 /// # Example
19 ///
20 /// ```
21 /// use gitea_sdk::{Client, Auth, model::issues::State};
22 /// async fn reviews() {
23 /// let client = Client::new(
24 /// "https://gitea.example.com",
25 /// Auth::Token("your-token")
26 /// );
27 /// let reviews = client
28 /// .pulls("owner", "repo")
29 /// .reviews()
30 /// .get(1)
31 /// .send(&client)
32 /// .await
33 /// .unwrap();
34 /// }
35 /// ```
36 /// This will allow you to get all the reviews from the pull request.
37 pub fn get(&self, index: i64) -> get::GetReviewsBuilder {
38 get::GetReviewsBuilder::new(&self.owner, &self.repo, index)
39 }
40}