Struct aws_sdk_ec2::model::launch_template_capacity_reservation_specification_response::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for LaunchTemplateCapacityReservationSpecificationResponse
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn capacity_reservation_preference(
self,
input: CapacityReservationPreference
) -> Self
pub fn capacity_reservation_preference(
self,
input: CapacityReservationPreference
) -> Self
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone). -
none
- The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
sourcepub fn set_capacity_reservation_preference(
self,
input: Option<CapacityReservationPreference>
) -> Self
pub fn set_capacity_reservation_preference(
self,
input: Option<CapacityReservationPreference>
) -> Self
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
-
open
- The instance can run in anyopen
Capacity Reservation that has matching attributes (instance type, platform, Availability Zone). -
none
- The instance avoids running in a Capacity Reservation even if one is available. The instance runs in On-Demand capacity.
Examples found in repository?
53006 53007 53008 53009 53010 53011 53012 53013 53014 53015 53016 53017 53018 53019 53020 53021 53022 53023 53024 53025 53026 53027 53028 53029 53030 53031 53032 53033 53034 53035 53036 53037 53038 53039 53040 53041 53042 53043 53044 53045
pub fn deser_structure_crate_model_launch_template_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::LaunchTemplateCapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder =
crate::model::LaunchTemplateCapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_2529 =
Some(
Result::<crate::model::CapacityReservationPreference, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::CapacityReservationPreference::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_capacity_reservation_preference(var_2529);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_2530 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_2530);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn capacity_reservation_target(
self,
input: CapacityReservationTargetResponse
) -> Self
pub fn capacity_reservation_target(
self,
input: CapacityReservationTargetResponse
) -> Self
Information about the target Capacity Reservation or Capacity Reservation group.
sourcepub fn set_capacity_reservation_target(
self,
input: Option<CapacityReservationTargetResponse>
) -> Self
pub fn set_capacity_reservation_target(
self,
input: Option<CapacityReservationTargetResponse>
) -> Self
Information about the target Capacity Reservation or Capacity Reservation group.
Examples found in repository?
53006 53007 53008 53009 53010 53011 53012 53013 53014 53015 53016 53017 53018 53019 53020 53021 53022 53023 53024 53025 53026 53027 53028 53029 53030 53031 53032 53033 53034 53035 53036 53037 53038 53039 53040 53041 53042 53043 53044 53045
pub fn deser_structure_crate_model_launch_template_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::LaunchTemplateCapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder =
crate::model::LaunchTemplateCapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_2529 =
Some(
Result::<crate::model::CapacityReservationPreference, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::CapacityReservationPreference::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_capacity_reservation_preference(var_2529);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_2530 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_2530);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> LaunchTemplateCapacityReservationSpecificationResponse
pub fn build(self) -> LaunchTemplateCapacityReservationSpecificationResponse
Consumes the builder and constructs a LaunchTemplateCapacityReservationSpecificationResponse
.
Examples found in repository?
53006 53007 53008 53009 53010 53011 53012 53013 53014 53015 53016 53017 53018 53019 53020 53021 53022 53023 53024 53025 53026 53027 53028 53029 53030 53031 53032 53033 53034 53035 53036 53037 53038 53039 53040 53041 53042 53043 53044 53045
pub fn deser_structure_crate_model_launch_template_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::LaunchTemplateCapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder =
crate::model::LaunchTemplateCapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_2529 =
Some(
Result::<crate::model::CapacityReservationPreference, aws_smithy_xml::decode::XmlDecodeError>::Ok(
crate::model::CapacityReservationPreference::from(
aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
)
)
?
)
;
builder = builder.set_capacity_reservation_preference(var_2529);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#LaunchTemplateCapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_2530 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_2530);
}
,
_ => {}
}
}
Ok(builder.build())
}