#[non_exhaustive]pub struct ValidateSecurityProfileBehaviorsError {
pub kind: ValidateSecurityProfileBehaviorsErrorKind,
/* private fields */
}
Expand description
Error type for the ValidateSecurityProfileBehaviors
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: ValidateSecurityProfileBehaviorsErrorKind
Kind of error that occurred.
Implementations§
source§impl ValidateSecurityProfileBehaviorsError
impl ValidateSecurityProfileBehaviorsError
sourcepub fn new(kind: ValidateSecurityProfileBehaviorsErrorKind, meta: Error) -> Self
pub fn new(kind: ValidateSecurityProfileBehaviorsErrorKind, meta: Error) -> Self
Creates a new ValidateSecurityProfileBehaviorsError
.
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 ValidateSecurityProfileBehaviorsError::Unhandled
variant from any error type.
Examples found in repository?
29786 29787 29788 29789 29790 29791 29792 29793 29794 29795 29796 29797 29798 29799 29800 29801 29802 29803 29804 29805 29806 29807 29808 29809 29810 29811 29812 29813 29814 29815 29816 29817 29818 29819 29820 29821 29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 29849 29850 29851 29852 29853 29854 29855 29856 29857 29858 29859 29860 29861 29862
pub fn parse_validate_security_profile_behaviors_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ValidateSecurityProfileBehaviorsOutput,
crate::error::ValidateSecurityProfileBehaviorsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::InternalFailureException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::InvalidRequestException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::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::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ValidateSecurityProfileBehaviorsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the ValidateSecurityProfileBehaviorsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
29786 29787 29788 29789 29790 29791 29792 29793 29794 29795 29796 29797 29798 29799 29800 29801 29802 29803 29804 29805 29806 29807 29808 29809 29810 29811 29812 29813 29814 29815 29816 29817 29818 29819 29820 29821 29822 29823 29824 29825 29826 29827 29828 29829 29830 29831 29832 29833 29834 29835 29836 29837 29838 29839 29840 29841 29842 29843 29844 29845 29846 29847 29848 29849 29850 29851 29852 29853 29854 29855 29856 29857 29858 29859 29860 29861 29862
pub fn parse_validate_security_profile_behaviors_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::ValidateSecurityProfileBehaviorsOutput,
crate::error::ValidateSecurityProfileBehaviorsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled(generic))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InternalFailureException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::InternalFailureException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::internal_failure_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_failure_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidRequestException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::InvalidRequestException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ThrottlingException" => crate::error::ValidateSecurityProfileBehaviorsError {
meta: generic,
kind: crate::error::ValidateSecurityProfileBehaviorsErrorKind::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::ValidateSecurityProfileBehaviorsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::ValidateSecurityProfileBehaviorsError::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_internal_failure_exception(&self) -> bool
pub fn is_internal_failure_exception(&self) -> bool
Returns true
if the error kind is ValidateSecurityProfileBehaviorsErrorKind::InternalFailureException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is ValidateSecurityProfileBehaviorsErrorKind::InvalidRequestException
.
sourcepub fn is_throttling_exception(&self) -> bool
pub fn is_throttling_exception(&self) -> bool
Returns true
if the error kind is ValidateSecurityProfileBehaviorsErrorKind::ThrottlingException
.