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
63
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Project merge request approvals API endpoint.
//!
//! This endpoint is used for querying project merge request approvals.
//! See <https://docs.gitlab.com/ee/api/merge_request_approvals.html#merge-request-level-mr-approvals>
//!
//! # Example
//! ```rust,no_run
//! use serde::{Serialize, Deserialize};
//! use gitlab::*;
//! use gitlab::api::Query;
//! use chrono::{DateTime, Utc};
//!
//! /// A merge request with approvals.
//! #[derive(Serialize, Deserialize, Debug, Clone)]
//! pub struct MergeRequestApprovals {
//! /// The ID of the merge request.
//! pub id: MergeRequestId,
//! /// The user-visible ID of the merge request.
//! pub iid: MergeRequestInternalId,
//! /// The ID of the project.
//! pub project_id: ProjectId,
//! /// The title of the merge request.
//! pub title: String,
//! /// The description of the merge request.
//! pub description: Option<String>,
//! /// The state of the merge request.
//! pub state: MergeRequestState,
//! /// When the merge request was created.
//! pub created_at: DateTime<Utc>,
//! /// When the merge request was last updated.
//! pub updated_at: DateTime<Utc>,
//! /// The status of the merge request.
//! pub merge_status: MergeStatus,
//! /// The total number of approvals required before the merge request can be merged.
//! pub approvals_required: u64,
//! /// The number of remaining approvals required before the merge request can be merged.
//! pub approvals_left: u64,
//! /// The users that approved the merge request.
//! pub approved_by: Vec<UserBasic>,
//! }
//! // Create the client.
//! let client = Gitlab::new("gitlab.com", "private-token").unwrap();
//! // Create the endpoint for the merge request 34 in project 12.
//! let endpoint = api::projects::merge_requests::approvals::MergeRequestApprovals::builder()
//! .project(12)
//! .merge_request(34)
//! .build()
//! .unwrap();
//! // Get the merge request with approvals.
//! let approvals: MergeRequestApprovals = endpoint.query(&client).unwrap();
//! ```
pub use MergeRequestApprovals;
pub use MergeRequestApprovalsBuilder;
pub use MergeRequestApprovalsBuilderError;