#[non_exhaustive]pub struct PutOrganizationConfigRuleError {
pub kind: PutOrganizationConfigRuleErrorKind,
/* private fields */
}Expand description
Error type for the PutOrganizationConfigRule 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: PutOrganizationConfigRuleErrorKindKind of error that occurred.
Implementations§
source§impl PutOrganizationConfigRuleError
impl PutOrganizationConfigRuleError
sourcepub fn new(kind: PutOrganizationConfigRuleErrorKind, meta: Error) -> Self
pub fn new(kind: PutOrganizationConfigRuleErrorKind, meta: Error) -> Self
Creates a new PutOrganizationConfigRuleError.
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 PutOrganizationConfigRuleError::Unhandled variant from any error type.
Examples found in repository?
6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256
pub fn parse_put_organization_config_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::PutOrganizationConfigRuleOutput,
crate::error::PutOrganizationConfigRuleError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::PutOrganizationConfigRuleError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientPermissionsException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::InsufficientPermissionsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::insufficient_permissions_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_permissions_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValueException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::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::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MaxNumberOfOrganizationConfigRulesExceededException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::MaxNumberOfOrganizationConfigRulesExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::max_number_of_organization_config_rules_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_max_number_of_organization_config_rules_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableOrganizationException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::NoAvailableOrganizationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_organization_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_organization_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAllFeaturesNotEnabledException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::OrganizationAllFeaturesNotEnabledException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_all_features_not_enabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_all_features_not_enabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::PutOrganizationConfigRuleError::generic(generic)
})
}sourcepub fn generic(err: Error) -> Self
pub fn generic(err: Error) -> Self
Creates the PutOrganizationConfigRuleError::Unhandled variant from a aws_smithy_types::Error.
Examples found in repository?
6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256
pub fn parse_put_organization_config_rule_error(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
crate::output::PutOrganizationConfigRuleOutput,
crate::error::PutOrganizationConfigRuleError,
> {
let generic = crate::json_deser::parse_http_generic_error(response)
.map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
let error_code = match generic.code() {
Some(code) => code,
None => {
return Err(crate::error::PutOrganizationConfigRuleError::unhandled(
generic,
))
}
};
let _error_message = generic.message().map(|msg| msg.to_owned());
Err(match error_code {
"InsufficientPermissionsException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::InsufficientPermissionsException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::insufficient_permissions_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_insufficient_permissions_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"InvalidParameterValueException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::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::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"MaxNumberOfOrganizationConfigRulesExceededException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::MaxNumberOfOrganizationConfigRulesExceededException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::max_number_of_organization_config_rules_exceeded_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_max_number_of_organization_config_rules_exceeded_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"NoAvailableOrganizationException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::NoAvailableOrganizationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::no_available_organization_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_no_available_organization_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAccessDeniedException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_access_denied_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_access_denied_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"OrganizationAllFeaturesNotEnabledException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::OrganizationAllFeaturesNotEnabledException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::organization_all_features_not_enabled_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_organization_all_features_not_enabled_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ResourceInUseException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::ResourceInUseException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::resource_in_use_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_resource_in_use_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
"ValidationException" => crate::error::PutOrganizationConfigRuleError { meta: generic, kind: crate::error::PutOrganizationConfigRuleErrorKind::ValidationException({
#[allow(unused_mut)]let mut tmp =
{
#[allow(unused_mut)]let mut output = crate::error::validation_exception::Builder::default();
let _ = response;
output = crate::json_deser::deser_structure_crate_error_validation_exception_json_err(response.body().as_ref(), output).map_err(crate::error::PutOrganizationConfigRuleError::unhandled)?;
output.build()
}
;
if tmp.message.is_none() {
tmp.message = _error_message;
}
tmp
})},
_ => crate::error::PutOrganizationConfigRuleError::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_insufficient_permissions_exception(&self) -> bool
pub fn is_insufficient_permissions_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::InsufficientPermissionsException.
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 PutOrganizationConfigRuleErrorKind::InvalidParameterValueException.
sourcepub fn is_max_number_of_organization_config_rules_exceeded_exception(
&self
) -> bool
pub fn is_max_number_of_organization_config_rules_exceeded_exception(
&self
) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::MaxNumberOfOrganizationConfigRulesExceededException.
sourcepub fn is_no_available_organization_exception(&self) -> bool
pub fn is_no_available_organization_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::NoAvailableOrganizationException.
sourcepub fn is_organization_access_denied_exception(&self) -> bool
pub fn is_organization_access_denied_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::OrganizationAccessDeniedException.
sourcepub fn is_organization_all_features_not_enabled_exception(&self) -> bool
pub fn is_organization_all_features_not_enabled_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::OrganizationAllFeaturesNotEnabledException.
sourcepub fn is_resource_in_use_exception(&self) -> bool
pub fn is_resource_in_use_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::ResourceInUseException.
sourcepub fn is_validation_exception(&self) -> bool
pub fn is_validation_exception(&self) -> bool
Returns true if the error kind is PutOrganizationConfigRuleErrorKind::ValidationException.