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

Error type for the UpdateOriginAccessControl 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: UpdateOriginAccessControlErrorKind

Kind of error that occurred.

Implementations§

Creates a new UpdateOriginAccessControlError.

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

Examples found in repository?
src/operation_deser.rs (lines 12601-12603)
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
pub fn parse_update_origin_access_control_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateOriginAccessControlOutput,
    crate::error::UpdateOriginAccessControlError,
> {
    let generic = crate::xml_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateOriginAccessControlError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDenied" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "IllegalUpdate" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InvalidArgument" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InvalidIfMatchVersion" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NoSuchOriginAccessControl" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::NoSuchOriginAccessControl({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output =
                        crate::error::no_such_origin_access_control::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_no_such_origin_access_control_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "OriginAccessControlAlreadyExists" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind:
                crate::error::UpdateOriginAccessControlErrorKind::OriginAccessControlAlreadyExists(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]let mut output = crate::error::origin_access_control_already_exists::Builder::default();
                            let _ = response;
                            output = crate::xml_deser::deser_structure_crate_error_origin_access_control_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "PreconditionFailed" => {
            crate::error::UpdateOriginAccessControlError {
                meta: generic,
                kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::UpdateOriginAccessControlError::generic(generic),
    })
}

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

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

Examples found in repository?
src/operation_deser.rs (line 12746)
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
pub fn parse_update_origin_access_control_error(
    response: &http::Response<bytes::Bytes>,
) -> std::result::Result<
    crate::output::UpdateOriginAccessControlOutput,
    crate::error::UpdateOriginAccessControlError,
> {
    let generic = crate::xml_deser::parse_http_generic_error(response)
        .map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
    let error_code = match generic.code() {
        Some(code) => code,
        None => {
            return Err(crate::error::UpdateOriginAccessControlError::unhandled(
                generic,
            ))
        }
    };

    let _error_message = generic.message().map(|msg| msg.to_owned());
    Err(match error_code {
        "AccessDenied" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "IllegalUpdate" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InvalidArgument" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "InvalidIfMatchVersion" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "NoSuchOriginAccessControl" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind: crate::error::UpdateOriginAccessControlErrorKind::NoSuchOriginAccessControl({
                #[allow(unused_mut)]
                let mut tmp = {
                    #[allow(unused_mut)]
                    let mut output =
                        crate::error::no_such_origin_access_control::Builder::default();
                    let _ = response;
                    output = crate::xml_deser::deser_structure_crate_error_no_such_origin_access_control_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
                    output.build()
                };
                if tmp.message.is_none() {
                    tmp.message = _error_message;
                }
                tmp
            }),
        },
        "OriginAccessControlAlreadyExists" => crate::error::UpdateOriginAccessControlError {
            meta: generic,
            kind:
                crate::error::UpdateOriginAccessControlErrorKind::OriginAccessControlAlreadyExists(
                    {
                        #[allow(unused_mut)]
                        let mut tmp = {
                            #[allow(unused_mut)]let mut output = crate::error::origin_access_control_already_exists::Builder::default();
                            let _ = response;
                            output = crate::xml_deser::deser_structure_crate_error_origin_access_control_already_exists_xml_err(response.body().as_ref(), output).map_err(crate::error::UpdateOriginAccessControlError::unhandled)?;
                            output.build()
                        };
                        if tmp.message.is_none() {
                            tmp.message = _error_message;
                        }
                        tmp
                    },
                ),
        },
        "PreconditionFailed" => {
            crate::error::UpdateOriginAccessControlError {
                meta: generic,
                kind: crate::error::UpdateOriginAccessControlErrorKind::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::UpdateOriginAccessControlError::unhandled)?;
                        output.build()
                    };
                    if tmp.message.is_none() {
                        tmp.message = _error_message;
                    }
                    tmp
                }),
            }
        }
        _ => crate::error::UpdateOriginAccessControlError::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 24553)
24552
24553
24554
    fn code(&self) -> Option<&str> {
        UpdateOriginAccessControlError::code(self)
    }

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

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

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

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

Returns true if the error kind is UpdateOriginAccessControlErrorKind::NoSuchOriginAccessControl.

Returns true if the error kind is UpdateOriginAccessControlErrorKind::OriginAccessControlAlreadyExists.

Returns true if the error kind is UpdateOriginAccessControlErrorKind::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