#[non_exhaustive]pub struct GenerateDataKeyWithoutPlaintextError {
pub kind: GenerateDataKeyWithoutPlaintextErrorKind,
/* private fields */
}
Expand description
Error type for the GenerateDataKeyWithoutPlaintext
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: GenerateDataKeyWithoutPlaintextErrorKind
Kind of error that occurred.
Implementations§
source§impl GenerateDataKeyWithoutPlaintextError
impl GenerateDataKeyWithoutPlaintextError
sourcepub fn new(kind: GenerateDataKeyWithoutPlaintextErrorKind, meta: Error) -> Self
pub fn new(kind: GenerateDataKeyWithoutPlaintextErrorKind, meta: Error) -> Self
Creates a new GenerateDataKeyWithoutPlaintextError
.
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 GenerateDataKeyWithoutPlaintextError::Unhandled
variant from any error type.
Examples found in repository?
3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183
pub fn parse_generate_data_key_without_plaintext_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GenerateDataKeyWithoutPlaintextOutput,
crate::error::GenerateDataKeyWithoutPlaintextError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind:
crate::error::GenerateDataKeyWithoutPlaintextErrorKind::DependencyTimeoutException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"DisabledException" => {
crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::DisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::disabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_disabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidGrantTokenException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind:
crate::error::GenerateDataKeyWithoutPlaintextErrorKind::InvalidGrantTokenException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_grant_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_grant_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidKeyUsageException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::InvalidKeyUsageException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_key_usage_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_key_usage_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KeyUnavailableException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KeyUnavailableException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::key_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_key_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KMSInternalException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KmsInvalidStateException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::kms_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"NotFoundException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::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::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GenerateDataKeyWithoutPlaintextError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the GenerateDataKeyWithoutPlaintextError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183
pub fn parse_generate_data_key_without_plaintext_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::GenerateDataKeyWithoutPlaintextOutput,
crate::error::GenerateDataKeyWithoutPlaintextError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"DependencyTimeoutException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind:
crate::error::GenerateDataKeyWithoutPlaintextErrorKind::DependencyTimeoutException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::dependency_timeout_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_dependency_timeout_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"DisabledException" => {
crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::DisabledException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::disabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_disabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidGrantTokenException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind:
crate::error::GenerateDataKeyWithoutPlaintextErrorKind::InvalidGrantTokenException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_grant_token_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_grant_token_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"InvalidKeyUsageException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::InvalidKeyUsageException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_key_usage_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_key_usage_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KeyUnavailableException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KeyUnavailableException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::key_unavailable_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_key_unavailable_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"KMSInternalException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KmsInternalException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::kms_internal_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_internal_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"KMSInvalidStateException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::KmsInvalidStateException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::kms_invalid_state_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_kms_invalid_state_exception_json_err(response.body().as_ref(), output).map_err(crate::error::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"NotFoundException" => crate::error::GenerateDataKeyWithoutPlaintextError {
meta: generic,
kind: crate::error::GenerateDataKeyWithoutPlaintextErrorKind::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::GenerateDataKeyWithoutPlaintextError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
_ => crate::error::GenerateDataKeyWithoutPlaintextError::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_dependency_timeout_exception(&self) -> bool
pub fn is_dependency_timeout_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::DependencyTimeoutException
.
sourcepub fn is_disabled_exception(&self) -> bool
pub fn is_disabled_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::DisabledException
.
sourcepub fn is_invalid_grant_token_exception(&self) -> bool
pub fn is_invalid_grant_token_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::InvalidGrantTokenException
.
sourcepub fn is_invalid_key_usage_exception(&self) -> bool
pub fn is_invalid_key_usage_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::InvalidKeyUsageException
.
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::KeyUnavailableException
.
sourcepub fn is_kms_internal_exception(&self) -> bool
pub fn is_kms_internal_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::KmsInternalException
.
sourcepub fn is_kms_invalid_state_exception(&self) -> bool
pub fn is_kms_invalid_state_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::KmsInvalidStateException
.
sourcepub fn is_not_found_exception(&self) -> bool
pub fn is_not_found_exception(&self) -> bool
Returns true
if the error kind is GenerateDataKeyWithoutPlaintextErrorKind::NotFoundException
.