pub struct Builder { /* private fields */ }
Expand description
A builder for CapacityReservationSpecificationResponse
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn capacity_reservation_preference(
self,
input: CapacityReservationPreference
) -> Self
pub fn capacity_reservation_preference(
self,
input: CapacityReservationPreference
) -> Self
Describes 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
Describes 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?
62983 62984 62985 62986 62987 62988 62989 62990 62991 62992 62993 62994 62995 62996 62997 62998 62999 63000 63001 63002 63003 63004 63005 63006 63007 63008 63009 63010 63011 63012 63013 63014 63015 63016 63017 63018 63019 63020 63021
pub fn deser_structure_crate_model_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::CapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder = crate::model::CapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_3068 =
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_3068);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_3069 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_3069);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn capacity_reservation_target(
self,
input: CapacityReservationTargetResponse
) -> Self
pub fn capacity_reservation_target(
self,
input: CapacityReservationTargetResponse
) -> Self
Information about the targeted 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 targeted Capacity Reservation or Capacity Reservation group.
Examples found in repository?
62983 62984 62985 62986 62987 62988 62989 62990 62991 62992 62993 62994 62995 62996 62997 62998 62999 63000 63001 63002 63003 63004 63005 63006 63007 63008 63009 63010 63011 63012 63013 63014 63015 63016 63017 63018 63019 63020 63021
pub fn deser_structure_crate_model_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::CapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder = crate::model::CapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_3068 =
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_3068);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_3069 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_3069);
}
,
_ => {}
}
}
Ok(builder.build())
}
sourcepub fn build(self) -> CapacityReservationSpecificationResponse
pub fn build(self) -> CapacityReservationSpecificationResponse
Consumes the builder and constructs a CapacityReservationSpecificationResponse
.
Examples found in repository?
62983 62984 62985 62986 62987 62988 62989 62990 62991 62992 62993 62994 62995 62996 62997 62998 62999 63000 63001 63002 63003 63004 63005 63006 63007 63008 63009 63010 63011 63012 63013 63014 63015 63016 63017 63018 63019 63020 63021
pub fn deser_structure_crate_model_capacity_reservation_specification_response(
decoder: &mut aws_smithy_xml::decode::ScopedDecoder,
) -> Result<
crate::model::CapacityReservationSpecificationResponse,
aws_smithy_xml::decode::XmlDecodeError,
> {
#[allow(unused_mut)]
let mut builder = crate::model::CapacityReservationSpecificationResponse::builder();
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("capacityReservationPreference") /* CapacityReservationPreference com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationPreference */ => {
let var_3068 =
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_3068);
}
,
s if s.matches("capacityReservationTarget") /* CapacityReservationTarget com.amazonaws.ec2#CapacityReservationSpecificationResponse$CapacityReservationTarget */ => {
let var_3069 =
Some(
crate::xml_deser::deser_structure_crate_model_capacity_reservation_target_response(&mut tag)
?
)
;
builder = builder.set_capacity_reservation_target(var_3069);
}
,
_ => {}
}
}
Ok(builder.build())
}