#[non_exhaustive]pub struct GetLambdaFunctionRecommendationsError {
pub kind: GetLambdaFunctionRecommendationsErrorKind,
/* private fields */
}
Expand description
Error type for the GetLambdaFunctionRecommendations
operation.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.kind: GetLambdaFunctionRecommendationsErrorKind
Kind of error that occurred.
Implementations§
source§impl GetLambdaFunctionRecommendationsError
impl GetLambdaFunctionRecommendationsError
sourcepub fn new(kind: GetLambdaFunctionRecommendationsErrorKind, meta: Error) -> Self
pub fn new(kind: GetLambdaFunctionRecommendationsErrorKind, meta: Error) -> Self
Creates a new GetLambdaFunctionRecommendationsError
.
sourcepub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
pub fn unhandled(err: impl Into<Box<dyn Error + Send + Sync + 'static>>) -> Self
Creates the GetLambdaFunctionRecommendationsError::Unhandled
variant from any error type.
Examples found in repository?
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155
pub fn parse_get_lambda_function_recommendations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetLambdaFunctionRecommendationsOutput,
crate::error::GetLambdaFunctionRecommendationsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetLambdaFunctionRecommendationsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::AccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::InternalServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValueException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"LimitExceededException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::LimitExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MissingAuthenticationToken" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::MissingAuthenticationToken({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::missing_authentication_token::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_missing_authentication_token_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OptInRequiredException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::OptInRequiredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::opt_in_required_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_opt_in_required_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::ThrottlingException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetLambdaFunctionRecommendationsError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetLambdaFunctionRecommendationsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155
pub fn parse_get_lambda_function_recommendations_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GetLambdaFunctionRecommendationsOutput,
crate::error::GetLambdaFunctionRecommendationsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::GetLambdaFunctionRecommendationsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AccessDeniedException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::AccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServerException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::InternalServerException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_server_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValueException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::InvalidParameterValueException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"LimitExceededException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::LimitExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MissingAuthenticationToken" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::MissingAuthenticationToken({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::missing_authentication_token::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_missing_authentication_token_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OptInRequiredException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::OptInRequiredException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::opt_in_required_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_opt_in_required_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ServiceUnavailableException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::ServiceUnavailableException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::service_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_service_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ThrottlingException" => crate::error::GetLambdaFunctionRecommendationsError { meta: generic, kind: crate::error::GetLambdaFunctionRecommendationsErrorKind::ThrottlingException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::throttling_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_throttling_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetLambdaFunctionRecommendationsError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::GetLambdaFunctionRecommendationsError::generic(generic)
})
}
sourcepub fn meta(&self) -> &Error
pub fn meta(&self) -> &Error
Returns error metadata, which includes the error code, message, request ID, and potentially additional information.
sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
Returns the request ID if it’s available.
sourcepub fn is_access_denied_exception(&self) -> bool
pub fn is_access_denied_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::AccessDeniedException
.
sourcepub fn is_internal_server_exception(&self) -> bool
pub fn is_internal_server_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::InternalServerException
.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::InvalidParameterValueException
.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::LimitExceededException
.
sourcepub fn is_missing_authentication_token(&self) -> bool
pub fn is_missing_authentication_token(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::MissingAuthenticationToken
.
sourcepub fn is_opt_in_required_exception(&self) -> bool
pub fn is_opt_in_required_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::OptInRequiredException
.
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::ServiceUnavailableException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is GetLambdaFunctionRecommendationsErrorKind::ThrottlingException
.