Struct aws_sdk_lambda::model::alias_routing_configuration::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for AliasRoutingConfiguration
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn additional_version_weights(self, k: impl Into<String>, v: f64) -> Self
pub fn additional_version_weights(self, k: impl Into<String>, v: f64) -> Self
Adds a key-value pair to additional_version_weights
.
To override the contents of this collection use set_additional_version_weights
.
The second version, and the percentage of traffic that's routed to it.
sourcepub fn set_additional_version_weights(
self,
input: Option<HashMap<String, f64>>
) -> Self
pub fn set_additional_version_weights(
self,
input: Option<HashMap<String, f64>>
) -> Self
The second version, and the percentage of traffic that's routed to it.
Examples found in repository?
src/json_deser.rs (lines 7284-7286)
7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309
pub(crate) fn deser_structure_crate_model_alias_routing_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AliasRoutingConfiguration>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::alias_routing_configuration::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"AdditionalVersionWeights" => {
builder = builder.set_additional_version_weights(
crate::json_deser::deser_map_com_amazonaws_lambda_additional_version_weights(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}
sourcepub fn build(self) -> AliasRoutingConfiguration
pub fn build(self) -> AliasRoutingConfiguration
Consumes the builder and constructs a AliasRoutingConfiguration
.
Examples found in repository?
src/json_deser.rs (line 7301)
7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309
pub(crate) fn deser_structure_crate_model_alias_routing_configuration<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::AliasRoutingConfiguration>,
aws_smithy_json::deserialize::error::DeserializeError,
>
where
I: Iterator<
Item = Result<
aws_smithy_json::deserialize::Token<'a>,
aws_smithy_json::deserialize::error::DeserializeError,
>,
>,
{
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
Some(aws_smithy_json::deserialize::Token::StartObject { .. }) => {
#[allow(unused_mut)]
let mut builder = crate::model::alias_routing_configuration::Builder::default();
loop {
match tokens.next().transpose()? {
Some(aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
match key.to_unescaped()?.as_ref() {
"AdditionalVersionWeights" => {
builder = builder.set_additional_version_weights(
crate::json_deser::deser_map_com_amazonaws_lambda_additional_version_weights(tokens)?
);
}
_ => aws_smithy_json::deserialize::token::skip_value(tokens)?,
}
}
other => {
return Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)),
)
}
}
}
Ok(Some(builder.build()))
}
_ => Err(
aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
),
),
}
}