AWS SDK

AWS SDK

rev. e063993ca0ab793f44c575dbe707d50a5e3e2406

Files changed:

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

@@ -1,0 +141,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_log_streams_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::describe_log_streams::DescribeLogStreamsOutput,
    9         -
    crate::operation::describe_log_streams::DescribeLogStreamsError,
   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::describe_log_streams::DescribeLogStreamsError::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::describe_log_streams::DescribeLogStreamsError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "InvalidParameterException" => crate::operation::describe_log_streams::DescribeLogStreamsError::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::describe_log_streams::DescribeLogStreamsError::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" => crate::operation::describe_log_streams::DescribeLogStreamsError::ResourceNotFoundException({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   43         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::describe_log_streams::DescribeLogStreamsError::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::describe_log_streams::DescribeLogStreamsError::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::describe_log_streams::DescribeLogStreamsError::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::describe_log_streams::DescribeLogStreamsError::generic(generic),
   70         -
    })
   71         -
}
   72         -
   73         -
#[allow(clippy::unnecessary_wraps)]
   74         -
pub fn de_describe_log_streams_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::describe_log_streams::DescribeLogStreamsOutput,
   80         -
    crate::operation::describe_log_streams::DescribeLogStreamsError,
   81         -
> {
   82         -
    Ok({
   83         -
        #[allow(unused_mut)]
   84         -
        let mut output = crate::operation::describe_log_streams::builders::DescribeLogStreamsOutputBuilder::default();
   85         -
        output = crate::protocol_serde::shape_describe_log_streams::de_describe_log_streams(_response_body, output)
   86         -
            .map_err(crate::operation::describe_log_streams::DescribeLogStreamsError::unhandled)?;
   87         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   88         -
        output.build()
   89         -
    })
   90         -
}
   91         -
   92         -
pub fn ser_describe_log_streams_input(
   93         -
    input: &crate::operation::describe_log_streams::DescribeLogStreamsInput,
   94         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   95         -
    let mut out = String::new();
   96         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   97         -
    crate::protocol_serde::shape_describe_log_streams_input::ser_describe_log_streams_input_input(&mut object, input)?;
   98         -
    object.finish();
   99         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  100         -
}
  101         -
  102         -
pub(crate) fn de_describe_log_streams(
  103         -
    _value: &[u8],
  104         -
    mut builder: crate::operation::describe_log_streams::builders::DescribeLogStreamsOutputBuilder,
  105         -
) -> ::std::result::Result<
  106         -
    crate::operation::describe_log_streams::builders::DescribeLogStreamsOutputBuilder,
  107         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  108         -
> {
  109         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  110         -
    let tokens = &mut tokens_owned;
  111         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  112         -
    loop {
  113         -
        match tokens.next().transpose()? {
  114         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  115         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  116         -
                "logStreams" => {
  117         -
                    builder = builder.set_log_streams(crate::protocol_serde::shape_log_streams::de_log_streams(tokens, _value)?);
  118         -
                }
  119         -
                "nextToken" => {
  120         -
                    builder = builder.set_next_token(
  121         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  122         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  123         -
                            .transpose()?,
  124         -
                    );
  125         -
                }
  126         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  127         -
            },
  128         -
            other => {
  129         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  130         -
                    "expected object key or end object, found: {other:?}"
  131         -
                )))
  132         -
            }
  133         -
        }
  134         -
    }
  135         -
    if tokens.next().is_some() {
  136         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  137         -
            "found more JSON tokens after completing parsing",
  138         -
        ));
  139         -
    }
  140         -
    Ok(builder)
  141         -
}

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

@@ -1,0 +31,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_log_streams_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_log_streams::DescribeLogStreamsInput,
    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.log_group_identifier {
   10         -
        object.key("logGroupIdentifier").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.log_stream_name_prefix {
   13         -
        object.key("logStreamNamePrefix").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.order_by {
   16         -
        object.key("orderBy").string(var_4.as_str());
   17         -
    }
   18         -
    if let Some(var_5) = &input.descending {
   19         -
        object.key("descending").boolean(*var_5);
   20         -
    }
   21         -
    if let Some(var_6) = &input.next_token {
   22         -
        object.key("nextToken").string(var_6.as_str());
   23         -
    }
   24         -
    if let Some(var_7) = &input.limit {
   25         -
        object.key("limit").number(
   26         -
            #[allow(clippy::useless_conversion)]
   27         -
            ::aws_smithy_types::Number::NegInt((*var_7).into()),
   28         -
        );
   29         -
    }
   30         -
    Ok(())
   31         -
}

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

@@ -1,0 +141,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_metric_filters_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::describe_metric_filters::DescribeMetricFiltersOutput,
    9         -
    crate::operation::describe_metric_filters::DescribeMetricFiltersError,
   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::describe_metric_filters::DescribeMetricFiltersError::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::describe_metric_filters::DescribeMetricFiltersError::unhandled(generic)),
   19         -
    };
   20         -
   21         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   22         -
    Err(match error_code {
   23         -
        "InvalidParameterException" => crate::operation::describe_metric_filters::DescribeMetricFiltersError::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::describe_metric_filters::DescribeMetricFiltersError::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" => crate::operation::describe_metric_filters::DescribeMetricFiltersError::ResourceNotFoundException({
   39         -
            #[allow(unused_mut)]
   40         -
            let mut tmp = {
   41         -
                #[allow(unused_mut)]
   42         -
                let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
   43         -
                output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
   44         -
                    .map_err(crate::operation::describe_metric_filters::DescribeMetricFiltersError::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::describe_metric_filters::DescribeMetricFiltersError::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::describe_metric_filters::DescribeMetricFiltersError::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::describe_metric_filters::DescribeMetricFiltersError::generic(generic),
   70         -
    })
   71         -
}
   72         -
   73         -
#[allow(clippy::unnecessary_wraps)]
   74         -
pub fn de_describe_metric_filters_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::describe_metric_filters::DescribeMetricFiltersOutput,
   80         -
    crate::operation::describe_metric_filters::DescribeMetricFiltersError,
   81         -
> {
   82         -
    Ok({
   83         -
        #[allow(unused_mut)]
   84         -
        let mut output = crate::operation::describe_metric_filters::builders::DescribeMetricFiltersOutputBuilder::default();
   85         -
        output = crate::protocol_serde::shape_describe_metric_filters::de_describe_metric_filters(_response_body, output)
   86         -
            .map_err(crate::operation::describe_metric_filters::DescribeMetricFiltersError::unhandled)?;
   87         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   88         -
        output.build()
   89         -
    })
   90         -
}
   91         -
   92         -
pub fn ser_describe_metric_filters_input(
   93         -
    input: &crate::operation::describe_metric_filters::DescribeMetricFiltersInput,
   94         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   95         -
    let mut out = String::new();
   96         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   97         -
    crate::protocol_serde::shape_describe_metric_filters_input::ser_describe_metric_filters_input_input(&mut object, input)?;
   98         -
    object.finish();
   99         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
  100         -
}
  101         -
  102         -
pub(crate) fn de_describe_metric_filters(
  103         -
    _value: &[u8],
  104         -
    mut builder: crate::operation::describe_metric_filters::builders::DescribeMetricFiltersOutputBuilder,
  105         -
) -> ::std::result::Result<
  106         -
    crate::operation::describe_metric_filters::builders::DescribeMetricFiltersOutputBuilder,
  107         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  108         -
> {
  109         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  110         -
    let tokens = &mut tokens_owned;
  111         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  112         -
    loop {
  113         -
        match tokens.next().transpose()? {
  114         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  115         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  116         -
                "metricFilters" => {
  117         -
                    builder = builder.set_metric_filters(crate::protocol_serde::shape_metric_filters::de_metric_filters(tokens, _value)?);
  118         -
                }
  119         -
                "nextToken" => {
  120         -
                    builder = builder.set_next_token(
  121         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  122         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  123         -
                            .transpose()?,
  124         -
                    );
  125         -
                }
  126         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  127         -
            },
  128         -
            other => {
  129         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  130         -
                    "expected object key or end object, found: {other:?}"
  131         -
                )))
  132         -
            }
  133         -
        }
  134         -
    }
  135         -
    if tokens.next().is_some() {
  136         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  137         -
            "found more JSON tokens after completing parsing",
  138         -
        ));
  139         -
    }
  140         -
    Ok(builder)
  141         -
}

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

@@ -1,0 +28,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_metric_filters_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_metric_filters::DescribeMetricFiltersInput,
    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.filter_name_prefix {
   10         -
        object.key("filterNamePrefix").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.next_token {
   13         -
        object.key("nextToken").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.limit {
   16         -
        object.key("limit").number(
   17         -
            #[allow(clippy::useless_conversion)]
   18         -
            ::aws_smithy_types::Number::NegInt((*var_4).into()),
   19         -
        );
   20         -
    }
   21         -
    if let Some(var_5) = &input.metric_name {
   22         -
        object.key("metricName").string(var_5.as_str());
   23         -
    }
   24         -
    if let Some(var_6) = &input.metric_namespace {
   25         -
        object.key("metricNamespace").string(var_6.as_str());
   26         -
    }
   27         -
    Ok(())
   28         -
}

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

@@ -1,0 +135,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_queries_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::describe_queries::DescribeQueriesOutput, crate::operation::describe_queries::DescribeQueriesError> {
    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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidParameterException" => crate::operation::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::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::describe_queries::DescribeQueriesError::generic(generic),
   67         -
    })
   68         -
}
   69         -
   70         -
#[allow(clippy::unnecessary_wraps)]
   71         -
pub fn de_describe_queries_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::describe_queries::DescribeQueriesOutput, crate::operation::describe_queries::DescribeQueriesError> {
   76         -
    Ok({
   77         -
        #[allow(unused_mut)]
   78         -
        let mut output = crate::operation::describe_queries::builders::DescribeQueriesOutputBuilder::default();
   79         -
        output = crate::protocol_serde::shape_describe_queries::de_describe_queries(_response_body, output)
   80         -
            .map_err(crate::operation::describe_queries::DescribeQueriesError::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_describe_queries_input(
   87         -
    input: &crate::operation::describe_queries::DescribeQueriesInput,
   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_describe_queries_input::ser_describe_queries_input_input(&mut object, input)?;
   92         -
    object.finish();
   93         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   94         -
}
   95         -
   96         -
pub(crate) fn de_describe_queries(
   97         -
    _value: &[u8],
   98         -
    mut builder: crate::operation::describe_queries::builders::DescribeQueriesOutputBuilder,
   99         -
) -> ::std::result::Result<
  100         -
    crate::operation::describe_queries::builders::DescribeQueriesOutputBuilder,
  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         -
                "queries" => {
  111         -
                    builder = builder.set_queries(crate::protocol_serde::shape_query_info_list::de_query_info_list(tokens, _value)?);
  112         -
                }
  113         -
                "nextToken" => {
  114         -
                    builder = builder.set_next_token(
  115         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  116         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  117         -
                            .transpose()?,
  118         -
                    );
  119         -
                }
  120         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  121         -
            },
  122         -
            other => {
  123         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  124         -
                    "expected object key or end object, found: {other:?}"
  125         -
                )))
  126         -
            }
  127         -
        }
  128         -
    }
  129         -
    if tokens.next().is_some() {
  130         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  131         -
            "found more JSON tokens after completing parsing",
  132         -
        ));
  133         -
    }
  134         -
    Ok(builder)
  135         -
}

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

@@ -1,0 +25,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_queries_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_queries::DescribeQueriesInput,
    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.status {
   10         -
        object.key("status").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.max_results {
   13         -
        object.key("maxResults").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((*var_3).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_4) = &input.next_token {
   19         -
        object.key("nextToken").string(var_4.as_str());
   20         -
    }
   21         -
    if let Some(var_5) = &input.query_language {
   22         -
        object.key("queryLanguage").string(var_5.as_str());
   23         -
    }
   24         -
    Ok(())
   25         -
}

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

@@ -1,0 +132,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_query_definitions_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::describe_query_definitions::DescribeQueryDefinitionsOutput,
    9         -
    crate::operation::describe_query_definitions::DescribeQueryDefinitionsError,
   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::describe_query_definitions::DescribeQueryDefinitionsError::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::describe_query_definitions::DescribeQueryDefinitionsError::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::describe_query_definitions::DescribeQueryDefinitionsError::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::describe_query_definitions::DescribeQueryDefinitionsError::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         -
        "ServiceUnavailableException" => crate::operation::describe_query_definitions::DescribeQueryDefinitionsError::ServiceUnavailableException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   47         -
                output =
   48         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   49         -
                        .map_err(crate::operation::describe_query_definitions::DescribeQueryDefinitionsError::unhandled)?;
   50         -
                let output = output.meta(generic);
   51         -
                output.build()
   52         -
            };
   53         -
            if tmp.message.is_none() {
   54         -
                tmp.message = _error_message;
   55         -
            }
   56         -
            tmp
   57         -
        }),
   58         -
        _ => crate::operation::describe_query_definitions::DescribeQueryDefinitionsError::generic(generic),
   59         -
    })
   60         -
}
   61         -
   62         -
#[allow(clippy::unnecessary_wraps)]
   63         -
pub fn de_describe_query_definitions_http_response(
   64         -
    _response_status: u16,
   65         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   66         -
    _response_body: &[u8],
   67         -
) -> std::result::Result<
   68         -
    crate::operation::describe_query_definitions::DescribeQueryDefinitionsOutput,
   69         -
    crate::operation::describe_query_definitions::DescribeQueryDefinitionsError,
   70         -
> {
   71         -
    Ok({
   72         -
        #[allow(unused_mut)]
   73         -
        let mut output = crate::operation::describe_query_definitions::builders::DescribeQueryDefinitionsOutputBuilder::default();
   74         -
        output = crate::protocol_serde::shape_describe_query_definitions::de_describe_query_definitions(_response_body, output)
   75         -
            .map_err(crate::operation::describe_query_definitions::DescribeQueryDefinitionsError::unhandled)?;
   76         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   77         -
        output.build()
   78         -
    })
   79         -
}
   80         -
   81         -
pub fn ser_describe_query_definitions_input(
   82         -
    input: &crate::operation::describe_query_definitions::DescribeQueryDefinitionsInput,
   83         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   84         -
    let mut out = String::new();
   85         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   86         -
    crate::protocol_serde::shape_describe_query_definitions_input::ser_describe_query_definitions_input_input(&mut object, input)?;
   87         -
    object.finish();
   88         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   89         -
}
   90         -
   91         -
pub(crate) fn de_describe_query_definitions(
   92         -
    _value: &[u8],
   93         -
    mut builder: crate::operation::describe_query_definitions::builders::DescribeQueryDefinitionsOutputBuilder,
   94         -
) -> ::std::result::Result<
   95         -
    crate::operation::describe_query_definitions::builders::DescribeQueryDefinitionsOutputBuilder,
   96         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   97         -
> {
   98         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   99         -
    let tokens = &mut tokens_owned;
  100         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  101         -
    loop {
  102         -
        match tokens.next().transpose()? {
  103         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  104         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  105         -
                "queryDefinitions" => {
  106         -
                    builder = builder.set_query_definitions(crate::protocol_serde::shape_query_definition_list::de_query_definition_list(
  107         -
                        tokens, _value,
  108         -
                    )?);
  109         -
                }
  110         -
                "nextToken" => {
  111         -
                    builder = builder.set_next_token(
  112         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  113         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  114         -
                            .transpose()?,
  115         -
                    );
  116         -
                }
  117         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  118         -
            },
  119         -
            other => {
  120         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  121         -
                    "expected object key or end object, found: {other:?}"
  122         -
                )))
  123         -
            }
  124         -
        }
  125         -
    }
  126         -
    if tokens.next().is_some() {
  127         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  128         -
            "found more JSON tokens after completing parsing",
  129         -
        ));
  130         -
    }
  131         -
    Ok(builder)
  132         -
}

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

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_query_definitions_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_query_definitions::DescribeQueryDefinitionsInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.query_language {
    7         -
        object.key("queryLanguage").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.query_definition_name_prefix {
   10         -
        object.key("queryDefinitionNamePrefix").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.max_results {
   13         -
        object.key("maxResults").number(
   14         -
            #[allow(clippy::useless_conversion)]
   15         -
            ::aws_smithy_types::Number::NegInt((*var_3).into()),
   16         -
        );
   17         -
    }
   18         -
    if let Some(var_4) = &input.next_token {
   19         -
        object.key("nextToken").string(var_4.as_str());
   20         -
    }
   21         -
    Ok(())
   22         -
}

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

@@ -1,0 +130,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_describe_resource_policies_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::describe_resource_policies::DescribeResourcePoliciesOutput,
    9         -
    crate::operation::describe_resource_policies::DescribeResourcePoliciesError,
   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::describe_resource_policies::DescribeResourcePoliciesError::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::describe_resource_policies::DescribeResourcePoliciesError::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::describe_resource_policies::DescribeResourcePoliciesError::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::describe_resource_policies::DescribeResourcePoliciesError::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         -
        "ServiceUnavailableException" => crate::operation::describe_resource_policies::DescribeResourcePoliciesError::ServiceUnavailableException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ServiceUnavailableExceptionBuilder::default();
   47         -
                output =
   48         -
                    crate::protocol_serde::shape_service_unavailable_exception::de_service_unavailable_exception_json_err(_response_body, output)
   49         -
                        .map_err(crate::operation::describe_resource_policies::DescribeResourcePoliciesError::unhandled)?;
   50         -
                let output = output.meta(generic);
   51         -
                output.build()
   52         -
            };
   53         -
            if tmp.message.is_none() {
   54         -
                tmp.message = _error_message;
   55         -
            }
   56         -
            tmp
   57         -
        }),
   58         -
        _ => crate::operation::describe_resource_policies::DescribeResourcePoliciesError::generic(generic),
   59         -
    })
   60         -
}
   61         -
   62         -
#[allow(clippy::unnecessary_wraps)]
   63         -
pub fn de_describe_resource_policies_http_response(
   64         -
    _response_status: u16,
   65         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   66         -
    _response_body: &[u8],
   67         -
) -> std::result::Result<
   68         -
    crate::operation::describe_resource_policies::DescribeResourcePoliciesOutput,
   69         -
    crate::operation::describe_resource_policies::DescribeResourcePoliciesError,
   70         -
> {
   71         -
    Ok({
   72         -
        #[allow(unused_mut)]
   73         -
        let mut output = crate::operation::describe_resource_policies::builders::DescribeResourcePoliciesOutputBuilder::default();
   74         -
        output = crate::protocol_serde::shape_describe_resource_policies::de_describe_resource_policies(_response_body, output)
   75         -
            .map_err(crate::operation::describe_resource_policies::DescribeResourcePoliciesError::unhandled)?;
   76         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   77         -
        output.build()
   78         -
    })
   79         -
}
   80         -
   81         -
pub fn ser_describe_resource_policies_input(
   82         -
    input: &crate::operation::describe_resource_policies::DescribeResourcePoliciesInput,
   83         -
) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
   84         -
    let mut out = String::new();
   85         -
    let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
   86         -
    crate::protocol_serde::shape_describe_resource_policies_input::ser_describe_resource_policies_input_input(&mut object, input)?;
   87         -
    object.finish();
   88         -
    Ok(::aws_smithy_types::body::SdkBody::from(out))
   89         -
}
   90         -
   91         -
pub(crate) fn de_describe_resource_policies(
   92         -
    _value: &[u8],
   93         -
    mut builder: crate::operation::describe_resource_policies::builders::DescribeResourcePoliciesOutputBuilder,
   94         -
) -> ::std::result::Result<
   95         -
    crate::operation::describe_resource_policies::builders::DescribeResourcePoliciesOutputBuilder,
   96         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   97         -
> {
   98         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   99         -
    let tokens = &mut tokens_owned;
  100         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  101         -
    loop {
  102         -
        match tokens.next().transpose()? {
  103         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  104         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  105         -
                "resourcePolicies" => {
  106         -
                    builder = builder.set_resource_policies(crate::protocol_serde::shape_resource_policies::de_resource_policies(tokens, _value)?);
  107         -
                }
  108         -
                "nextToken" => {
  109         -
                    builder = builder.set_next_token(
  110         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
  111         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
  112         -
                            .transpose()?,
  113         -
                    );
  114         -
                }
  115         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
  116         -
            },
  117         -
            other => {
  118         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
  119         -
                    "expected object key or end object, found: {other:?}"
  120         -
                )))
  121         -
            }
  122         -
        }
  123         -
    }
  124         -
    if tokens.next().is_some() {
  125         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  126         -
            "found more JSON tokens after completing parsing",
  127         -
        ));
  128         -
    }
  129         -
    Ok(builder)
  130         -
}

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

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_resource_policies_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_resource_policies::DescribeResourcePoliciesInput,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    if let Some(var_1) = &input.next_token {
    7         -
        object.key("nextToken").string(var_1.as_str());
    8         -
    }
    9         -
    if let Some(var_2) = &input.limit {
   10         -
        object.key("limit").number(
   11         -
            #[allow(clippy::useless_conversion)]
   12         -
            ::aws_smithy_types::Number::NegInt((*var_2).into()),
   13         -
        );
   14         -
    }
   15         -
    if let Some(var_3) = &input.resource_arn {
   16         -
        object.key("resourceArn").string(var_3.as_str());
   17         -
    }
   18         -
    if let Some(var_4) = &input.policy_scope {
   19         -
        object.key("policyScope").string(var_4.as_str());
   20         -
    }
   21         -
    Ok(())
   22         -
}

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

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

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

@@ -1,0 +22,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_describe_subscription_filters_input_input(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::operation::describe_subscription_filters::DescribeSubscriptionFiltersInput,
    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.filter_name_prefix {
   10         -
        object.key("filterNamePrefix").string(var_2.as_str());
   11         -
    }
   12         -
    if let Some(var_3) = &input.next_token {
   13         -
        object.key("nextToken").string(var_3.as_str());
   14         -
    }
   15         -
    if let Some(var_4) = &input.limit {
   16         -
        object.key("limit").number(
   17         -
            #[allow(clippy::useless_conversion)]
   18         -
            ::aws_smithy_types::Number::NegInt((*var_4).into()),
   19         -
        );
   20         -
    }
   21         -
    Ok(())
   22         -
}

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

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