Struct aws_sdk_apigateway::model::method_setting::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for MethodSetting
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn metrics_enabled(self, input: bool) -> Self
pub fn metrics_enabled(self, input: bool) -> Self
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
sourcepub fn set_metrics_enabled(self, input: Option<bool>) -> Self
pub fn set_metrics_enabled(self, input: Option<bool>) -> Self
Specifies whether Amazon CloudWatch metrics are enabled for this method. The PATCH path for this setting is /{method_setting_key}/metrics/enabled
, and the value is a Boolean.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 logging_level(self, input: impl Into<String>) -> Self
pub fn logging_level(self, input: impl Into<String>) -> Self
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
sourcepub fn set_logging_level(self, input: Option<String>) -> Self
pub fn set_logging_level(self, input: Option<String>) -> Self
Specifies the logging level for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/loglevel
, and the available levels are OFF
, ERROR
, and INFO
. Choose ERROR
to write only error-level entries to CloudWatch Logs, or choose INFO
to include all ERROR
events as well as extra informational events.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 data_trace_enabled(self, input: bool) -> Self
pub fn data_trace_enabled(self, input: bool) -> Self
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
sourcepub fn set_data_trace_enabled(self, input: Option<bool>) -> Self
pub fn set_data_trace_enabled(self, input: Option<bool>) -> Self
Specifies whether data trace logging is enabled for this method, which affects the log entries pushed to Amazon CloudWatch Logs. The PATCH path for this setting is /{method_setting_key}/logging/dataTrace
, and the value is a Boolean.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 throttling_burst_limit(self, input: i32) -> Self
pub fn throttling_burst_limit(self, input: i32) -> Self
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
sourcepub fn set_throttling_burst_limit(self, input: Option<i32>) -> Self
pub fn set_throttling_burst_limit(self, input: Option<i32>) -> Self
Specifies the throttling burst limit. The PATCH path for this setting is /{method_setting_key}/throttling/burstLimit
, and the value is an integer.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 throttling_rate_limit(self, input: f64) -> Self
pub fn throttling_rate_limit(self, input: f64) -> Self
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
sourcepub fn set_throttling_rate_limit(self, input: Option<f64>) -> Self
pub fn set_throttling_rate_limit(self, input: Option<f64>) -> Self
Specifies the throttling rate limit. The PATCH path for this setting is /{method_setting_key}/throttling/rateLimit
, and the value is a double.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 caching_enabled(self, input: bool) -> Self
pub fn caching_enabled(self, input: bool) -> Self
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
sourcepub fn set_caching_enabled(self, input: Option<bool>) -> Self
pub fn set_caching_enabled(self, input: Option<bool>) -> Self
Specifies whether responses should be cached and returned for requests. A cache cluster must be enabled on the stage for responses to be cached. The PATCH path for this setting is /{method_setting_key}/caching/enabled
, and the value is a Boolean.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 cache_ttl_in_seconds(self, input: i32) -> Self
pub fn cache_ttl_in_seconds(self, input: i32) -> Self
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
sourcepub fn set_cache_ttl_in_seconds(self, input: Option<i32>) -> Self
pub fn set_cache_ttl_in_seconds(self, input: Option<i32>) -> Self
Specifies the time to live (TTL), in seconds, for cached responses. The higher the TTL, the longer the response will be cached. The PATCH path for this setting is /{method_setting_key}/caching/ttlInSeconds
, and the value is an integer.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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 cache_data_encrypted(self, input: bool) -> Self
pub fn cache_data_encrypted(self, input: bool) -> Self
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
sourcepub fn set_cache_data_encrypted(self, input: Option<bool>) -> Self
pub fn set_cache_data_encrypted(self, input: Option<bool>) -> Self
Specifies whether the cached responses are encrypted. The PATCH path for this setting is /{method_setting_key}/caching/dataEncrypted
, and the value is a Boolean.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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",
),
),
}
}
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
Specifies whether authorization is required for a cache invalidation request. The PATCH path for this setting is /{method_setting_key}/caching/requireAuthorizationForCacheControl
, and the value is a Boolean.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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",
),
),
}
}
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
Specifies how to handle unauthorized requests for cache invalidation. The PATCH path for this setting is /{method_setting_key}/caching/unauthorizedCacheControlHeaderStrategy
, and the available values are FAIL_WITH_403
, SUCCEED_WITH_RESPONSE_HEADER
, SUCCEED_WITHOUT_RESPONSE_HEADER
.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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) -> MethodSetting
pub fn build(self) -> MethodSetting
Consumes the builder and constructs a MethodSetting
.
Examples found in repository?
11135 11136 11137 11138 11139 11140 11141 11142 11143 11144 11145 11146 11147 11148 11149 11150 11151 11152 11153 11154 11155 11156 11157 11158 11159 11160 11161 11162 11163 11164 11165 11166 11167 11168 11169 11170 11171 11172 11173 11174 11175 11176 11177 11178 11179 11180 11181 11182 11183 11184 11185 11186 11187 11188 11189 11190 11191 11192 11193 11194 11195 11196 11197 11198 11199 11200 11201 11202 11203 11204 11205 11206 11207 11208 11209 11210 11211 11212 11213 11214 11215 11216 11217 11218 11219 11220 11221 11222 11223 11224 11225 11226 11227 11228 11229 11230 11231 11232 11233 11234 11235 11236 11237 11238 11239 11240 11241 11242 11243 11244 11245 11246 11247 11248 11249 11250 11251 11252 11253 11254 11255 11256 11257 11258 11259
pub(crate) fn deser_structure_crate_model_method_setting<'a, I>(
tokens: &mut std::iter::Peekable<I>,
) -> Result<
Option<crate::model::MethodSetting>,
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::method_setting::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() {
"metricsEnabled" => {
builder = builder.set_metrics_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"loggingLevel" => {
builder = builder.set_logging_level(
aws_smithy_json::deserialize::token::expect_string_or_null(
tokens.next(),
)?
.map(|s| s.to_unescaped().map(|u| u.into_owned()))
.transpose()?,
);
}
"dataTraceEnabled" => {
builder = builder.set_data_trace_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"throttlingBurstLimit" => {
builder = builder.set_throttling_burst_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"throttlingRateLimit" => {
builder = builder.set_throttling_rate_limit(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(|v| v.to_f64_lossy()),
);
}
"cachingEnabled" => {
builder = builder.set_caching_enabled(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"cacheTtlInSeconds" => {
builder = builder.set_cache_ttl_in_seconds(
aws_smithy_json::deserialize::token::expect_number_or_null(
tokens.next(),
)?
.map(i32::try_from)
.transpose()?,
);
}
"cacheDataEncrypted" => {
builder = builder.set_cache_data_encrypted(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"requireAuthorizationForCacheControl" => {
builder = builder.set_require_authorization_for_cache_control(
aws_smithy_json::deserialize::token::expect_bool_or_null(
tokens.next(),
)?,
);
}
"unauthorizedCacheControlHeaderStrategy" => {
builder = builder.set_unauthorized_cache_control_header_strategy(
aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?.map(|s|
s.to_unescaped().map(|u|
crate::model::UnauthorizedCacheControlHeaderStrategy::from(u.as_ref())
)
).transpose()?
);
}
_ => 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",
),
),
}
}