openapi_github/models/
protected_branch_pull_request_review.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProtectedBranchPullRequestReview : Protected Branch Pull Request Review
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProtectedBranchPullRequestReview {
17    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
18    pub url: Option<String>,
19    #[serde(rename = "dismissal_restrictions", skip_serializing_if = "Option::is_none")]
20    pub dismissal_restrictions: Option<Box<models::ProtectedBranchPullRequestReviewDismissalRestrictions>>,
21    #[serde(rename = "bypass_pull_request_allowances", skip_serializing_if = "Option::is_none")]
22    pub bypass_pull_request_allowances: Option<Box<models::ProtectedBranchPullRequestReviewBypassPullRequestAllowances>>,
23    #[serde(rename = "dismiss_stale_reviews")]
24    pub dismiss_stale_reviews: bool,
25    #[serde(rename = "require_code_owner_reviews")]
26    pub require_code_owner_reviews: bool,
27    #[serde(rename = "required_approving_review_count", skip_serializing_if = "Option::is_none")]
28    pub required_approving_review_count: Option<i32>,
29    /// Whether the most recent push must be approved by someone other than the person who pushed it.
30    #[serde(rename = "require_last_push_approval", skip_serializing_if = "Option::is_none")]
31    pub require_last_push_approval: Option<bool>,
32}
33
34impl ProtectedBranchPullRequestReview {
35    /// Protected Branch Pull Request Review
36    pub fn new(dismiss_stale_reviews: bool, require_code_owner_reviews: bool) -> ProtectedBranchPullRequestReview {
37        ProtectedBranchPullRequestReview {
38            url: None,
39            dismissal_restrictions: None,
40            bypass_pull_request_allowances: None,
41            dismiss_stale_reviews,
42            require_code_owner_reviews,
43            required_approving_review_count: None,
44            require_last_push_approval: None,
45        }
46    }
47}
48