AWS SDK

AWS SDK

rev. ba98f30b52e51c6e715b0ae469e7a2e988c27d9a (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_converse_text_block.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_coverage.rs

@@ -1,0 +43,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_guardrail_coverage<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::GuardrailCoverage>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::GuardrailCoverageBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "textCharacters" => {
   18         -
                            builder = builder.set_text_characters(
   19         -
                                crate::protocol_serde::shape_guardrail_text_characters_coverage::de_guardrail_text_characters_coverage(tokens)?,
   20         -
                            );
   21         -
                        }
   22         -
                        "images" => {
   23         -
                            builder = builder.set_images(crate::protocol_serde::shape_guardrail_image_coverage::de_guardrail_image_coverage(
   24         -
                                tokens,
   25         -
                            )?);
   26         -
                        }
   27         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   28         -
                    },
   29         -
                    other => {
   30         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   31         -
                            "expected object key or end object, found: {:?}",
   32         -
                            other
   33         -
                        )))
   34         -
                    }
   35         -
                }
   36         -
            }
   37         -
            Ok(Some(builder.build()))
   38         -
        }
   39         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   40         -
            "expected start object or null",
   41         -
        )),
   42         -
    }
   43         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_custom_word.rs

@@ -1,0 +52,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_guardrail_custom_word<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::GuardrailCustomWord>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::GuardrailCustomWordBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "match" => {
   18         -
                            builder = builder.set_match(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
   23         -
                        }
   24         -
                        "action" => {
   25         -
                            builder = builder.set_action(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   27         -
                                    .map(|s| s.to_unescaped().map(|u| crate::types::GuardrailWordPolicyAction::from(u.as_ref())))
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        "detected" => {
   32         -
                            builder = builder.set_detected(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
   33         -
                        }
   34         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   35         -
                    },
   36         -
                    other => {
   37         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   38         -
                            "expected object key or end object, found: {:?}",
   39         -
                            other
   40         -
                        )))
   41         -
                    }
   42         -
                }
   43         -
            }
   44         -
            Ok(Some(crate::serde_util::guardrail_custom_word_correct_errors(builder).build().map_err(
   45         -
                |err| ::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err),
   46         -
            )?))
   47         -
        }
   48         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   49         -
            "expected start object or null",
   50         -
        )),
   51         -
    }
   52         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_custom_word_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_image_block.rs

@@ -1,0 +16,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_guardrail_image_block(
    3         -
    object: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::GuardrailImageBlock,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    {
    7         -
        object.key("format").string(input.format.as_str());
    8         -
    }
    9         -
    if let Some(var_1) = &input.source {
   10         -
        #[allow(unused_mut)]
   11         -
        let mut object_2 = object.key("source").start_object();
   12         -
        crate::protocol_serde::shape_guardrail_image_source::ser_guardrail_image_source(&mut object_2, var_1)?;
   13         -
        object_2.finish();
   14         -
    }
   15         -
    Ok(())
   16         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_image_coverage.rs

@@ -1,0 +47,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_guardrail_image_coverage<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::GuardrailImageCoverage>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::GuardrailImageCoverageBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "guarded" => {
   18         -
                            builder = builder.set_guarded(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   20         -
                                    .map(i32::try_from)
   21         -
                                    .transpose()?,
   22         -
                            );
   23         -
                        }
   24         -
                        "total" => {
   25         -
                            builder = builder.set_total(
   26         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   27         -
                                    .map(i32::try_from)
   28         -
                                    .transpose()?,
   29         -
                            );
   30         -
                        }
   31         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   32         -
                    },
   33         -
                    other => {
   34         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   35         -
                            "expected object key or end object, found: {:?}",
   36         -
                            other
   37         -
                        )))
   38         -
                    }
   39         -
                }
   40         -
            }
   41         -
            Ok(Some(builder.build()))
   42         -
        }
   43         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   44         -
            "expected start object or null",
   45         -
        )),
   46         -
    }
   47         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_image_source.rs

@@ -1,0 +17,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub fn ser_guardrail_image_source(
    3         -
    object_2: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
    4         -
    input: &crate::types::GuardrailImageSource,
    5         -
) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::SerializationError> {
    6         -
    match input {
    7         -
        crate::types::GuardrailImageSource::Bytes(inner) => {
    8         -
            object_2.key("bytes").string_unchecked(&::aws_smithy_types::base64::encode(inner));
    9         -
        }
   10         -
        crate::types::GuardrailImageSource::Unknown => {
   11         -
            return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
   12         -
                "GuardrailImageSource",
   13         -
            ))
   14         -
        }
   15         -
    }
   16         -
    Ok(())
   17         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_invocation_metrics.rs

@@ -1,0 +46,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_guardrail_invocation_metrics<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::GuardrailInvocationMetrics>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::GuardrailInvocationMetricsBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "guardrailProcessingLatency" => {
   18         -
                            builder = builder.set_guardrail_processing_latency(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
   20         -
                                    .map(i64::try_from)
   21         -
                                    .transpose()?,
   22         -
                            );
   23         -
                        }
   24         -
                        "usage" => {
   25         -
                            builder = builder.set_usage(crate::protocol_serde::shape_guardrail_usage::de_guardrail_usage(tokens)?);
   26         -
                        }
   27         -
                        "guardrailCoverage" => {
   28         -
                            builder = builder.set_guardrail_coverage(crate::protocol_serde::shape_guardrail_coverage::de_guardrail_coverage(tokens)?);
   29         -
                        }
   30         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   31         -
                    },
   32         -
                    other => {
   33         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   34         -
                            "expected object key or end object, found: {:?}",
   35         -
                            other
   36         -
                        )))
   37         -
                    }
   38         -
                }
   39         -
            }
   40         -
            Ok(Some(builder.build()))
   41         -
        }
   42         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   43         -
            "expected start object or null",
   44         -
        )),
   45         -
    }
   46         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_managed_word.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_managed_word_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_output_content.rs

@@ -1,0 +40,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
pub(crate) fn de_guardrail_output_content<'a, I>(
    3         -
    tokens: &mut ::std::iter::Peekable<I>,
    4         -
) -> ::std::result::Result<Option<crate::types::GuardrailOutputContent>, ::aws_smithy_json::deserialize::error::DeserializeError>
    5         -
where
    6         -
    I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
    7         -
{
    8         -
    match tokens.next().transpose()? {
    9         -
        Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
   10         -
        Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
   11         -
            #[allow(unused_mut)]
   12         -
            let mut builder = crate::types::builders::GuardrailOutputContentBuilder::default();
   13         -
            loop {
   14         -
                match tokens.next().transpose()? {
   15         -
                    Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   16         -
                    Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   17         -
                        "text" => {
   18         -
                            builder = builder.set_text(
   19         -
                                ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   20         -
                                    .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   21         -
                                    .transpose()?,
   22         -
                            );
   23         -
                        }
   24         -
                        _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   25         -
                    },
   26         -
                    other => {
   27         -
                        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   28         -
                            "expected object key or end object, found: {:?}",
   29         -
                            other
   30         -
                        )))
   31         -
                    }
   32         -
                }
   33         -
            }
   34         -
            Ok(Some(builder.build()))
   35         -
        }
   36         -
        _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   37         -
            "expected start object or null",
   38         -
        )),
   39         -
    }
   40         -
}

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_output_content_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_pii_entity_filter.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_pii_entity_filter_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_regex_filter.rs

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

tmp-codegen-diff/aws-sdk/sdk/bedrockruntime/src/protocol_serde/shape_guardrail_regex_filter_list.rs

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