aws-sdk-machinelearning 1.97.0

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

/// Matcher union: {"output":{"path":"Results[].Status","expected":"COMPLETED","comparator":"allStringEquals"}}
pub(crate) fn match_describe_batch_predictions_147c4749b8435ead2(
    _result: ::std::result::Result<
        &crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput,
        &crate::operation::describe_batch_predictions::DescribeBatchPredictionsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::BatchPrediction) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            !value.is_empty()
                && value.iter().all(|value| {
                    let _tmp_2 = value.as_str();
                    let right = "COMPLETED";
                    let _cmp_1 = _tmp_2 == right;
                    _cmp_1
                })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
pub(crate) fn match_describe_batch_predictions_772ab1725e6b52e57(
    _result: ::std::result::Result<
        &crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput,
        &crate::operation::describe_batch_predictions::DescribeBatchPredictionsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_batch_predictions::DescribeBatchPredictionsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::BatchPrediction) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            value.iter().any(|value| {
                let _tmp_2 = value.as_str();
                let right = "FAILED";
                let _cmp_1 = _tmp_2 == right;
                _cmp_1
            })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"COMPLETED","comparator":"allStringEquals"}}
pub(crate) fn match_describe_data_sources_147c4749b8435ead2(
    _result: ::std::result::Result<
        &crate::operation::describe_data_sources::DescribeDataSourcesOutput,
        &crate::operation::describe_data_sources::DescribeDataSourcesError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_data_sources::DescribeDataSourcesOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::DataSource) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            !value.is_empty()
                && value.iter().all(|value| {
                    let _tmp_2 = value.as_str();
                    let right = "COMPLETED";
                    let _cmp_1 = _tmp_2 == right;
                    _cmp_1
                })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
pub(crate) fn match_describe_data_sources_772ab1725e6b52e57(
    _result: ::std::result::Result<
        &crate::operation::describe_data_sources::DescribeDataSourcesOutput,
        &crate::operation::describe_data_sources::DescribeDataSourcesError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_data_sources::DescribeDataSourcesOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::DataSource) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            value.iter().any(|value| {
                let _tmp_2 = value.as_str();
                let right = "FAILED";
                let _cmp_1 = _tmp_2 == right;
                _cmp_1
            })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"COMPLETED","comparator":"allStringEquals"}}
pub(crate) fn match_describe_evaluations_147c4749b8435ead2(
    _result: ::std::result::Result<
        &crate::operation::describe_evaluations::DescribeEvaluationsOutput,
        &crate::operation::describe_evaluations::DescribeEvaluationsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_evaluations::DescribeEvaluationsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::Evaluation) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            !value.is_empty()
                && value.iter().all(|value| {
                    let _tmp_2 = value.as_str();
                    let right = "COMPLETED";
                    let _cmp_1 = _tmp_2 == right;
                    _cmp_1
                })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
pub(crate) fn match_describe_evaluations_772ab1725e6b52e57(
    _result: ::std::result::Result<
        &crate::operation::describe_evaluations::DescribeEvaluationsOutput,
        &crate::operation::describe_evaluations::DescribeEvaluationsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_evaluations::DescribeEvaluationsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::Evaluation) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            value.iter().any(|value| {
                let _tmp_2 = value.as_str();
                let right = "FAILED";
                let _cmp_1 = _tmp_2 == right;
                _cmp_1
            })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"COMPLETED","comparator":"allStringEquals"}}
pub(crate) fn match_describe_ml_models_147c4749b8435ead2(
    _result: ::std::result::Result<
        &crate::operation::describe_ml_models::DescribeMlModelsOutput,
        &crate::operation::describe_ml_models::DescribeMLModelsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_ml_models::DescribeMlModelsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::MlModel) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            !value.is_empty()
                && value.iter().all(|value| {
                    let _tmp_2 = value.as_str();
                    let right = "COMPLETED";
                    let _cmp_1 = _tmp_2 == right;
                    _cmp_1
                })
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Results[].Status","expected":"FAILED","comparator":"anyStringEquals"}}
pub(crate) fn match_describe_ml_models_772ab1725e6b52e57(
    _result: ::std::result::Result<
        &crate::operation::describe_ml_models::DescribeMlModelsOutput,
        &crate::operation::describe_ml_models::DescribeMLModelsError,
    >,
) -> bool {
    fn path_traversal<'a>(
        _output: &'a crate::operation::describe_ml_models::DescribeMlModelsOutput,
    ) -> ::std::option::Option<::std::vec::Vec<&'a crate::types::EntityStatus>> {
        let _fld_1 = _output.results.as_ref()?;
        let _prj_3 = _fld_1
            .iter()
            .flat_map(|v| {
                #[allow(clippy::let_and_return)]
                fn map(_v: &crate::types::MlModel) -> ::std::option::Option<&crate::types::EntityStatus> {
                    let _fld_2 = _v.status.as_ref();
                    _fld_2
                }
                map(v)
            })
            .collect::<::std::vec::Vec<_>>();
        ::std::option::Option::Some(_prj_3)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            value.iter().any(|value| {
                let _tmp_2 = value.as_str();
                let right = "FAILED";
                let _cmp_1 = _tmp_2 == right;
                _cmp_1
            })
        })
        .unwrap_or_default()
}