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

/// <p>The capacity information for instances that can be launched onto the Dedicated Host. </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AvailableCapacity {
    /// <p>The number of instances that can be launched onto the Dedicated Host depending on the host's available capacity. For Dedicated Hosts that support multiple instance types, this parameter represents the number of instances for each instance size that is supported on the host.</p>
    #[doc(hidden)]
    pub available_instance_capacity:
        std::option::Option<std::vec::Vec<crate::types::InstanceCapacity>>,
    /// <p>The number of vCPUs available for launching instances onto the Dedicated Host.</p>
    #[doc(hidden)]
    pub available_v_cpus: std::option::Option<i32>,
}
impl AvailableCapacity {
    /// <p>The number of instances that can be launched onto the Dedicated Host depending on the host's available capacity. For Dedicated Hosts that support multiple instance types, this parameter represents the number of instances for each instance size that is supported on the host.</p>
    pub fn available_instance_capacity(
        &self,
    ) -> std::option::Option<&[crate::types::InstanceCapacity]> {
        self.available_instance_capacity.as_deref()
    }
    /// <p>The number of vCPUs available for launching instances onto the Dedicated Host.</p>
    pub fn available_v_cpus(&self) -> std::option::Option<i32> {
        self.available_v_cpus
    }
}
impl AvailableCapacity {
    /// Creates a new builder-style object to manufacture [`AvailableCapacity`](crate::types::AvailableCapacity).
    pub fn builder() -> crate::types::builders::AvailableCapacityBuilder {
        crate::types::builders::AvailableCapacityBuilder::default()
    }
}

/// A builder for [`AvailableCapacity`](crate::types::AvailableCapacity).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct AvailableCapacityBuilder {
    pub(crate) available_instance_capacity:
        std::option::Option<std::vec::Vec<crate::types::InstanceCapacity>>,
    pub(crate) available_v_cpus: std::option::Option<i32>,
}
impl AvailableCapacityBuilder {
    /// Appends an item to `available_instance_capacity`.
    ///
    /// To override the contents of this collection use [`set_available_instance_capacity`](Self::set_available_instance_capacity).
    ///
    /// <p>The number of instances that can be launched onto the Dedicated Host depending on the host's available capacity. For Dedicated Hosts that support multiple instance types, this parameter represents the number of instances for each instance size that is supported on the host.</p>
    pub fn available_instance_capacity(mut self, input: crate::types::InstanceCapacity) -> Self {
        let mut v = self.available_instance_capacity.unwrap_or_default();
        v.push(input);
        self.available_instance_capacity = Some(v);
        self
    }
    /// <p>The number of instances that can be launched onto the Dedicated Host depending on the host's available capacity. For Dedicated Hosts that support multiple instance types, this parameter represents the number of instances for each instance size that is supported on the host.</p>
    pub fn set_available_instance_capacity(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::InstanceCapacity>>,
    ) -> Self {
        self.available_instance_capacity = input;
        self
    }
    /// <p>The number of vCPUs available for launching instances onto the Dedicated Host.</p>
    pub fn available_v_cpus(mut self, input: i32) -> Self {
        self.available_v_cpus = Some(input);
        self
    }
    /// <p>The number of vCPUs available for launching instances onto the Dedicated Host.</p>
    pub fn set_available_v_cpus(mut self, input: std::option::Option<i32>) -> Self {
        self.available_v_cpus = input;
        self
    }
    /// Consumes the builder and constructs a [`AvailableCapacity`](crate::types::AvailableCapacity).
    pub fn build(self) -> crate::types::AvailableCapacity {
        crate::types::AvailableCapacity {
            available_instance_capacity: self.available_instance_capacity,
            available_v_cpus: self.available_v_cpus,
        }
    }
}