138 142 | crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError,
|
139 143 | >::new());
|
140 144 |
|
141 145 | ::std::borrow::Cow::Owned(rcb)
|
142 146 | }
|
143 147 | }
|
144 148 |
|
145 149 | #[derive(Debug)]
|
146 150 | struct GetSpeechSynthesisTaskResponseDeserializer;
|
147 151 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetSpeechSynthesisTaskResponseDeserializer {
|
148 - | fn deserialize_nonstreaming(
|
152 + | fn deserialize_nonstreaming_with_config(
|
149 153 | &self,
|
150 154 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
155 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
151 156 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
152 157 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
153 - | let headers = response.headers();
|
154 - | let body = response.body().bytes().expect("body loaded");
|
155 158 | #[allow(unused_mut)]
|
156 159 | let mut force_error = false;
|
157 160 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
158 - | let parse_result = if !success && status != 200 || force_error {
|
159 - | crate::protocol_serde::shape_get_speech_synthesis_task::de_get_speech_synthesis_task_http_error(status, headers, body)
|
160 - | } else {
|
161 - | crate::protocol_serde::shape_get_speech_synthesis_task::de_get_speech_synthesis_task_http_response(status, headers, body)
|
161 + | if !success && status != 200 || force_error {
|
162 + | let headers = response.headers();
|
163 + | let body = response.body().bytes().expect("body loaded");
|
164 + | #[allow(unused_mut)]
|
165 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
166 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
167 + | })?;
|
168 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
169 + | let generic = generic_builder.build();
|
170 + | let error_code = match generic.code() {
|
171 + | ::std::option::Option::Some(code) => code,
|
172 + | ::std::option::Option::None => {
|
173 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
174 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
175 + | crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::unhandled(generic),
|
176 + | ),
|
177 + | ))
|
178 + | }
|
162 179 | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
180 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
181 + | let protocol = _cfg
|
182 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
183 + | .expect("a SharedClientProtocol is required");
|
184 + | let err = match error_code {
|
185 + | "InvalidTaskIdException" => crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::InvalidTaskIdException({
|
186 + | let mut tmp = match protocol
|
187 + | .deserialize_response(response, crate::types::error::InvalidTaskIdException::SCHEMA, _cfg)
|
188 + | .and_then(|mut deser| {
|
189 + | crate::types::error::InvalidTaskIdException::deserialize_with_response(
|
190 + | &mut *deser,
|
191 + | response.headers(),
|
192 + | response.status().into(),
|
193 + | body,
|
194 + | )
|
195 + | }) {
|
196 + | ::std::result::Result::Ok(val) => val,
|
197 + | ::std::result::Result::Err(e) => {
|
198 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
199 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
200 + | ))
|
201 + | }
|
202 + | };
|
203 + | tmp.meta = generic;
|
204 + | if tmp.message.is_none() {
|
205 + | tmp.message = _error_message;
|
206 + | }
|
207 + | tmp
|
208 + | }),
|
209 + | "ServiceFailureException" => crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::ServiceFailureException({
|
210 + | let mut tmp = match protocol
|
211 + | .deserialize_response(response, crate::types::error::ServiceFailureException::SCHEMA, _cfg)
|
212 + | .and_then(|mut deser| {
|
213 + | crate::types::error::ServiceFailureException::deserialize_with_response(
|
214 + | &mut *deser,
|
215 + | response.headers(),
|
216 + | response.status().into(),
|
217 + | body,
|
218 + | )
|
219 + | }) {
|
220 + | ::std::result::Result::Ok(val) => val,
|
221 + | ::std::result::Result::Err(e) => {
|
222 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
223 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
224 + | ))
|
225 + | }
|
226 + | };
|
227 + | tmp.meta = generic;
|
228 + | if tmp.message.is_none() {
|
229 + | tmp.message = _error_message;
|
230 + | }
|
231 + | tmp
|
232 + | }),
|
233 + | "SynthesisTaskNotFoundException" => {
|
234 + | crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::SynthesisTaskNotFoundException({
|
235 + | let mut tmp = match protocol
|
236 + | .deserialize_response(response, crate::types::error::SynthesisTaskNotFoundException::SCHEMA, _cfg)
|
237 + | .and_then(|mut deser| {
|
238 + | crate::types::error::SynthesisTaskNotFoundException::deserialize_with_response(
|
239 + | &mut *deser,
|
240 + | response.headers(),
|
241 + | response.status().into(),
|
242 + | body,
|
243 + | )
|
244 + | }) {
|
245 + | ::std::result::Result::Ok(val) => val,
|
246 + | ::std::result::Result::Err(e) => {
|
247 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
248 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
249 + | ))
|
250 + | }
|
251 + | };
|
252 + | tmp.meta = generic;
|
253 + | if tmp.message.is_none() {
|
254 + | tmp.message = _error_message;
|
255 + | }
|
256 + | tmp
|
257 + | })
|
258 + | }
|
259 + | _ => crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskError::generic(generic),
|
260 + | };
|
261 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
262 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
263 + | ))
|
264 + | } else {
|
265 + | let protocol = _cfg
|
266 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
267 + | .expect("a SharedClientProtocol is required");
|
268 + | let mut deser = protocol
|
269 + | .deserialize_response(response, GetSpeechSynthesisTask::OUTPUT_SCHEMA, _cfg)
|
270 + | .map_err(|e| {
|
271 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
272 + | })?;
|
273 + | let body = response.body().bytes().expect("body loaded");
|
274 + | let output = crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskOutput::deserialize_with_response(
|
275 + | &mut *deser,
|
276 + | response.headers(),
|
277 + | response.status().into(),
|
278 + | body,
|
279 + | )
|
280 + | .map_err(|e| {
|
281 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
282 + | })?;
|
283 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
284 + | }
|
164 285 | }
|
165 286 | }
|
166 287 | #[derive(Debug)]
|
167 288 | struct GetSpeechSynthesisTaskRequestSerializer;
|
168 289 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetSpeechSynthesisTaskRequestSerializer {
|
169 290 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 291 | fn serialize_input(
|
171 292 | &self,
|
172 293 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 294 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 295 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 296 | let input = input
|
176 297 | .downcast::<crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskInput>()
|
177 298 | .expect("correct type");
|
178 - | let _header_serialization_settings = _cfg
|
179 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
180 - | .cloned()
|
181 - | .unwrap_or_default();
|
182 - | let mut request_builder = {
|
183 - | #[allow(clippy::uninlined_format_args)]
|
184 - | fn uri_base(
|
185 - | _input: &crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskInput,
|
186 - | output: &mut ::std::string::String,
|
187 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
188 - | use ::std::fmt::Write as _;
|
189 - | let input_1 = &_input.task_id;
|
190 - | let input_1 = input_1
|
191 - | .as_ref()
|
192 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("task_id", "cannot be empty or unset"))?;
|
193 - | let task_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
194 - | if task_id.is_empty() {
|
195 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
196 - | "task_id",
|
197 - | "cannot be empty or unset",
|
198 - | ));
|
199 - | }
|
200 - | ::std::write!(output, "/v1/synthesisTasks/{TaskId}", TaskId = task_id).expect("formatting should succeed");
|
201 - | ::std::result::Result::Ok(())
|
202 - | }
|
203 - | #[allow(clippy::unnecessary_wraps)]
|
204 - | fn update_http_builder(
|
205 - | input: &crate::operation::get_speech_synthesis_task::GetSpeechSynthesisTaskInput,
|
206 - | builder: ::http_1x::request::Builder,
|
207 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
208 - | let mut uri = ::std::string::String::new();
|
209 - | uri_base(input, &mut uri)?;
|
210 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
211 - | }
|
212 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
213 - | builder
|
214 - | };
|
215 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
299 + | let protocol = _cfg
|
300 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
301 + | .expect("a SharedClientProtocol is required");
|
302 + | let mut request = protocol
|
303 + | .serialize_request(&input, GetSpeechSynthesisTask::INPUT_SCHEMA, "", _cfg)
|
304 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
216 305 |
|
217 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
306 + | return ::std::result::Result::Ok(request);
|
218 307 | }
|
219 308 | }
|
220 309 | #[derive(Debug)]
|
221 310 | struct GetSpeechSynthesisTaskEndpointParamsInterceptor;
|
222 311 |
|
223 312 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetSpeechSynthesisTaskEndpointParamsInterceptor {
|
224 313 | fn name(&self) -> &'static str {
|
225 314 | "GetSpeechSynthesisTaskEndpointParamsInterceptor"
|
226 315 | }
|
227 316 |
|