130 136 | crate::operation::describe_continuous_backups::DescribeContinuousBackupsError,
|
131 137 | >::new());
|
132 138 |
|
133 139 | ::std::borrow::Cow::Owned(rcb)
|
134 140 | }
|
135 141 | }
|
136 142 |
|
137 143 | #[derive(Debug)]
|
138 144 | struct DescribeContinuousBackupsResponseDeserializer;
|
139 145 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DescribeContinuousBackupsResponseDeserializer {
|
140 - | fn deserialize_nonstreaming(
|
146 + | fn deserialize_nonstreaming_with_config(
|
141 147 | &self,
|
142 148 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
149 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
143 150 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
144 151 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
145 - | let headers = response.headers();
|
146 - | let body = response.body().bytes().expect("body loaded");
|
147 152 | #[allow(unused_mut)]
|
148 153 | let mut force_error = false;
|
149 154 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_describe_continuous_backups::de_describe_continuous_backups_http_error(status, headers, body)
|
155 + | if !success && status != 200 || force_error {
|
156 + | let headers = response.headers();
|
157 + | let body = response.body().bytes().expect("body loaded");
|
158 + | #[allow(unused_mut)]
|
159 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
160 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
161 + | })?;
|
162 + |
|
163 + | let generic = generic_builder.build();
|
164 + | let error_code = match generic.code() {
|
165 + | ::std::option::Option::Some(code) => code,
|
166 + | ::std::option::Option::None => {
|
167 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
168 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
169 + | crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::unhandled(generic),
|
170 + | ),
|
171 + | ))
|
172 + | }
|
173 + | };
|
174 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
175 + | let protocol = _cfg
|
176 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
177 + | .expect("a SharedClientProtocol is required");
|
178 + | let err = match error_code {
|
179 + | "InternalServerError" => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::InternalServerError({
|
180 + | let mut tmp = match protocol
|
181 + | .deserialize_response(response, crate::types::error::InternalServerError::SCHEMA, _cfg)
|
182 + | .and_then(|mut deser| {
|
183 + | crate::types::error::InternalServerError::deserialize_with_response(
|
184 + | &mut *deser,
|
185 + | response.headers(),
|
186 + | response.status().into(),
|
187 + | body,
|
188 + | )
|
189 + | }) {
|
190 + | ::std::result::Result::Ok(val) => val,
|
191 + | ::std::result::Result::Err(e) => {
|
192 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
193 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
194 + | ))
|
195 + | }
|
196 + | };
|
197 + | tmp.meta = generic;
|
198 + | if tmp.message.is_none() {
|
199 + | tmp.message = _error_message;
|
200 + | }
|
201 + | tmp
|
202 + | }),
|
203 + | "InvalidEndpointException" => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::InvalidEndpointError({
|
204 + | let mut tmp = match protocol
|
205 + | .deserialize_response(response, crate::types::error::InvalidEndpointError::SCHEMA, _cfg)
|
206 + | .and_then(|mut deser| {
|
207 + | crate::types::error::InvalidEndpointError::deserialize_with_response(
|
208 + | &mut *deser,
|
209 + | response.headers(),
|
210 + | response.status().into(),
|
211 + | body,
|
212 + | )
|
213 + | }) {
|
214 + | ::std::result::Result::Ok(val) => val,
|
215 + | ::std::result::Result::Err(e) => {
|
216 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
217 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
218 + | ))
|
219 + | }
|
220 + | };
|
221 + | tmp.meta = generic;
|
222 + | if tmp.message.is_none() {
|
223 + | tmp.message = _error_message;
|
224 + | }
|
225 + | tmp
|
226 + | }),
|
227 + | "TableNotFoundException" => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::TableNotFoundError({
|
228 + | let mut tmp = match protocol
|
229 + | .deserialize_response(response, crate::types::error::TableNotFoundError::SCHEMA, _cfg)
|
230 + | .and_then(|mut deser| {
|
231 + | crate::types::error::TableNotFoundError::deserialize_with_response(
|
232 + | &mut *deser,
|
233 + | response.headers(),
|
234 + | response.status().into(),
|
235 + | body,
|
236 + | )
|
237 + | }) {
|
238 + | ::std::result::Result::Ok(val) => val,
|
239 + | ::std::result::Result::Err(e) => {
|
240 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
241 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
242 + | ))
|
243 + | }
|
244 + | };
|
245 + | tmp.meta = generic;
|
246 + | if tmp.message.is_none() {
|
247 + | tmp.message = _error_message;
|
248 + | }
|
249 + | tmp
|
250 + | }),
|
251 + | _ => crate::operation::describe_continuous_backups::DescribeContinuousBackupsError::generic(generic),
|
252 + | };
|
253 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
254 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
255 + | ))
|
152 256 | } else {
|
153 - | crate::protocol_serde::shape_describe_continuous_backups::de_describe_continuous_backups_http_response(status, headers, body)
|
154 - | };
|
155 - | crate::protocol_serde::type_erase_result(parse_result)
|
257 + | let protocol = _cfg
|
258 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
259 + | .expect("a SharedClientProtocol is required");
|
260 + | let mut deser = protocol
|
261 + | .deserialize_response(response, DescribeContinuousBackups::OUTPUT_SCHEMA, _cfg)
|
262 + | .map_err(|e| {
|
263 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
264 + | })?;
|
265 + | let body = response.body().bytes().expect("body loaded");
|
266 + | let output = crate::operation::describe_continuous_backups::DescribeContinuousBackupsOutput::deserialize_with_response(
|
267 + | &mut *deser,
|
268 + | response.headers(),
|
269 + | response.status().into(),
|
270 + | body,
|
271 + | )
|
272 + | .map_err(|e| {
|
273 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
274 + | })?;
|
275 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
276 + | }
|
156 277 | }
|
157 278 | }
|
158 279 | #[derive(Debug)]
|
159 280 | struct DescribeContinuousBackupsRequestSerializer;
|
160 281 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for DescribeContinuousBackupsRequestSerializer {
|
161 282 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
162 283 | fn serialize_input(
|
163 284 | &self,
|
164 285 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
165 286 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
166 287 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
167 288 | let input = input
|
168 289 | .downcast::<crate::operation::describe_continuous_backups::DescribeContinuousBackupsInput>()
|
169 290 | .expect("correct type");
|
170 - | let _header_serialization_settings = _cfg
|
171 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
172 - | .cloned()
|
173 - | .unwrap_or_default();
|
174 - | let mut request_builder = {
|
175 - | #[allow(clippy::uninlined_format_args)]
|
176 - | fn uri_base(
|
177 - | _input: &crate::operation::describe_continuous_backups::DescribeContinuousBackupsInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | ::std::write!(output, "/").expect("formatting should succeed");
|
182 - | ::std::result::Result::Ok(())
|
183 - | }
|
184 - | #[allow(clippy::unnecessary_wraps)]
|
185 - | fn update_http_builder(
|
186 - | input: &crate::operation::describe_continuous_backups::DescribeContinuousBackupsInput,
|
187 - | builder: ::http_1x::request::Builder,
|
188 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
189 - | let mut uri = ::std::string::String::new();
|
190 - | uri_base(input, &mut uri)?;
|
191 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
192 - | }
|
193 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
194 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.0");
|
195 - | builder = _header_serialization_settings.set_default_header(
|
196 - | builder,
|
197 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
198 - | "DynamoDB_20120810.DescribeContinuousBackups",
|
199 - | );
|
200 - | builder
|
201 - | };
|
202 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
203 - | crate::protocol_serde::shape_describe_continuous_backups::ser_describe_continuous_backups_input(&input)?,
|
204 - | );
|
205 - | if let Some(content_length) = body.content_length() {
|
206 - | let content_length = content_length.to_string();
|
207 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
208 - | }
|
209 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
291 + | let protocol = _cfg
|
292 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
293 + | .expect("a SharedClientProtocol is required");
|
294 + | let mut request = protocol
|
295 + | .serialize_request(&input, DescribeContinuousBackups::INPUT_SCHEMA, "", _cfg)
|
296 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
297 + |
|
298 + | return ::std::result::Result::Ok(request);
|
210 299 | }
|
211 300 | }
|
212 301 | #[derive(Debug)]
|
213 302 | struct DescribeContinuousBackupsEndpointParamsInterceptor;
|
214 303 |
|
215 304 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DescribeContinuousBackupsEndpointParamsInterceptor {
|
216 305 | fn name(&self) -> &'static str {
|
217 306 | "DescribeContinuousBackupsEndpointParamsInterceptor"
|
218 307 | }
|
219 308 |
|