Struct aws_sdk_ssm::error::PutInventoryError
source · #[non_exhaustive]pub struct PutInventoryError {
pub kind: PutInventoryErrorKind,
/* private fields */
}
Expand description
Error type for the PutInventory
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: PutInventoryErrorKind
Kind of error that occurred.
Implementations§
source§impl PutInventoryError
impl PutInventoryError
sourcepub fn new(kind: PutInventoryErrorKind, meta: Error) -> Self
pub fn new(kind: PutInventoryErrorKind, meta: Error) -> Self
Creates a new PutInventoryError
.
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 PutInventoryError::Unhandled
variant from any error type.
Examples found in repository?
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 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219
pub fn parse_put_inventory_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PutInventoryOutput, crate::error::PutInventoryError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutInventoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutInventoryError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CustomSchemaCountLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::CustomSchemaCountLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::custom_schema_count_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_schema_count_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInstanceId" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInventoryItemContextException" => {
crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidInventoryItemContextException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::invalid_inventory_item_context_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_inventory_item_context_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidItemContentException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidItemContentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_item_content_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_item_content_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidTypeNameException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidTypeNameException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_type_name_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_type_name_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ItemContentMismatchException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::ItemContentMismatchException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::item_content_mismatch_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_item_content_mismatch_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ItemSizeLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::ItemSizeLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::item_size_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_item_size_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubTypeCountLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::SubTypeCountLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::sub_type_count_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_sub_type_count_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TotalSizeLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::TotalSizeLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::total_size_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_total_size_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedInventoryItemContextException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::UnsupportedInventoryItemContextException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unsupported_inventory_item_context_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_inventory_item_context_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedInventorySchemaVersionException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::UnsupportedInventorySchemaVersionException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unsupported_inventory_schema_version_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_inventory_schema_version_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::PutInventoryError::generic(generic),
})
}
sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the PutInventoryError::Unhandled
variant from a aws_smithy_types::Error
.
Examples found in repository?
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 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219
pub fn parse_put_inventory_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::PutInventoryOutput, crate::error::PutInventoryError> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutInventoryError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => return Err(crate::error::PutInventoryError::unhandled(generic)),
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"CustomSchemaCountLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::CustomSchemaCountLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::custom_schema_count_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_custom_schema_count_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InternalServerError" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InternalServerError({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::internal_server_error::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_internal_server_error_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInstanceId" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidInstanceId({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_instance_id::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_instance_id_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidInventoryItemContextException" => {
crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidInventoryItemContextException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::invalid_inventory_item_context_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_inventory_item_context_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
}
}
"InvalidItemContentException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidItemContentException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::invalid_item_content_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_item_content_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"InvalidTypeNameException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::InvalidTypeNameException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output = crate::error::invalid_type_name_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_invalid_type_name_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ItemContentMismatchException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::ItemContentMismatchException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::item_content_mismatch_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_item_content_mismatch_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"ItemSizeLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::ItemSizeLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::item_size_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_item_size_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"SubTypeCountLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::SubTypeCountLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::sub_type_count_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_sub_type_count_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"TotalSizeLimitExceededException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::TotalSizeLimitExceededException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]
let mut output =
crate::error::total_size_limit_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_total_size_limit_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedInventoryItemContextException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::UnsupportedInventoryItemContextException({
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unsupported_inventory_item_context_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_inventory_item_context_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
}),
},
"UnsupportedInventorySchemaVersionException" => crate::error::PutInventoryError {
meta: generic,
kind: crate::error::PutInventoryErrorKind::UnsupportedInventorySchemaVersionException(
{
#[allow(unused_mut)]
let mut tmp = {
#[allow(unused_mut)]let mut output = crate::error::unsupported_inventory_schema_version_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_unsupported_inventory_schema_version_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutInventoryError::unhandled)?;
output.build()
};
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
},
),
},
_ => crate::error::PutInventoryError::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_custom_schema_count_limit_exceeded_exception(&self) -> bool
pub fn is_custom_schema_count_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::CustomSchemaCountLimitExceededException
.
sourcepub fn is_internal_server_error(&self) -> bool
pub fn is_internal_server_error(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::InternalServerError
.
sourcepub fn is_invalid_instance_id(&self) -> bool
pub fn is_invalid_instance_id(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::InvalidInstanceId
.
sourcepub fn is_invalid_inventory_item_context_exception(&self) -> bool
pub fn is_invalid_inventory_item_context_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::InvalidInventoryItemContextException
.
sourcepub fn is_invalid_item_content_exception(&self) -> bool
pub fn is_invalid_item_content_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::InvalidItemContentException
.
sourcepub fn is_invalid_type_name_exception(&self) -> bool
pub fn is_invalid_type_name_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::InvalidTypeNameException
.
sourcepub fn is_item_content_mismatch_exception(&self) -> bool
pub fn is_item_content_mismatch_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::ItemContentMismatchException
.
sourcepub fn is_item_size_limit_exceeded_exception(&self) -> bool
pub fn is_item_size_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::ItemSizeLimitExceededException
.
sourcepub fn is_sub_type_count_limit_exceeded_exception(&self) -> bool
pub fn is_sub_type_count_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::SubTypeCountLimitExceededException
.
sourcepub fn is_total_size_limit_exceeded_exception(&self) -> bool
pub fn is_total_size_limit_exceeded_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::TotalSizeLimitExceededException
.
sourcepub fn is_unsupported_inventory_item_context_exception(&self) -> bool
pub fn is_unsupported_inventory_item_context_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::UnsupportedInventoryItemContextException
.
sourcepub fn is_unsupported_inventory_schema_version_exception(&self) -> bool
pub fn is_unsupported_inventory_schema_version_exception(&self) -> bool
Returns true
if the error kind is PutInventoryErrorKind::UnsupportedInventorySchemaVersionException
.