AWS SDK

AWS SDK

rev. 96f5a1b4ad139d2f1ad1e8e40f300e1cd1ff574c

Files changed:

tmp-codegen-diff/aws-sdk/sdk/polly/src/operation/start_speech_synthesis_task/_start_speech_synthesis_task_input.rs

@@ -73,73 +263,264 @@
   93     93   
    "com.amazonaws.polly.synthetic",
   94     94   
    "StartSpeechSynthesisTaskInput",
   95     95   
);
   96     96   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_ENGINE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   97     97   
    ::aws_smithy_schema::ShapeId::from_static(
   98     98   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$Engine",
   99     99   
        "com.amazonaws.polly.synthetic",
  100    100   
        "StartSpeechSynthesisTaskInput",
  101    101   
    ),
  102    102   
    ::aws_smithy_schema::ShapeType::String,
  103         -
    "engine",
         103  +
    "Engine",
  104    104   
    0,
  105    105   
);
  106    106   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_LANGUAGE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  107    107   
    ::aws_smithy_schema::ShapeId::from_static(
  108    108   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$LanguageCode",
  109    109   
        "com.amazonaws.polly.synthetic",
  110    110   
        "StartSpeechSynthesisTaskInput",
  111    111   
    ),
  112    112   
    ::aws_smithy_schema::ShapeType::String,
  113         -
    "language_code",
         113  +
    "LanguageCode",
  114    114   
    1,
  115    115   
);
  116    116   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_LEXICON_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  117    117   
    ::aws_smithy_schema::ShapeId::from_static(
  118    118   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$LexiconNames",
  119    119   
        "com.amazonaws.polly.synthetic",
  120    120   
        "StartSpeechSynthesisTaskInput",
  121    121   
    ),
  122    122   
    ::aws_smithy_schema::ShapeType::List,
  123         -
    "lexicon_names",
         123  +
    "LexiconNames",
  124    124   
    2,
  125    125   
);
  126    126   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_FORMAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  127    127   
    ::aws_smithy_schema::ShapeId::from_static(
  128    128   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$OutputFormat",
  129    129   
        "com.amazonaws.polly.synthetic",
  130    130   
        "StartSpeechSynthesisTaskInput",
  131    131   
    ),
  132    132   
    ::aws_smithy_schema::ShapeType::String,
  133         -
    "output_format",
         133  +
    "OutputFormat",
  134    134   
    3,
  135    135   
);
  136    136   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_S3_BUCKET_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  137    137   
    ::aws_smithy_schema::ShapeId::from_static(
  138    138   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$OutputS3BucketName",
  139    139   
        "com.amazonaws.polly.synthetic",
  140    140   
        "StartSpeechSynthesisTaskInput",
  141    141   
    ),
  142    142   
    ::aws_smithy_schema::ShapeType::String,
  143         -
    "output_s3_bucket_name",
         143  +
    "OutputS3BucketName",
  144    144   
    4,
  145    145   
);
  146    146   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_S3_KEY_PREFIX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  147    147   
    ::aws_smithy_schema::ShapeId::from_static(
  148    148   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$OutputS3KeyPrefix",
  149    149   
        "com.amazonaws.polly.synthetic",
  150    150   
        "StartSpeechSynthesisTaskInput",
  151    151   
    ),
  152    152   
    ::aws_smithy_schema::ShapeType::String,
  153         -
    "output_s3_key_prefix",
         153  +
    "OutputS3KeyPrefix",
  154    154   
    5,
  155    155   
);
  156    156   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SAMPLE_RATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  157    157   
    ::aws_smithy_schema::ShapeId::from_static(
  158    158   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$SampleRate",
  159    159   
        "com.amazonaws.polly.synthetic",
  160    160   
        "StartSpeechSynthesisTaskInput",
  161    161   
    ),
  162    162   
    ::aws_smithy_schema::ShapeType::String,
  163         -
    "sample_rate",
         163  +
    "SampleRate",
  164    164   
    6,
  165    165   
);
  166    166   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SNS_TOPIC_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  167    167   
    ::aws_smithy_schema::ShapeId::from_static(
  168    168   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$SnsTopicArn",
  169    169   
        "com.amazonaws.polly.synthetic",
  170    170   
        "StartSpeechSynthesisTaskInput",
  171    171   
    ),
  172    172   
    ::aws_smithy_schema::ShapeType::String,
  173         -
    "sns_topic_arn",
         173  +
    "SnsTopicArn",
  174    174   
    7,
  175    175   
);
  176    176   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SPEECH_MARK_TYPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  177    177   
    ::aws_smithy_schema::ShapeId::from_static(
  178    178   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$SpeechMarkTypes",
  179    179   
        "com.amazonaws.polly.synthetic",
  180    180   
        "StartSpeechSynthesisTaskInput",
  181    181   
    ),
  182    182   
    ::aws_smithy_schema::ShapeType::List,
  183         -
    "speech_mark_types",
         183  +
    "SpeechMarkTypes",
  184    184   
    8,
  185    185   
);
  186    186   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_TEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  187    187   
    ::aws_smithy_schema::ShapeId::from_static(
  188    188   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$Text",
  189    189   
        "com.amazonaws.polly.synthetic",
  190    190   
        "StartSpeechSynthesisTaskInput",
  191    191   
    ),
  192    192   
    ::aws_smithy_schema::ShapeType::String,
  193         -
    "text",
         193  +
    "Text",
  194    194   
    9,
  195    195   
);
  196    196   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_TEXT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  197    197   
    ::aws_smithy_schema::ShapeId::from_static(
  198    198   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$TextType",
  199    199   
        "com.amazonaws.polly.synthetic",
  200    200   
        "StartSpeechSynthesisTaskInput",
  201    201   
    ),
  202    202   
    ::aws_smithy_schema::ShapeType::String,
  203         -
    "text_type",
         203  +
    "TextType",
  204    204   
    10,
  205    205   
);
  206    206   
static STARTSPEECHSYNTHESISTASKINPUT_MEMBER_VOICE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
  207    207   
    ::aws_smithy_schema::ShapeId::from_static(
  208    208   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskInput$VoiceId",
  209    209   
        "com.amazonaws.polly.synthetic",
  210    210   
        "StartSpeechSynthesisTaskInput",
  211    211   
    ),
  212    212   
    ::aws_smithy_schema::ShapeType::String,
  213         -
    "voice_id",
         213  +
    "VoiceId",
  214    214   
    11,
  215    215   
);
  216    216   
static STARTSPEECHSYNTHESISTASKINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
  217    217   
    STARTSPEECHSYNTHESISTASKINPUT_SCHEMA_ID,
  218    218   
    ::aws_smithy_schema::ShapeType::Structure,
  219    219   
    &[
  220    220   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_ENGINE,
  221    221   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_LANGUAGE_CODE,
  222    222   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_LEXICON_NAMES,
  223    223   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_FORMAT,
  224    224   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_S3_BUCKET_NAME,
  225    225   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_OUTPUT_S3_KEY_PREFIX,
  226    226   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SAMPLE_RATE,
  227    227   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SNS_TOPIC_ARN,
  228    228   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_SPEECH_MARK_TYPES,
  229    229   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_TEXT,
  230    230   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_TEXT_TYPE,
  231    231   
        &STARTSPEECHSYNTHESISTASKINPUT_MEMBER_VOICE_ID,
  232    232   
    ],
  233         -
);
         233  +
)
         234  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/v1/synthesisTasks", None));
  234    235   
impl StartSpeechSynthesisTaskInput {
  235    236   
    /// The schema for this shape.
  236    237   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STARTSPEECHSYNTHESISTASKINPUT_SCHEMA;
  237    238   
}
  238    239   
impl ::aws_smithy_schema::serde::SerializableStruct for StartSpeechSynthesisTaskInput {
  239    240   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
  240    241   
    fn serialize_members(
  241    242   
        &self,
  242    243   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
  243    244   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
@@ -271,272 +409,410 @@
  291    292   
            ser.write_string(&STARTSPEECHSYNTHESISTASKINPUT_MEMBER_TEXT_TYPE, val.as_str())?;
  292    293   
        }
  293    294   
        if let Some(ref val) = self.voice_id {
  294    295   
            ser.write_string(&STARTSPEECHSYNTHESISTASKINPUT_MEMBER_VOICE_ID, val.as_str())?;
  295    296   
        }
  296    297   
        Ok(())
  297    298   
    }
  298    299   
}
  299    300   
impl StartSpeechSynthesisTaskInput {
  300    301   
    /// Deserializes this structure from a [`ShapeDeserializer`].
  301         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
  302         -
        deserializer: &mut D,
         302  +
    pub fn deserialize(
         303  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
  303    304   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
  304    305   
        #[allow(unused_variables, unused_mut)]
  305    306   
        let mut builder = Self::builder();
  306    307   
        #[allow(
  307    308   
            unused_variables,
  308    309   
            unreachable_code,
  309    310   
            clippy::single_match,
  310    311   
            clippy::match_single_binding,
  311    312   
            clippy::diverging_sub_expression
  312    313   
        )]
  313         -
        deserializer.read_struct(&STARTSPEECHSYNTHESISTASKINPUT_SCHEMA, (), |_, member, deser| {
         314  +
        deserializer.read_struct(&STARTSPEECHSYNTHESISTASKINPUT_SCHEMA, &mut |member, deser| {
  314    315   
            match member.member_index() {
  315    316   
                Some(0) => {
  316    317   
                    builder.engine = Some(crate::types::Engine::from(deser.read_string(member)?.as_str()));
  317    318   
                }
  318    319   
                Some(1) => {
  319    320   
                    builder.language_code = Some(crate::types::LanguageCode::from(deser.read_string(member)?.as_str()));
  320    321   
                }
  321    322   
                Some(2) => {
  322         -
                    builder.lexicon_names = Some({
  323         -
                        let container = if let Some(cap) = deser.container_size() {
  324         -
                            Vec::with_capacity(cap)
  325         -
                        } else {
  326         -
                            Vec::new()
  327         -
                        };
  328         -
                        deser.read_list(member, container, |mut list, deser| {
  329         -
                            list.push(deser.read_string(member)?);
  330         -
                            Ok(list)
  331         -
                        })?
  332         -
                    });
         323  +
                    builder.lexicon_names = Some(deser.read_string_list(member)?);
  333    324   
                }
  334    325   
                Some(3) => {
  335    326   
                    builder.output_format = Some(crate::types::OutputFormat::from(deser.read_string(member)?.as_str()));
  336    327   
                }
  337    328   
                Some(4) => {
  338    329   
                    builder.output_s3_bucket_name = Some(deser.read_string(member)?);
  339    330   
                }
  340    331   
                Some(5) => {
  341    332   
                    builder.output_s3_key_prefix = Some(deser.read_string(member)?);
  342    333   
                }
  343    334   
                Some(6) => {
  344    335   
                    builder.sample_rate = Some(deser.read_string(member)?);
  345    336   
                }
  346    337   
                Some(7) => {
  347    338   
                    builder.sns_topic_arn = Some(deser.read_string(member)?);
  348    339   
                }
  349    340   
                Some(8) => {
  350    341   
                    builder.speech_mark_types = Some({
  351         -
                        let container = if let Some(cap) = deser.container_size() {
  352         -
                            Vec::with_capacity(cap)
  353         -
                        } else {
  354         -
                            Vec::new()
  355         -
                        };
  356         -
                        deser.read_list(member, container, |mut list, deser| {
  357         -
                            list.push(crate::types::SpeechMarkType::from(deser.read_string(member)?.as_str()));
  358         -
                            Ok(list)
  359         -
                        })?
         342  +
                        let mut container = Vec::new();
         343  +
                        deser.read_list(member, &mut |deser| {
         344  +
                            container.push(crate::types::SpeechMarkType::from(deser.read_string(member)?.as_str()));
         345  +
                            Ok(())
         346  +
                        })?;
         347  +
                        container
  360    348   
                    });
  361    349   
                }
  362    350   
                Some(9) => {
  363    351   
                    builder.text = Some(deser.read_string(member)?);
  364    352   
                }
  365    353   
                Some(10) => {
  366    354   
                    builder.text_type = Some(crate::types::TextType::from(deser.read_string(member)?.as_str()));
  367    355   
                }
  368    356   
                Some(11) => {
  369    357   
                    builder.voice_id = Some(crate::types::VoiceId::from(deser.read_string(member)?.as_str()));
  370    358   
                }
  371    359   
                _ => {}
  372    360   
            }
  373    361   
            Ok(())
  374    362   
        })?;
         363  +
        builder.output_s3_bucket_name = builder.output_s3_bucket_name.or(Some(String::new()));
         364  +
        builder.text = builder.text.or(Some(String::new()));
  375    365   
        builder
  376    366   
            .build()
  377    367   
            .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
  378    368   
    }
  379    369   
}
         370  +
impl StartSpeechSynthesisTaskInput {
         371  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         372  +
    pub fn deserialize_with_response(
         373  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         374  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         375  +
        _status: u16,
         376  +
        _body: &[u8],
         377  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         378  +
        Self::deserialize(deserializer)
         379  +
    }
         380  +
}
  380    381   
impl StartSpeechSynthesisTaskInput {
  381    382   
    /// Creates a new builder-style object to manufacture [`StartSpeechSynthesisTaskInput`](crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskInput).
  382    383   
    pub fn builder() -> crate::operation::start_speech_synthesis_task::builders::StartSpeechSynthesisTaskInputBuilder {
  383    384   
        crate::operation::start_speech_synthesis_task::builders::StartSpeechSynthesisTaskInputBuilder::default()
  384    385   
    }
  385    386   
}
  386    387   
  387    388   
/// A builder for [`StartSpeechSynthesisTaskInput`](crate::operation::start_speech_synthesis_task::StartSpeechSynthesisTaskInput).
  388    389   
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
  389    390   
#[non_exhaustive]

tmp-codegen-diff/aws-sdk/sdk/polly/src/operation/start_speech_synthesis_task/_start_speech_synthesis_task_output.rs

@@ -1,1 +96,143 @@
   18     18   
    "com.amazonaws.polly.synthetic",
   19     19   
    "StartSpeechSynthesisTaskOutput",
   20     20   
);
   21     21   
static STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER_SYNTHESIS_TASK: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
   22     22   
    ::aws_smithy_schema::ShapeId::from_static(
   23     23   
        "com.amazonaws.polly.synthetic#StartSpeechSynthesisTaskOutput$SynthesisTask",
   24     24   
        "com.amazonaws.polly.synthetic",
   25     25   
        "StartSpeechSynthesisTaskOutput",
   26     26   
    ),
   27     27   
    ::aws_smithy_schema::ShapeType::Structure,
   28         -
    "synthesis_task",
          28  +
    "SynthesisTask",
   29     29   
    0,
   30     30   
);
          31  +
static STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          32  +
    ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
          33  +
    ::aws_smithy_schema::ShapeType::String,
          34  +
    "request_id",
          35  +
    1,
          36  +
)
          37  +
.with_http_header("x-amzn-requestid");
   31     38   
static STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
   32     39   
    STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA_ID,
   33     40   
    ::aws_smithy_schema::ShapeType::Structure,
   34         -
    &[&STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER_SYNTHESIS_TASK],
          41  +
    &[
          42  +
        &STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER_SYNTHESIS_TASK,
          43  +
        &STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER__REQUEST_ID,
          44  +
    ],
   35     45   
);
   36     46   
impl StartSpeechSynthesisTaskOutput {
   37     47   
    /// The schema for this shape.
   38     48   
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA;
   39     49   
}
   40     50   
impl ::aws_smithy_schema::serde::SerializableStruct for StartSpeechSynthesisTaskOutput {
   41     51   
    #[allow(unused_variables, clippy::diverging_sub_expression)]
   42     52   
    fn serialize_members(
   43     53   
        &self,
   44     54   
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
   45     55   
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
   46     56   
        if let Some(ref val) = self.synthesis_task {
   47     57   
            ser.write_struct(&STARTSPEECHSYNTHESISTASKOUTPUT_MEMBER_SYNTHESIS_TASK, val)?;
   48     58   
        }
   49     59   
        Ok(())
   50     60   
    }
   51     61   
}
   52     62   
impl StartSpeechSynthesisTaskOutput {
   53     63   
    /// Deserializes this structure from a [`ShapeDeserializer`].
   54         -
    pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
   55         -
        deserializer: &mut D,
          64  +
    pub fn deserialize(
          65  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
   56     66   
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
   57     67   
        #[allow(unused_variables, unused_mut)]
   58     68   
        let mut builder = Self::builder();
   59     69   
        #[allow(
   60     70   
            unused_variables,
   61     71   
            unreachable_code,
   62     72   
            clippy::single_match,
   63     73   
            clippy::match_single_binding,
   64     74   
            clippy::diverging_sub_expression
   65     75   
        )]
   66         -
        deserializer.read_struct(&STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA, (), |_, member, deser| {
          76  +
        deserializer.read_struct(&STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA, &mut |member, deser| {
          77  +
            match member.member_index() {
          78  +
                Some(0) => {
          79  +
                    builder.synthesis_task = Some(crate::types::SynthesisTask::deserialize(deser)?);
          80  +
                }
          81  +
                Some(1) => {
          82  +
                    builder._request_id = Some(deser.read_string(member)?);
          83  +
                }
          84  +
                _ => {}
          85  +
            }
          86  +
            Ok(())
          87  +
        })?;
          88  +
        Ok(builder.build())
          89  +
    }
          90  +
}
          91  +
impl StartSpeechSynthesisTaskOutput {
          92  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
          93  +
    /// Header-bound members are read directly from headers, avoiding runtime
          94  +
    /// member iteration overhead. Body members are read via the deserializer.
          95  +
    pub fn deserialize_with_response(
          96  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          97  +
        headers: &::aws_smithy_runtime_api::http::Headers,
          98  +
        _status: u16,
          99  +
        _body: &[u8],
         100  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         101  +
        #[allow(unused_variables, unused_mut)]
         102  +
        let mut builder = Self::builder();
         103  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         104  +
            builder._request_id = Some(val.to_string());
         105  +
        }
         106  +
        #[allow(
         107  +
            unused_variables,
         108  +
            unreachable_code,
         109  +
            clippy::single_match,
         110  +
            clippy::match_single_binding,
         111  +
            clippy::diverging_sub_expression
         112  +
        )]
         113  +
        deserializer.read_struct(&STARTSPEECHSYNTHESISTASKOUTPUT_SCHEMA, &mut |member, deser| {
   67    114   
            match member.member_index() {
   68    115   
                Some(0) => {
   69    116   
                    builder.synthesis_task = Some(crate::types::SynthesisTask::deserialize(deser)?);
   70    117   
                }
   71    118   
                _ => {}
   72    119   
            }
   73    120   
            Ok(())
   74    121   
        })?;
   75    122   
        Ok(builder.build())
   76    123   
    }

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

@@ -1,1 +40,44 @@
    1      1   
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
    2      2   
/// Orchestration and serialization glue logic for `SynthesizeSpeech`.
    3      3   
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
    4      4   
#[non_exhaustive]
    5      5   
pub struct SynthesizeSpeech;
    6      6   
impl SynthesizeSpeech {
    7      7   
    /// Creates a new `SynthesizeSpeech`
    8      8   
    pub fn new() -> Self {
    9      9   
        Self
   10     10   
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::synthesize_speech::SynthesizeSpeechInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = crate::operation::synthesize_speech::SynthesizeSpeechOutput::SCHEMA;
   11     15   
    pub(crate) async fn orchestrate(
   12     16   
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
   13     17   
        input: crate::operation::synthesize_speech::SynthesizeSpeechInput,
   14     18   
    ) -> ::std::result::Result<
   15     19   
        crate::operation::synthesize_speech::SynthesizeSpeechOutput,
   16     20   
        ::aws_smithy_runtime_api::client::result::SdkError<
   17     21   
            crate::operation::synthesize_speech::SynthesizeSpeechError,
   18     22   
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
   19     23   
        >,
   20     24   
    > {
@@ -56,60 +116,242 @@
   76     80   
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
   77     81   
            }
   78     82   
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
   79     83   
                config_override,
   80     84   
                client_config.config.clone(),
   81     85   
                &client_config.runtime_components,
   82     86   
            ));
   83     87   
        }
   84     88   
        runtime_plugins
   85     89   
    }
          90  +
    /// The schema for this operation's presigned input shape.
          91  +
    pub const PRESIGNED_INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema = &PRESIGNED_SCHEMA;
   86     92   
}
          93  +
static PRESIGNED_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
          94  +
    "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput",
          95  +
    "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
          96  +
    "SynthesizeSpeechInput",
          97  +
);
          98  +
static PRESIGNED_MEMBER_ENGINE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
          99  +
    ::aws_smithy_schema::ShapeId::from_static(
         100  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$Engine",
         101  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         102  +
        "SynthesizeSpeechInput",
         103  +
    ),
         104  +
    ::aws_smithy_schema::ShapeType::String,
         105  +
    "Engine",
         106  +
    0,
         107  +
)
         108  +
.with_http_query("Engine");
         109  +
static PRESIGNED_MEMBER_LANGUAGE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         110  +
    ::aws_smithy_schema::ShapeId::from_static(
         111  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$LanguageCode",
         112  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         113  +
        "SynthesizeSpeechInput",
         114  +
    ),
         115  +
    ::aws_smithy_schema::ShapeType::String,
         116  +
    "LanguageCode",
         117  +
    1,
         118  +
)
         119  +
.with_http_query("LanguageCode");
         120  +
static PRESIGNED_MEMBER_LEXICON_NAMES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         121  +
    ::aws_smithy_schema::ShapeId::from_static(
         122  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$LexiconNames",
         123  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         124  +
        "SynthesizeSpeechInput",
         125  +
    ),
         126  +
    ::aws_smithy_schema::ShapeType::List,
         127  +
    "LexiconNames",
         128  +
    2,
         129  +
)
         130  +
.with_http_query("LexiconNames");
         131  +
static PRESIGNED_MEMBER_OUTPUT_FORMAT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         132  +
    ::aws_smithy_schema::ShapeId::from_static(
         133  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$OutputFormat",
         134  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         135  +
        "SynthesizeSpeechInput",
         136  +
    ),
         137  +
    ::aws_smithy_schema::ShapeType::String,
         138  +
    "OutputFormat",
         139  +
    3,
         140  +
)
         141  +
.with_http_query("OutputFormat");
         142  +
static PRESIGNED_MEMBER_SAMPLE_RATE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         143  +
    ::aws_smithy_schema::ShapeId::from_static(
         144  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$SampleRate",
         145  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         146  +
        "SynthesizeSpeechInput",
         147  +
    ),
         148  +
    ::aws_smithy_schema::ShapeType::String,
         149  +
    "SampleRate",
         150  +
    4,
         151  +
)
         152  +
.with_http_query("SampleRate");
         153  +
static PRESIGNED_MEMBER_SPEECH_MARK_TYPES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         154  +
    ::aws_smithy_schema::ShapeId::from_static(
         155  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$SpeechMarkTypes",
         156  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         157  +
        "SynthesizeSpeechInput",
         158  +
    ),
         159  +
    ::aws_smithy_schema::ShapeType::List,
         160  +
    "SpeechMarkTypes",
         161  +
    5,
         162  +
)
         163  +
.with_http_query("SpeechMarkTypes");
         164  +
static PRESIGNED_MEMBER_TEXT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         165  +
    ::aws_smithy_schema::ShapeId::from_static(
         166  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$Text",
         167  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         168  +
        "SynthesizeSpeechInput",
         169  +
    ),
         170  +
    ::aws_smithy_schema::ShapeType::String,
         171  +
    "Text",
         172  +
    6,
         173  +
)
         174  +
.with_http_query("Text");
         175  +
static PRESIGNED_MEMBER_TEXT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         176  +
    ::aws_smithy_schema::ShapeId::from_static(
         177  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$TextType",
         178  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         179  +
        "SynthesizeSpeechInput",
         180  +
    ),
         181  +
    ::aws_smithy_schema::ShapeType::String,
         182  +
    "TextType",
         183  +
    7,
         184  +
)
         185  +
.with_http_query("TextType");
         186  +
static PRESIGNED_MEMBER_VOICE_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
         187  +
    ::aws_smithy_schema::ShapeId::from_static(
         188  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned#SynthesizeSpeechInput$VoiceId",
         189  +
        "com.amazonaws.polly.synthetic.synthetic.aws.presigned",
         190  +
        "SynthesizeSpeechInput",
         191  +
    ),
         192  +
    ::aws_smithy_schema::ShapeType::String,
         193  +
    "VoiceId",
         194  +
    8,
         195  +
)
         196  +
.with_http_query("VoiceId");
         197  +
static PRESIGNED_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
         198  +
    PRESIGNED_SCHEMA_ID,
         199  +
    ::aws_smithy_schema::ShapeType::Structure,
         200  +
    &[
         201  +
        &PRESIGNED_MEMBER_ENGINE,
         202  +
        &PRESIGNED_MEMBER_LANGUAGE_CODE,
         203  +
        &PRESIGNED_MEMBER_LEXICON_NAMES,
         204  +
        &PRESIGNED_MEMBER_OUTPUT_FORMAT,
         205  +
        &PRESIGNED_MEMBER_SAMPLE_RATE,
         206  +
        &PRESIGNED_MEMBER_SPEECH_MARK_TYPES,
         207  +
        &PRESIGNED_MEMBER_TEXT,
         208  +
        &PRESIGNED_MEMBER_TEXT_TYPE,
         209  +
        &PRESIGNED_MEMBER_VOICE_ID,
         210  +
    ],
         211  +
)
         212  +
.with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/v1/speech", None));
   87    213   
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for SynthesizeSpeech {
   88    214   
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
   89    215   
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("SynthesizeSpeech");
   90    216   
   91    217   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
   92    218   
            SynthesizeSpeechRequestSerializer,
   93    219   
        ));
   94    220   
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
   95    221   
            SynthesizeSpeechResponseDeserializer,
   96    222   
        ));
@@ -132,258 +249,594 @@
  152    278   
  153    279   
        // If this is an error, defer to the non-streaming parser
  154    280   
        if (!response.status().is_success() && response.status().as_u16() != 200) || force_error {
  155    281   
            return ::std::option::Option::None;
  156    282   
        }
  157    283   
        ::std::option::Option::Some(crate::protocol_serde::type_erase_result(
  158    284   
            crate::protocol_serde::shape_synthesize_speech::de_synthesize_speech_http_response(response),
  159    285   
        ))
  160    286   
    }
  161    287   
  162         -
    fn deserialize_nonstreaming(
         288  +
    fn deserialize_nonstreaming_with_config(
  163    289   
        &self,
  164    290   
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         291  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
  165    292   
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
  166    293   
        // For streaming operations, we only hit this case if its an error
  167    294   
        let body = response.body().bytes().expect("body loaded");
  168         -
        crate::protocol_serde::type_erase_result(crate::protocol_serde::shape_synthesize_speech::de_synthesize_speech_http_error(
  169         -
            response.status().as_u16(),
  170         -
            response.headers(),
  171         -
            body,
         295  +
        let status = response.status().as_u16();
         296  +
        let headers = response.headers();
         297  +
        #[allow(unused_mut)]
         298  +
        let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
         299  +
            ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         300  +
        })?;
         301  +
        generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         302  +
        let generic = generic_builder.build();
         303  +
        let error_code = match generic.code() {
         304  +
            ::std::option::Option::Some(code) => code,
         305  +
            ::std::option::Option::None => {
         306  +
                return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         307  +
                    ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::synthesize_speech::SynthesizeSpeechError::unhandled(
         308  +
                        generic,
         309  +
                    )),
         310  +
                ))
         311  +
            }
         312  +
        };
         313  +
        let _error_message = generic.message().map(|msg| msg.to_owned());
         314  +
        let protocol = _cfg
         315  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         316  +
            .expect("a SharedClientProtocol is required");
         317  +
        let err = match error_code {
         318  +
            "EngineNotSupportedException" => crate::operation::synthesize_speech::SynthesizeSpeechError::EngineNotSupportedException({
         319  +
                let mut tmp = match protocol
         320  +
                    .deserialize_response(response, crate::types::error::EngineNotSupportedException::SCHEMA, _cfg)
         321  +
                    .and_then(|mut deser| {
         322  +
                        crate::types::error::EngineNotSupportedException::deserialize_with_response(
         323  +
                            &mut *deser,
         324  +
                            response.headers(),
         325  +
                            response.status().into(),
         326  +
                            body,
         327  +
                        )
         328  +
                    }) {
         329  +
                    ::std::result::Result::Ok(val) => val,
         330  +
                    ::std::result::Result::Err(e) => {
         331  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         332  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         333  +
                        ))
         334  +
                    }
         335  +
                };
         336  +
                tmp.meta = generic;
         337  +
                if tmp.message.is_none() {
         338  +
                    tmp.message = _error_message;
         339  +
                }
         340  +
                tmp
         341  +
            }),
         342  +
            "InvalidSampleRateException" => crate::operation::synthesize_speech::SynthesizeSpeechError::InvalidSampleRateException({
         343  +
                let mut tmp = match protocol
         344  +
                    .deserialize_response(response, crate::types::error::InvalidSampleRateException::SCHEMA, _cfg)
         345  +
                    .and_then(|mut deser| {
         346  +
                        crate::types::error::InvalidSampleRateException::deserialize_with_response(
         347  +
                            &mut *deser,
         348  +
                            response.headers(),
         349  +
                            response.status().into(),
         350  +
                            body,
         351  +
                        )
         352  +
                    }) {
         353  +
                    ::std::result::Result::Ok(val) => val,
         354  +
                    ::std::result::Result::Err(e) => {
         355  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         356  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         357  +
                        ))
         358  +
                    }
         359  +
                };
         360  +
                tmp.meta = generic;
         361  +
                if tmp.message.is_none() {
         362  +
                    tmp.message = _error_message;
         363  +
                }
         364  +
                tmp
         365  +
            }),
         366  +
            "InvalidSsmlException" => crate::operation::synthesize_speech::SynthesizeSpeechError::InvalidSsmlException({
         367  +
                let mut tmp = match protocol
         368  +
                    .deserialize_response(response, crate::types::error::InvalidSsmlException::SCHEMA, _cfg)
         369  +
                    .and_then(|mut deser| {
         370  +
                        crate::types::error::InvalidSsmlException::deserialize_with_response(
         371  +
                            &mut *deser,
         372  +
                            response.headers(),
         373  +
                            response.status().into(),
         374  +
                            body,
         375  +
                        )
         376  +
                    }) {
         377  +
                    ::std::result::Result::Ok(val) => val,
         378  +
                    ::std::result::Result::Err(e) => {
         379  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         380  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         381  +
                        ))
         382  +
                    }
         383  +
                };
         384  +
                tmp.meta = generic;
         385  +
                if tmp.message.is_none() {
         386  +
                    tmp.message = _error_message;
         387  +
                }
         388  +
                tmp
         389  +
            }),
         390  +
            "LanguageNotSupportedException" => crate::operation::synthesize_speech::SynthesizeSpeechError::LanguageNotSupportedException({
         391  +
                let mut tmp = match protocol
         392  +
                    .deserialize_response(response, crate::types::error::LanguageNotSupportedException::SCHEMA, _cfg)
         393  +
                    .and_then(|mut deser| {
         394  +
                        crate::types::error::LanguageNotSupportedException::deserialize_with_response(
         395  +
                            &mut *deser,
         396  +
                            response.headers(),
         397  +
                            response.status().into(),
         398  +
                            body,
         399  +
                        )
         400  +
                    }) {
         401  +
                    ::std::result::Result::Ok(val) => val,
         402  +
                    ::std::result::Result::Err(e) => {
         403  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         404  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         405  +
                        ))
         406  +
                    }
         407  +
                };
         408  +
                tmp.meta = generic;
         409  +
                if tmp.message.is_none() {
         410  +
                    tmp.message = _error_message;
         411  +
                }
         412  +
                tmp
         413  +
            }),
         414  +
            "LexiconNotFoundException" => crate::operation::synthesize_speech::SynthesizeSpeechError::LexiconNotFoundException({
         415  +
                let mut tmp = match protocol
         416  +
                    .deserialize_response(response, crate::types::error::LexiconNotFoundException::SCHEMA, _cfg)
         417  +
                    .and_then(|mut deser| {
         418  +
                        crate::types::error::LexiconNotFoundException::deserialize_with_response(
         419  +
                            &mut *deser,
         420  +
                            response.headers(),
         421  +
                            response.status().into(),
         422  +
                            body,
         423  +
                        )
         424  +
                    }) {
         425  +
                    ::std::result::Result::Ok(val) => val,
         426  +
                    ::std::result::Result::Err(e) => {
         427  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         428  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         429  +
                        ))
         430  +
                    }
         431  +
                };
         432  +
                tmp.meta = generic;
         433  +
                if tmp.message.is_none() {
         434  +
                    tmp.message = _error_message;
         435  +
                }
         436  +
                tmp
         437  +
            }),
         438  +
            "MarksNotSupportedForFormatException" => {
         439  +
                crate::operation::synthesize_speech::SynthesizeSpeechError::MarksNotSupportedForFormatException({
         440  +
                    let mut tmp = match protocol
         441  +
                        .deserialize_response(response, crate::types::error::MarksNotSupportedForFormatException::SCHEMA, _cfg)
         442  +
                        .and_then(|mut deser| {
         443  +
                            crate::types::error::MarksNotSupportedForFormatException::deserialize_with_response(
         444  +
                                &mut *deser,
         445  +
                                response.headers(),
         446  +
                                response.status().into(),
         447  +
                                body,
         448  +
                            )
         449  +
                        }) {
         450  +
                        ::std::result::Result::Ok(val) => val,
         451  +
                        ::std::result::Result::Err(e) => {
         452  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         453  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         454  +
                            ))
         455  +
                        }
         456  +
                    };
         457  +
                    tmp.meta = generic;
         458  +
                    if tmp.message.is_none() {
         459  +
                        tmp.message = _error_message;
         460  +
                    }
         461  +
                    tmp
         462  +
                })
         463  +
            }
         464  +
            "ServiceFailureException" => crate::operation::synthesize_speech::SynthesizeSpeechError::ServiceFailureException({
         465  +
                let mut tmp = match protocol
         466  +
                    .deserialize_response(response, crate::types::error::ServiceFailureException::SCHEMA, _cfg)
         467  +
                    .and_then(|mut deser| {
         468  +
                        crate::types::error::ServiceFailureException::deserialize_with_response(
         469  +
                            &mut *deser,
         470  +
                            response.headers(),
         471  +
                            response.status().into(),
         472  +
                            body,
         473  +
                        )
         474  +
                    }) {
         475  +
                    ::std::result::Result::Ok(val) => val,
         476  +
                    ::std::result::Result::Err(e) => {
         477  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         478  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         479  +
                        ))
         480  +
                    }
         481  +
                };
         482  +
                tmp.meta = generic;
         483  +
                if tmp.message.is_none() {
         484  +
                    tmp.message = _error_message;
         485  +
                }
         486  +
                tmp
         487  +
            }),
         488  +
            "SsmlMarksNotSupportedForTextTypeException" => {
         489  +
                crate::operation::synthesize_speech::SynthesizeSpeechError::SsmlMarksNotSupportedForTextTypeException({
         490  +
                    let mut tmp = match protocol
         491  +
                        .deserialize_response(response, crate::types::error::SsmlMarksNotSupportedForTextTypeException::SCHEMA, _cfg)
         492  +
                        .and_then(|mut deser| {
         493  +
                            crate::types::error::SsmlMarksNotSupportedForTextTypeException::deserialize_with_response(
         494  +
                                &mut *deser,
         495  +
                                response.headers(),
         496  +
                                response.status().into(),
         497  +
                                body,
         498  +
                            )
         499  +
                        }) {
         500  +
                        ::std::result::Result::Ok(val) => val,
         501  +
                        ::std::result::Result::Err(e) => {
         502  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         503  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         504  +
                            ))
         505  +
                        }
         506  +
                    };
         507  +
                    tmp.meta = generic;
         508  +
                    if tmp.message.is_none() {
         509  +
                        tmp.message = _error_message;
         510  +
                    }
         511  +
                    tmp
         512  +
                })
         513  +
            }
         514  +
            "TextLengthExceededException" => crate::operation::synthesize_speech::SynthesizeSpeechError::TextLengthExceededException({
         515  +
                let mut tmp = match protocol
         516  +
                    .deserialize_response(response, crate::types::error::TextLengthExceededException::SCHEMA, _cfg)
         517  +
                    .and_then(|mut deser| {
         518  +
                        crate::types::error::TextLengthExceededException::deserialize_with_response(
         519  +
                            &mut *deser,
         520  +
                            response.headers(),
         521  +
                            response.status().into(),
         522  +
                            body,
         523  +
                        )
         524  +
                    }) {
         525  +
                    ::std::result::Result::Ok(val) => val,
         526  +
                    ::std::result::Result::Err(e) => {
         527  +
                        return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         528  +
                            ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         529  +
                        ))
         530  +
                    }
         531  +
                };
         532  +
                tmp.meta = generic;
         533  +
                if tmp.message.is_none() {
         534  +
                    tmp.message = _error_message;
         535  +
                }
         536  +
                tmp
         537  +
            }),
         538  +
            _ => crate::operation::synthesize_speech::SynthesizeSpeechError::generic(generic),
         539  +
        };
         540  +
        ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         541  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
  172    542   
        ))
  173    543   
    }
  174    544   
}
  175    545   
#[derive(Debug)]
  176    546   
struct SynthesizeSpeechRequestSerializer;
  177    547   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SynthesizeSpeechRequestSerializer {
  178    548   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  179    549   
    fn serialize_input(
  180    550   
        &self,
  181    551   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  182    552   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  183    553   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  184    554   
        let input = input
  185    555   
            .downcast::<crate::operation::synthesize_speech::SynthesizeSpeechInput>()
  186    556   
            .expect("correct type");
  187         -
        let _header_serialization_settings = _cfg
  188         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  189         -
            .cloned()
  190         -
            .unwrap_or_default();
  191         -
        let mut request_builder = {
  192         -
            #[allow(clippy::uninlined_format_args)]
  193         -
            fn uri_base(
  194         -
                _input: &crate::operation::synthesize_speech::SynthesizeSpeechInput,
  195         -
                output: &mut ::std::string::String,
  196         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  197         -
                use ::std::fmt::Write as _;
  198         -
                ::std::write!(output, "/v1/speech").expect("formatting should succeed");
  199         -
                ::std::result::Result::Ok(())
  200         -
            }
  201         -
            #[allow(clippy::unnecessary_wraps)]
  202         -
            fn update_http_builder(
  203         -
                input: &crate::operation::synthesize_speech::SynthesizeSpeechInput,
  204         -
                builder: ::http_1x::request::Builder,
  205         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  206         -
                let mut uri = ::std::string::String::new();
  207         -
                uri_base(input, &mut uri)?;
  208         -
                ::std::result::Result::Ok(builder.method("POST").uri(uri))
  209         -
            }
  210         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  211         -
            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
  212         -
            builder
  213         -
        };
  214         -
        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_synthesize_speech::ser_synthesize_speech_input(&input)?);
  215         -
        if let Some(content_length) = body.content_length() {
  216         -
            let content_length = content_length.to_string();
  217         -
            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
  218         -
        }
  219         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         557  +
        let protocol = _cfg
         558  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         559  +
            .expect("a SharedClientProtocol is required");
         560  +
        let mut request = protocol
         561  +
            .serialize_request(&input, SynthesizeSpeech::INPUT_SCHEMA, "", _cfg)
         562  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         563  +
         564  +
        return ::std::result::Result::Ok(request);
  220    565   
    }
  221    566   
}
  222    567   
#[derive(Debug)]
  223    568   
struct SynthesizeSpeechEndpointParamsInterceptor;
  224    569   
  225    570   
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for SynthesizeSpeechEndpointParamsInterceptor {
  226    571   
    fn name(&self) -> &'static str {
  227    572   
        "SynthesizeSpeechEndpointParamsInterceptor"
  228    573   
    }
  229    574   
@@ -440,785 +563,824 @@
  460    805   
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for SynthesizeSpeechPresigningRequestSerializer {
  461    806   
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
  462    807   
    fn serialize_input(
  463    808   
        &self,
  464    809   
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
  465    810   
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
  466    811   
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
  467    812   
        let input = input
  468    813   
            .downcast::<crate::operation::synthesize_speech::SynthesizeSpeechInput>()
  469    814   
            .expect("correct type");
  470         -
        let _header_serialization_settings = _cfg
  471         -
            .load::<crate::serialization_settings::HeaderSerializationSettings>()
  472         -
            .cloned()
  473         -
            .unwrap_or_default();
  474         -
        let mut request_builder = {
  475         -
            #[allow(clippy::uninlined_format_args)]
  476         -
            fn uri_base(
  477         -
                _input: &crate::operation::synthesize_speech::SynthesizeSpeechInput,
  478         -
                output: &mut ::std::string::String,
  479         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  480         -
                use ::std::fmt::Write as _;
  481         -
                ::std::write!(output, "/v1/speech").expect("formatting should succeed");
  482         -
                ::std::result::Result::Ok(())
  483         -
            }
  484         -
            fn uri_query(
  485         -
                _input: &crate::operation::synthesize_speech::SynthesizeSpeechInput,
  486         -
                mut output: &mut ::std::string::String,
  487         -
            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
  488         -
                let mut query = ::aws_smithy_http::query::Writer::new(output);
  489         -
                if let ::std::option::Option::Some(inner_1) = &_input.engine {
  490         -
                    {
  491         -
                        query.push_kv("Engine", &::aws_smithy_http::query::fmt_string(inner_1.as_str()));
  492         -
                    }
  493         -
                }
  494         -
                if let ::std::option::Option::Some(inner_2) = &_input.language_code {
  495         -
                    {
  496         -
                        query.push_kv("LanguageCode", &::aws_smithy_http::query::fmt_string(inner_2.as_str()));
  497         -
                    }
  498         -
                }
  499         -
                if let ::std::option::Option::Some(inner_3) = &_input.lexicon_names {
  500         -
                    {
  501         -
                        for inner_4 in inner_3 {
  502         -
                            query.push_kv("LexiconNames", &::aws_smithy_http::query::fmt_string(inner_4));
  503         -
                        }
  504         -
                    }
  505         -
                }
  506         -
                let inner_5 = &_input.output_format;
  507         -
                let inner_5 = inner_5
  508         -
                    .as_ref()
  509         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("output_format", "cannot be empty or unset"))?;
  510         -
                query.push_kv("OutputFormat", &::aws_smithy_http::query::fmt_string(inner_5.as_str()));
  511         -
                if let ::std::option::Option::Some(inner_6) = &_input.sample_rate {
  512         -
                    {
  513         -
                        query.push_kv("SampleRate", &::aws_smithy_http::query::fmt_string(inner_6));
  514         -
                    }
  515         -
                }
  516         -
                if let ::std::option::Option::Some(inner_7) = &_input.speech_mark_types {
  517         -
                    {
  518         -
                        for inner_8 in inner_7 {
  519         -
                            query.push_kv("SpeechMarkTypes", &::aws_smithy_http::query::fmt_string(inner_8.as_str()));
  520         -
                        }
  521         -
                    }
  522         -
                }
  523         -
                let inner_9 = &_input.text;
  524         -
                let inner_9 = inner_9
  525         -
                    .as_ref()
  526         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("text", "cannot be empty or unset"))?;
  527         -
                if inner_9.is_empty() {
  528         -
                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
  529         -
                        "text",
  530         -
                        "cannot be empty or unset",
  531         -
                    ));
  532         -
                }
  533         -
                query.push_kv("Text", &::aws_smithy_http::query::fmt_string(inner_9));
  534         -
                if let ::std::option::Option::Some(inner_10) = &_input.text_type {
  535         -
                    {
  536         -
                        query.push_kv("TextType", &::aws_smithy_http::query::fmt_string(inner_10.as_str()));
  537         -
                    }
  538         -
                }
  539         -
                let inner_11 = &_input.voice_id;
  540         -
                let inner_11 = inner_11
  541         -
                    .as_ref()
  542         -
                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("voice_id", "cannot be empty or unset"))?;
  543         -
                query.push_kv("VoiceId", &::aws_smithy_http::query::fmt_string(inner_11.as_str()));
  544         -
                ::std::result::Result::Ok(())
  545         -
            }
  546         -
            #[allow(clippy::unnecessary_wraps)]
  547         -
            fn update_http_builder(
  548         -
                input: &crate::operation::synthesize_speech::SynthesizeSpeechInput,
  549         -
                builder: ::http_1x::request::Builder,
  550         -
            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
  551         -
                let mut uri = ::std::string::String::new();
  552         -
                uri_base(input, &mut uri)?;
  553         -
                uri_query(input, &mut uri)?;
  554         -
                ::std::result::Result::Ok(builder.method("GET").uri(uri))
  555         -
            }
  556         -
            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
  557         -
            builder
  558         -
        };
  559         -
        let body = ::aws_smithy_types::body::SdkBody::empty();
         815  +
        let protocol = _cfg
         816  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         817  +
            .expect("a SharedClientProtocol is required");
         818  +
        let mut request = protocol
         819  +
            .serialize_request(&input, SynthesizeSpeech::PRESIGNED_INPUT_SCHEMA, "", _cfg)
         820  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
  560    821   
  561         -
        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
         822  +
        return ::std::result::Result::Ok(request);
  562    823   
    }
  563    824   
}

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         -
}