Struct aws_sdk_workdocs::error::DeleteFolderContentsError
source · #[non_exhaustive]pub struct DeleteFolderContentsError {
pub kind: DeleteFolderContentsErrorKind,
/* private fields */
}
Expand description
Error type for the DeleteFolderContents
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: DeleteFolderContentsErrorKind
Kind of error that occurred.
Implementations§
source§impl DeleteFolderContentsError
impl DeleteFolderContentsError
sourcepub fn new(kind: DeleteFolderContentsErrorKind, meta: Error) -> Self
pub fn new(kind: DeleteFolderContentsErrorKind, meta: Error) -> Self
Creates a new DeleteFolderContentsError
.
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 DeleteFolderContentsError::Unhandled
variant from any error type.
Examples found in repository?
1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 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
pub fn parse_delete_folder_contents_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteFolderContentsOutput,
crate::error::DeleteFolderContentsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteFolderContentsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteFolderContentsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingOperationException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::ConflictingOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"EntityNotExistsException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::EntityNotExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::entity_not_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_entity_not_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::FailedDependencyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::failed_dependency_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_failed_dependency_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ProhibitedStateException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::ProhibitedStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::prohibited_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_prohibited_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::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::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::UnauthorizedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => {
crate::error::DeleteFolderContentsError {
meta: generic,
kind:
crate::error::DeleteFolderContentsErrorKind::UnauthorizedResourceAccessException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unauthorized_resource_access_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_resource_access_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
}
}
_ => crate::error::DeleteFolderContentsError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the DeleteFolderContentsError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 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
pub fn parse_delete_folder_contents_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::DeleteFolderContentsOutput,
crate::error::DeleteFolderContentsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::DeleteFolderContentsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::DeleteFolderContentsError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ConflictingOperationException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::ConflictingOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::conflicting_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_conflicting_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"EntityNotExistsException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::EntityNotExistsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::entity_not_exists_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_entity_not_exists_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"FailedDependencyException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::FailedDependencyException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::failed_dependency_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_failed_dependency_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ProhibitedStateException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::ProhibitedStateException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::prohibited_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_prohibited_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ServiceUnavailableException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::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::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedOperationException" => crate::error::DeleteFolderContentsError {
meta: generic,
kind: crate::error::DeleteFolderContentsErrorKind::UnauthorizedOperationException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::unauthorized_operation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_operation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedResourceAccessException" => {
crate::error::DeleteFolderContentsError {
meta: generic,
kind:
crate::error::DeleteFolderContentsErrorKind::UnauthorizedResourceAccessException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unauthorized_resource_access_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_resource_access_exception_json_err(response.body().as_ref(), output).map_err(crate::error::DeleteFolderContentsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
}
}
_ => crate::error::DeleteFolderContentsError::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_conflicting_operation_exception(&self) -> bool
pub fn is_conflicting_operation_exception(&self) -> bool
Returns true
if the error kind is DeleteFolderContentsErrorKind::ConflictingOperationException
.
sourcepub fn is_entity_not_exists_exception(&self) -> bool
pub fn is_entity_not_exists_exception(&self) -> bool
Returns true
if the error kind is DeleteFolderContentsErrorKind::EntityNotExistsException
.
sourcepub fn is_failed_dependency_exception(&self) -> bool
pub fn is_failed_dependency_exception(&self) -> bool
Returns true
if the error kind is DeleteFolderContentsErrorKind::FailedDependencyException
.
sourcepub fn is_prohibited_state_exception(&self) -> bool
pub fn is_prohibited_state_exception(&self) -> bool
Returns true
if the error kind is DeleteFolderContentsErrorKind::ProhibitedStateException
.
Returns true
if the error kind is DeleteFolderContentsErrorKind::ServiceUnavailableException
.
Returns true
if the error kind is DeleteFolderContentsErrorKind::UnauthorizedOperationException
.
Returns true
if the error kind is DeleteFolderContentsErrorKind::UnauthorizedResourceAccessException
.