openapi_github/models/
environment_protection_rules_inner_any_of_1.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EnvironmentProtectionRulesInnerAnyOf1 {
16    #[serde(rename = "id")]
17    pub id: i32,
18    #[serde(rename = "node_id")]
19    pub node_id: String,
20    /// Whether deployments to this environment can be approved by the user who created the deployment.
21    #[serde(rename = "prevent_self_review", skip_serializing_if = "Option::is_none")]
22    pub prevent_self_review: Option<bool>,
23    #[serde(rename = "type")]
24    pub r#type: String,
25    /// The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed.
26    #[serde(rename = "reviewers", skip_serializing_if = "Option::is_none")]
27    pub reviewers: Option<Vec<models::PendingDeploymentReviewersInner>>,
28}
29
30impl EnvironmentProtectionRulesInnerAnyOf1 {
31    pub fn new(id: i32, node_id: String, r#type: String) -> EnvironmentProtectionRulesInnerAnyOf1 {
32        EnvironmentProtectionRulesInnerAnyOf1 {
33            id,
34            node_id,
35            prevent_self_review: None,
36            r#type,
37            reviewers: None,
38        }
39    }
40}
41