121 125 | crate::operation::create_backup::CreateBackupError,
|
122 126 | >::new());
|
123 127 |
|
124 128 | ::std::borrow::Cow::Owned(rcb)
|
125 129 | }
|
126 130 | }
|
127 131 |
|
128 132 | #[derive(Debug)]
|
129 133 | struct CreateBackupResponseDeserializer;
|
130 134 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateBackupResponseDeserializer {
|
131 - | fn deserialize_nonstreaming(
|
135 + | fn deserialize_nonstreaming_with_config(
|
132 136 | &self,
|
133 137 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
138 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
134 139 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
135 140 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
136 - | let headers = response.headers();
|
137 - | let body = response.body().bytes().expect("body loaded");
|
138 141 | #[allow(unused_mut)]
|
139 142 | let mut force_error = false;
|
140 143 |
|
141 - | let parse_result = if !success && status != 200 || force_error {
|
142 - | crate::protocol_serde::shape_create_backup::de_create_backup_http_error(status, headers, body)
|
144 + | if !success && status != 200 || force_error {
|
145 + | let headers = response.headers();
|
146 + | let body = response.body().bytes().expect("body loaded");
|
147 + | #[allow(unused_mut)]
|
148 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
149 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
150 + | })?;
|
151 + |
|
152 + | let generic = generic_builder.build();
|
153 + | let error_code = match generic.code() {
|
154 + | ::std::option::Option::Some(code) => code,
|
155 + | ::std::option::Option::None => {
|
156 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
157 + | ::aws_smithy_runtime_api::box_error::BoxError::from(crate::operation::create_backup::CreateBackupError::unhandled(generic)),
|
158 + | ))
|
159 + | }
|
160 + | };
|
161 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
162 + | let protocol = _cfg
|
163 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
164 + | .expect("a SharedClientProtocol is required");
|
165 + | let err = match error_code {
|
166 + | "BackupInUseException" => crate::operation::create_backup::CreateBackupError::BackupInUseError({
|
167 + | let mut tmp = match protocol
|
168 + | .deserialize_response(response, crate::types::error::BackupInUseError::SCHEMA, _cfg)
|
169 + | .and_then(|mut deser| {
|
170 + | crate::types::error::BackupInUseError::deserialize_with_response(
|
171 + | &mut *deser,
|
172 + | response.headers(),
|
173 + | response.status().into(),
|
174 + | body,
|
175 + | )
|
176 + | }) {
|
177 + | ::std::result::Result::Ok(val) => val,
|
178 + | ::std::result::Result::Err(e) => {
|
179 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
180 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
181 + | ))
|
182 + | }
|
183 + | };
|
184 + | tmp.meta = generic;
|
185 + | if tmp.message.is_none() {
|
186 + | tmp.message = _error_message;
|
187 + | }
|
188 + | tmp
|
189 + | }),
|
190 + | "ContinuousBackupsUnavailableException" => crate::operation::create_backup::CreateBackupError::ContinuousBackupsUnavailableError({
|
191 + | let mut tmp = match protocol
|
192 + | .deserialize_response(response, crate::types::error::ContinuousBackupsUnavailableError::SCHEMA, _cfg)
|
193 + | .and_then(|mut deser| {
|
194 + | crate::types::error::ContinuousBackupsUnavailableError::deserialize_with_response(
|
195 + | &mut *deser,
|
196 + | response.headers(),
|
197 + | response.status().into(),
|
198 + | body,
|
199 + | )
|
200 + | }) {
|
201 + | ::std::result::Result::Ok(val) => val,
|
202 + | ::std::result::Result::Err(e) => {
|
203 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
204 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
205 + | ))
|
206 + | }
|
207 + | };
|
208 + | tmp.meta = generic;
|
209 + | if tmp.message.is_none() {
|
210 + | tmp.message = _error_message;
|
211 + | }
|
212 + | tmp
|
213 + | }),
|
214 + | "InternalServerError" => crate::operation::create_backup::CreateBackupError::InternalServerError({
|
215 + | let mut tmp = match protocol
|
216 + | .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
|
217 + | .and_then(|mut deser| {
|
218 + | crate::types::error::InternalServerError::deserialize_with_response(
|
219 + | &mut *deser,
|
220 + | response.headers(),
|
221 + | response.status().into(),
|
222 + | body,
|
223 + | )
|
224 + | }) {
|
225 + | ::std::result::Result::Ok(val) => val,
|
226 + | ::std::result::Result::Err(e) => {
|
227 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
228 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
229 + | ))
|
230 + | }
|
231 + | };
|
232 + | tmp.meta = generic;
|
233 + | if tmp.message.is_none() {
|
234 + | tmp.message = _error_message;
|
235 + | }
|
236 + | tmp
|
237 + | }),
|
238 + | "InvalidEndpointException" => crate::operation::create_backup::CreateBackupError::InvalidEndpointError({
|
239 + | let mut tmp = match protocol
|
240 + | .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
|
241 + | .and_then(|mut deser| {
|
242 + | crate::types::error::InvalidEndpointError::deserialize_with_response(
|
243 + | &mut *deser,
|
244 + | response.headers(),
|
245 + | response.status().into(),
|
246 + | body,
|
247 + | )
|
248 + | }) {
|
249 + | ::std::result::Result::Ok(val) => val,
|
250 + | ::std::result::Result::Err(e) => {
|
251 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
252 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
253 + | ))
|
254 + | }
|
255 + | };
|
256 + | tmp.meta = generic;
|
257 + | if tmp.message.is_none() {
|
258 + | tmp.message = _error_message;
|
259 + | }
|
260 + | tmp
|
261 + | }),
|
262 + | "LimitExceededException" => crate::operation::create_backup::CreateBackupError::LimitExceededError({
|
263 + | let mut tmp = match protocol
|
264 + | .deserialize_response(response, crate::types::error::LimitExceededError::SCHEMA, _cfg)
|
265 + | .and_then(|mut deser| {
|
266 + | crate::types::error::LimitExceededError::deserialize_with_response(
|
267 + | &mut *deser,
|
268 + | response.headers(),
|
269 + | response.status().into(),
|
270 + | body,
|
271 + | )
|
272 + | }) {
|
273 + | ::std::result::Result::Ok(val) => val,
|
274 + | ::std::result::Result::Err(e) => {
|
275 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
276 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
277 + | ))
|
278 + | }
|
279 + | };
|
280 + | tmp.meta = generic;
|
281 + | if tmp.message.is_none() {
|
282 + | tmp.message = _error_message;
|
283 + | }
|
284 + | tmp
|
285 + | }),
|
286 + | "TableInUseException" => crate::operation::create_backup::CreateBackupError::TableInUseError({
|
287 + | let mut tmp = match protocol
|
288 + | .deserialize_response(response, crate::types::error::TableInUseError::SCHEMA, _cfg)
|
289 + | .and_then(|mut deser| {
|
290 + | crate::types::error::TableInUseError::deserialize_with_response(
|
291 + | &mut *deser,
|
292 + | response.headers(),
|
293 + | response.status().into(),
|
294 + | body,
|
295 + | )
|
296 + | }) {
|
297 + | ::std::result::Result::Ok(val) => val,
|
298 + | ::std::result::Result::Err(e) => {
|
299 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
300 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
301 + | ))
|
302 + | }
|
303 + | };
|
304 + | tmp.meta = generic;
|
305 + | if tmp.message.is_none() {
|
306 + | tmp.message = _error_message;
|
307 + | }
|
308 + | tmp
|
309 + | }),
|
310 + | "TableNotFoundException" => crate::operation::create_backup::CreateBackupError::TableNotFoundError({
|
311 + | let mut tmp = match protocol
|
312 + | .deserialize_response(response, crate::types::error::TableNotFoundError::SCHEMA, _cfg)
|
313 + | .and_then(|mut deser| {
|
314 + | crate::types::error::TableNotFoundError::deserialize_with_response(
|
315 + | &mut *deser,
|
316 + | response.headers(),
|
317 + | response.status().into(),
|
318 + | body,
|
319 + | )
|
320 + | }) {
|
321 + | ::std::result::Result::Ok(val) => val,
|
322 + | ::std::result::Result::Err(e) => {
|
323 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
324 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
325 + | ))
|
326 + | }
|
327 + | };
|
328 + | tmp.meta = generic;
|
329 + | if tmp.message.is_none() {
|
330 + | tmp.message = _error_message;
|
331 + | }
|
332 + | tmp
|
333 + | }),
|
334 + | _ => crate::operation::create_backup::CreateBackupError::generic(generic),
|
335 + | };
|
336 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
337 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
338 + | ))
|
143 339 | } else {
|
144 - | crate::protocol_serde::shape_create_backup::de_create_backup_http_response(status, headers, body)
|
145 - | };
|
146 - | crate::protocol_serde::type_erase_result(parse_result)
|
340 + | let protocol = _cfg
|
341 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
342 + | .expect("a SharedClientProtocol is required");
|
343 + | let mut deser = protocol.deserialize_response(response, CreateBackup::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
344 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
345 + | })?;
|
346 + | let body = response.body().bytes().expect("body loaded");
|
347 + | let output = crate::operation::create_backup::CreateBackupOutput::deserialize_with_response(
|
348 + | &mut *deser,
|
349 + | response.headers(),
|
350 + | response.status().into(),
|
351 + | body,
|
352 + | )
|
353 + | .map_err(|e| {
|
354 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
355 + | })?;
|
356 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
357 + | }
|
147 358 | }
|
148 359 | }
|
149 360 | #[derive(Debug)]
|
150 361 | struct CreateBackupRequestSerializer;
|
151 362 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateBackupRequestSerializer {
|
152 363 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
153 364 | fn serialize_input(
|
154 365 | &self,
|
155 366 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
156 367 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
157 368 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
158 369 | let input = input
|
159 370 | .downcast::<crate::operation::create_backup::CreateBackupInput>()
|
160 371 | .expect("correct type");
|
161 - | let _header_serialization_settings = _cfg
|
162 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
163 - | .cloned()
|
164 - | .unwrap_or_default();
|
165 - | let mut request_builder = {
|
166 - | #[allow(clippy::uninlined_format_args)]
|
167 - | fn uri_base(
|
168 - | _input: &crate::operation::create_backup::CreateBackupInput,
|
169 - | output: &mut ::std::string::String,
|
170 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
171 - | use ::std::fmt::Write as _;
|
172 - | ::std::write!(output, "/").expect("formatting should succeed");
|
173 - | ::std::result::Result::Ok(())
|
174 - | }
|
175 - | #[allow(clippy::unnecessary_wraps)]
|
176 - | fn update_http_builder(
|
177 - | input: &crate::operation::create_backup::CreateBackupInput,
|
178 - | builder: ::http_1x::request::Builder,
|
179 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
180 - | let mut uri = ::std::string::String::new();
|
181 - | uri_base(input, &mut uri)?;
|
182 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
183 - | }
|
184 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
185 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
186 - | builder = _header_serialization_settings.set_default_header(
|
187 - | builder,
|
188 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
189 - | "DynamoDB_20120810.CreateBackup",
|
190 - | );
|
191 - | builder
|
192 - | };
|
193 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_backup::ser_create_backup_input(&input)?);
|
194 - | if let Some(content_length) = body.content_length() {
|
195 - | let content_length = content_length.to_string();
|
196 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
197 - | }
|
198 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
372 + | let protocol = _cfg
|
373 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
374 + | .expect("a SharedClientProtocol is required");
|
375 + | let mut request = protocol
|
376 + | .serialize_request(&input, CreateBackup::INPUT_SCHEMA, "", _cfg)
|
377 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
378 + |
|
379 + | return ::std::result::Result::Ok(request);
|
199 380 | }
|
200 381 | }
|
201 382 | #[derive(Debug)]
|
202 383 | struct CreateBackupEndpointParamsInterceptor;
|
203 384 |
|
204 385 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateBackupEndpointParamsInterceptor {
|
205 386 | fn name(&self) -> &'static str {
|
206 387 | "CreateBackupEndpointParamsInterceptor"
|
207 388 | }
|
208 389 |
|