#[non_exhaustive]
pub struct UpdateCloudFrontOriginAccessIdentityError { pub kind: UpdateCloudFrontOriginAccessIdentityErrorKind, /* private fields */ }
Expand description

Error type for the UpdateCloudFrontOriginAccessIdentity operation.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§kind: UpdateCloudFrontOriginAccessIdentityErrorKind

Kind of error that occurred.

Implementations§

Creates a new UpdateCloudFrontOriginAccessIdentityError.

Creates the UpdateCloudFrontOriginAccessIdentityError::Unhandled variant from any error type.

Examples found in repository?
src/operation_deser.rs (line 10806)
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
pub fn parse_update_cloud_front_origin_access_identity_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateCloudFrontOriginAccessIdentityOutput,
    crate::error::UpdateCloudFrontOriginAccessIdentityError,
> {
    let generic = crate::xml_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDenied" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::AccessDenied({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::access_denied::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "IllegalUpdate" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::IllegalUpdate({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::illegal_update::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_illegal_update_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InconsistentQuantities" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::inconsistent_quantities::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_inconsistent_quantities_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InvalidArgument" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::invalid_argument::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InvalidIfMatchVersion" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidIfMatchVersion({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::invalid_if_match_version::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "MissingBody" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::MissingBody({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::missing_body::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_missing_body_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "NoSuchCloudFrontOriginAccessIdentity" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::no_such_cloud_front_origin_access_identity::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_no_such_cloud_front_origin_access_identity_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "PreconditionFailed" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::PreconditionFailed({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::precondition_failed::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        _ => crate::error::UpdateCloudFrontOriginAccessIdentityError::generic(generic)
    })
}

#[allow(clippy::unnecessary_wraps)]
pub fn parse_update_cloud_front_origin_access_identity_response(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateCloudFrontOriginAccessIdentityOutput,
    crate::error::UpdateCloudFrontOriginAccessIdentityError,
> {
    Ok({
        #[allow(unused_mut)]
        let mut output =
            crate::output::update_cloud_front_origin_access_identity_output::Builder::default();
        let _ = response;
        output = output.set_cloud_front_origin_access_identity(
            crate::http_serde::deser_payload_update_cloud_front_origin_access_identity_update_cloud_front_origin_access_identity_output_cloud_front_origin_access_identity(response.body().as_ref())?
        );
        output = output.set_e_tag(
            crate::http_serde::deser_header_update_cloud_front_origin_access_identity_update_cloud_front_origin_access_identity_output_e_tag(response.headers())
                                    .map_err(|_|crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled("Failed to parse ETag from header `ETag"))?
        );
        output.build()
    })
}

Creates the UpdateCloudFrontOriginAccessIdentityError::Unhandled variant from a aws_smithy_types::Error.

Examples found in repository?
src/operation_deser.rs (line 10924)
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
pub fn parse_update_cloud_front_origin_access_identity_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateCloudFrontOriginAccessIdentityOutput,
    crate::error::UpdateCloudFrontOriginAccessIdentityError,
> {
    let generic = crate::xml_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled(generic))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDenied" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::AccessDenied({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::access_denied::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_access_denied_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "IllegalUpdate" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::IllegalUpdate({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::illegal_update::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_illegal_update_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InconsistentQuantities" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::inconsistent_quantities::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_inconsistent_quantities_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InvalidArgument" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::invalid_argument::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_invalid_argument_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "InvalidIfMatchVersion" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidIfMatchVersion({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::invalid_if_match_version::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_invalid_if_match_version_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "MissingBody" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::MissingBody({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::missing_body::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_missing_body_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "NoSuchCloudFrontOriginAccessIdentity" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::no_such_cloud_front_origin_access_identity::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_no_such_cloud_front_origin_access_identity_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        "PreconditionFailed" => crate::error::UpdateCloudFrontOriginAccessIdentityError { meta: generic, kind: crate::error::UpdateCloudFrontOriginAccessIdentityErrorKind::PreconditionFailed({
            #[allow(unused_mut)]let mut tmp =
                 {
                    #[allow(unused_mut)]let mut output = crate::error::precondition_failed::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_precondition_failed_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateCloudFrontOriginAccessIdentityError::unhandled)?;
                    output.build()
                }
            ;
            if tmp.message.is_none() {
                                                        tmp.message = _error_message;
                                                    }
            tmp
        })},
        _ => crate::error::UpdateCloudFrontOriginAccessIdentityError::generic(generic)
    })
}

Returns the error message if one is available.

Returns error metadata, which includes the error code, message, request ID, and potentially additional information.

Returns the request ID if it’s available.

Returns the error code if it’s available.

Examples found in repository?
src/error.rs (line 22452)
22451
22452
22453
    fn code(&self) -> Option<&str> {
        UpdateCloudFrontOriginAccessIdentityError::code(self)
    }

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::AccessDenied.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::IllegalUpdate.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::InconsistentQuantities.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidArgument.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::InvalidIfMatchVersion.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::MissingBody.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::NoSuchCloudFrontOriginAccessIdentity.

Returns true if the error kind is UpdateCloudFrontOriginAccessIdentityErrorKind::PreconditionFailed.

Trait Implementations§

Creates an unhandled error variant with the given source.
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
The lower-level source of this error, if any. Read more
👎Deprecated since 1.42.0: use the Display impl or to_string()
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
Converts to this type from the input type.
Returns the code for this error if one exists
Returns the ErrorKind when the error is modeled as retryable Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
Should always be Self
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more