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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Defines the details of a high availability configuration.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct HighAvailabilityConfig {
    /// <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
    pub desired_capacity: i32,
}
impl HighAvailabilityConfig {
    /// <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
    pub fn desired_capacity(&self) -> i32 {
        self.desired_capacity
    }
}
impl HighAvailabilityConfig {
    /// Creates a new builder-style object to manufacture [`HighAvailabilityConfig`](crate::types::HighAvailabilityConfig).
    pub fn builder() -> crate::types::builders::HighAvailabilityConfigBuilder {
        crate::types::builders::HighAvailabilityConfigBuilder::default()
    }
}

/// A builder for [`HighAvailabilityConfig`](crate::types::HighAvailabilityConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct HighAvailabilityConfigBuilder {
    pub(crate) desired_capacity: ::std::option::Option<i32>,
}
impl HighAvailabilityConfigBuilder {
    /// <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
    /// This field is required.
    pub fn desired_capacity(mut self, input: i32) -> Self {
        self.desired_capacity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
    pub fn set_desired_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.desired_capacity = input;
        self
    }
    /// <p>The number of instances in a high availability configuration. The minimum possible value is 1 and the maximum is 100.</p>
    pub fn get_desired_capacity(&self) -> &::std::option::Option<i32> {
        &self.desired_capacity
    }
    /// Consumes the builder and constructs a [`HighAvailabilityConfig`](crate::types::HighAvailabilityConfig).
    /// This method will fail if any of the following fields are not set:
    /// - [`desired_capacity`](crate::types::builders::HighAvailabilityConfigBuilder::desired_capacity)
    pub fn build(self) -> ::std::result::Result<crate::types::HighAvailabilityConfig, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::HighAvailabilityConfig {
            desired_capacity: self.desired_capacity.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "desired_capacity",
                    "desired_capacity was not specified but it is required when building HighAvailabilityConfig",
                )
            })?,
        })
    }
}