aws-sdk-opensearchmemory 1.0.0

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

/// Matcher union: {"output":{"path":"status","expected":"ACTIVE","comparator":"stringEquals"}}
pub(crate) fn match_get_space_a0b9c099115634691(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "ACTIVE";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"errorType":"ResourceNotFoundException"}
pub(crate) fn match_get_space_1cce2c05524fb92d4(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> 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":"status","expected":"CREATING","comparator":"stringEquals"}}
pub(crate) fn match_get_space_ab538ef2e7cb9d2b4(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "CREATING";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"status","expected":"UPDATING","comparator":"stringEquals"}}
pub(crate) fn match_get_space_45c85fb7765d90d16(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "UPDATING";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"status","expected":"FAILED","comparator":"stringEquals"}}
pub(crate) fn match_get_space_f9c483f08ce8cb218(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|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":"status","expected":"DELETING","comparator":"stringEquals"}}
pub(crate) fn match_get_space_ac9cf40eec4f10ab5(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "DELETING";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"status","expected":"DELETED","comparator":"stringEquals"}}
pub(crate) fn match_get_space_8edac4c36e2a37f69(
    _result: ::std::result::Result<&crate::operation::get_space::GetSpaceOutput, &crate::operation::get_space::GetSpaceError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::get_space::GetSpaceOutput) -> ::std::option::Option<&'a crate::types::SpaceStatus> {
        let _fld_1 = &_output.status;
        ::std::option::Option::Some(_fld_1)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "DELETED";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}