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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Information about minimum healthy instance.</p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MinimumHealthyHosts {
    /// <p>The minimum healthy instance type:</p>
    /// <ul>
    /// <li> <p> <code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p> </li>
    /// <li> <p> <code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p> </li>
    /// </ul>
    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p> <note>
    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
    /// </note>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
    #[doc(hidden)]
    pub r#type: std::option::Option<crate::types::MinimumHealthyHostsType>,
    /// <p>The minimum healthy instance value.</p>
    #[doc(hidden)]
    pub value: i32,
}
impl MinimumHealthyHosts {
    /// <p>The minimum healthy instance type:</p>
    /// <ul>
    /// <li> <p> <code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p> </li>
    /// <li> <p> <code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p> </li>
    /// </ul>
    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p> <note>
    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
    /// </note>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
    pub fn r#type(&self) -> std::option::Option<&crate::types::MinimumHealthyHostsType> {
        self.r#type.as_ref()
    }
    /// <p>The minimum healthy instance value.</p>
    pub fn value(&self) -> i32 {
        self.value
    }
}
impl MinimumHealthyHosts {
    /// Creates a new builder-style object to manufacture [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
    pub fn builder() -> crate::types::builders::MinimumHealthyHostsBuilder {
        crate::types::builders::MinimumHealthyHostsBuilder::default()
    }
}

/// A builder for [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct MinimumHealthyHostsBuilder {
    pub(crate) r#type: std::option::Option<crate::types::MinimumHealthyHostsType>,
    pub(crate) value: std::option::Option<i32>,
}
impl MinimumHealthyHostsBuilder {
    /// <p>The minimum healthy instance type:</p>
    /// <ul>
    /// <li> <p> <code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p> </li>
    /// <li> <p> <code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p> </li>
    /// </ul>
    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p> <note>
    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
    /// </note>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
    pub fn r#type(mut self, input: crate::types::MinimumHealthyHostsType) -> Self {
        self.r#type = Some(input);
        self
    }
    /// <p>The minimum healthy instance type:</p>
    /// <ul>
    /// <li> <p> <code>HOST_COUNT</code>: The minimum number of healthy instances as an absolute value.</p> </li>
    /// <li> <p> <code>FLEET_PERCENT</code>: The minimum number of healthy instances as a percentage of the total number of instances in the deployment.</p> </li>
    /// </ul>
    /// <p>In an example of nine instances, if a HOST_COUNT of six is specified, deploy to up to three instances at a time. The deployment is successful if six or more instances are deployed to successfully. Otherwise, the deployment fails. If a FLEET_PERCENT of 40 is specified, deploy to up to five instances at a time. The deployment is successful if four or more instances are deployed to successfully. Otherwise, the deployment fails.</p> <note>
    /// <p>In a call to the <code>GetDeploymentConfig</code>, CodeDeployDefault.OneAtATime returns a minimum healthy instance type of MOST_CONCURRENCY and a value of 1. This means a deployment to only one instance at a time. (You cannot set the type to MOST_CONCURRENCY, only to HOST_COUNT or FLEET_PERCENT.) In addition, with CodeDeployDefault.OneAtATime, CodeDeploy attempts to ensure that all instances but one are kept in a healthy state during the deployment. Although this allows one instance at a time to be taken offline for a new deployment, it also means that if the deployment to the last instance fails, the overall deployment is still successful.</p>
    /// </note>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/instances-health.html">CodeDeploy Instance Health</a> in the <i>CodeDeploy User Guide</i>.</p>
    pub fn set_type(
        mut self,
        input: std::option::Option<crate::types::MinimumHealthyHostsType>,
    ) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The minimum healthy instance value.</p>
    pub fn value(mut self, input: i32) -> Self {
        self.value = Some(input);
        self
    }
    /// <p>The minimum healthy instance value.</p>
    pub fn set_value(mut self, input: std::option::Option<i32>) -> Self {
        self.value = input;
        self
    }
    /// Consumes the builder and constructs a [`MinimumHealthyHosts`](crate::types::MinimumHealthyHosts).
    pub fn build(self) -> crate::types::MinimumHealthyHosts {
        crate::types::MinimumHealthyHosts {
            r#type: self.r#type,
            value: self.value.unwrap_or_default(),
        }
    }
}