aws_sdk_ec2/operation/modify_hosts/_modify_hosts_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ModifyHostsInput {
6 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html">Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
7 pub host_recovery: ::std::option::Option<crate::types::HostRecovery>,
8 /// <p>Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.</p>
9 /// <p>If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
10 pub instance_type: ::std::option::Option<::std::string::String>,
11 /// <p>Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.</p>
12 /// <p>If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
13 pub instance_family: ::std::option::Option<::std::string::String>,
14 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
15 pub host_maintenance: ::std::option::Option<crate::types::HostMaintenance>,
16 /// <p>The IDs of the Dedicated Hosts to modify.</p>
17 pub host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18 /// <p>Specify whether to enable or disable auto-placement.</p>
19 pub auto_placement: ::std::option::Option<crate::types::AutoPlacement>,
20}
21impl ModifyHostsInput {
22 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html">Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
23 pub fn host_recovery(&self) -> ::std::option::Option<&crate::types::HostRecovery> {
24 self.host_recovery.as_ref()
25 }
26 /// <p>Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.</p>
27 /// <p>If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
28 pub fn instance_type(&self) -> ::std::option::Option<&str> {
29 self.instance_type.as_deref()
30 }
31 /// <p>Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.</p>
32 /// <p>If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
33 pub fn instance_family(&self) -> ::std::option::Option<&str> {
34 self.instance_family.as_deref()
35 }
36 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
37 pub fn host_maintenance(&self) -> ::std::option::Option<&crate::types::HostMaintenance> {
38 self.host_maintenance.as_ref()
39 }
40 /// <p>The IDs of the Dedicated Hosts to modify.</p>
41 ///
42 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.host_ids.is_none()`.
43 pub fn host_ids(&self) -> &[::std::string::String] {
44 self.host_ids.as_deref().unwrap_or_default()
45 }
46 /// <p>Specify whether to enable or disable auto-placement.</p>
47 pub fn auto_placement(&self) -> ::std::option::Option<&crate::types::AutoPlacement> {
48 self.auto_placement.as_ref()
49 }
50}
51impl ModifyHostsInput {
52 /// Creates a new builder-style object to manufacture [`ModifyHostsInput`](crate::operation::modify_hosts::ModifyHostsInput).
53 pub fn builder() -> crate::operation::modify_hosts::builders::ModifyHostsInputBuilder {
54 crate::operation::modify_hosts::builders::ModifyHostsInputBuilder::default()
55 }
56}
57
58/// A builder for [`ModifyHostsInput`](crate::operation::modify_hosts::ModifyHostsInput).
59#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct ModifyHostsInputBuilder {
62 pub(crate) host_recovery: ::std::option::Option<crate::types::HostRecovery>,
63 pub(crate) instance_type: ::std::option::Option<::std::string::String>,
64 pub(crate) instance_family: ::std::option::Option<::std::string::String>,
65 pub(crate) host_maintenance: ::std::option::Option<crate::types::HostMaintenance>,
66 pub(crate) host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
67 pub(crate) auto_placement: ::std::option::Option<crate::types::AutoPlacement>,
68}
69impl ModifyHostsInputBuilder {
70 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html">Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
71 pub fn host_recovery(mut self, input: crate::types::HostRecovery) -> Self {
72 self.host_recovery = ::std::option::Option::Some(input);
73 self
74 }
75 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html">Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
76 pub fn set_host_recovery(mut self, input: ::std::option::Option<crate::types::HostRecovery>) -> Self {
77 self.host_recovery = input;
78 self
79 }
80 /// <p>Indicates whether to enable or disable host recovery for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html">Host recovery</a> in the <i>Amazon EC2 User Guide</i>.</p>
81 pub fn get_host_recovery(&self) -> &::std::option::Option<crate::types::HostRecovery> {
82 &self.host_recovery
83 }
84 /// <p>Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.</p>
85 /// <p>If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
86 pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.instance_type = ::std::option::Option::Some(input.into());
88 self
89 }
90 /// <p>Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.</p>
91 /// <p>If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
92 pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93 self.instance_type = input;
94 self
95 }
96 /// <p>Specifies the instance type to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support only a specific instance type.</p>
97 /// <p>If you want to modify a Dedicated Host to support multiple instance types in its current instance family, omit this parameter and specify <b>InstanceFamily</b> instead. You cannot specify <b>InstanceType</b> and <b>InstanceFamily</b> in the same request.</p>
98 pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
99 &self.instance_type
100 }
101 /// <p>Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.</p>
102 /// <p>If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
103 pub fn instance_family(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.instance_family = ::std::option::Option::Some(input.into());
105 self
106 }
107 /// <p>Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.</p>
108 /// <p>If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
109 pub fn set_instance_family(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110 self.instance_family = input;
111 self
112 }
113 /// <p>Specifies the instance family to be supported by the Dedicated Host. Specify this parameter to modify a Dedicated Host to support multiple instance types within its current instance family.</p>
114 /// <p>If you want to modify a Dedicated Host to support a specific instance type only, omit this parameter and specify <b>InstanceType</b> instead. You cannot specify <b>InstanceFamily</b> and <b>InstanceType</b> in the same request.</p>
115 pub fn get_instance_family(&self) -> &::std::option::Option<::std::string::String> {
116 &self.instance_family
117 }
118 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
119 pub fn host_maintenance(mut self, input: crate::types::HostMaintenance) -> Self {
120 self.host_maintenance = ::std::option::Option::Some(input);
121 self
122 }
123 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
124 pub fn set_host_maintenance(mut self, input: ::std::option::Option<crate::types::HostMaintenance>) -> Self {
125 self.host_maintenance = input;
126 self
127 }
128 /// <p>Indicates whether to enable or disable host maintenance for the Dedicated Host. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-maintenance.html">Host maintenance</a> in the <i>Amazon EC2 User Guide</i>.</p>
129 pub fn get_host_maintenance(&self) -> &::std::option::Option<crate::types::HostMaintenance> {
130 &self.host_maintenance
131 }
132 /// Appends an item to `host_ids`.
133 ///
134 /// To override the contents of this collection use [`set_host_ids`](Self::set_host_ids).
135 ///
136 /// <p>The IDs of the Dedicated Hosts to modify.</p>
137 pub fn host_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 let mut v = self.host_ids.unwrap_or_default();
139 v.push(input.into());
140 self.host_ids = ::std::option::Option::Some(v);
141 self
142 }
143 /// <p>The IDs of the Dedicated Hosts to modify.</p>
144 pub fn set_host_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
145 self.host_ids = input;
146 self
147 }
148 /// <p>The IDs of the Dedicated Hosts to modify.</p>
149 pub fn get_host_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
150 &self.host_ids
151 }
152 /// <p>Specify whether to enable or disable auto-placement.</p>
153 pub fn auto_placement(mut self, input: crate::types::AutoPlacement) -> Self {
154 self.auto_placement = ::std::option::Option::Some(input);
155 self
156 }
157 /// <p>Specify whether to enable or disable auto-placement.</p>
158 pub fn set_auto_placement(mut self, input: ::std::option::Option<crate::types::AutoPlacement>) -> Self {
159 self.auto_placement = input;
160 self
161 }
162 /// <p>Specify whether to enable or disable auto-placement.</p>
163 pub fn get_auto_placement(&self) -> &::std::option::Option<crate::types::AutoPlacement> {
164 &self.auto_placement
165 }
166 /// Consumes the builder and constructs a [`ModifyHostsInput`](crate::operation::modify_hosts::ModifyHostsInput).
167 pub fn build(self) -> ::std::result::Result<crate::operation::modify_hosts::ModifyHostsInput, ::aws_smithy_types::error::operation::BuildError> {
168 ::std::result::Result::Ok(crate::operation::modify_hosts::ModifyHostsInput {
169 host_recovery: self.host_recovery,
170 instance_type: self.instance_type,
171 instance_family: self.instance_family,
172 host_maintenance: self.host_maintenance,
173 host_ids: self.host_ids,
174 auto_placement: self.auto_placement,
175 })
176 }
177}