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