#[non_exhaustive]pub struct StartOutboundVoiceContactError {
pub kind: StartOutboundVoiceContactErrorKind,
/* private fields */
}
Expand description
Error type for the StartOutboundVoiceContact
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: StartOutboundVoiceContactErrorKind
Kind of error that occurred.
Implementations§
source§impl StartOutboundVoiceContactError
impl StartOutboundVoiceContactError
sourcepub fn new(kind: StartOutboundVoiceContactErrorKind, meta: Error) -> Self
pub fn new(kind: StartOutboundVoiceContactErrorKind, meta: Error) -> Self
Creates a new StartOutboundVoiceContactError
.
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 StartOutboundVoiceContactError::Unhandled
variant from any error type.
Examples found in repository?
14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574
pub fn parse_start_outbound_voice_contact_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartOutboundVoiceContactOutput,
crate::error::StartOutboundVoiceContactError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StartOutboundVoiceContactError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DestinationNotAllowedException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::DestinationNotAllowedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::destination_not_allowed_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_destination_not_allowed_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServiceException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::InternalServiceException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::InvalidParameterException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::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::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"LimitExceededException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::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::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OutboundContactNotPermittedException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::OutboundContactNotPermittedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::outbound_contact_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_outbound_contact_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::StartOutboundVoiceContactError::generic(generic)
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StartOutboundVoiceContactError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
14455 14456 14457 14458 14459 14460 14461 14462 14463 14464 14465 14466 14467 14468 14469 14470 14471 14472 14473 14474 14475 14476 14477 14478 14479 14480 14481 14482 14483 14484 14485 14486 14487 14488 14489 14490 14491 14492 14493 14494 14495 14496 14497 14498 14499 14500 14501 14502 14503 14504 14505 14506 14507 14508 14509 14510 14511 14512 14513 14514 14515 14516 14517 14518 14519 14520 14521 14522 14523 14524 14525 14526 14527 14528 14529 14530 14531 14532 14533 14534 14535 14536 14537 14538 14539 14540 14541 14542 14543 14544 14545 14546 14547 14548 14549 14550 14551 14552 14553 14554 14555 14556 14557 14558 14559 14560 14561 14562 14563 14564 14565 14566 14567 14568 14569 14570 14571 14572 14573 14574
pub fn parse_start_outbound_voice_contact_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StartOutboundVoiceContactOutput,
crate::error::StartOutboundVoiceContactError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StartOutboundVoiceContactError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DestinationNotAllowedException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::DestinationNotAllowedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::destination_not_allowed_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_destination_not_allowed_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InternalServiceException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::InternalServiceException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::internal_service_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_service_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::InvalidParameterException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::invalid_parameter_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidRequestException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::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::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"LimitExceededException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::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::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OutboundContactNotPermittedException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::OutboundContactNotPermittedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::outbound_contact_not_permitted_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_outbound_contact_not_permitted_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceNotFoundException" => crate::error::StartOutboundVoiceContactError { meta: generic, kind: crate::error::StartOutboundVoiceContactErrorKind::ResourceNotFoundException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StartOutboundVoiceContactError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::StartOutboundVoiceContactError::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_destination_not_allowed_exception(&self) -> bool
pub fn is_destination_not_allowed_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::DestinationNotAllowedException
.
sourcepub fn is_internal_service_exception(&self) -> bool
pub fn is_internal_service_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::InternalServiceException
.
sourcepub fn is_invalid_parameter_exception(&self) -> bool
pub fn is_invalid_parameter_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::InvalidParameterException
.
sourcepub fn is_invalid_request_exception(&self) -> bool
pub fn is_invalid_request_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::InvalidRequestException
.
sourcepub fn is_limit_exceeded_exception(&self) -> bool
pub fn is_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::LimitExceededException
.
sourcepub fn is_outbound_contact_not_permitted_exception(&self) -> bool
pub fn is_outbound_contact_not_permitted_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::OutboundContactNotPermittedException
.
sourcepub fn is_resource_not_found_exception(&self) -> bool
pub fn is_resource_not_found_exception(&self) -> bool
Returns true
if the error kind is StartOutboundVoiceContactErrorKind::ResourceNotFoundException
.