AWS SDK

AWS SDK

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_filtered_log_event.rs

@@ -1,0 +68,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_filtered_log_event<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<crate::types::FilteredLogEvent>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   12         -
            #[allow(unused_mut)]
   13         -
            let mut builder = crate::types::builders::FilteredLogEventBuilder::default();
   14         -
            loop {
   15         -
                match tokens.next().transpose()? {
   16         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   17         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   18         -
                        "logStreamName" => {
   19         -
                            builder = builder.set_log_stream_name(
   20         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   21         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   22         -
                                    .transpose()?,
   23         -
                            );
   24         -
                        }
   25         -
                        "timestamp" => {
   26         -
                            builder = builder.set_timestamp(
   27         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   28         -
                                    .map(i64::try_from)
   29         -
                                    .transpose()?,
   30         -
                            );
   31         -
                        }
   32         -
                        "message" => {
   33         -
                            builder = builder.set_message(
   34         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   35         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   36         -
                                    .transpose()?,
   37         -
                            );
   38         -
                        }
   39         -
                        "ingestionTime" => {
   40         -
                            builder = builder.set_ingestion_time(
   41         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   42         -
                                    .map(i64::try_from)
   43         -
                                    .transpose()?,
   44         -
                            );
   45         -
                        }
   46         -
                        "eventId" => {
   47         -
                            builder = builder.set_event_id(
   48         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   49         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   50         -
                                    .transpose()?,
   51         -
                            );
   52         -
                        }
   53         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   54         -
                    },
   55         -
                    other => {
   56         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   57         -
                            "expected object key or end object, found: {other:?}"
   58         -
                        )))
   59         -
                    }
   60         -
                }
   61         -
            }
   62         -
            Ok(Some(builder.build()))
   63         -
        }
   64         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   65         -
            "expected start object or null",
   66         -
        )),
   67         -
    }
   68         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_filtered_log_events.rs

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_filtered_log_events<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::FilteredLogEvent>>, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
where
    7         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    8         -
{
    9         -
    match tokens.next().transpose()? {
   10         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   11         -
        Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => {
   12         -
            let mut items = Vec::new();
   13         -
            loop {
   14         -
                match tokens.peek() {
   15         -
                    Some(Ok(::aws_smithy_json::deserialize::Token::EndArray { .. })) => {
   16         -
                        tokens.next().transpose().unwrap();
   17         -
                        break;
   18         -
                    }
   19         -
                    _ => {
   20         -
                        let value = crate::protocol_serde::shape_filtered_log_event::de_filtered_log_event(tokens, _value)?;
   21         -
                        if let Some(value) = value {
   22         -
                            items.push(value);
   23         -
                        } else {
   24         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   25         -
                                "dense list cannot contain null values",
   26         -
                            ));
   27         -
                        }
   28         -
                    }
   29         -
                }
   30         -
            }
   31         -
            Ok(Some(items))
   32         -
        }
   33         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   34         -
            "expected start array or null",
   35         -
        )),
   36         -
    }
   37         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_data_protection_policy.rs

@@ -1,0 +171,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_data_protection_policy_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::get_data_protection_policy::GetDataProtectionPolicyOutput,
    9         -
    crate::operation::get_data_protection_policy::GetDataProtectionPolicyError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => {
   19         -
            return Err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "InvalidParameterException" => crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::InvalidParameterException({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
   32         -
                output = crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
   34         -
                let output = output.meta(generic);
   35         -
                output.build()
   36         -
            };
   37         -
            if tmp.message.is_none() {
   38         -
                tmp.message = _error_message;
   39         -
            }
   40         -
            tmp
   41         -
        }),
   42         -
        "OperationAbortedException" => crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::OperationAbortedException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::OperationAbortedExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_operation_aborted_exception::de_operation_aborted_exception_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
   49         -
                let output = output.meta(generic);
   50         -
                output.build()
   51         -
            };
   52         -
            if tmp.message.is_none() {
   53         -
                tmp.message = _error_message;
   54         -
            }
   55         -
            tmp
   56         -
        }),
   57         -
        "ResourceNotFoundException" => crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::ResourceNotFoundException({
   58         -
            #[allow(unused_mut)]
   59         -
            let mut tmp = {
   60         -
                #[allow(unused_mut)]
   61         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   62         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   63         -
                    .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
   64         -
                let output = output.meta(generic);
   65         -
                output.build()
   66         -
            };
   67         -
            if tmp.message.is_none() {
   68         -
                tmp.message = _error_message;
   69         -
            }
   70         -
            tmp
   71         -
        }),
   72         -
        "ServiceUnavailableException" => crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::ServiceUnavailableException({
   73         -
            #[allow(unused_mut)]
   74         -
            let mut tmp = {
   75         -
                #[allow(unused_mut)]
   76         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   77         -
                output =
   78         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   79         -
                        .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
   80         -
                let output = output.meta(generic);
   81         -
                output.build()
   82         -
            };
   83         -
            if tmp.message.is_none() {
   84         -
                tmp.message = _error_message;
   85         -
            }
   86         -
            tmp
   87         -
        }),
   88         -
        _ => crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::generic(generic),
   89         -
    })
   90         -
}
   91         -
   92         -
#[allow(clippy::unnecessary_wraps)]
   93         -
pub fn de_get_data_protection_policy_http_response(
   94         -
    _response_status: u16,
   95         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   96         -
    _response_body: &[u8],
   97         -
) -> std::result::Result<
   98         -
    crate::operation::get_data_protection_policy::GetDataProtectionPolicyOutput,
   99         -
    crate::operation::get_data_protection_policy::GetDataProtectionPolicyError,
  100         -
> {
  101         -
    Ok({
  102         -
        #[allow(unused_mut)]
  103         -
        let mut output = crate::operation::get_data_protection_policy::builders::GetDataProtectionPolicyOutputBuilder::default();
  104         -
        output = crate::protocol_serde::shape_get_data_protection_policy::de_get_data_protection_policy(_response_body, output)
  105         -
            .map_err(crate::operation::get_data_protection_policy::GetDataProtectionPolicyError::unhandled)?;
  106         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  107         -
        output.build()
  108         -
    })
  109         -
}
  110         -
  111         -
pub fn ser_get_data_protection_policy_input(
  112         -
    input: &crate::operation::get_data_protection_policy::GetDataProtectionPolicyInput,
  113         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  114         -
    let mut out = String::new();
  115         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  116         -
    crate::protocol_serde::shape_get_data_protection_policy_input::ser_get_data_protection_policy_input_input(&mut object, input)?;
  117         -
    object.finish();
  118         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  119         -
}
  120         -
  121         -
pub(crate) fn de_get_data_protection_policy(
  122         -
    _value: &[u8],
  123         -
    mut builder: crate::operation::get_data_protection_policy::builders::GetDataProtectionPolicyOutputBuilder,
  124         -
) -> ::std::result::Result<
  125         -
    crate::operation::get_data_protection_policy::builders::GetDataProtectionPolicyOutputBuilder,
  126         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  127         -
> {
  128         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  129         -
    let tokens = &mut tokens_owned;
  130         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  131         -
    loop {
  132         -
        match tokens.next().transpose()? {
  133         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  134         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  135         -
                "logGroupIdentifier" => {
  136         -
                    builder = builder.set_log_group_identifier(
  137         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  138         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  139         -
                            .transpose()?,
  140         -
                    );
  141         -
                }
  142         -
                "policyDocument" => {
  143         -
                    builder = builder.set_policy_document(
  144         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  145         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  146         -
                            .transpose()?,
  147         -
                    );
  148         -
                }
  149         -
                "lastUpdatedTime" => {
  150         -
                    builder = builder.set_last_updated_time(
  151         -
                        ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
  152         -
                            .map(i64::try_from)
  153         -
                            .transpose()?,
  154         -
                    );
  155         -
                }
  156         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  157         -
            },
  158         -
            other => {
  159         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  160         -
                    "expected object key or end object, found: {other:?}"
  161         -
                )))
  162         -
            }
  163         -
        }
  164         -
    }
  165         -
    if tokens.next().is_some() {
  166         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  167         -
            "found more JSON tokens after completing parsing",
  168         -
        ));
  169         -
    }
  170         -
    Ok(builder)
  171         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_data_protection_policy_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_data_protection_policy_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_data_protection_policy::GetDataProtectionPolicyInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.log_group_identifier {
    7         -
        object.key("logGroupIdentifier").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery.rs

@@ -1,0 +159,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_delivery_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::get_delivery::GetDeliveryOutput, crate::operation::get_delivery::GetDeliveryError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::get_delivery::GetDeliveryError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "ResourceNotFoundException" => crate::operation::get_delivery::GetDeliveryError::ResourceNotFoundException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "ServiceQuotaExceededException" => crate::operation::get_delivery::GetDeliveryError::ServiceQuotaExceededException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   41         -
                    _response_body,
   42         -
                    output,
   43         -
                )
   44         -
                .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   45         -
                let output = output.meta(generic);
   46         -
                output.build()
   47         -
            };
   48         -
            if tmp.message.is_none() {
   49         -
                tmp.message = _error_message;
   50         -
            }
   51         -
            tmp
   52         -
        }),
   53         -
        "ServiceUnavailableException" => crate::operation::get_delivery::GetDeliveryError::ServiceUnavailableException({
   54         -
            #[allow(unused_mut)]
   55         -
            let mut tmp = {
   56         -
                #[allow(unused_mut)]
   57         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   58         -
                output =
   59         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   60         -
                        .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   61         -
                let output = output.meta(generic);
   62         -
                output.build()
   63         -
            };
   64         -
            if tmp.message.is_none() {
   65         -
                tmp.message = _error_message;
   66         -
            }
   67         -
            tmp
   68         -
        }),
   69         -
        "ThrottlingException" => crate::operation::get_delivery::GetDeliveryError::ThrottlingException({
   70         -
            #[allow(unused_mut)]
   71         -
            let mut tmp = {
   72         -
                #[allow(unused_mut)]
   73         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   74         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   75         -
                    .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   76         -
                let output = output.meta(generic);
   77         -
                output.build()
   78         -
            };
   79         -
            if tmp.message.is_none() {
   80         -
                tmp.message = _error_message;
   81         -
            }
   82         -
            tmp
   83         -
        }),
   84         -
        "ValidationException" => crate::operation::get_delivery::GetDeliveryError::ValidationException({
   85         -
            #[allow(unused_mut)]
   86         -
            let mut tmp = {
   87         -
                #[allow(unused_mut)]
   88         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   89         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   90         -
                    .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
   91         -
                let output = output.meta(generic);
   92         -
                output.build()
   93         -
            };
   94         -
            if tmp.message.is_none() {
   95         -
                tmp.message = _error_message;
   96         -
            }
   97         -
            tmp
   98         -
        }),
   99         -
        _ => crate::operation::get_delivery::GetDeliveryError::generic(generic),
  100         -
    })
  101         -
}
  102         -
  103         -
#[allow(clippy::unnecessary_wraps)]
  104         -
pub fn de_get_delivery_http_response(
  105         -
    _response_status: u16,
  106         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  107         -
    _response_body: &[u8],
  108         -
) -> std::result::Result<crate::operation::get_delivery::GetDeliveryOutput, crate::operation::get_delivery::GetDeliveryError> {
  109         -
    Ok({
  110         -
        #[allow(unused_mut)]
  111         -
        let mut output = crate::operation::get_delivery::builders::GetDeliveryOutputBuilder::default();
  112         -
        output = crate::protocol_serde::shape_get_delivery::de_get_delivery(_response_body, output)
  113         -
            .map_err(crate::operation::get_delivery::GetDeliveryError::unhandled)?;
  114         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  115         -
        output.build()
  116         -
    })
  117         -
}
  118         -
  119         -
pub fn ser_get_delivery_input(
  120         -
    input: &crate::operation::get_delivery::GetDeliveryInput,
  121         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  122         -
    let mut out = String::new();
  123         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  124         -
    crate::protocol_serde::shape_get_delivery_input::ser_get_delivery_input_input(&mut object, input)?;
  125         -
    object.finish();
  126         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  127         -
}
  128         -
  129         -
pub(crate) fn de_get_delivery(
  130         -
    _value: &[u8],
  131         -
    mut builder: crate::operation::get_delivery::builders::GetDeliveryOutputBuilder,
  132         -
) -> ::std::result::Result<crate::operation::get_delivery::builders::GetDeliveryOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
  133         -
{
  134         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  135         -
    let tokens = &mut tokens_owned;
  136         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  137         -
    loop {
  138         -
        match tokens.next().transpose()? {
  139         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  140         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  141         -
                "delivery" => {
  142         -
                    builder = builder.set_delivery(crate::protocol_serde::shape_delivery::de_delivery(tokens, _value)?);
  143         -
                }
  144         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  145         -
            },
  146         -
            other => {
  147         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  148         -
                    "expected object key or end object, found: {other:?}"
  149         -
                )))
  150         -
            }
  151         -
        }
  152         -
    }
  153         -
    if tokens.next().is_some() {
  154         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  155         -
            "found more JSON tokens after completing parsing",
  156         -
        ));
  157         -
    }
  158         -
    Ok(builder)
  159         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_destination.rs

@@ -1,0 +173,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_delivery_destination_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::get_delivery_destination::GetDeliveryDestinationOutput,
    9         -
    crate::operation::get_delivery_destination::GetDeliveryDestinationError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => {
   19         -
            return Err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "ResourceNotFoundException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ResourceNotFoundException({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   32         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   34         -
                let output = output.meta(generic);
   35         -
                output.build()
   36         -
            };
   37         -
            if tmp.message.is_none() {
   38         -
                tmp.message = _error_message;
   39         -
            }
   40         -
            tmp
   41         -
        }),
   42         -
        "ServiceQuotaExceededException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ServiceQuotaExceededException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   48         -
                    _response_body,
   49         -
                    output,
   50         -
                )
   51         -
                .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   52         -
                let output = output.meta(generic);
   53         -
                output.build()
   54         -
            };
   55         -
            if tmp.message.is_none() {
   56         -
                tmp.message = _error_message;
   57         -
            }
   58         -
            tmp
   59         -
        }),
   60         -
        "ServiceUnavailableException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ServiceUnavailableException({
   61         -
            #[allow(unused_mut)]
   62         -
            let mut tmp = {
   63         -
                #[allow(unused_mut)]
   64         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   65         -
                output =
   66         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   67         -
                        .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   68         -
                let output = output.meta(generic);
   69         -
                output.build()
   70         -
            };
   71         -
            if tmp.message.is_none() {
   72         -
                tmp.message = _error_message;
   73         -
            }
   74         -
            tmp
   75         -
        }),
   76         -
        "ThrottlingException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ThrottlingException({
   77         -
            #[allow(unused_mut)]
   78         -
            let mut tmp = {
   79         -
                #[allow(unused_mut)]
   80         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   81         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   82         -
                    .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   83         -
                let output = output.meta(generic);
   84         -
                output.build()
   85         -
            };
   86         -
            if tmp.message.is_none() {
   87         -
                tmp.message = _error_message;
   88         -
            }
   89         -
            tmp
   90         -
        }),
   91         -
        "ValidationException" => crate::operation::get_delivery_destination::GetDeliveryDestinationError::ValidationException({
   92         -
            #[allow(unused_mut)]
   93         -
            let mut tmp = {
   94         -
                #[allow(unused_mut)]
   95         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   96         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   97         -
                    .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
   98         -
                let output = output.meta(generic);
   99         -
                output.build()
  100         -
            };
  101         -
            if tmp.message.is_none() {
  102         -
                tmp.message = _error_message;
  103         -
            }
  104         -
            tmp
  105         -
        }),
  106         -
        _ => crate::operation::get_delivery_destination::GetDeliveryDestinationError::generic(generic),
  107         -
    })
  108         -
}
  109         -
  110         -
#[allow(clippy::unnecessary_wraps)]
  111         -
pub fn de_get_delivery_destination_http_response(
  112         -
    _response_status: u16,
  113         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  114         -
    _response_body: &[u8],
  115         -
) -> std::result::Result<
  116         -
    crate::operation::get_delivery_destination::GetDeliveryDestinationOutput,
  117         -
    crate::operation::get_delivery_destination::GetDeliveryDestinationError,
  118         -
> {
  119         -
    Ok({
  120         -
        #[allow(unused_mut)]
  121         -
        let mut output = crate::operation::get_delivery_destination::builders::GetDeliveryDestinationOutputBuilder::default();
  122         -
        output = crate::protocol_serde::shape_get_delivery_destination::de_get_delivery_destination(_response_body, output)
  123         -
            .map_err(crate::operation::get_delivery_destination::GetDeliveryDestinationError::unhandled)?;
  124         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  125         -
        output.build()
  126         -
    })
  127         -
}
  128         -
  129         -
pub fn ser_get_delivery_destination_input(
  130         -
    input: &crate::operation::get_delivery_destination::GetDeliveryDestinationInput,
  131         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  132         -
    let mut out = String::new();
  133         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  134         -
    crate::protocol_serde::shape_get_delivery_destination_input::ser_get_delivery_destination_input_input(&mut object, input)?;
  135         -
    object.finish();
  136         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  137         -
}
  138         -
  139         -
pub(crate) fn de_get_delivery_destination(
  140         -
    _value: &[u8],
  141         -
    mut builder: crate::operation::get_delivery_destination::builders::GetDeliveryDestinationOutputBuilder,
  142         -
) -> ::std::result::Result<
  143         -
    crate::operation::get_delivery_destination::builders::GetDeliveryDestinationOutputBuilder,
  144         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  145         -
> {
  146         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  147         -
    let tokens = &mut tokens_owned;
  148         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  149         -
    loop {
  150         -
        match tokens.next().transpose()? {
  151         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  152         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  153         -
                "deliveryDestination" => {
  154         -
                    builder = builder.set_delivery_destination(crate::protocol_serde::shape_delivery_destination::de_delivery_destination(
  155         -
                        tokens, _value,
  156         -
                    )?);
  157         -
                }
  158         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  159         -
            },
  160         -
            other => {
  161         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  162         -
                    "expected object key or end object, found: {other:?}"
  163         -
                )))
  164         -
            }
  165         -
        }
  166         -
    }
  167         -
    if tokens.next().is_some() {
  168         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  169         -
            "found more JSON tokens after completing parsing",
  170         -
        ));
  171         -
    }
  172         -
    Ok(builder)
  173         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_destination_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_delivery_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_delivery_destination::GetDeliveryDestinationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.name {
    7         -
        object.key("name").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_destination_policy.rs

@@ -1,0 +139,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_delivery_destination_policy_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyOutput,
    9         -
    crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => return Err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "ResourceNotFoundException" => {
   24         -
            crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::ResourceNotFoundException({
   25         -
                #[allow(unused_mut)]
   26         -
                let mut tmp = {
   27         -
                    #[allow(unused_mut)]
   28         -
                    let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   29         -
                    output =
   30         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   31         -
                            .map_err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled)?;
   32         -
                    let output = output.meta(generic);
   33         -
                    output.build()
   34         -
                };
   35         -
                if tmp.message.is_none() {
   36         -
                    tmp.message = _error_message;
   37         -
                }
   38         -
                tmp
   39         -
            })
   40         -
        }
   41         -
        "ServiceUnavailableException" => {
   42         -
            crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::ServiceUnavailableException({
   43         -
                #[allow(unused_mut)]
   44         -
                let mut tmp = {
   45         -
                    #[allow(unused_mut)]
   46         -
                    let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   47         -
                    output =
   48         -
                        crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   49         -
                            .map_err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled)?;
   50         -
                    let output = output.meta(generic);
   51         -
                    output.build()
   52         -
                };
   53         -
                if tmp.message.is_none() {
   54         -
                    tmp.message = _error_message;
   55         -
                }
   56         -
                tmp
   57         -
            })
   58         -
        }
   59         -
        "ValidationException" => crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::ValidationException({
   60         -
            #[allow(unused_mut)]
   61         -
            let mut tmp = {
   62         -
                #[allow(unused_mut)]
   63         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   64         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   65         -
                    .map_err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled)?;
   66         -
                let output = output.meta(generic);
   67         -
                output.build()
   68         -
            };
   69         -
            if tmp.message.is_none() {
   70         -
                tmp.message = _error_message;
   71         -
            }
   72         -
            tmp
   73         -
        }),
   74         -
        _ => crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::generic(generic),
   75         -
    })
   76         -
}
   77         -
   78         -
#[allow(clippy::unnecessary_wraps)]
   79         -
pub fn de_get_delivery_destination_policy_http_response(
   80         -
    _response_status: u16,
   81         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   82         -
    _response_body: &[u8],
   83         -
) -> std::result::Result<
   84         -
    crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyOutput,
   85         -
    crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError,
   86         -
> {
   87         -
    Ok({
   88         -
        #[allow(unused_mut)]
   89         -
        let mut output = crate::operation::get_delivery_destination_policy::builders::GetDeliveryDestinationPolicyOutputBuilder::default();
   90         -
        output = crate::protocol_serde::shape_get_delivery_destination_policy::de_get_delivery_destination_policy(_response_body, output)
   91         -
            .map_err(crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyError::unhandled)?;
   92         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   93         -
        output.build()
   94         -
    })
   95         -
}
   96         -
   97         -
pub fn ser_get_delivery_destination_policy_input(
   98         -
    input: &crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyInput,
   99         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  100         -
    let mut out = String::new();
  101         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  102         -
    crate::protocol_serde::shape_get_delivery_destination_policy_input::ser_get_delivery_destination_policy_input_input(&mut object, input)?;
  103         -
    object.finish();
  104         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  105         -
}
  106         -
  107         -
pub(crate) fn de_get_delivery_destination_policy(
  108         -
    _value: &[u8],
  109         -
    mut builder: crate::operation::get_delivery_destination_policy::builders::GetDeliveryDestinationPolicyOutputBuilder,
  110         -
) -> ::std::result::Result<
  111         -
    crate::operation::get_delivery_destination_policy::builders::GetDeliveryDestinationPolicyOutputBuilder,
  112         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  113         -
> {
  114         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  115         -
    let tokens = &mut tokens_owned;
  116         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  117         -
    loop {
  118         -
        match tokens.next().transpose()? {
  119         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  120         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  121         -
                "policy" => {
  122         -
                    builder = builder.set_policy(crate::protocol_serde::shape_policy::de_policy(tokens, _value)?);
  123         -
                }
  124         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  125         -
            },
  126         -
            other => {
  127         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  128         -
                    "expected object key or end object, found: {other:?}"
  129         -
                )))
  130         -
            }
  131         -
        }
  132         -
    }
  133         -
    if tokens.next().is_some() {
  134         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  135         -
            "found more JSON tokens after completing parsing",
  136         -
        ));
  137         -
    }
  138         -
    Ok(builder)
  139         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_destination_policy_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_delivery_destination_policy_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_delivery_destination_policy::GetDeliveryDestinationPolicyInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.delivery_destination_name {
    7         -
        object.key("deliveryDestinationName").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_delivery_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_delivery::GetDeliveryInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.id {
    7         -
        object.key("id").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_source.rs

@@ -1,0 +163,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_delivery_source_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::get_delivery_source::GetDeliverySourceOutput, crate::operation::get_delivery_source::GetDeliverySourceError>
    8         -
{
    9         -
    #[allow(unused_mut)]
   10         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   11         -
        .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   12         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   13         -
    let generic = generic_builder.build();
   14         -
    let error_code = match generic.code() {
   15         -
        Some(code) => code,
   16         -
        None => return Err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled(generic)),
   17         -
    };
   18         -
   19         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   20         -
    Err(match error_code {
   21         -
        "ResourceNotFoundException" => crate::operation::get_delivery_source::GetDeliverySourceError::ResourceNotFoundException({
   22         -
            #[allow(unused_mut)]
   23         -
            let mut tmp = {
   24         -
                #[allow(unused_mut)]
   25         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   26         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   27         -
                    .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   28         -
                let output = output.meta(generic);
   29         -
                output.build()
   30         -
            };
   31         -
            if tmp.message.is_none() {
   32         -
                tmp.message = _error_message;
   33         -
            }
   34         -
            tmp
   35         -
        }),
   36         -
        "ServiceQuotaExceededException" => crate::operation::get_delivery_source::GetDeliverySourceError::ServiceQuotaExceededException({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   41         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   42         -
                    _response_body,
   43         -
                    output,
   44         -
                )
   45         -
                .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   46         -
                let output = output.meta(generic);
   47         -
                output.build()
   48         -
            };
   49         -
            if tmp.message.is_none() {
   50         -
                tmp.message = _error_message;
   51         -
            }
   52         -
            tmp
   53         -
        }),
   54         -
        "ServiceUnavailableException" => crate::operation::get_delivery_source::GetDeliverySourceError::ServiceUnavailableException({
   55         -
            #[allow(unused_mut)]
   56         -
            let mut tmp = {
   57         -
                #[allow(unused_mut)]
   58         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   59         -
                output =
   60         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   61         -
                        .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   62         -
                let output = output.meta(generic);
   63         -
                output.build()
   64         -
            };
   65         -
            if tmp.message.is_none() {
   66         -
                tmp.message = _error_message;
   67         -
            }
   68         -
            tmp
   69         -
        }),
   70         -
        "ThrottlingException" => crate::operation::get_delivery_source::GetDeliverySourceError::ThrottlingException({
   71         -
            #[allow(unused_mut)]
   72         -
            let mut tmp = {
   73         -
                #[allow(unused_mut)]
   74         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   75         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   76         -
                    .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   77         -
                let output = output.meta(generic);
   78         -
                output.build()
   79         -
            };
   80         -
            if tmp.message.is_none() {
   81         -
                tmp.message = _error_message;
   82         -
            }
   83         -
            tmp
   84         -
        }),
   85         -
        "ValidationException" => crate::operation::get_delivery_source::GetDeliverySourceError::ValidationException({
   86         -
            #[allow(unused_mut)]
   87         -
            let mut tmp = {
   88         -
                #[allow(unused_mut)]
   89         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   90         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   91         -
                    .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
   92         -
                let output = output.meta(generic);
   93         -
                output.build()
   94         -
            };
   95         -
            if tmp.message.is_none() {
   96         -
                tmp.message = _error_message;
   97         -
            }
   98         -
            tmp
   99         -
        }),
  100         -
        _ => crate::operation::get_delivery_source::GetDeliverySourceError::generic(generic),
  101         -
    })
  102         -
}
  103         -
  104         -
#[allow(clippy::unnecessary_wraps)]
  105         -
pub fn de_get_delivery_source_http_response(
  106         -
    _response_status: u16,
  107         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  108         -
    _response_body: &[u8],
  109         -
) -> std::result::Result<crate::operation::get_delivery_source::GetDeliverySourceOutput, crate::operation::get_delivery_source::GetDeliverySourceError>
  110         -
{
  111         -
    Ok({
  112         -
        #[allow(unused_mut)]
  113         -
        let mut output = crate::operation::get_delivery_source::builders::GetDeliverySourceOutputBuilder::default();
  114         -
        output = crate::protocol_serde::shape_get_delivery_source::de_get_delivery_source(_response_body, output)
  115         -
            .map_err(crate::operation::get_delivery_source::GetDeliverySourceError::unhandled)?;
  116         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  117         -
        output.build()
  118         -
    })
  119         -
}
  120         -
  121         -
pub fn ser_get_delivery_source_input(
  122         -
    input: &crate::operation::get_delivery_source::GetDeliverySourceInput,
  123         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  124         -
    let mut out = String::new();
  125         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  126         -
    crate::protocol_serde::shape_get_delivery_source_input::ser_get_delivery_source_input_input(&mut object, input)?;
  127         -
    object.finish();
  128         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  129         -
}
  130         -
  131         -
pub(crate) fn de_get_delivery_source(
  132         -
    _value: &[u8],
  133         -
    mut builder: crate::operation::get_delivery_source::builders::GetDeliverySourceOutputBuilder,
  134         -
) -> ::std::result::Result<
  135         -
    crate::operation::get_delivery_source::builders::GetDeliverySourceOutputBuilder,
  136         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  137         -
> {
  138         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  139         -
    let tokens = &mut tokens_owned;
  140         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  141         -
    loop {
  142         -
        match tokens.next().transpose()? {
  143         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  144         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  145         -
                "deliverySource" => {
  146         -
                    builder = builder.set_delivery_source(crate::protocol_serde::shape_delivery_source::de_delivery_source(tokens, _value)?);
  147         -
                }
  148         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  149         -
            },
  150         -
            other => {
  151         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  152         -
                    "expected object key or end object, found: {other:?}"
  153         -
                )))
  154         -
            }
  155         -
        }
  156         -
    }
  157         -
    if tokens.next().is_some() {
  158         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  159         -
            "found more JSON tokens after completing parsing",
  160         -
        ));
  161         -
    }
  162         -
    Ok(builder)
  163         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_delivery_source_input.rs

@@ -1,0 +10,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_get_delivery_source_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::get_delivery_source::GetDeliverySourceInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.name {
    7         -
        object.key("name").string(var_1.as_str());
    8         -
    }
    9         -
    Ok(())
   10         -
}

tmp-codegen-diff/aws-sdk/sdk/cloudwatchlogs/src/protocol_serde/shape_get_integration.rs

@@ -1,0 +150,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_integration_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::get_integration::GetIntegrationOutput, crate::operation::get_integration::GetIntegrationError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::get_integration::GetIntegrationError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::get_integration::GetIntegrationError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::get_integration::GetIntegrationError::InvalidParameterException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::get_integration::GetIntegrationError::unhandled)?;
   27         -
                let output = output.meta(generic);
   28         -
                output.build()
   29         -
            };
   30         -
            if tmp.message.is_none() {
   31         -
                tmp.message = _error_message;
   32         -
            }
   33         -
            tmp
   34         -
        }),
   35         -
        "ResourceNotFoundException" => crate::operation::get_integration::GetIntegrationError::ResourceNotFoundException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::get_integration::GetIntegrationError::unhandled)?;
   42         -
                let output = output.meta(generic);
   43         -
                output.build()
   44         -
            };
   45         -
            if tmp.message.is_none() {
   46         -
                tmp.message = _error_message;
   47         -
            }
   48         -
            tmp
   49         -
        }),
   50         -
        "ServiceUnavailableException" => crate::operation::get_integration::GetIntegrationError::ServiceUnavailableException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   55         -
                output =
   56         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   57         -
                        .map_err(crate::operation::get_integration::GetIntegrationError::unhandled)?;
   58         -
                let output = output.meta(generic);
   59         -
                output.build()
   60         -
            };
   61         -
            if tmp.message.is_none() {
   62         -
                tmp.message = _error_message;
   63         -
            }
   64         -
            tmp
   65         -
        }),
   66         -
        _ => crate::operation::get_integration::GetIntegrationError::generic(generic),
   67         -
    })
   68         -
}
   69         -
   70         -
#[allow(clippy::unnecessary_wraps)]
   71         -
pub fn de_get_integration_http_response(
   72         -
    _response_status: u16,
   73         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   74         -
    _response_body: &[u8],
   75         -
) -> std::result::Result<crate::operation::get_integration::GetIntegrationOutput, crate::operation::get_integration::GetIntegrationError> {
   76         -
    Ok({
   77         -
        #[allow(unused_mut)]
   78         -
        let mut output = crate::operation::get_integration::builders::GetIntegrationOutputBuilder::default();
   79         -
        output = crate::protocol_serde::shape_get_integration::de_get_integration(_response_body, output)
   80         -
            .map_err(crate::operation::get_integration::GetIntegrationError::unhandled)?;
   81         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   82         -
        output.build()
   83         -
    })
   84         -
}
   85         -
   86         -
pub fn ser_get_integration_input(
   87         -
    input: &crate::operation::get_integration::GetIntegrationInput,
   88         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   89         -
    let mut out = String::new();
   90         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   91         -
    crate::protocol_serde::shape_get_integration_input::ser_get_integration_input_input(&mut object, input)?;
   92         -
    object.finish();
   93         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   94         -
}
   95         -
   96         -
pub(crate) fn de_get_integration(
   97         -
    _value: &[u8],
   98         -
    mut builder: crate::operation::get_integration::builders::GetIntegrationOutputBuilder,
   99         -
) -> ::std::result::Result<
  100         -
    crate::operation::get_integration::builders::GetIntegrationOutputBuilder,
  101         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  102         -
> {
  103         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  104         -
    let tokens = &mut tokens_owned;
  105         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  106         -
    loop {
  107         -
        match tokens.next().transpose()? {
  108         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  109         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  110         -
                "integrationName" => {
  111         -
                    builder = builder.set_integration_name(
  112         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  113         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  114         -
                            .transpose()?,
  115         -
                    );
  116         -
                }
  117         -
                "integrationType" => {
  118         -
                    builder = builder.set_integration_type(
  119         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  120         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::IntegrationType::from(u.as_ref())))
  121         -
                            .transpose()?,
  122         -
                    );
  123         -
                }
  124         -
                "integrationStatus" => {
  125         -
                    builder = builder.set_integration_status(
  126         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  127         -
                            .map(|s| s.to_unescaped().map(|u| crate::types::IntegrationStatus::from(u.as_ref())))
  128         -
                            .transpose()?,
  129         -
                    );
  130         -
                }
  131         -
                "integrationDetails" => {
  132         -
                    builder =
  133         -
                        builder.set_integration_details(crate::protocol_serde::shape_integration_details::de_integration_details(tokens, _value)?);
  134         -
                }
  135         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  136         -
            },
  137         -
            other => {
  138         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  139         -
                    "expected object key or end object, found: {other:?}"
  140         -
                )))
  141         -
            }
  142         -
        }
  143         -
    }
  144         -
    if tokens.next().is_some() {
  145         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  146         -
            "found more JSON tokens after completing parsing",
  147         -
        ));
  148         -
    }
  149         -
    Ok(builder)
  150         -
}