AWS SDK

AWS SDK

rev. 163d4d6410694aaf071424777ecbecd050925f36

Files changed:

tmp-codegen-diff/aws-sdk/sdk/polly/src/operation/synthesize_speech/_synthesize_speech_input.rs

@@ -57,57 +342,342 @@
   77     77   
    "com.amazonaws.polly.synthetic",
   78     78   
    "SynthesizeSpeechInput",
   79     79   
);
   80     80   
static SYNTHESIZESPEECHINPUT_MEMBER_ENGINE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   81     81   
    ::aws_smithy_schema::ShapeId::from_static(
   82     82   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$Engine",
   83     83   
        "com.amazonaws.polly.synthetic",
   84     84   
        "SynthesizeSpeechInput",
   85     85   
    ),
   86     86   
    ::aws_smithy_schema::ShapeType::String,
   87         -
    "engine",
          87  +
    "Engine",
   88     88   
    0,
   89     89   
);
   90     90   
static SYNTHESIZESPEECHINPUT_MEMBER_LANGUAGE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   91     91   
    ::aws_smithy_schema::ShapeId::from_static(
   92     92   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$LanguageCode",
   93     93   
        "com.amazonaws.polly.synthetic",
   94     94   
        "SynthesizeSpeechInput",
   95     95   
    ),
   96     96   
    ::aws_smithy_schema::ShapeType::String,
   97         -
    "language_code",
          97  +
    "LanguageCode",
   98     98   
    1,
   99     99   
);
  100    100   
static SYNTHESIZESPEECHINPUT_MEMBER_LEXICON_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  101    101   
    ::aws_smithy_schema::ShapeId::from_static(
  102    102   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$LexiconNames",
  103    103   
        "com.amazonaws.polly.synthetic",
  104    104   
        "SynthesizeSpeechInput",
  105    105   
    ),
  106    106   
    ::aws_smithy_schema::ShapeType::List,
  107         -
    "lexicon_names",
         107  +
    "LexiconNames",
  108    108   
    2,
  109    109   
);
  110    110   
static SYNTHESIZESPEECHINPUT_MEMBER_OUTPUT_FORMAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  111    111   
    ::aws_smithy_schema::ShapeId::from_static(
  112    112   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$OutputFormat",
  113    113   
        "com.amazonaws.polly.synthetic",
  114    114   
        "SynthesizeSpeechInput",
  115    115   
    ),
  116    116   
    ::aws_smithy_schema::ShapeType::String,
  117         -
    "output_format",
         117  +
    "OutputFormat",
  118    118   
    3,
  119    119   
);
  120    120   
static SYNTHESIZESPEECHINPUT_MEMBER_SAMPLE_RATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  121    121   
    ::aws_smithy_schema::ShapeId::from_static(
  122    122   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$SampleRate",
  123    123   
        "com.amazonaws.polly.synthetic",
  124    124   
        "SynthesizeSpeechInput",
  125    125   
    ),
  126    126   
    ::aws_smithy_schema::ShapeType::String,
  127         -
    "sample_rate",
         127  +
    "SampleRate",
  128    128   
    4,
  129    129   
);
  130    130   
static SYNTHESIZESPEECHINPUT_MEMBER_SPEECH_MARK_TYPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  131    131   
    ::aws_smithy_schema::ShapeId::from_static(
  132    132   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$SpeechMarkTypes",
  133    133   
        "com.amazonaws.polly.synthetic",
  134    134   
        "SynthesizeSpeechInput",
  135    135   
    ),
  136    136   
    ::aws_smithy_schema::ShapeType::List,
  137         -
    "speech_mark_types",
         137  +
    "SpeechMarkTypes",
  138    138   
    5,
  139    139   
);
  140    140   
static SYNTHESIZESPEECHINPUT_MEMBER_TEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  141    141   
    ::aws_smithy_schema::ShapeId::from_static(
  142    142   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$Text",
  143    143   
        "com.amazonaws.polly.synthetic",
  144    144   
        "SynthesizeSpeechInput",
  145    145   
    ),
  146    146   
    ::aws_smithy_schema::ShapeType::String,
  147         -
    "text",
         147  +
    "Text",
  148    148   
    6,
  149    149   
);
  150    150   
static SYNTHESIZESPEECHINPUT_MEMBER_TEXT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  151    151   
    ::aws_smithy_schema::ShapeId::from_static(
  152    152   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$TextType",
  153    153   
        "com.amazonaws.polly.synthetic",
  154    154   
        "SynthesizeSpeechInput",
  155    155   
    ),
  156    156   
    ::aws_smithy_schema::ShapeType::String,
  157         -
    "text_type",
         157  +
    "TextType",
  158    158   
    7,
  159    159   
);
  160    160   
static SYNTHESIZESPEECHINPUT_MEMBER_VOICE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  161    161   
    ::aws_smithy_schema::ShapeId::from_static(
  162    162   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechInput$VoiceId",
  163    163   
        "com.amazonaws.polly.synthetic",
  164    164   
        "SynthesizeSpeechInput",
  165    165   
    ),
  166    166   
    ::aws_smithy_schema::ShapeType::String,
  167         -
    "voice_id",
         167  +
    "VoiceId",
  168    168   
    8,
  169    169   
);
  170    170   
static SYNTHESIZESPEECHINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  171    171   
    SYNTHESIZESPEECHINPUT_SCHEMA_ID,
  172    172   
    ::aws_smithy_schema::ShapeType::Structure,
  173    173   
    &[
  174    174   
        &SYNTHESIZESPEECHINPUT_MEMBER_ENGINE,
  175    175   
        &SYNTHESIZESPEECHINPUT_MEMBER_LANGUAGE_CODE,
  176    176   
        &SYNTHESIZESPEECHINPUT_MEMBER_LEXICON_NAMES,
  177    177   
        &SYNTHESIZESPEECHINPUT_MEMBER_OUTPUT_FORMAT,
  178    178   
        &SYNTHESIZESPEECHINPUT_MEMBER_SAMPLE_RATE,
  179    179   
        &SYNTHESIZESPEECHINPUT_MEMBER_SPEECH_MARK_TYPES,
  180    180   
        &SYNTHESIZESPEECHINPUT_MEMBER_TEXT,
  181    181   
        &SYNTHESIZESPEECHINPUT_MEMBER_TEXT_TYPE,
  182    182   
        &SYNTHESIZESPEECHINPUT_MEMBER_VOICE_ID,
  183    183   
    ],
  184         -
);
         184  +
)
         185  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/v1/speech", None));
  185    186   
impl SynthesizeSpeechInput {
  186    187   
    /// The schema for this shape.
  187    188   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SYNTHESIZESPEECHINPUT_SCHEMA;
  188    189   
}
  189    190   
impl ::aws_smithy_schema::serde::SerializableStruct for SynthesizeSpeechInput {
  190    191   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  191    192   
    fn serialize_members(
  192    193   
        &self,
  193    194   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  194    195   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  195    196   
        if let Some(ref val) = self.engine {
  196    197   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_ENGINE, val.as_str())?;
  197    198   
        }
  198    199   
        if let Some(ref val) = self.language_code {
  199    200   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_LANGUAGE_CODE, val.as_str())?;
  200    201   
        }
  201    202   
        if let Some(ref val) = self.lexicon_names {
  202    203   
            ser.write_list(
  203    204   
                &SYNTHESIZESPEECHINPUT_MEMBER_LEXICON_NAMES,
  204    205   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  205    206   
                    for item in val {
  206    207   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
  207    208   
                    }
  208    209   
                    Ok(())
  209    210   
                },
  210    211   
            )?;
  211    212   
        }
  212    213   
        if let Some(ref val) = self.output_format {
  213    214   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_OUTPUT_FORMAT, val.as_str())?;
  214    215   
        }
  215    216   
        if let Some(ref val) = self.sample_rate {
  216    217   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_SAMPLE_RATE, val)?;
  217    218   
        }
  218    219   
        if let Some(ref val) = self.speech_mark_types {
  219    220   
            ser.write_list(
  220    221   
                &SYNTHESIZESPEECHINPUT_MEMBER_SPEECH_MARK_TYPES,
  221    222   
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
  222    223   
                    for item in val {
  223    224   
                        ser.write_string(&aws_smithy_schema::prelude::STRING, item.as_str())?;
  224    225   
                    }
  225    226   
                    Ok(())
  226    227   
                },
  227    228   
            )?;
  228    229   
        }
  229    230   
        if let Some(ref val) = self.text {
  230    231   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_TEXT, val)?;
  231    232   
        }
  232    233   
        if let Some(ref val) = self.text_type {
  233    234   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_TEXT_TYPE, val.as_str())?;
  234    235   
        }
  235    236   
        if let Some(ref val) = self.voice_id {
  236    237   
            ser.write_string(&SYNTHESIZESPEECHINPUT_MEMBER_VOICE_ID, val.as_str())?;
  237    238   
        }
  238    239   
        Ok(())
  239    240   
    }
  240    241   
}
  241    242   
impl SynthesizeSpeechInput {
  242    243   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  243         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  244         -
        deserializer: &mut D,
         244  +
    pub fn deserialize(
         245  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  245    246   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  246    247   
        #[allow(unused_variables, unused_mut)]
  247    248   
        let mut builder = Self::builder();
  248    249   
        #[allow(
  249    250   
            unused_variables,
  250    251   
            unreachable_code,
  251    252   
            clippy::single_match,
  252    253   
            clippy::match_single_binding,
  253    254   
            clippy::diverging_sub_expression
  254    255   
        )]
  255         -
        deserializer.read_struct(&SYNTHESIZESPEECHINPUT_SCHEMA, (), |_, member, deser| {
         256  +
        deserializer.read_struct(&SYNTHESIZESPEECHINPUT_SCHEMA, &mut |member, deser| {
  256    257   
            match member.member_index() {
  257    258   
                Some(0) => {
  258    259   
                    builder.engine = Some(crate::types::Engine::from(deser.read_string(member)?.as_str()));
  259    260   
                }
  260    261   
                Some(1) => {
  261    262   
                    builder.language_code = Some(crate::types::LanguageCode::from(deser.read_string(member)?.as_str()));
  262    263   
                }
  263    264   
                Some(2) => {
  264         -
                    builder.lexicon_names = Some({
  265         -
                        let container = if let Some(cap) = deser.container_size() {
  266         -
                            Vec::with_capacity(cap)
  267         -
                        } else {
  268         -
                            Vec::new()
  269         -
                        };
  270         -
                        deser.read_list(member, container, |mut list, deser| {
  271         -
                            list.push(deser.read_string(member)?);
  272         -
                            Ok(list)
  273         -
                        })?
  274         -
                    });
         265  +
                    builder.lexicon_names = Some(deser.read_string_list(member)?);
  275    266   
                }
  276    267   
                Some(3) => {
  277    268   
                    builder.output_format = Some(crate::types::OutputFormat::from(deser.read_string(member)?.as_str()));
  278    269   
                }
  279    270   
                Some(4) => {
  280    271   
                    builder.sample_rate = Some(deser.read_string(member)?);
  281    272   
                }
  282    273   
                Some(5) => {
  283    274   
                    builder.speech_mark_types = Some({
  284         -
                        let container = if let Some(cap) = deser.container_size() {
  285         -
                            Vec::with_capacity(cap)
  286         -
                        } else {
  287         -
                            Vec::new()
  288         -
                        };
  289         -
                        deser.read_list(member, container, |mut list, deser| {
  290         -
                            list.push(crate::types::SpeechMarkType::from(deser.read_string(member)?.as_str()));
  291         -
                            Ok(list)
  292         -
                        })?
         275  +
                        let mut container = Vec::new();
         276  +
                        deser.read_list(member, &mut |deser| {
         277  +
                            container.push(crate::types::SpeechMarkType::from(deser.read_string(member)?.as_str()));
         278  +
                            Ok(())
         279  +
                        })?;
         280  +
                        container
  293    281   
                    });
  294    282   
                }
  295    283   
                Some(6) => {
  296    284   
                    builder.text = Some(deser.read_string(member)?);
  297    285   
                }
  298    286   
                Some(7) => {
  299    287   
                    builder.text_type = Some(crate::types::TextType::from(deser.read_string(member)?.as_str()));
  300    288   
                }
  301    289   
                Some(8) => {
  302    290   
                    builder.voice_id = Some(crate::types::VoiceId::from(deser.read_string(member)?.as_str()));
  303    291   
                }
  304    292   
                _ => {}
  305    293   
            }
  306    294   
            Ok(())
  307    295   
        })?;
         296  +
        builder.text = builder.text.or(Some(String::new()));
  308    297   
        builder
  309    298   
            .build()
  310    299   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  311    300   
    }
  312    301   
}
         302  +
impl SynthesizeSpeechInput {
         303  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         304  +
    pub fn deserialize_with_response(
         305  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         306  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         307  +
        _status: u16,
         308  +
        _body: &[u8],
         309  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         310  +
        Self::deserialize(deserializer)
         311  +
    }
         312  +
}
  313    313   
impl SynthesizeSpeechInput {
  314    314   
    /// Creates a new builder-style object to manufacture [`SynthesizeSpeechInput`](crate::operation::synthesize_speech::SynthesizeSpeechInput).
  315    315   
    pub fn builder() -> crate::operation::synthesize_speech::builders::SynthesizeSpeechInputBuilder {
  316    316   
        crate::operation::synthesize_speech::builders::SynthesizeSpeechInputBuilder::default()
  317    317   
    }
  318    318   
}
  319    319   
  320    320   
/// A builder for [`SynthesizeSpeechInput`](crate::operation::synthesize_speech::SynthesizeSpeechInput).
  321    321   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  322    322   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/polly/src/operation/synthesize_speech/_synthesize_speech_output.rs

@@ -32,32 +178,230 @@
   52     52   
    "com.amazonaws.polly.synthetic",
   53     53   
    "SynthesizeSpeechOutput",
   54     54   
);
   55     55   
static SYNTHESIZESPEECHOUTPUT_MEMBER_AUDIO_STREAM: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   56     56   
    ::aws_smithy_schema::ShapeId::from_static(
   57     57   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechOutput$AudioStream",
   58     58   
        "com.amazonaws.polly.synthetic",
   59     59   
        "SynthesizeSpeechOutput",
   60     60   
    ),
   61     61   
    ::aws_smithy_schema::ShapeType::Blob,
   62         -
    "audio_stream",
          62  +
    "AudioStream",
   63     63   
    0,
   64     64   
)
   65     65   
.with_http_payload();
   66     66   
static SYNTHESIZESPEECHOUTPUT_MEMBER_CONTENT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   67     67   
    ::aws_smithy_schema::ShapeId::from_static(
   68     68   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechOutput$ContentType",
   69     69   
        "com.amazonaws.polly.synthetic",
   70     70   
        "SynthesizeSpeechOutput",
   71     71   
    ),
   72     72   
    ::aws_smithy_schema::ShapeType::String,
   73         -
    "content_type",
          73  +
    "ContentType",
   74     74   
    1,
   75     75   
)
   76     76   
.with_http_header("Content-Type");
   77     77   
static SYNTHESIZESPEECHOUTPUT_MEMBER_REQUEST_CHARACTERS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   78     78   
    ::aws_smithy_schema::ShapeId::from_static(
   79     79   
        "com.amazonaws.polly.synthetic#SynthesizeSpeechOutput$RequestCharacters",
   80     80   
        "com.amazonaws.polly.synthetic",
   81     81   
        "SynthesizeSpeechOutput",
   82     82   
    ),
   83     83   
    ::aws_smithy_schema::ShapeType::Integer,
   84         -
    "request_characters",
          84  +
    "RequestCharacters",
   85     85   
    2,
   86     86   
)
   87     87   
.with_http_header("x-amzn-RequestCharacters");
          88  +
static SYNTHESIZESPEECHOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          89  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          90  +
    ::aws_smithy_schema::ShapeType::String,
          91  +
    "request_id",
          92  +
    3,
          93  +
)
          94  +
.with_http_header("x-amzn-requestid");
   88     95   
static SYNTHESIZESPEECHOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   89     96   
    SYNTHESIZESPEECHOUTPUT_SCHEMA_ID,
   90     97   
    ::aws_smithy_schema::ShapeType::Structure,
   91     98   
    &[
   92     99   
        &SYNTHESIZESPEECHOUTPUT_MEMBER_AUDIO_STREAM,
   93    100   
        &SYNTHESIZESPEECHOUTPUT_MEMBER_CONTENT_TYPE,
   94    101   
        &SYNTHESIZESPEECHOUTPUT_MEMBER_REQUEST_CHARACTERS,
         102  +
        &SYNTHESIZESPEECHOUTPUT_MEMBER__REQUEST_ID,
   95    103   
    ],
   96    104   
);
   97    105   
impl SynthesizeSpeechOutput {
   98    106   
    /// The schema for this shape.
   99    107   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &SYNTHESIZESPEECHOUTPUT_SCHEMA;
  100    108   
}
  101    109   
impl ::aws_smithy_schema::serde::SerializableStruct for SynthesizeSpeechOutput {
  102    110   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  103    111   
    fn serialize_members(
  104    112   
        &self,
  105    113   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  106    114   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
  107         -
        {
  108         -
            let val = &self.audio_stream;
  109         -
            // streaming blob is serialized as the HTTP body by the protocol, not the codec
  110         -
        }
  111    115   
        if let Some(ref val) = self.content_type {
  112    116   
            ser.write_string(&SYNTHESIZESPEECHOUTPUT_MEMBER_CONTENT_TYPE, val)?;
  113    117   
        }
  114    118   
        {
  115    119   
            let val = &self.request_characters;
  116    120   
            ser.write_integer(&SYNTHESIZESPEECHOUTPUT_MEMBER_REQUEST_CHARACTERS, *val)?;
  117    121   
        }
  118    122   
        Ok(())
  119    123   
    }
  120    124   
}
  121    125   
impl SynthesizeSpeechOutput {
  122    126   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  123         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  124         -
        deserializer: &mut D,
         127  +
    pub fn deserialize(
         128  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  125    129   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  126    130   
        #[allow(unused_variables, unused_mut)]
  127    131   
        let mut builder = Self::builder();
  128    132   
        #[allow(
  129    133   
            unused_variables,
  130    134   
            unreachable_code,
  131    135   
            clippy::single_match,
  132    136   
            clippy::match_single_binding,
  133    137   
            clippy::diverging_sub_expression
  134    138   
        )]
  135         -
        deserializer.read_struct(&SYNTHESIZESPEECHOUTPUT_SCHEMA, (), |_, member, deser| {
         139  +
        deserializer.read_struct(&SYNTHESIZESPEECHOUTPUT_SCHEMA, &mut |member, deser| {
  136    140   
            match member.member_index() {
  137    141   
                Some(0) => {
  138    142   
                    builder.audio_stream = Some({
  139    143   
                        let _ = member;
  140    144   
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
  141    145   
                    });
  142    146   
                }
  143    147   
                Some(1) => {
  144    148   
                    builder.content_type = Some(deser.read_string(member)?);
  145    149   
                }
  146    150   
                Some(2) => {
  147    151   
                    builder.request_characters = Some(deser.read_integer(member)?);
  148    152   
                }
         153  +
                Some(3) => {
         154  +
                    builder._request_id = Some(deser.read_string(member)?);
         155  +
                }
         156  +
                _ => {}
         157  +
            }
         158  +
            Ok(())
         159  +
        })?;
         160  +
        Ok(builder.build())
         161  +
    }
         162  +
}
         163  +
impl SynthesizeSpeechOutput {
         164  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         165  +
    /// Header-bound members are read directly from headers, avoiding runtime
         166  +
    /// member iteration overhead. Body members are read via the deserializer.
         167  +
    pub fn deserialize_with_response(
         168  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         169  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         170  +
        _status: u16,
         171  +
        _body: &[u8],
         172  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         173  +
        #[allow(unused_variables, unused_mut)]
         174  +
        let mut builder = Self::builder();
         175  +
        if let Some(val) = headers.get("Content-Type") {
         176  +
            builder.content_type = Some(val.to_string());
         177  +
        }
         178  +
        if let Some(val) = headers.get("x-amzn-RequestCharacters") {
         179  +
            builder.request_characters = val.parse::<i32>().ok();
         180  +
        }
         181  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         182  +
            builder._request_id = Some(val.to_string());
         183  +
        }
         184  +
        #[allow(
         185  +
            unused_variables,
         186  +
            unreachable_code,
         187  +
            clippy::single_match,
         188  +
            clippy::match_single_binding,
         189  +
            clippy::diverging_sub_expression
         190  +
        )]
         191  +
        deserializer.read_struct(&SYNTHESIZESPEECHOUTPUT_SCHEMA, &mut |member, deser| {
         192  +
            match member.member_index() {
         193  +
                Some(0) => {
         194  +
                    builder.audio_stream = Some({
         195  +
                        let _ = member;
         196  +
                        ::aws_smithy_types::byte_stream::ByteStream::new(::aws_smithy_types::body::SdkBody::empty())
         197  +
                    });
         198  +
                }
         199  +
                Some(1) => { /* read from headers above */ }
         200  +
                Some(2) => { /* read from headers above */ }
  149    201   
                _ => {}
  150    202   
            }
  151    203   
            Ok(())
  152    204   
        })?;
  153    205   
        Ok(builder.build())
  154    206   
    }
  155    207   
}
  156    208   
impl ::aws_types::request_id::RequestId for SynthesizeSpeechOutput {
  157    209   
    fn request_id(&self) -> Option<&str> {
  158    210   
        self._request_id.as_deref()

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde.rs

@@ -1,1 +124,0 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub fn parse_http_error_metadata(
           3  +
    _response_status: u16,
           4  +
    response_headers: &::aws_smithy_runtime_api::http::Headers,
           5  +
    response_body: &[u8],
           6  +
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
           7  +
    crate::json_errors::parse_error_metadata(response_body, response_headers)
           8  +
}
           9  +
    2     10   
pub(crate) fn type_erase_result<O, E>(
    3     11   
    result: ::std::result::Result<O, E>,
    4     12   
) -> ::std::result::Result<
    5     13   
    ::aws_smithy_runtime_api::client::interceptors::context::Output,
    6     14   
    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError<::aws_smithy_runtime_api::client::interceptors::context::Error>,
    7     15   
>
    8     16   
where
    9     17   
    O: ::std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   10     18   
    E: ::std::error::Error + std::fmt::Debug + ::std::marker::Send + ::std::marker::Sync + 'static,
   11     19   
{
   12     20   
    result
   13     21   
        .map(|output| ::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
   14     22   
        .map_err(|error| ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(error))
   15     23   
        .map_err(::std::convert::Into::into)
   16     24   
}
   17     25   
   18         -
pub fn parse_http_error_metadata(
   19         -
    _response_status: u16,
   20         -
    response_headers: &::aws_smithy_runtime_api::http::Headers,
   21         -
    response_body: &[u8],
   22         -
) -> ::std::result::Result<::aws_smithy_types::error::metadata::Builder, ::aws_smithy_json::deserialize::error::DeserializeError> {
   23         -
    crate::json_errors::parse_error_metadata(response_body, response_headers)
   24         -
}
   25         -
   26         -
pub(crate) mod shape_delete_lexicon;
   27         -
   28         -
pub(crate) mod shape_describe_voices;
   29         -
   30         -
pub(crate) mod shape_get_lexicon;
   31         -
   32         -
pub(crate) mod shape_get_speech_synthesis_task;
   33         -
   34         -
pub(crate) mod shape_list_lexicons;
   35         -
   36         -
pub(crate) mod shape_list_speech_synthesis_tasks;
   37         -
   38         -
pub(crate) mod shape_put_lexicon;
   39         -
   40         -
pub(crate) mod shape_start_speech_synthesis_task;
   41         -
   42     26   
pub(crate) mod shape_synthesize_speech;
   43     27   
   44         -
pub(crate) fn or_empty_doc(data: &[u8]) -> &[u8] {
   45         -
    if data.is_empty() {
   46         -
        b"{}"
   47         -
    } else {
   48         -
        data
   49         -
    }
   50         -
}
   51         -
   52         -
pub(crate) mod shape_engine_not_supported_exception;
   53         -
   54         -
pub(crate) mod shape_invalid_lexicon_exception;
   55         -
   56         -
pub(crate) mod shape_invalid_next_token_exception;
   57         -
   58         -
pub(crate) mod shape_invalid_s3_bucket_exception;
   59         -
   60         -
pub(crate) mod shape_invalid_s3_key_exception;
   61         -
   62         -
pub(crate) mod shape_invalid_sample_rate_exception;
   63         -
   64         -
pub(crate) mod shape_invalid_sns_topic_arn_exception;
   65         -
   66         -
pub(crate) mod shape_invalid_ssml_exception;
   67         -
   68         -
pub(crate) mod shape_invalid_task_id_exception;
   69         -
   70         -
pub(crate) mod shape_language_not_supported_exception;
   71         -
   72         -
pub(crate) mod shape_lexicon_not_found_exception;
   73         -
   74         -
pub(crate) mod shape_lexicon_size_exceeded_exception;
   75         -
   76         -
pub(crate) mod shape_marks_not_supported_for_format_exception;
   77         -
   78         -
pub(crate) mod shape_max_lexeme_length_exceeded_exception;
   79         -
   80         -
pub(crate) mod shape_max_lexicons_number_exceeded_exception;
   81         -
   82         -
pub(crate) mod shape_put_lexicon_input;
   83         -
   84         -
pub(crate) mod shape_service_failure_exception;
   85         -
   86         -
pub(crate) mod shape_ssml_marks_not_supported_for_text_type_exception;
   87         -
   88         -
pub(crate) mod shape_start_speech_synthesis_task_input;
   89         -
   90         -
pub(crate) mod shape_synthesis_task_not_found_exception;
   91         -
   92         -
pub(crate) mod shape_synthesize_speech_input;
   93         -
   94     28   
pub(crate) mod shape_synthesize_speech_output;
   95         -
   96         -
pub(crate) mod shape_text_length_exceeded_exception;
   97         -
   98         -
pub(crate) mod shape_unsupported_pls_alphabet_exception;
   99         -
  100         -
pub(crate) mod shape_unsupported_pls_language_exception;
  101         -
  102         -
pub(crate) mod shape_lexicon;
  103         -
  104         -
pub(crate) mod shape_lexicon_attributes;
  105         -
  106         -
pub(crate) mod shape_lexicon_description_list;
  107         -
  108         -
pub(crate) mod shape_synthesis_task;
  109         -
  110         -
pub(crate) mod shape_synthesis_tasks;
  111         -
  112         -
pub(crate) mod shape_voice_list;
  113         -
  114         -
pub(crate) mod shape_lexicon_description;
  115         -
  116         -
pub(crate) mod shape_lexicon_name_list;
  117         -
  118         -
pub(crate) mod shape_speech_mark_type_list;
  119         -
  120         -
pub(crate) mod shape_voice;
  121         -
  122         -
pub(crate) mod shape_engine_list;
  123         -
  124         -
pub(crate) mod shape_language_code_list;

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_delete_lexicon.rs

@@ -1,0 +66,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_delete_lexicon_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::delete_lexicon::DeleteLexiconOutput, crate::operation::delete_lexicon::DeleteLexiconError> {
    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::delete_lexicon::DeleteLexiconError::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::delete_lexicon::DeleteLexiconError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "LexiconNotFoundException" => crate::operation::delete_lexicon::DeleteLexiconError::LexiconNotFoundException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::LexiconNotFoundExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_lexicon_not_found_exception::de_lexicon_not_found_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::delete_lexicon::DeleteLexiconError::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         -
        "ServiceFailureException" => crate::operation::delete_lexicon::DeleteLexiconError::ServiceFailureException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::delete_lexicon::DeleteLexiconError::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         -
        _ => crate::operation::delete_lexicon::DeleteLexiconError::generic(generic),
   51         -
    })
   52         -
}
   53         -
   54         -
#[allow(clippy::unnecessary_wraps)]
   55         -
pub fn de_delete_lexicon_http_response(
   56         -
    _response_status: u16,
   57         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   58         -
    _response_body: &[u8],
   59         -
) -> std::result::Result<crate::operation::delete_lexicon::DeleteLexiconOutput, crate::operation::delete_lexicon::DeleteLexiconError> {
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::delete_lexicon::builders::DeleteLexiconOutputBuilder::default();
   63         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   64         -
        output.build()
   65         -
    })
   66         -
}

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_describe_voices.rs

@@ -1,0 +109,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_voices_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_voices::DescribeVoicesOutput, crate::operation::describe_voices::DescribeVoicesError> {
    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_voices::DescribeVoicesError::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_voices::DescribeVoicesError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "InvalidNextTokenException" => crate::operation::describe_voices::DescribeVoicesError::InvalidNextTokenException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::InvalidNextTokenExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_invalid_next_token_exception::de_invalid_next_token_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::describe_voices::DescribeVoicesError::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         -
        "ServiceFailureException" => crate::operation::describe_voices::DescribeVoicesError::ServiceFailureException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::describe_voices::DescribeVoicesError::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         -
        _ => crate::operation::describe_voices::DescribeVoicesError::generic(generic),
   51         -
    })
   52         -
}
   53         -
   54         -
#[allow(clippy::unnecessary_wraps)]
   55         -
pub fn de_describe_voices_http_response(
   56         -
    _response_status: u16,
   57         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   58         -
    _response_body: &[u8],
   59         -
) -> std::result::Result<crate::operation::describe_voices::DescribeVoicesOutput, crate::operation::describe_voices::DescribeVoicesError> {
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::describe_voices::builders::DescribeVoicesOutputBuilder::default();
   63         -
        output = crate::protocol_serde::shape_describe_voices::de_describe_voices(_response_body, output)
   64         -
            .map_err(crate::operation::describe_voices::DescribeVoicesError::unhandled)?;
   65         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   66         -
        output.build()
   67         -
    })
   68         -
}
   69         -
   70         -
pub(crate) fn de_describe_voices(
   71         -
    _value: &[u8],
   72         -
    mut builder: crate::operation::describe_voices::builders::DescribeVoicesOutputBuilder,
   73         -
) -> ::std::result::Result<
   74         -
    crate::operation::describe_voices::builders::DescribeVoicesOutputBuilder,
   75         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
   76         -
> {
   77         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   78         -
    let tokens = &mut tokens_owned;
   79         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   80         -
    loop {
   81         -
        match tokens.next().transpose()? {
   82         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   83         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   84         -
                "NextToken" => {
   85         -
                    builder = builder.set_next_token(
   86         -
                        ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
   87         -
                            .map(|s| s.to_unescaped().map(|u| u.into_owned()))
   88         -
                            .transpose()?,
   89         -
                    );
   90         -
                }
   91         -
                "Voices" => {
   92         -
                    builder = builder.set_voices(crate::protocol_serde::shape_voice_list::de_voice_list(tokens, _value)?);
   93         -
                }
   94         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   95         -
            },
   96         -
            other => {
   97         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   98         -
                    "expected object key or end object, found: {other:?}"
   99         -
                )))
  100         -
            }
  101         -
        }
  102         -
    }
  103         -
    if tokens.next().is_some() {
  104         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
  105         -
            "found more JSON tokens after completing parsing",
  106         -
        ));
  107         -
    }
  108         -
    Ok(builder)
  109         -
}

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_engine_list.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_engine_not_supported_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_get_lexicon.rs

@@ -1,0 +103,0 @@
    1         -
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2         -
#[allow(clippy::unnecessary_wraps)]
    3         -
pub fn de_get_lexicon_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<crate::operation::get_lexicon::GetLexiconOutput, crate::operation::get_lexicon::GetLexiconError> {
    8         -
    #[allow(unused_mut)]
    9         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   10         -
        .map_err(crate::operation::get_lexicon::GetLexiconError::unhandled)?;
   11         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   12         -
    let generic = generic_builder.build();
   13         -
    let error_code = match generic.code() {
   14         -
        Some(code) => code,
   15         -
        None => return Err(crate::operation::get_lexicon::GetLexiconError::unhandled(generic)),
   16         -
    };
   17         -
   18         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   19         -
    Err(match error_code {
   20         -
        "LexiconNotFoundException" => crate::operation::get_lexicon::GetLexiconError::LexiconNotFoundException({
   21         -
            #[allow(unused_mut)]
   22         -
            let mut tmp = {
   23         -
                #[allow(unused_mut)]
   24         -
                let mut output = crate::types::error::builders::LexiconNotFoundExceptionBuilder::default();
   25         -
                output = crate::protocol_serde::shape_lexicon_not_found_exception::de_lexicon_not_found_exception_json_err(_response_body, output)
   26         -
                    .map_err(crate::operation::get_lexicon::GetLexiconError::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         -
        "ServiceFailureException" => crate::operation::get_lexicon::GetLexiconError::ServiceFailureException({
   36         -
            #[allow(unused_mut)]
   37         -
            let mut tmp = {
   38         -
                #[allow(unused_mut)]
   39         -
                let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
   40         -
                output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_json_err(_response_body, output)
   41         -
                    .map_err(crate::operation::get_lexicon::GetLexiconError::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         -
        _ => crate::operation::get_lexicon::GetLexiconError::generic(generic),
   51         -
    })
   52         -
}
   53         -
   54         -
#[allow(clippy::unnecessary_wraps)]
   55         -
pub fn de_get_lexicon_http_response(
   56         -
    _response_status: u16,
   57         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
   58         -
    _response_body: &[u8],
   59         -
) -> std::result::Result<crate::operation::get_lexicon::GetLexiconOutput, crate::operation::get_lexicon::GetLexiconError> {
   60         -
    Ok({
   61         -
        #[allow(unused_mut)]
   62         -
        let mut output = crate::operation::get_lexicon::builders::GetLexiconOutputBuilder::default();
   63         -
        output = crate::protocol_serde::shape_get_lexicon::de_get_lexicon(_response_body, output)
   64         -
            .map_err(crate::operation::get_lexicon::GetLexiconError::unhandled)?;
   65         -
        output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
   66         -
        output.build()
   67         -
    })
   68         -
}
   69         -
   70         -
pub(crate) fn de_get_lexicon(
   71         -
    _value: &[u8],
   72         -
    mut builder: crate::operation::get_lexicon::builders::GetLexiconOutputBuilder,
   73         -
) -> ::std::result::Result<crate::operation::get_lexicon::builders::GetLexiconOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
   74         -
{
   75         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
   76         -
    let tokens = &mut tokens_owned;
   77         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
   78         -
    loop {
   79         -
        match tokens.next().transpose()? {
   80         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
   81         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
   82         -
                "Lexicon" => {
   83         -
                    builder = builder.set_lexicon(crate::protocol_serde::shape_lexicon::de_lexicon(tokens, _value)?);
   84         -
                }
   85         -
                "LexiconAttributes" => {
   86         -
                    builder = builder.set_lexicon_attributes(crate::protocol_serde::shape_lexicon_attributes::de_lexicon_attributes(tokens, _value)?);
   87         -
                }
   88         -
                _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
   89         -
            },
   90         -
            other => {
   91         -
                return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
   92         -
                    "expected object key or end object, found: {other:?}"
   93         -
                )))
   94         -
            }
   95         -
        }
   96         -
    }
   97         -
    if tokens.next().is_some() {
   98         -
        return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
   99         -
            "found more JSON tokens after completing parsing",
  100         -
        ));
  101         -
    }
  102         -
    Ok(builder)
  103         -
}

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_get_speech_synthesis_task.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_get_speech_synthesis_task_http_error(
    4         -
    _response_status: u16,
    5         -
    _response_headers: &::aws_smithy_runtime_api::http::Headers,
    6         -
    _response_body: &[u8],
    7         -
) -> std::result::Result<
    8         -
    crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskOutput,
    9         -
    crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError,
   10         -
> {
   11         -
    #[allow(unused_mut)]
   12         -
    let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
   13         -
        .map_err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::unhandled)?;
   14         -
    generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
   15         -
    let generic = generic_builder.build();
   16         -
    let error_code = match generic.code() {
   17         -
        Some(code) => code,
   18         -
        None => {
   19         -
            return Err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::unhandled(
   20         -
                generic,
   21         -
            ))
   22         -
        }
   23         -
    };
   24         -
   25         -
    let _error_message = generic.message().map(|msg| msg.to_owned());
   26         -
    Err(match error_code {
   27         -
        "InvalidTaskIdException" => crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::InvalidTaskIdException({
   28         -
            #[allow(unused_mut)]
   29         -
            let mut tmp = {
   30         -
                #[allow(unused_mut)]
   31         -
                let mut output = crate::types::error::builders::InvalidTaskIdExceptionBuilder::default();
   32         -
                output = crate::protocol_serde::shape_invalid_task_id_exception::de_invalid_task_id_exception_json_err(_response_body, output)
   33         -
                    .map_err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::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         -
        "ServiceFailureException" => crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::ServiceFailureException({
   43         -
            #[allow(unused_mut)]
   44         -
            let mut tmp = {
   45         -
                #[allow(unused_mut)]
   46         -
                let mut output = crate::types::error::builders::ServiceFailureExceptionBuilder::default();
   47         -
                output = crate::protocol_serde::shape_service_failure_exception::de_service_failure_exception_json_err(_response_body, output)
   48         -
                    .map_err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::unhandled)?;
   49         -
                let output = output.meta(generic);
   50         -
                output.build()
   51         -
            };
   52         -
            if tmp.message.is_none() {
   53         -
                tmp.message = _error_message;
   54         -
            }
   55         -
            tmp
   56         -
        }),
   57         -
        "SynthesisTaskNotFoundException" => {
   58         -
            crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::SynthesisTaskNotFoundException({
   59         -
                #[allow(unused_mut)]
   60         -
                let mut tmp = {
   61         -
                    #[allow(unused_mut)]
   62         -
                    let mut output = crate::types::error::builders::SynthesisTaskNotFoundExceptionBuilder::default();
   63         -
                    output = crate::protocol_serde::shape_synthesis_task_not_found_exception::de_synthesis_task_not_found_exception_json_err(
   64         -
                        _response_body,
   65         -
                        output,
   66         -
                    )
   67         -
                    .map_err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::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::get_speech_synthesis_task::GetSpeechSynthesisTaskError::generic(generic),
   78         -
    })
   79         -
}
   80         -
   81         -
#[allow(clippy::unnecessary_wraps)]
   82         -
pub fn de_get_speech_synthesis_task_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::get_speech_synthesis_task::GetSpeechSynthesisTaskOutput,
   88         -
    crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError,
   89         -
> {
   90         -
    Ok({
   91         -
        #[allow(unused_mut)]
   92         -
        let mut output = crate::operation::get_speech_synthesis_task::builders::GetSpeechSynthesisTaskOutputBuilder::default();
   93         -
        output = crate::protocol_serde::shape_get_speech_synthesis_task::de_get_speech_synthesis_task(_response_body, output)
   94         -
            .map_err(crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::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(crate) fn de_get_speech_synthesis_task(
  101         -
    _value: &[u8],
  102         -
    mut builder: crate::operation::get_speech_synthesis_task::builders::GetSpeechSynthesisTaskOutputBuilder,
  103         -
) -> ::std::result::Result<
  104         -
    crate::operation::get_speech_synthesis_task::builders::GetSpeechSynthesisTaskOutputBuilder,
  105         -
    ::aws_smithy_json::deserialize::error::DeserializeError,
  106         -
> {
  107         -
    let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable();
  108         -
    let tokens = &mut tokens_owned;
  109         -
    ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
  110         -
    loop {
  111         -
        match tokens.next().transpose()? {
  112         -
            Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
  113         -
            Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
  114         -
                "SynthesisTask" => {
  115         -
                    builder = builder.set_synthesis_task(crate::protocol_serde::shape_synthesis_task::de_synthesis_task(tokens, _value)?);
  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/polly/src/protocol_serde/shape_invalid_lexicon_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_next_token_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_s3_bucket_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_s3_key_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_sample_rate_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_sns_topic_arn_exception.rs

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

tmp-codegen-diff/aws-sdk/sdk/polly/src/protocol_serde/shape_invalid_ssml_exception.rs

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