Struct aws_sdk_sts::error::AssumeRoleWithSAMLError
source · #[non_exhaustive]pub struct AssumeRoleWithSAMLError {
pub kind: AssumeRoleWithSAMLErrorKind,
/* private fields */
}Expand description
Error type for the AssumeRoleWithSAML 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: AssumeRoleWithSAMLErrorKindKind of error that occurred.
Implementations§
source§impl AssumeRoleWithSAMLError
impl AssumeRoleWithSAMLError
sourcepub fn new(kind: AssumeRoleWithSAMLErrorKind, meta: Error) -> Self
pub fn new(kind: AssumeRoleWithSAMLErrorKind, meta: Error) -> Self
Creates a new AssumeRoleWithSAMLError.
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 AssumeRoleWithSAMLError::Unhandled variant from any error type.
Examples found in repository?
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
pub fn parse_assume_role_with_saml_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssumeRoleWithSamlOutput,
crate::error::AssumeRoleWithSAMLError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::AssumeRoleWithSAMLError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ExpiredTokenException" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::ExpiredTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::expired_token_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_expired_token_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"IDPRejectedClaim" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::IdpRejectedClaimException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::idp_rejected_claim_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_idp_rejected_claim_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIdentityToken" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::InvalidIdentityTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_identity_token_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_identity_token_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"MalformedPolicyDocument" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::MalformedPolicyDocumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::malformed_policy_document_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_malformed_policy_document_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PackedPolicyTooLarge" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::PackedPolicyTooLargeException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::packed_policy_too_large_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_packed_policy_too_large_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"RegionDisabledException" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::RegionDisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::region_disabled_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_region_disabled_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::AssumeRoleWithSAMLError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the AssumeRoleWithSAMLError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
pub fn parse_assume_role_with_saml_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::AssumeRoleWithSamlOutput,
crate::error::AssumeRoleWithSAMLError,
> {
let generic = crate::xml_deser::parse_http_generic_error(response)
.map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::AssumeRoleWithSAMLError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"ExpiredTokenException" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::ExpiredTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::expired_token_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_expired_token_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"IDPRejectedClaim" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::IdpRejectedClaimException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::idp_rejected_claim_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_idp_rejected_claim_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidIdentityToken" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::InvalidIdentityTokenException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_identity_token_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_invalid_identity_token_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"MalformedPolicyDocument" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::MalformedPolicyDocumentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::malformed_policy_document_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_malformed_policy_document_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"PackedPolicyTooLarge" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::PackedPolicyTooLargeException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::packed_policy_too_large_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_packed_policy_too_large_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"RegionDisabledException" => crate::error::AssumeRoleWithSAMLError {
meta: generic,
kind: crate::error::AssumeRoleWithSAMLErrorKind::RegionDisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::region_disabled_exception::Builder::default();
let _ = response;
output = crate::xml_deser::deser_structure_crate_error_region_disabled_exception_xml_err(response.body().as_ref(), output).map_err(crate::error::AssumeRoleWithSAMLError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::AssumeRoleWithSAMLError::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_expired_token_exception(&self) -> bool
pub fn is_expired_token_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::ExpiredTokenException.
sourcepub fn is_idp_rejected_claim_exception(&self) -> bool
pub fn is_idp_rejected_claim_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::IdpRejectedClaimException.
sourcepub fn is_invalid_identity_token_exception(&self) -> bool
pub fn is_invalid_identity_token_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::InvalidIdentityTokenException.
sourcepub fn is_malformed_policy_document_exception(&self) -> bool
pub fn is_malformed_policy_document_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::MalformedPolicyDocumentException.
sourcepub fn is_packed_policy_too_large_exception(&self) -> bool
pub fn is_packed_policy_too_large_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::PackedPolicyTooLargeException.
sourcepub fn is_region_disabled_exception(&self) -> bool
pub fn is_region_disabled_exception(&self) -> bool
Returns true if the error kind is AssumeRoleWithSAMLErrorKind::RegionDisabledException.