Struct aws_sdk_apigateway::error::GetUsagePlanKeysError
source · #[non_exhaustive]pub struct GetUsagePlanKeysError {
pub kind: GetUsagePlanKeysErrorKind,
/* private fields */
}
Expand description
Error type for the GetUsagePlanKeys
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: GetUsagePlanKeysErrorKind
Kind of error that occurred.
Implementations§
source§impl GetUsagePlanKeysError
impl GetUsagePlanKeysError
sourcepub fn new(kind: GetUsagePlanKeysErrorKind, meta: Error) -> Self
pub fn new(kind: GetUsagePlanKeysErrorKind, meta: Error) -> Self
Creates a new GetUsagePlanKeysError
.
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 GetUsagePlanKeysError::Unhandled
variant from any error type.
Examples found in repository?
9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075
pub fn parse_get_usage_plan_keys_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetUsagePlanKeysOutput, crate::error::GetUsagePlanKeysError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetUsagePlanKeysError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"BadRequestException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::BadRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::bad_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyRequestsException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_usage_plan_keys_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetUsagePlanKeysError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetUsagePlanKeysError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GetUsagePlanKeysError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 10000 10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075
pub fn parse_get_usage_plan_keys_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetUsagePlanKeysOutput, crate::error::GetUsagePlanKeysError>
{
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GetUsagePlanKeysError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"BadRequestException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::BadRequestException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::bad_request_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_bad_request_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"NotFoundException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::NotFoundException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::not_found_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_not_found_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TooManyRequestsException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::TooManyRequestsException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::too_many_requests_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_too_many_requests_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output = output.set_retry_after_seconds(
crate::http_serde::deser_header_get_usage_plan_keys_too_many_requests_exception_retry_after_seconds(response.headers())
.map_err(|_|crate::error::GetUsagePlanKeysError::unhandled("Failed to parse retryAfterSeconds from header `Retry-After"))?
);
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnauthorizedException" => crate::error::GetUsagePlanKeysError {
meta: generic,
kind: crate::error::GetUsagePlanKeysErrorKind::UnauthorizedException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::unauthorized_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unauthorized_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GetUsagePlanKeysError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GetUsagePlanKeysError::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_bad_request_exception(&self) -> bool
pub fn is_bad_request_exception(&self) -> bool
Returns true
if the error kind is GetUsagePlanKeysErrorKind::BadRequestException
.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true
if the error kind is GetUsagePlanKeysErrorKind::NotFoundException
.
sourcepub fn is_too_many_requests_exception(&self) -> bool
pub fn is_too_many_requests_exception(&self) -> bool
Returns true
if the error kind is GetUsagePlanKeysErrorKind::TooManyRequestsException
.
Returns true
if the error kind is GetUsagePlanKeysErrorKind::UnauthorizedException
.