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