aws-sdk-mediaconnect 1.41.0

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

/// Matcher union: {"output":{"path":"Flow.Status","expected":"ACTIVE","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_c101e51f836c37ad0(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _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: {"output":{"path":"Flow.Status","expected":"STARTING","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_007e0c27ad477bfa3(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "STARTING";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Flow.Status","expected":"UPDATING","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_ed940df20c9b33b76(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _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: {"errorType":"InternalServerErrorException"}
pub(crate) fn match_describe_flow_23a4ee68df28eed70(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> 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 == "InternalServerErrorException";
        }
    }
    false
}

/// Matcher union: {"errorType":"ServiceUnavailableException"}
pub(crate) fn match_describe_flow_370bdfc8b90a93f70(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> 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 == "ServiceUnavailableException";
        }
    }
    false
}

/// Matcher union: {"output":{"path":"Flow.Status","expected":"ERROR","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_4eb5bd3e59f68831d(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "ERROR";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"errorType":"NotFoundException"}
pub(crate) fn match_describe_flow_bcffe71d9077ffaa1(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> 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 == "NotFoundException";
        }
    }
    false
}

/// Matcher union: {"output":{"path":"Flow.Status","expected":"DELETING","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_58fa01d9b568bfa16(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _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":"Flow.Status","expected":"STANDBY","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_50041433fc24a447b(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "STANDBY";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}

/// Matcher union: {"output":{"path":"Flow.Status","expected":"STOPPING","comparator":"stringEquals"}}
pub(crate) fn match_describe_flow_5ca2df6a6ffba30b9(
    _result: ::std::result::Result<&crate::operation::describe_flow::DescribeFlowOutput, &crate::operation::describe_flow::DescribeFlowError>,
) -> bool {
    fn path_traversal<'a>(_output: &'a crate::operation::describe_flow::DescribeFlowOutput) -> ::std::option::Option<&'a crate::types::Status> {
        let _fld_1 = _output.flow.as_ref()?;
        let _fld_2 = _fld_1.status.as_ref()?;
        ::std::option::Option::Some(_fld_2)
    }
    _result
        .as_ref()
        .ok()
        .and_then(|output| path_traversal(output))
        .map(|value| {
            let _tmp_2 = value.as_str();
            let right = "STOPPING";
            let _cmp_1 = _tmp_2 == right;
            _cmp_1
        })
        .unwrap_or_default()
}