openapi_github/models/deployment_protection_rule.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/// DeploymentProtectionRule : Deployment protection rule
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DeploymentProtectionRule {
17 /// The unique identifier for the deployment protection rule.
18 #[serde(rename = "id")]
19 pub id: i32,
20 /// The node ID for the deployment protection rule.
21 #[serde(rename = "node_id")]
22 pub node_id: String,
23 /// Whether the deployment protection rule is enabled for the environment.
24 #[serde(rename = "enabled")]
25 pub enabled: bool,
26 #[serde(rename = "app")]
27 pub app: Box<models::CustomDeploymentRuleApp>,
28}
29
30impl DeploymentProtectionRule {
31 /// Deployment protection rule
32 pub fn new(id: i32, node_id: String, enabled: bool, app: models::CustomDeploymentRuleApp) -> DeploymentProtectionRule {
33 DeploymentProtectionRule {
34 id,
35 node_id,
36 enabled,
37 app: Box::new(app),
38 }
39 }
40}
41