aws-sdk-cloudwatch 1.112.0

AWS SDK for Amazon CloudWatch
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Matcher union: {"output":{"path":"length(MetricAlarms[]) > `0`","expected":"true","comparator":"booleanEquals"}}
pub(crate) fn match_describe_alarms_beb7bce02503b1deb(
    _result: ::std::result::Result<&crate::operation::describe_alarms::DescribeAlarmsOutput, &crate::operation::describe_alarms::DescribeAlarmsError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_alarms::DescribeAlarmsOutput) -> ::std::option::Option<bool> {
        let _fld_2 = _output.metric_alarms.as_ref()?;
        let _ret_1 = _fld_2.len() as i64;
        const _LIT_3: &f64 = &0.0;
        let _tmp_5 = *_LIT_3;
        let _tmp_6 = _tmp_5 as i64;
        let _cmp_4 = _ret_1 > _tmp_6;
        ::std::option::Option::Some(_cmp_4)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let right = true;
            let _cmp_1 = value == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"success":true}
pub(crate) fn match_get_alarm_mute_rule_c955e57777ec0d736(
    _result: ::std::result::Result<
        &crate::operation::get_alarm_mute_rule::GetAlarmMuteRuleOutput,
        &crate::operation::get_alarm_mute_rule::GetAlarmMuteRuleError,
    >,
) -> bool {
    _result.is_ok()
}

/// Matcher union: {"errorType":"ResourceNotFoundException"}
pub(crate) fn match_get_alarm_mute_rule_1cce2c05524fb92d4(
    _result: ::std::result::Result<
        &crate::operation::get_alarm_mute_rule::GetAlarmMuteRuleOutput,
        &crate::operation::get_alarm_mute_rule::GetAlarmMuteRuleError,
    >,
) -> bool {
    if let ::std::result::Result::Err(err) = _result {
        if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(err) {
            return code == "ResourceNotFoundException";
        }
    }
    false
}

/// Matcher union: {"output":{"path":"length(CompositeAlarms[]) > `0`","expected":"true","comparator":"booleanEquals"}}
pub(crate) fn match_describe_alarms_5e47a4f72e6ce4350(
    _result: ::std::result::Result<&crate::operation::describe_alarms::DescribeAlarmsOutput, &crate::operation::describe_alarms::DescribeAlarmsError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_alarms::DescribeAlarmsOutput) -> ::std::option::Option<bool> {
        let _fld_2 = _output.composite_alarms.as_ref()?;
        let _ret_1 = _fld_2.len() as i64;
        const _LIT_3: &f64 = &0.0;
        let _tmp_5 = *_LIT_3;
        let _tmp_6 = _tmp_5 as i64;
        let _cmp_4 = _ret_1 > _tmp_6;
        ::std::option::Option::Some(_cmp_4)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let right = true;
            let _cmp_1 = value == right;
            _cmp_1
        })
        .unwrap_or_default()
}