AWS SDK

AWS SDK

rev. 163d4d6410694aaf071424777ecbecd050925f36 (ignoring whitespace)

Files changed:

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

@@ -1,0 +188,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_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::put_delivery_destination::PutDeliveryDestinationOutput,
    9         -
    crate::operation::put_delivery_destination::PutDeliveryDestinationError,
   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::put_delivery_destination::PutDeliveryDestinationError::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::put_delivery_destination::PutDeliveryDestinationError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "ConflictException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ConflictException({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
   32         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::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         -
        "ResourceNotFoundException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ResourceNotFoundException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::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         -
        "ServiceQuotaExceededException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ServiceQuotaExceededException({
   58         -
            #[allow(unused_mut)]
   59         -
            let mut tmp = {
   60         -
                #[allow(unused_mut)]
   61         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   62         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   63         -
                    _response_body,
   64         -
                    output,
   65         -
                )
   66         -
                .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::unhandled)?;
   67         -
                let output = output.meta(generic);
   68         -
                output.build()
   69         -
            };
   70         -
            if tmp.message.is_none() {
   71         -
                tmp.message = _error_message;
   72         -
            }
   73         -
            tmp
   74         -
        }),
   75         -
        "ServiceUnavailableException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ServiceUnavailableException({
   76         -
            #[allow(unused_mut)]
   77         -
            let mut tmp = {
   78         -
                #[allow(unused_mut)]
   79         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   80         -
                output =
   81         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   82         -
                        .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::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         -
        "ThrottlingException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ThrottlingException({
   92         -
            #[allow(unused_mut)]
   93         -
            let mut tmp = {
   94         -
                #[allow(unused_mut)]
   95         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   96         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   97         -
                    .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::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         -
        "ValidationException" => crate::operation::put_delivery_destination::PutDeliveryDestinationError::ValidationException({
  107         -
            #[allow(unused_mut)]
  108         -
            let mut tmp = {
  109         -
                #[allow(unused_mut)]
  110         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
  111         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  112         -
                    .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::unhandled)?;
  113         -
                let output = output.meta(generic);
  114         -
                output.build()
  115         -
            };
  116         -
            if tmp.message.is_none() {
  117         -
                tmp.message = _error_message;
  118         -
            }
  119         -
            tmp
  120         -
        }),
  121         -
        _ => crate::operation::put_delivery_destination::PutDeliveryDestinationError::generic(generic),
  122         -
    })
  123         -
}
  124         -
  125         -
#[allow(clippy::unnecessary_wraps)]
  126         -
pub fn de_put_delivery_destination_http_response(
  127         -
    _response_status: u16,
  128         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  129         -
    _response_body: &[u8],
  130         -
) -> std::result::Result<
  131         -
    crate::operation::put_delivery_destination::PutDeliveryDestinationOutput,
  132         -
    crate::operation::put_delivery_destination::PutDeliveryDestinationError,
  133         -
> {
  134         -
    Ok({
  135         -
        #[allow(unused_mut)]
  136         -
        let mut output = crate::operation::put_delivery_destination::builders::PutDeliveryDestinationOutputBuilder::default();
  137         -
        output = crate::protocol_serde::shape_put_delivery_destination::de_put_delivery_destination(_response_body, output)
  138         -
            .map_err(crate::operation::put_delivery_destination::PutDeliveryDestinationError::unhandled)?;
  139         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  140         -
        output.build()
  141         -
    })
  142         -
}
  143         -
  144         -
pub fn ser_put_delivery_destination_input(
  145         -
    input: &crate::operation::put_delivery_destination::PutDeliveryDestinationInput,
  146         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  147         -
    let mut out = String::new();
  148         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  149         -
    crate::protocol_serde::shape_put_delivery_destination_input::ser_put_delivery_destination_input_input(&mut object, input)?;
  150         -
    object.finish();
  151         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  152         -
}
  153         -
  154         -
pub(crate) fn de_put_delivery_destination(
  155         -
    _value: &[u8],
  156         -
    mut builder: crate::operation::put_delivery_destination::builders::PutDeliveryDestinationOutputBuilder,
  157         -
) -> ::std::result::Result<
  158         -
    crate::operation::put_delivery_destination::builders::PutDeliveryDestinationOutputBuilder,
  159         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  160         -
> {
  161         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  162         -
    let tokens = &mut tokens_owned;
  163         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  164         -
    loop {
  165         -
        match tokens.next().transpose()? {
  166         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  167         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  168         -
                "deliveryDestination" => {
  169         -
                    builder = builder.set_delivery_destination(crate::protocol_serde::shape_delivery_destination::de_delivery_destination(
  170         -
                        tokens, _value,
  171         -
                    )?);
  172         -
                }
  173         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  174         -
            },
  175         -
            other => {
  176         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  177         -
                    "expected object key or end object, found: {other:?}"
  178         -
                )))
  179         -
            }
  180         -
        }
  181         -
    }
  182         -
    if tokens.next().is_some() {
  183         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  184         -
            "found more JSON tokens after completing parsing",
  185         -
        ));
  186         -
    }
  187         -
    Ok(builder)
  188         -
}

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

@@ -1,0 +32,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_delivery_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_delivery_destination::PutDeliveryDestinationInput,
    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         -
    if let Some(var_2) = &input.output_format {
   10         -
        object.key("outputFormat").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.delivery_destination_configuration {
   13         -
        #[allow(unused_mut)]
   14         -
        let mut object_4 = object.key("deliveryDestinationConfiguration").start_object();
   15         -
        crate::protocol_serde::shape_delivery_destination_configuration::ser_delivery_destination_configuration(&mut object_4, var_3)?;
   16         -
        object_4.finish();
   17         -
    }
   18         -
    if let Some(var_5) = &input.delivery_destination_type {
   19         -
        object.key("deliveryDestinationType").string(var_5.as_str());
   20         -
    }
   21         -
    if let Some(var_6) = &input.tags {
   22         -
        #[allow(unused_mut)]
   23         -
        let mut object_7 = object.key("tags").start_object();
   24         -
        for (key_8, value_9) in var_6 {
   25         -
            {
   26         -
                object_7.key(key_8.as_str()).string(value_9.as_str());
   27         -
            }
   28         -
        }
   29         -
        object_7.finish();
   30         -
    }
   31         -
    Ok(())
   32         -
}

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

@@ -1,0 +154,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_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::put_delivery_destination_policy::PutDeliveryDestinationPolicyOutput,
    9         -
    crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError,
   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::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::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::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "ConflictException" => crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::ConflictException({
   24         -
            #[allow(unused_mut)]
   25         -
            let mut tmp = {
   26         -
                #[allow(unused_mut)]
   27         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
   28         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   29         -
                    .map_err(crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::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         -
        "ResourceNotFoundException" => {
   39         -
            crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::ResourceNotFoundException({
   40         -
                #[allow(unused_mut)]
   41         -
                let mut tmp = {
   42         -
                    #[allow(unused_mut)]
   43         -
                    let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   44         -
                    output =
   45         -
                        crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   46         -
                            .map_err(crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::unhandled)?;
   47         -
                    let output = output.meta(generic);
   48         -
                    output.build()
   49         -
                };
   50         -
                if tmp.message.is_none() {
   51         -
                    tmp.message = _error_message;
   52         -
                }
   53         -
                tmp
   54         -
            })
   55         -
        }
   56         -
        "ServiceUnavailableException" => {
   57         -
            crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::ServiceUnavailableException({
   58         -
                #[allow(unused_mut)]
   59         -
                let mut tmp = {
   60         -
                    #[allow(unused_mut)]
   61         -
                    let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   62         -
                    output =
   63         -
                        crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   64         -
                            .map_err(crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::unhandled)?;
   65         -
                    let output = output.meta(generic);
   66         -
                    output.build()
   67         -
                };
   68         -
                if tmp.message.is_none() {
   69         -
                    tmp.message = _error_message;
   70         -
                }
   71         -
                tmp
   72         -
            })
   73         -
        }
   74         -
        "ValidationException" => crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::ValidationException({
   75         -
            #[allow(unused_mut)]
   76         -
            let mut tmp = {
   77         -
                #[allow(unused_mut)]
   78         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
   79         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
   80         -
                    .map_err(crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::unhandled)?;
   81         -
                let output = output.meta(generic);
   82         -
                output.build()
   83         -
            };
   84         -
            if tmp.message.is_none() {
   85         -
                tmp.message = _error_message;
   86         -
            }
   87         -
            tmp
   88         -
        }),
   89         -
        _ => crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::generic(generic),
   90         -
    })
   91         -
}
   92         -
   93         -
#[allow(clippy::unnecessary_wraps)]
   94         -
pub fn de_put_delivery_destination_policy_http_response(
   95         -
    _response_status: u16,
   96         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   97         -
    _response_body: &[u8],
   98         -
) -> std::result::Result<
   99         -
    crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyOutput,
  100         -
    crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError,
  101         -
> {
  102         -
    Ok({
  103         -
        #[allow(unused_mut)]
  104         -
        let mut output = crate::operation::put_delivery_destination_policy::builders::PutDeliveryDestinationPolicyOutputBuilder::default();
  105         -
        output = crate::protocol_serde::shape_put_delivery_destination_policy::de_put_delivery_destination_policy(_response_body, output)
  106         -
            .map_err(crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyError::unhandled)?;
  107         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  108         -
        output.build()
  109         -
    })
  110         -
}
  111         -
  112         -
pub fn ser_put_delivery_destination_policy_input(
  113         -
    input: &crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyInput,
  114         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  115         -
    let mut out = String::new();
  116         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  117         -
    crate::protocol_serde::shape_put_delivery_destination_policy_input::ser_put_delivery_destination_policy_input_input(&mut object, input)?;
  118         -
    object.finish();
  119         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  120         -
}
  121         -
  122         -
pub(crate) fn de_put_delivery_destination_policy(
  123         -
    _value: &[u8],
  124         -
    mut builder: crate::operation::put_delivery_destination_policy::builders::PutDeliveryDestinationPolicyOutputBuilder,
  125         -
) -> ::std::result::Result<
  126         -
    crate::operation::put_delivery_destination_policy::builders::PutDeliveryDestinationPolicyOutputBuilder,
  127         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  128         -
> {
  129         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  130         -
    let tokens = &mut tokens_owned;
  131         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  132         -
    loop {
  133         -
        match tokens.next().transpose()? {
  134         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  135         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  136         -
                "policy" => {
  137         -
                    builder = builder.set_policy(crate::protocol_serde::shape_policy::de_policy(tokens, _value)?);
  138         -
                }
  139         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  140         -
            },
  141         -
            other => {
  142         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  143         -
                    "expected object key or end object, found: {other:?}"
  144         -
                )))
  145         -
            }
  146         -
        }
  147         -
    }
  148         -
    if tokens.next().is_some() {
  149         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  150         -
            "found more JSON tokens after completing parsing",
  151         -
        ));
  152         -
    }
  153         -
    Ok(builder)
  154         -
}

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

@@ -1,0 +13,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_delivery_destination_policy_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_delivery_destination_policy::PutDeliveryDestinationPolicyInput,
    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         -
    if let Some(var_2) = &input.delivery_destination_policy {
   10         -
        object.key("deliveryDestinationPolicy").string(var_2.as_str());
   11         -
    }
   12         -
    Ok(())
   13         -
}

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

@@ -1,0 +178,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_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::put_delivery_source::PutDeliverySourceOutput, crate::operation::put_delivery_source::PutDeliverySourceError>
    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::put_delivery_source::PutDeliverySourceError::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::put_delivery_source::PutDeliverySourceError::unhandled(generic)),
   17         -
    };
   18         -
   19         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   20         -
    Err(match error_code {
   21         -
        "ConflictException" => crate::operation::put_delivery_source::PutDeliverySourceError::ConflictException({
   22         -
            #[allow(unused_mut)]
   23         -
            let mut tmp = {
   24         -
                #[allow(unused_mut)]
   25         -
                let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
   26         -
                output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
   27         -
                    .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::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         -
        "ResourceNotFoundException" => crate::operation::put_delivery_source::PutDeliverySourceError::ResourceNotFoundException({
   37         -
            #[allow(unused_mut)]
   38         -
            let mut tmp = {
   39         -
                #[allow(unused_mut)]
   40         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   41         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   42         -
                    .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::unhandled)?;
   43         -
                let output = output.meta(generic);
   44         -
                output.build()
   45         -
            };
   46         -
            if tmp.message.is_none() {
   47         -
                tmp.message = _error_message;
   48         -
            }
   49         -
            tmp
   50         -
        }),
   51         -
        "ServiceQuotaExceededException" => crate::operation::put_delivery_source::PutDeliverySourceError::ServiceQuotaExceededException({
   52         -
            #[allow(unused_mut)]
   53         -
            let mut tmp = {
   54         -
                #[allow(unused_mut)]
   55         -
                let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
   56         -
                output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
   57         -
                    _response_body,
   58         -
                    output,
   59         -
                )
   60         -
                .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::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         -
        "ServiceUnavailableException" => crate::operation::put_delivery_source::PutDeliverySourceError::ServiceUnavailableException({
   70         -
            #[allow(unused_mut)]
   71         -
            let mut tmp = {
   72         -
                #[allow(unused_mut)]
   73         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   74         -
                output =
   75         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   76         -
                        .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::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         -
        "ThrottlingException" => crate::operation::put_delivery_source::PutDeliverySourceError::ThrottlingException({
   86         -
            #[allow(unused_mut)]
   87         -
            let mut tmp = {
   88         -
                #[allow(unused_mut)]
   89         -
                let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
   90         -
                output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
   91         -
                    .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::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         -
        "ValidationException" => crate::operation::put_delivery_source::PutDeliverySourceError::ValidationException({
  101         -
            #[allow(unused_mut)]
  102         -
            let mut tmp = {
  103         -
                #[allow(unused_mut)]
  104         -
                let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
  105         -
                output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
  106         -
                    .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::unhandled)?;
  107         -
                let output = output.meta(generic);
  108         -
                output.build()
  109         -
            };
  110         -
            if tmp.message.is_none() {
  111         -
                tmp.message = _error_message;
  112         -
            }
  113         -
            tmp
  114         -
        }),
  115         -
        _ => crate::operation::put_delivery_source::PutDeliverySourceError::generic(generic),
  116         -
    })
  117         -
}
  118         -
  119         -
#[allow(clippy::unnecessary_wraps)]
  120         -
pub fn de_put_delivery_source_http_response(
  121         -
    _response_status: u16,
  122         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  123         -
    _response_body: &[u8],
  124         -
) -> std::result::Result<crate::operation::put_delivery_source::PutDeliverySourceOutput, crate::operation::put_delivery_source::PutDeliverySourceError>
  125         -
{
  126         -
    Ok({
  127         -
        #[allow(unused_mut)]
  128         -
        let mut output = crate::operation::put_delivery_source::builders::PutDeliverySourceOutputBuilder::default();
  129         -
        output = crate::protocol_serde::shape_put_delivery_source::de_put_delivery_source(_response_body, output)
  130         -
            .map_err(crate::operation::put_delivery_source::PutDeliverySourceError::unhandled)?;
  131         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  132         -
        output.build()
  133         -
    })
  134         -
}
  135         -
  136         -
pub fn ser_put_delivery_source_input(
  137         -
    input: &crate::operation::put_delivery_source::PutDeliverySourceInput,
  138         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  139         -
    let mut out = String::new();
  140         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  141         -
    crate::protocol_serde::shape_put_delivery_source_input::ser_put_delivery_source_input_input(&mut object, input)?;
  142         -
    object.finish();
  143         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  144         -
}
  145         -
  146         -
pub(crate) fn de_put_delivery_source(
  147         -
    _value: &[u8],
  148         -
    mut builder: crate::operation::put_delivery_source::builders::PutDeliverySourceOutputBuilder,
  149         -
) -> ::std::result::Result<
  150         -
    crate::operation::put_delivery_source::builders::PutDeliverySourceOutputBuilder,
  151         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  152         -
> {
  153         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  154         -
    let tokens = &mut tokens_owned;
  155         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  156         -
    loop {
  157         -
        match tokens.next().transpose()? {
  158         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  159         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  160         -
                "deliverySource" => {
  161         -
                    builder = builder.set_delivery_source(crate::protocol_serde::shape_delivery_source::de_delivery_source(tokens, _value)?);
  162         -
                }
  163         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  164         -
            },
  165         -
            other => {
  166         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  167         -
                    "expected object key or end object, found: {other:?}"
  168         -
                )))
  169         -
            }
  170         -
        }
  171         -
    }
  172         -
    if tokens.next().is_some() {
  173         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  174         -
            "found more JSON tokens after completing parsing",
  175         -
        ));
  176         -
    }
  177         -
    Ok(builder)
  178         -
}

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

@@ -1,0 +26,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_delivery_source_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_delivery_source::PutDeliverySourceInput,
    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         -
    if let Some(var_2) = &input.resource_arn {
   10         -
        object.key("resourceArn").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.log_type {
   13         -
        object.key("logType").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.tags {
   16         -
        #[allow(unused_mut)]
   17         -
        let mut object_5 = object.key("tags").start_object();
   18         -
        for (key_6, value_7) in var_4 {
   19         -
            {
   20         -
                object_5.key(key_6.as_str()).string(value_7.as_str());
   21         -
            }
   22         -
        }
   23         -
        object_5.finish();
   24         -
    }
   25         -
    Ok(())
   26         -
}

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

@@ -1,0 +128,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_destination_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::put_destination::PutDestinationOutput, crate::operation::put_destination::PutDestinationError> {
    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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::put_destination::PutDestinationError::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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::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::put_destination::PutDestinationError::generic(generic),
   67         -
    })
   68         -
}
   69         -
   70         -
#[allow(clippy::unnecessary_wraps)]
   71         -
pub fn de_put_destination_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::put_destination::PutDestinationOutput, crate::operation::put_destination::PutDestinationError> {
   76         -
    Ok({
   77         -
        #[allow(unused_mut)]
   78         -
        let mut output = crate::operation::put_destination::builders::PutDestinationOutputBuilder::default();
   79         -
        output = crate::protocol_serde::shape_put_destination::de_put_destination(_response_body, output)
   80         -
            .map_err(crate::operation::put_destination::PutDestinationError::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_put_destination_input(
   87         -
    input: &crate::operation::put_destination::PutDestinationInput,
   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_put_destination_input::ser_put_destination_input_input(&mut object, input)?;
   92         -
    object.finish();
   93         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   94         -
}
   95         -
   96         -
pub(crate) fn de_put_destination(
   97         -
    _value: &[u8],
   98         -
    mut builder: crate::operation::put_destination::builders::PutDestinationOutputBuilder,
   99         -
) -> ::std::result::Result<
  100         -
    crate::operation::put_destination::builders::PutDestinationOutputBuilder,
  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         -
                "destination" => {
  111         -
                    builder = builder.set_destination(crate::protocol_serde::shape_destination::de_destination(tokens, _value)?);
  112         -
                }
  113         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  114         -
            },
  115         -
            other => {
  116         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  117         -
                    "expected object key or end object, found: {other:?}"
  118         -
                )))
  119         -
            }
  120         -
        }
  121         -
    }
  122         -
    if tokens.next().is_some() {
  123         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  124         -
            "found more JSON tokens after completing parsing",
  125         -
        ));
  126         -
    }
  127         -
    Ok(builder)
  128         -
}

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

@@ -1,0 +26,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_destination_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_destination::PutDestinationInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.destination_name {
    7         -
        object.key("destinationName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.target_arn {
   10         -
        object.key("targetArn").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.role_arn {
   13         -
        object.key("roleArn").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.tags {
   16         -
        #[allow(unused_mut)]
   17         -
        let mut object_5 = object.key("tags").start_object();
   18         -
        for (key_6, value_7) in var_4 {
   19         -
            {
   20         -
                object_5.key(key_6.as_str()).string(value_7.as_str());
   21         -
            }
   22         -
        }
   23         -
        object_5.finish();
   24         -
    }
   25         -
    Ok(())
   26         -
}

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

@@ -1,0 +98,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_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::put_destination_policy::PutDestinationPolicyOutput,
    9         -
    crate::operation::put_destination_policy::PutDestinationPolicyError,
   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::put_destination_policy::PutDestinationPolicyError::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::put_destination_policy::PutDestinationPolicyError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "InvalidParameterException" => crate::operation::put_destination_policy::PutDestinationPolicyError::InvalidParameterException({
   24         -
            #[allow(unused_mut)]
   25         -
            let mut tmp = {
   26         -
                #[allow(unused_mut)]
   27         -
                let mut output = crate::types::error::builders::InvalidParameterExceptionBuilder::default();
   28         -
                output = crate::protocol_serde::shape_invalid_parameter_exception::de_invalid_parameter_exception_json_err(_response_body, output)
   29         -
                    .map_err(crate::operation::put_destination_policy::PutDestinationPolicyError::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         -
        "OperationAbortedException" => crate::operation::put_destination_policy::PutDestinationPolicyError::OperationAbortedException({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::OperationAbortedExceptionBuilder::default();
   43         -
                output = crate::protocol_serde::shape_operation_aborted_exception::de_operation_aborted_exception_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::put_destination_policy::PutDestinationPolicyError::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::put_destination_policy::PutDestinationPolicyError::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::put_destination_policy::PutDestinationPolicyError::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         -
        _ => crate::operation::put_destination_policy::PutDestinationPolicyError::generic(generic),
   70         -
    })
   71         -
}
   72         -
   73         -
#[allow(clippy::unnecessary_wraps)]
   74         -
pub fn de_put_destination_policy_http_response(
   75         -
    _response_status: u16,
   76         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   77         -
    _response_body: &[u8],
   78         -
) -> std::result::Result<
   79         -
    crate::operation::put_destination_policy::PutDestinationPolicyOutput,
   80         -
    crate::operation::put_destination_policy::PutDestinationPolicyError,
   81         -
> {
   82         -
    Ok({
   83         -
        #[allow(unused_mut)]
   84         -
        let mut output = crate::operation::put_destination_policy::builders::PutDestinationPolicyOutputBuilder::default();
   85         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   86         -
        output.build()
   87         -
    })
   88         -
}
   89         -
   90         -
pub fn ser_put_destination_policy_input(
   91         -
    input: &crate::operation::put_destination_policy::PutDestinationPolicyInput,
   92         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   93         -
    let mut out = String::new();
   94         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   95         -
    crate::protocol_serde::shape_put_destination_policy_input::ser_put_destination_policy_input_input(&mut object, input)?;
   96         -
    object.finish();
   97         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   98         -
}

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

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_put_destination_policy_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::put_destination_policy::PutDestinationPolicyInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.destination_name {
    7         -
        object.key("destinationName").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.access_policy {
   10         -
        object.key("accessPolicy").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.force_update {
   13         -
        object.key("forceUpdate").boolean(*var_3);
   14         -
    }
   15         -
    Ok(())
   16         -
}

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

@@ -1,0 +158,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_put_index_policy_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::put_index_policy::PutIndexPolicyOutput, crate::operation::put_index_policy::PutIndexPolicyError> {
    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::put_index_policy::PutIndexPolicyError::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::put_index_policy::PutIndexPolicyError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::put_index_policy::PutIndexPolicyError::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::put_index_policy::PutIndexPolicyError::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         -
        "LimitExceededException" => crate::operation::put_index_policy::PutIndexPolicyError::LimitExceededException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::LimitExceededExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_limit_exceeded_exception::de_limit_exceeded_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::put_index_policy::PutIndexPolicyError::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         -
        "OperationAbortedException" => crate::operation::put_index_policy::PutIndexPolicyError::OperationAbortedException({
   51         -
            #[allow(unused_mut)]
   52         -
            let mut tmp = {
   53         -
                #[allow(unused_mut)]
   54         -
                let mut output = crate::types::error::builders::OperationAbortedExceptionBuilder::default();
   55         -
                output = crate::protocol_serde::shape_operation_aborted_exception::de_operation_aborted_exception_json_err(_response_body, output)
   56         -
                    .map_err(crate::operation::put_index_policy::PutIndexPolicyError::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         -
        "ResourceNotFoundException" => crate::operation::put_index_policy::PutIndexPolicyError::ResourceNotFoundException({
   66         -
            #[allow(unused_mut)]
   67         -
            let mut tmp = {
   68         -
                #[allow(unused_mut)]
   69         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   70         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   71         -
                    .map_err(crate::operation::put_index_policy::PutIndexPolicyError::unhandled)?;
   72         -
                let output = output.meta(generic);
   73         -
                output.build()
   74         -
            };
   75         -
            if tmp.message.is_none() {
   76         -
                tmp.message = _error_message;
   77         -
            }
   78         -
            tmp
   79         -
        }),
   80         -
        "ServiceUnavailableException" => crate::operation::put_index_policy::PutIndexPolicyError::ServiceUnavailableException({
   81         -
            #[allow(unused_mut)]
   82         -
            let mut tmp = {
   83         -
                #[allow(unused_mut)]
   84         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   85         -
                output =
   86         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   87         -
                        .map_err(crate::operation::put_index_policy::PutIndexPolicyError::unhandled)?;
   88         -
                let output = output.meta(generic);
   89         -
                output.build()
   90         -
            };
   91         -
            if tmp.message.is_none() {
   92         -
                tmp.message = _error_message;
   93         -
            }
   94         -
            tmp
   95         -
        }),
   96         -
        _ => crate::operation::put_index_policy::PutIndexPolicyError::generic(generic),
   97         -
    })
   98         -
}
   99         -
  100         -
#[allow(clippy::unnecessary_wraps)]
  101         -
pub fn de_put_index_policy_http_response(
  102         -
    _response_status: u16,
  103         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
  104         -
    _response_body: &[u8],
  105         -
) -> std::result::Result<crate::operation::put_index_policy::PutIndexPolicyOutput, crate::operation::put_index_policy::PutIndexPolicyError> {
  106         -
    Ok({
  107         -
        #[allow(unused_mut)]
  108         -
        let mut output = crate::operation::put_index_policy::builders::PutIndexPolicyOutputBuilder::default();
  109         -
        output = crate::protocol_serde::shape_put_index_policy::de_put_index_policy(_response_body, output)
  110         -
            .map_err(crate::operation::put_index_policy::PutIndexPolicyError::unhandled)?;
  111         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
  112         -
        output.build()
  113         -
    })
  114         -
}
  115         -
  116         -
pub fn ser_put_index_policy_input(
  117         -
    input: &crate::operation::put_index_policy::PutIndexPolicyInput,
  118         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
  119         -
    let mut out = String::new();
  120         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
  121         -
    crate::protocol_serde::shape_put_index_policy_input::ser_put_index_policy_input_input(&mut object, input)?;
  122         -
    object.finish();
  123         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  124         -
}
  125         -
  126         -
pub(crate) fn de_put_index_policy(
  127         -
    _value: &[u8],
  128         -
    mut builder: crate::operation::put_index_policy::builders::PutIndexPolicyOutputBuilder,
  129         -
) -> ::std::result::Result<
  130         -
    crate::operation::put_index_policy::builders::PutIndexPolicyOutputBuilder,
  131         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  132         -
> {
  133         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  134         -
    let tokens = &mut tokens_owned;
  135         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  136         -
    loop {
  137         -
        match tokens.next().transpose()? {
  138         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  139         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  140         -
                "indexPolicy" => {
  141         -
                    builder = builder.set_index_policy(crate::protocol_serde::shape_index_policy::de_index_policy(tokens, _value)?);
  142         -
                }
  143         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  144         -
            },
  145         -
            other => {
  146         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  147         -
                    "expected object key or end object, found: {other:?}"
  148         -
                )))
  149         -
            }
  150         -
        }
  151         -
    }
  152         -
    if tokens.next().is_some() {
  153         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  154         -
            "found more JSON tokens after completing parsing",
  155         -
        ));
  156         -
    }
  157         -
    Ok(builder)
  158         -
}