/*
* GitHub's official OpenAPI spec + Octokit extension
*
* OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
*
* The version of the OpenAPI document: 16.6.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// DeploymentBranchPolicySettings : The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeploymentBranchPolicySettings {
/// Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`.
#[serde(rename = "protected_branches")]
pub protected_branches: bool,
/// Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`.
#[serde(rename = "custom_branch_policies")]
pub custom_branch_policies: bool,
}
impl DeploymentBranchPolicySettings {
/// The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`.
pub fn new(protected_branches: bool, custom_branch_policies: bool) -> DeploymentBranchPolicySettings {
DeploymentBranchPolicySettings {
protected_branches,
custom_branch_policies,
}
}
}