AWS SDK

AWS SDK

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

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

@@ -1,0 +59,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_type_converter(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::TypeConverter,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        let mut array_1 = object.key("entries").start_array();
    8         -
        for item_2 in &input.entries {
    9         -
            {
   10         -
                #[allow(unused_mut)]
   11         -
                let mut object_3 = array_1.value().start_object();
   12         -
                crate::protocol_serde::shape_type_converter_entry::ser_type_converter_entry(&mut object_3, item_2)?;
   13         -
                object_3.finish();
   14         -
            }
   15         -
        }
   16         -
        array_1.finish();
   17         -
    }
   18         -
    Ok(())
   19         -
}
   20         -
   21         -
pub(crate) fn de_type_converter<'a, I>(
   22         -
    tokens: &mut ::std::iter::Peekable<I>,
   23         -
    _value: &'a [u8],
   24         -
) -> ::std::result::Result<Option<crate::types::TypeConverter>, ::aws_smithy_json::deserialize::error::DeserializeError>
   25         -
where
   26         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   27         -
{
   28         -
    match tokens.next().transpose()? {
   29         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   30         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   31         -
            #[allow(unused_mut)]
   32         -
            let mut builder = crate::types::builders::TypeConverterBuilder::default();
   33         -
            loop {
   34         -
                match tokens.next().transpose()? {
   35         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   36         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   37         -
                        "entries" => {
   38         -
                            builder = builder.set_entries(crate::protocol_serde::shape_type_converter_entries::de_type_converter_entries(
   39         -
                                tokens, _value,
   40         -
                            )?);
   41         -
                        }
   42         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   43         -
                    },
   44         -
                    other => {
   45         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   46         -
                            "expected object key or end object, found: {other:?}"
   47         -
                        )))
   48         -
                    }
   49         -
                }
   50         -
            }
   51         -
            Ok(Some(crate::serde_util::type_converter_correct_errors(builder).build().map_err(
   52         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   53         -
            )?))
   54         -
        }
   55         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   56         -
            "expected start object or null",
   57         -
        )),
   58         -
    }
   59         -
}

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

@@ -1,0 +37,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_type_converter_entries<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<crate::types::TypeConverterEntry>>, ::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_type_converter_entry::de_type_converter_entry(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_type_converter_entry.rs

@@ -1,0 +62,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_type_converter_entry(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::TypeConverterEntry,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("key").string(input.key.as_str());
    8         -
    }
    9         -
    {
   10         -
        object.key("type").string(input.r#type.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}
   14         -
   15         -
pub(crate) fn de_type_converter_entry<'a, I>(
   16         -
    tokens: &mut ::std::iter::Peekable<I>,
   17         -
    _value: &'a [u8],
   18         -
) -> ::std::result::Result<Option<crate::types::TypeConverterEntry>, ::aws_smithy_json::deserialize::error::DeserializeError>
   19         -
where
   20         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   21         -
{
   22         -
    match tokens.next().transpose()? {
   23         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   24         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   25         -
            #[allow(unused_mut)]
   26         -
            let mut builder = crate::types::builders::TypeConverterEntryBuilder::default();
   27         -
            loop {
   28         -
                match tokens.next().transpose()? {
   29         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   30         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   31         -
                        "key" => {
   32         -
                            builder = builder.set_key(
   33         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   34         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   35         -
                                    .transpose()?,
   36         -
                            );
   37         -
                        }
   38         -
                        "type" => {
   39         -
                            builder = builder.set_type(
   40         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   41         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::Type::from(u.as_ref())))
   42         -
                                    .transpose()?,
   43         -
                            );
   44         -
                        }
   45         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   46         -
                    },
   47         -
                    other => {
   48         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   49         -
                            "expected object key or end object, found: {other:?}"
   50         -
                        )))
   51         -
                    }
   52         -
                }
   53         -
            }
   54         -
            Ok(Some(crate::serde_util::type_converter_entry_correct_errors(builder).build().map_err(
   55         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   56         -
            )?))
   57         -
        }
   58         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   59         -
            "expected start object or null",
   60         -
        )),
   61         -
    }
   62         -
}

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

@@ -1,0 +36,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_unrecognized_client_exception_json_err(
    3         -
    _value: &[u8],
    4         -
    mut builder: crate::types::error::builders::UnrecognizedClientExceptionBuilder,
    5         -
) -> ::std::result::Result<crate::types::error::builders::UnrecognizedClientExceptionBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
    6         -
{
    7         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
    8         -
    let tokens = &mut tokens_owned;
    9         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   10         -
    loop {
   11         -
        match tokens.next().transpose()? {
   12         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   13         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   14         -
                "message" => {
   15         -
                    builder = builder.set_message(
   16         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   17         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   18         -
                            .transpose()?,
   19         -
                    );
   20         -
                }
   21         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   22         -
            },
   23         -
            other => {
   24         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   25         -
                    "expected object key or end object, found: {other:?}"
   26         -
                )))
   27         -
            }
   28         -
        }
   29         -
    }
   30         -
    if tokens.next().is_some() {
   31         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   32         -
            "found more JSON tokens after completing parsing",
   33         -
        ));
   34         -
    }
   35         -
    Ok(builder)
   36         -
}

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

@@ -1,0 +61,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_untag_log_group_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::untag_log_group::UntagLogGroupOutput, crate::operation::untag_log_group::UntagLogGroupError> {
    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::untag_log_group::UntagLogGroupError::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::untag_log_group::UntagLogGroupError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "ResourceNotFoundException" => crate::operation::untag_log_group::UntagLogGroupError::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::untag_log_group::UntagLogGroupError::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         -
        _ => crate::operation::untag_log_group::UntagLogGroupError::generic(generic),
   36         -
    })
   37         -
}
   38         -
   39         -
#[allow(clippy::unnecessary_wraps)]
   40         -
pub fn de_untag_log_group_http_response(
   41         -
    _response_status: u16,
   42         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   43         -
    _response_body: &[u8],
   44         -
) -> std::result::Result<crate::operation::untag_log_group::UntagLogGroupOutput, crate::operation::untag_log_group::UntagLogGroupError> {
   45         -
    Ok({
   46         -
        #[allow(unused_mut)]
   47         -
        let mut output = crate::operation::untag_log_group::builders::UntagLogGroupOutputBuilder::default();
   48         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   49         -
        output.build()
   50         -
    })
   51         -
}
   52         -
   53         -
pub fn ser_untag_log_group_input(
   54         -
    input: &crate::operation::untag_log_group::UntagLogGroupInput,
   55         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   56         -
    let mut out = String::new();
   57         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   58         -
    crate::protocol_serde::shape_untag_log_group_input::ser_untag_log_group_input_input(&mut object, input)?;
   59         -
    object.finish();
   60         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   61         -
}

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

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_untag_log_group_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::untag_log_group::UntagLogGroupInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.log_group_name {
    7         -
        object.key("logGroupName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.tags {
   10         -
        let mut array_3 = object.key("tags").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                array_3.value().string(item_4.as_str());
   14         -
            }
   15         -
        }
   16         -
        array_3.finish();
   17         -
    }
   18         -
    Ok(())
   19         -
}

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

@@ -1,0 +92,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_untag_resource_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::untag_resource::UntagResourceOutput, crate::operation::untag_resource::UntagResourceError> {
    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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::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::untag_resource::UntagResourceError::generic(generic),
   67         -
    })
   68         -
}
   69         -
   70         -
#[allow(clippy::unnecessary_wraps)]
   71         -
pub fn de_untag_resource_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::untag_resource::UntagResourceOutput, crate::operation::untag_resource::UntagResourceError> {
   76         -
    Ok({
   77         -
        #[allow(unused_mut)]
   78         -
        let mut output = crate::operation::untag_resource::builders::UntagResourceOutputBuilder::default();
   79         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   80         -
        output.build()
   81         -
    })
   82         -
}
   83         -
   84         -
pub fn ser_untag_resource_input(
   85         -
    input: &crate::operation::untag_resource::UntagResourceInput,
   86         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   87         -
    let mut out = String::new();
   88         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   89         -
    crate::protocol_serde::shape_untag_resource_input::ser_untag_resource_input_input(&mut object, input)?;
   90         -
    object.finish();
   91         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   92         -
}

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

@@ -1,0 +19,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_untag_resource_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::untag_resource::UntagResourceInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.resource_arn {
    7         -
        object.key("resourceArn").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.tag_keys {
   10         -
        let mut array_3 = object.key("tagKeys").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                array_3.value().string(item_4.as_str());
   14         -
            }
   15         -
        }
   16         -
        array_3.finish();
   17         -
    }
   18         -
    Ok(())
   19         -
}

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

@@ -1,0 +107,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_anomaly_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::update_anomaly::UpdateAnomalyOutput, crate::operation::update_anomaly::UpdateAnomalyError> {
    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::update_anomaly::UpdateAnomalyError::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::update_anomaly::UpdateAnomalyError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::update_anomaly::UpdateAnomalyError::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::update_anomaly::UpdateAnomalyError::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         -
        "OperationAbortedException" => crate::operation::update_anomaly::UpdateAnomalyError::OperationAbortedException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::OperationAbortedExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_operation_aborted_exception::de_operation_aborted_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::update_anomaly::UpdateAnomalyError::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         -
        "ResourceNotFoundException" => crate::operation::update_anomaly::UpdateAnomalyError::ResourceNotFoundException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::update_anomaly::UpdateAnomalyError::unhandled)?;
   57         -
                let output = output.meta(generic);
   58         -
                output.build()
   59         -
            };
   60         -
            if tmp.message.is_none() {
   61         -
                tmp.message = _error_message;
   62         -
            }
   63         -
            tmp
   64         -
        }),
   65         -
        "ServiceUnavailableException" => crate::operation::update_anomaly::UpdateAnomalyError::ServiceUnavailableException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   70         -
                output =
   71         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   72         -
                        .map_err(crate::operation::update_anomaly::UpdateAnomalyError::unhandled)?;
   73         -
                let output = output.meta(generic);
   74         -
                output.build()
   75         -
            };
   76         -
            if tmp.message.is_none() {
   77         -
                tmp.message = _error_message;
   78         -
            }
   79         -
            tmp
   80         -
        }),
   81         -
        _ => crate::operation::update_anomaly::UpdateAnomalyError::generic(generic),
   82         -
    })
   83         -
}
   84         -
   85         -
#[allow(clippy::unnecessary_wraps)]
   86         -
pub fn de_update_anomaly_http_response(
   87         -
    _response_status: u16,
   88         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   89         -
    _response_body: &[u8],
   90         -
) -> std::result::Result<crate::operation::update_anomaly::UpdateAnomalyOutput, crate::operation::update_anomaly::UpdateAnomalyError> {
   91         -
    Ok({
   92         -
        #[allow(unused_mut)]
   93         -
        let mut output = crate::operation::update_anomaly::builders::UpdateAnomalyOutputBuilder::default();
   94         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   95         -
        output.build()
   96         -
    })
   97         -
}
   98         -
   99         -
pub fn ser_update_anomaly_input(
  100         -
    input: &crate::operation::update_anomaly::UpdateAnomalyInput,
  101         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  102         -
    let mut out = String::new();
  103         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  104         -
    crate::protocol_serde::shape_update_anomaly_input::ser_update_anomaly_input_input(&mut object, input)?;
  105         -
    object.finish();
  106         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  107         -
}

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_anomaly_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_anomaly::UpdateAnomalyInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.anomaly_id {
    7         -
        object.key("anomalyId").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.pattern_id {
   10         -
        object.key("patternId").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.anomaly_detector_arn {
   13         -
        object.key("anomalyDetectorArn").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.suppression_type {
   16         -
        object.key("suppressionType").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.suppression_period {
   19         -
        #[allow(unused_mut)]
   20         -
        let mut object_6 = object.key("suppressionPeriod").start_object();
   21         -
        crate::protocol_serde::shape_suppression_period::ser_suppression_period(&mut object_6, var_5)?;
   22         -
        object_6.finish();
   23         -
    }
   24         -
    if let Some(var_7) = &input.baseline {
   25         -
        object.key("baseline").boolean(*var_7);
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +148,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_delivery_configuration_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::update_delivery_configuration::UpdateDeliveryConfigurationOutput,
    9         -
    crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError,
   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::update_delivery_configuration::UpdateDeliveryConfigurationError::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::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "AccessDeniedException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::AccessDeniedException({
   24         -
            #[allow(unused_mut)]
   25         -
            let mut tmp = {
   26         -
                #[allow(unused_mut)]
   27         -
                let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
   28         -
                output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
   29         -
                    .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
   30         -
                let output = output.meta(generic);
   31         -
                output.build()
   32         -
            };
   33         -
            if tmp.message.is_none() {
   34         -
                tmp.message = _error_message;
   35         -
            }
   36         -
            tmp
   37         -
        }),
   38         -
        "ConflictException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ConflictException({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
   43         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::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         -
        "ResourceNotFoundException" => {
   54         -
            crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ResourceNotFoundException({
   55         -
                #[allow(unused_mut)]
   56         -
                let mut tmp = {
   57         -
                    #[allow(unused_mut)]
   58         -
                    let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   59         -
                    output =
   60         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   61         -
                            .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::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         -
        }
   71         -
        "ServiceUnavailableException" => {
   72         -
            crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::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::update_delivery_configuration::UpdateDeliveryConfigurationError::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         -
        }
   89         -
        "ThrottlingException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ThrottlingException({
   90         -
            #[allow(unused_mut)]
   91         -
            let mut tmp = {
   92         -
                #[allow(unused_mut)]
   93         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   94         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   95         -
                    .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
   96         -
                let output = output.meta(generic);
   97         -
                output.build()
   98         -
            };
   99         -
            if tmp.message.is_none() {
  100         -
                tmp.message = _error_message;
  101         -
            }
  102         -
            tmp
  103         -
        }),
  104         -
        "ValidationException" => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::ValidationException({
  105         -
            #[allow(unused_mut)]
  106         -
            let mut tmp = {
  107         -
                #[allow(unused_mut)]
  108         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
  109         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  110         -
                    .map_err(crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::unhandled)?;
  111         -
                let output = output.meta(generic);
  112         -
                output.build()
  113         -
            };
  114         -
            if tmp.message.is_none() {
  115         -
                tmp.message = _error_message;
  116         -
            }
  117         -
            tmp
  118         -
        }),
  119         -
        _ => crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError::generic(generic),
  120         -
    })
  121         -
}
  122         -
  123         -
#[allow(clippy::unnecessary_wraps)]
  124         -
pub fn de_update_delivery_configuration_http_response(
  125         -
    _response_status: u16,
  126         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  127         -
    _response_body: &[u8],
  128         -
) -> std::result::Result<
  129         -
    crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationOutput,
  130         -
    crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationError,
  131         -
> {
  132         -
    Ok({
  133         -
        #[allow(unused_mut)]
  134         -
        let mut output = crate::operation::update_delivery_configuration::builders::UpdateDeliveryConfigurationOutputBuilder::default();
  135         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  136         -
        output.build()
  137         -
    })
  138         -
}
  139         -
  140         -
pub fn ser_update_delivery_configuration_input(
  141         -
    input: &crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationInput,
  142         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  143         -
    let mut out = String::new();
  144         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  145         -
    crate::protocol_serde::shape_update_delivery_configuration_input::ser_update_delivery_configuration_input_input(&mut object, input)?;
  146         -
    object.finish();
  147         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  148         -
}

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_delivery_configuration_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_delivery_configuration::UpdateDeliveryConfigurationInput,
    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         -
    if let Some(var_2) = &input.record_fields {
   10         -
        let mut array_3 = object.key("recordFields").start_array();
   11         -
        for item_4 in var_2 {
   12         -
            {
   13         -
                array_3.value().string(item_4.as_str());
   14         -
            }
   15         -
        }
   16         -
        array_3.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.field_delimiter {
   19         -
        object.key("fieldDelimiter").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.s3_delivery_configuration {
   22         -
        #[allow(unused_mut)]
   23         -
        let mut object_7 = object.key("s3DeliveryConfiguration").start_object();
   24         -
        crate::protocol_serde::shape_s3_delivery_configuration::ser_s3_delivery_configuration(&mut object_7, var_6)?;
   25         -
        object_7.finish();
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +117,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_update_log_anomaly_detector_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::update_log_anomaly_detector::UpdateLogAnomalyDetectorOutput,
    9         -
    crate::operation::update_log_anomaly_detector::UpdateLogAnomalyDetectorError,
   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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::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::update_log_anomaly_detector::UpdateLogAnomalyDetectorError::generic(generic),
   89         -
    })
   90         -
}
   91         -
   92         -
#[allow(clippy::unnecessary_wraps)]
   93         -
pub fn de_update_log_anomaly_detector_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::update_log_anomaly_detector::UpdateLogAnomalyDetectorOutput,
   99         -
    crate::operation::update_log_anomaly_detector::UpdateLogAnomalyDetectorError,
  100         -
> {
  101         -
    Ok({
  102         -
        #[allow(unused_mut)]
  103         -
        let mut output = crate::operation::update_log_anomaly_detector::builders::UpdateLogAnomalyDetectorOutputBuilder::default();
  104         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  105         -
        output.build()
  106         -
    })
  107         -
}
  108         -
  109         -
pub fn ser_update_log_anomaly_detector_input(
  110         -
    input: &crate::operation::update_log_anomaly_detector::UpdateLogAnomalyDetectorInput,
  111         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  112         -
    let mut out = String::new();
  113         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  114         -
    crate::protocol_serde::shape_update_log_anomaly_detector_input::ser_update_log_anomaly_detector_input_input(&mut object, input)?;
  115         -
    object.finish();
  116         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  117         -
}

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

@@ -1,0 +25,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_update_log_anomaly_detector_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::update_log_anomaly_detector::UpdateLogAnomalyDetectorInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.anomaly_detector_arn {
    7         -
        object.key("anomalyDetectorArn").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.evaluation_frequency {
   10         -
        object.key("evaluationFrequency").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.filter_pattern {
   13         -
        object.key("filterPattern").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.anomaly_visibility_time {
   16         -
        object.key("anomalyVisibilityTime").number(
   17         -
            #[allow(clippy::useless_conversion)]
   18         -
            ::aws_smithy_types::Number::NegInt((*var_4).into()),
   19         -
        );
   20         -
    }
   21         -
    if let Some(var_5) = &input.enabled {
   22         -
        object.key("enabled").boolean(*var_5);
   23         -
    }
   24         -
    Ok(())
   25         -
}

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

@@ -1,0 +56,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_upper_case_string(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::UpperCaseString,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        let mut array_1 = object.key("withKeys").start_array();
    8         -
        for item_2 in &input.with_keys {
    9         -
            {
   10         -
                array_1.value().string(item_2.as_str());
   11         -
            }
   12         -
        }
   13         -
        array_1.finish();
   14         -
    }
   15         -
    Ok(())
   16         -
}
   17         -
   18         -
pub(crate) fn de_upper_case_string<'a, I>(
   19         -
    tokens: &mut ::std::iter::Peekable<I>,
   20         -
    _value: &'a [u8],
   21         -
) -> ::std::result::Result<Option<crate::types::UpperCaseString>, ::aws_smithy_json::deserialize::error::DeserializeError>
   22         -
where
   23         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
   24         -
{
   25         -
    match tokens.next().transpose()? {
   26         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   27         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   28         -
            #[allow(unused_mut)]
   29         -
            let mut builder = crate::types::builders::UpperCaseStringBuilder::default();
   30         -
            loop {
   31         -
                match tokens.next().transpose()? {
   32         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   33         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   34         -
                        "withKeys" => {
   35         -
                            builder = builder.set_with_keys(
   36         -
                                crate::protocol_serde::shape_upper_case_string_with_keys::de_upper_case_string_with_keys(tokens, _value)?,
   37         -
                            );
   38         -
                        }
   39         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   40         -
                    },
   41         -
                    other => {
   42         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   43         -
                            "expected object key or end object, found: {other:?}"
   44         -
                        )))
   45         -
                    }
   46         -
                }
   47         -
            }
   48         -
            Ok(Some(crate::serde_util::upper_case_string_correct_errors(builder).build().map_err(
   49         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   50         -
            )?))
   51         -
        }
   52         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   53         -
            "expected start object or null",
   54         -
        )),
   55         -
    }
   56         -
}

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

@@ -1,0 +39,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_upper_case_string_with_keys<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
    _value: &'a [u8],
    5         -
) -> ::std::result::Result<Option<::std::vec::Vec<::std::string::String>>, ::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 = ::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         -
                        if let Some(value) = value {
   24         -
                            items.push(value);
   25         -
                        } else {
   26         -
                            return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   27         -
                                "dense list cannot contain null values",
   28         -
                            ));
   29         -
                        }
   30         -
                    }
   31         -
                }
   32         -
            }
   33         -
            Ok(Some(items))
   34         -
        }
   35         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   36         -
            "expected start array or null",
   37         -
        )),
   38         -
    }
   39         -
}