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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ModifyInstancePlacementInput {
/// <p>The affinity setting for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub affinity: ::std::option::Option<crate::types::Affinity>,
/// <p>The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of <code>default</code>. For cluster and partition placement groups, the instance must have a tenancy of <code>default</code> or <code>dedicated</code>.</p>
/// <p>To remove an instance from a placement group, specify an empty string ("").</p>
pub group_name: ::std::option::Option<::std::string::String>,
/// <p>The ID of the Dedicated Host with which to associate the instance.</p>
pub host_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the instance that you are modifying.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>The tenancy for the instance.</p><note>
/// <p>For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of <code>host</code>. You can't change the tenancy from <code>host</code> to <code>dedicated</code> or <code>default</code>. Attempting to make one of these unsupported tenancy changes results in an <code>InvalidRequest</code> error code.</p>
/// </note>
pub tenancy: ::std::option::Option<crate::types::HostTenancy>,
/// <p>The number of the partition in which to place the instance. Valid only if the placement group strategy is set to <code>partition</code>.</p>
pub partition_number: ::std::option::Option<i32>,
/// <p>The ARN of the host resource group in which to place the instance. The instance must have a tenancy of <code>host</code> to specify this parameter.</p>
pub host_resource_group_arn: ::std::option::Option<::std::string::String>,
/// <p>The Group Id of a placement group. You must specify the Placement Group <b>Group Id</b> to launch an instance in a shared placement group.</p>
pub group_id: ::std::option::Option<::std::string::String>,
}
impl ModifyInstancePlacementInput {
/// <p>The affinity setting for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn affinity(&self) -> ::std::option::Option<&crate::types::Affinity> {
self.affinity.as_ref()
}
/// <p>The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of <code>default</code>. For cluster and partition placement groups, the instance must have a tenancy of <code>default</code> or <code>dedicated</code>.</p>
/// <p>To remove an instance from a placement group, specify an empty string ("").</p>
pub fn group_name(&self) -> ::std::option::Option<&str> {
self.group_name.as_deref()
}
/// <p>The ID of the Dedicated Host with which to associate the instance.</p>
pub fn host_id(&self) -> ::std::option::Option<&str> {
self.host_id.as_deref()
}
/// <p>The ID of the instance that you are modifying.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>The tenancy for the instance.</p><note>
/// <p>For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of <code>host</code>. You can't change the tenancy from <code>host</code> to <code>dedicated</code> or <code>default</code>. Attempting to make one of these unsupported tenancy changes results in an <code>InvalidRequest</code> error code.</p>
/// </note>
pub fn tenancy(&self) -> ::std::option::Option<&crate::types::HostTenancy> {
self.tenancy.as_ref()
}
/// <p>The number of the partition in which to place the instance. Valid only if the placement group strategy is set to <code>partition</code>.</p>
pub fn partition_number(&self) -> ::std::option::Option<i32> {
self.partition_number
}
/// <p>The ARN of the host resource group in which to place the instance. The instance must have a tenancy of <code>host</code> to specify this parameter.</p>
pub fn host_resource_group_arn(&self) -> ::std::option::Option<&str> {
self.host_resource_group_arn.as_deref()
}
/// <p>The Group Id of a placement group. You must specify the Placement Group <b>Group Id</b> to launch an instance in a shared placement group.</p>
pub fn group_id(&self) -> ::std::option::Option<&str> {
self.group_id.as_deref()
}
}
impl ModifyInstancePlacementInput {
/// Creates a new builder-style object to manufacture [`ModifyInstancePlacementInput`](crate::operation::modify_instance_placement::ModifyInstancePlacementInput).
pub fn builder() -> crate::operation::modify_instance_placement::builders::ModifyInstancePlacementInputBuilder {
crate::operation::modify_instance_placement::builders::ModifyInstancePlacementInputBuilder::default()
}
}
/// A builder for [`ModifyInstancePlacementInput`](crate::operation::modify_instance_placement::ModifyInstancePlacementInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ModifyInstancePlacementInputBuilder {
pub(crate) affinity: ::std::option::Option<crate::types::Affinity>,
pub(crate) group_name: ::std::option::Option<::std::string::String>,
pub(crate) host_id: ::std::option::Option<::std::string::String>,
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) tenancy: ::std::option::Option<crate::types::HostTenancy>,
pub(crate) partition_number: ::std::option::Option<i32>,
pub(crate) host_resource_group_arn: ::std::option::Option<::std::string::String>,
pub(crate) group_id: ::std::option::Option<::std::string::String>,
}
impl ModifyInstancePlacementInputBuilder {
/// <p>The affinity setting for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn affinity(mut self, input: crate::types::Affinity) -> Self {
self.affinity = ::std::option::Option::Some(input);
self
}
/// <p>The affinity setting for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn set_affinity(mut self, input: ::std::option::Option<crate::types::Affinity>) -> Self {
self.affinity = input;
self
}
/// <p>The affinity setting for the instance. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-affinity">Host affinity</a> in the <i>Amazon EC2 User Guide</i>.</p>
pub fn get_affinity(&self) -> &::std::option::Option<crate::types::Affinity> {
&self.affinity
}
/// <p>The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of <code>default</code>. For cluster and partition placement groups, the instance must have a tenancy of <code>default</code> or <code>dedicated</code>.</p>
/// <p>To remove an instance from a placement group, specify an empty string ("").</p>
pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of <code>default</code>. For cluster and partition placement groups, the instance must have a tenancy of <code>default</code> or <code>dedicated</code>.</p>
/// <p>To remove an instance from a placement group, specify an empty string ("").</p>
pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_name = input;
self
}
/// <p>The name of the placement group in which to place the instance. For spread placement groups, the instance must have a tenancy of <code>default</code>. For cluster and partition placement groups, the instance must have a tenancy of <code>default</code> or <code>dedicated</code>.</p>
/// <p>To remove an instance from a placement group, specify an empty string ("").</p>
pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
&self.group_name
}
/// <p>The ID of the Dedicated Host with which to associate the instance.</p>
pub fn host_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.host_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Dedicated Host with which to associate the instance.</p>
pub fn set_host_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.host_id = input;
self
}
/// <p>The ID of the Dedicated Host with which to associate the instance.</p>
pub fn get_host_id(&self) -> &::std::option::Option<::std::string::String> {
&self.host_id
}
/// <p>The ID of the instance that you are modifying.</p>
/// This field is required.
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the instance that you are modifying.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The ID of the instance that you are modifying.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>The tenancy for the instance.</p><note>
/// <p>For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of <code>host</code>. You can't change the tenancy from <code>host</code> to <code>dedicated</code> or <code>default</code>. Attempting to make one of these unsupported tenancy changes results in an <code>InvalidRequest</code> error code.</p>
/// </note>
pub fn tenancy(mut self, input: crate::types::HostTenancy) -> Self {
self.tenancy = ::std::option::Option::Some(input);
self
}
/// <p>The tenancy for the instance.</p><note>
/// <p>For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of <code>host</code>. You can't change the tenancy from <code>host</code> to <code>dedicated</code> or <code>default</code>. Attempting to make one of these unsupported tenancy changes results in an <code>InvalidRequest</code> error code.</p>
/// </note>
pub fn set_tenancy(mut self, input: ::std::option::Option<crate::types::HostTenancy>) -> Self {
self.tenancy = input;
self
}
/// <p>The tenancy for the instance.</p><note>
/// <p>For T3 instances, you must launch the instance on a Dedicated Host to use a tenancy of <code>host</code>. You can't change the tenancy from <code>host</code> to <code>dedicated</code> or <code>default</code>. Attempting to make one of these unsupported tenancy changes results in an <code>InvalidRequest</code> error code.</p>
/// </note>
pub fn get_tenancy(&self) -> &::std::option::Option<crate::types::HostTenancy> {
&self.tenancy
}
/// <p>The number of the partition in which to place the instance. Valid only if the placement group strategy is set to <code>partition</code>.</p>
pub fn partition_number(mut self, input: i32) -> Self {
self.partition_number = ::std::option::Option::Some(input);
self
}
/// <p>The number of the partition in which to place the instance. Valid only if the placement group strategy is set to <code>partition</code>.</p>
pub fn set_partition_number(mut self, input: ::std::option::Option<i32>) -> Self {
self.partition_number = input;
self
}
/// <p>The number of the partition in which to place the instance. Valid only if the placement group strategy is set to <code>partition</code>.</p>
pub fn get_partition_number(&self) -> &::std::option::Option<i32> {
&self.partition_number
}
/// <p>The ARN of the host resource group in which to place the instance. The instance must have a tenancy of <code>host</code> to specify this parameter.</p>
pub fn host_resource_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.host_resource_group_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The ARN of the host resource group in which to place the instance. The instance must have a tenancy of <code>host</code> to specify this parameter.</p>
pub fn set_host_resource_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.host_resource_group_arn = input;
self
}
/// <p>The ARN of the host resource group in which to place the instance. The instance must have a tenancy of <code>host</code> to specify this parameter.</p>
pub fn get_host_resource_group_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.host_resource_group_arn
}
/// <p>The Group Id of a placement group. You must specify the Placement Group <b>Group Id</b> to launch an instance in a shared placement group.</p>
pub fn group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.group_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Group Id of a placement group. You must specify the Placement Group <b>Group Id</b> to launch an instance in a shared placement group.</p>
pub fn set_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.group_id = input;
self
}
/// <p>The Group Id of a placement group. You must specify the Placement Group <b>Group Id</b> to launch an instance in a shared placement group.</p>
pub fn get_group_id(&self) -> &::std::option::Option<::std::string::String> {
&self.group_id
}
/// Consumes the builder and constructs a [`ModifyInstancePlacementInput`](crate::operation::modify_instance_placement::ModifyInstancePlacementInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::modify_instance_placement::ModifyInstancePlacementInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::modify_instance_placement::ModifyInstancePlacementInput {
affinity: self.affinity,
group_name: self.group_name,
host_id: self.host_id,
instance_id: self.instance_id,
tenancy: self.tenancy,
partition_number: self.partition_number,
host_resource_group_arn: self.host_resource_group_arn,
group_id: self.group_id,
})
}
}