#[non_exhaustive]pub struct StopDataCollectionByAgentIdsError {
pub kind: StopDataCollectionByAgentIdsErrorKind,
/* private fields */
}Expand description
Error type for the StopDataCollectionByAgentIds 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: StopDataCollectionByAgentIdsErrorKindKind of error that occurred.
Implementations§
source§impl StopDataCollectionByAgentIdsError
impl StopDataCollectionByAgentIdsError
sourcepub fn new(kind: StopDataCollectionByAgentIdsErrorKind, meta: Error) -> Self
pub fn new(kind: StopDataCollectionByAgentIdsErrorKind, meta: Error) -> Self
Creates a new StopDataCollectionByAgentIdsError.
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 StopDataCollectionByAgentIdsError::Unhandled variant from any error type.
Examples found in repository?
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313
pub fn parse_stop_data_collection_by_agent_ids_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopDataCollectionByAgentIdsOutput,
crate::error::StopDataCollectionByAgentIdsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopDataCollectionByAgentIdsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AuthorizationErrorException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::AuthorizationErrorException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::authorization_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_authorization_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"HomeRegionNotSetException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::HomeRegionNotSetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::home_region_not_set_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_home_region_not_set_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::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::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind:
crate::error::StopDataCollectionByAgentIdsErrorKind::InvalidParameterValueException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ServerInternalErrorException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::ServerInternalErrorException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::server_internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StopDataCollectionByAgentIdsError::generic(generic),
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the StopDataCollectionByAgentIdsError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313
pub fn parse_stop_data_collection_by_agent_ids_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::StopDataCollectionByAgentIdsOutput,
crate::error::StopDataCollectionByAgentIdsError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::StopDataCollectionByAgentIdsError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"AuthorizationErrorException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::AuthorizationErrorException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::authorization_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_authorization_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"HomeRegionNotSetException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::HomeRegionNotSetException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::home_region_not_set_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_home_region_not_set_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::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::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidParameterValueException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind:
crate::error::StopDataCollectionByAgentIdsErrorKind::InvalidParameterValueException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_parameter_value_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_parameter_value_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
"ServerInternalErrorException" => crate::error::StopDataCollectionByAgentIdsError {
meta: generic,
kind: crate::error::StopDataCollectionByAgentIdsErrorKind::ServerInternalErrorException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::server_internal_error_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_server_internal_error_exception_json_err(response.body().as_ref(), output).map_err(crate::error::StopDataCollectionByAgentIdsError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::StopDataCollectionByAgentIdsError::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.
Returns true if the error kind is StopDataCollectionByAgentIdsErrorKind::AuthorizationErrorException.
sourcepub fn is_home_region_not_set_exception(&self) -> bool
pub fn is_home_region_not_set_exception(&self) -> bool
Returns true if the error kind is StopDataCollectionByAgentIdsErrorKind::HomeRegionNotSetException.
sourcepub fn is_invalid_parameter_exception(&self) -> bool
pub fn is_invalid_parameter_exception(&self) -> bool
Returns true if the error kind is StopDataCollectionByAgentIdsErrorKind::InvalidParameterException.
sourcepub fn is_invalid_parameter_value_exception(&self) -> bool
pub fn is_invalid_parameter_value_exception(&self) -> bool
Returns true if the error kind is StopDataCollectionByAgentIdsErrorKind::InvalidParameterValueException.
sourcepub fn is_server_internal_error_exception(&self) -> bool
pub fn is_server_internal_error_exception(&self) -> bool
Returns true if the error kind is StopDataCollectionByAgentIdsErrorKind::ServerInternalErrorException.