#[non_exhaustive]pub struct PutOrganizationConformancePackError {
pub kind: PutOrganizationConformancePackErrorKind,
/* private fields */
}Expand description
Error type for the PutOrganizationConformancePack 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: PutOrganizationConformancePackErrorKindKind of error that occurred.
Implementations§
source§impl PutOrganizationConformancePackError
impl PutOrganizationConformancePackError
sourcepub fn new(kind: PutOrganizationConformancePackErrorKind, meta: Error) -> Self
pub fn new(kind: PutOrganizationConformancePackErrorKind, meta: Error) -> Self
Creates a new PutOrganizationConformancePackError.
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 PutOrganizationConformancePackError::Unhandled variant from any error type.
Examples found in repository?
6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408
pub fn parse_put_organization_conformance_pack_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::PutOrganizationConformancePackOutput,
crate::error::PutOrganizationConformancePackError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutOrganizationConformancePackError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientPermissionsException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::InsufficientPermissionsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::insufficient_permissions_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_permissions_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MaxNumberOfOrganizationConformancePacksExceededException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::MaxNumberOfOrganizationConformancePacksExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::max_number_of_organization_conformance_packs_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_max_number_of_organization_conformance_packs_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableOrganizationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::NoAvailableOrganizationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_organization_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_organization_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAllFeaturesNotEnabledException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationAllFeaturesNotEnabledException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_all_features_not_enabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_all_features_not_enabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationConformancePackTemplateValidationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationConformancePackTemplateValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_conformance_pack_template_validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_conformance_pack_template_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::PutOrganizationConformancePackError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the PutOrganizationConformancePackError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408
pub fn parse_put_organization_conformance_pack_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::PutOrganizationConformancePackOutput,
crate::error::PutOrganizationConformancePackError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutOrganizationConformancePackError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientPermissionsException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::InsufficientPermissionsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::insufficient_permissions_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_permissions_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MaxNumberOfOrganizationConformancePacksExceededException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::MaxNumberOfOrganizationConformancePacksExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::max_number_of_organization_conformance_packs_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_max_number_of_organization_conformance_packs_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableOrganizationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::NoAvailableOrganizationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_organization_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_organization_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAllFeaturesNotEnabledException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationAllFeaturesNotEnabledException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_all_features_not_enabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_all_features_not_enabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationConformancePackTemplateValidationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::OrganizationConformancePackTemplateValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_conformance_pack_template_validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_conformance_pack_template_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::PutOrganizationConformancePackError { meta: generic, kind: crate::error::PutOrganizationConformancePackErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConformancePackError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::PutOrganizationConformancePackError::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_insufficient_permissions_exception(&self) -> bool
pub fn is_insufficient_permissions_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::InsufficientPermissionsException.
sourcepub fn is_max_number_of_organization_conformance_packs_exceeded_exception(
&self
) -> bool
pub fn is_max_number_of_organization_conformance_packs_exceeded_exception(
&self
) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::MaxNumberOfOrganizationConformancePacksExceededException.
sourcepub fn is_no_available_organization_exception(&self) -> bool
pub fn is_no_available_organization_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::NoAvailableOrganizationException.
sourcepub fn is_organization_access_denied_exception(&self) -> bool
pub fn is_organization_access_denied_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::OrganizationAccessDeniedException.
sourcepub fn is_organization_all_features_not_enabled_exception(&self) -> bool
pub fn is_organization_all_features_not_enabled_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::OrganizationAllFeaturesNotEnabledException.
sourcepub fn is_organization_conformance_pack_template_validation_exception(
&self
) -> bool
pub fn is_organization_conformance_pack_template_validation_exception(
&self
) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::OrganizationConformancePackTemplateValidationException.
sourcepub fn is_resource_in_use_exception(&self) -> bool
pub fn is_resource_in_use_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::ResourceInUseException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConformancePackErrorKind::ValidationException.