124 128 | ::std::borrow::Cow::Owned(rcb)
|
125 129 | }
|
126 130 | }
|
127 131 |
|
128 132 | #[derive(Debug)]
|
129 133 | struct ErrCollisionsResponseDeserializer;
|
130 134 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ErrCollisionsResponseDeserializer {
|
131 135 | fn deserialize_nonstreaming(
|
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());
|
141 + | #[allow(unused_mut)]
|
142 + | let mut force_error = false;
|
143 + |
|
144 + | if !success && status != 200 || force_error {
|
136 145 | let headers = response.headers();
|
137 146 | let body = response.body().bytes().expect("body loaded");
|
138 147 | #[allow(unused_mut)]
|
139 - | let mut force_error = false;
|
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 + | })?;
|
140 151 |
|
141 - | let parse_result = if !success && status != 200 || force_error {
|
142 - | crate::protocol_serde::shape_err_collisions::de_err_collisions_http_error(status, headers, body)
|
143 - | } else {
|
144 - | crate::protocol_serde::shape_err_collisions::de_err_collisions_http_response(status, headers, body)
|
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::err_collisions::ErrCollisionsError::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 + | "CollidingError" => crate::operation::err_collisions::ErrCollisionsError::CollidingError({
|
167 + | let mut tmp = match protocol
|
168 + | .deserialize_response(response, crate::types::error::CollidingError::SCHEMA, _cfg)
|
169 + | .and_then(|mut deser| {
|
170 + | crate::types::error::CollidingError::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 + | "CollidingException" => crate::operation::err_collisions::ErrCollisionsError::CollidingException({
|
191 + | let mut tmp = match protocol
|
192 + | .deserialize_response(response, crate::types::error::CollidingException::SCHEMA, _cfg)
|
193 + | .and_then(|mut deser| {
|
194 + | crate::types::error::CollidingException::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 + | }
|
145 207 | };
|
146 - | crate::protocol_serde::type_erase_result(parse_result)
|
208 + | tmp.meta = generic;
|
209 + | if tmp.message.is_none() {
|
210 + | tmp.message = _error_message;
|
211 + | }
|
212 + | tmp
|
213 + | }),
|
214 + | _ => crate::operation::err_collisions::ErrCollisionsError::generic(generic),
|
215 + | };
|
216 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
217 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
218 + | ))
|
219 + | } else {
|
220 + | let protocol = _cfg
|
221 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
222 + | .expect("a SharedClientProtocol is required");
|
223 + | let mut deser = protocol.deserialize_response(response, ErrCollisions::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
224 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
225 + | })?;
|
226 + | let body = response.body().bytes().expect("body loaded");
|
227 + | let output = crate::operation::err_collisions::ErrCollisionsOutput::deserialize_with_response(
|
228 + | &mut *deser,
|
229 + | response.headers(),
|
230 + | response.status().into(),
|
231 + | body,
|
232 + | )
|
233 + | .map_err(|e| {
|
234 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
235 + | })?;
|
236 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
237 + | }
|
147 238 | }
|
148 239 | }
|
149 240 | #[derive(Debug)]
|
150 241 | struct ErrCollisionsRequestSerializer;
|
151 242 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ErrCollisionsRequestSerializer {
|
152 243 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
153 244 | fn serialize_input(
|
154 245 | &self,
|
155 246 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
156 247 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
157 248 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
158 249 | let input = input
|
159 250 | .downcast::<crate::operation::err_collisions::ErrCollisionsInput>()
|
160 251 | .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::err_collisions::ErrCollisionsInput,
|
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::err_collisions::ErrCollisionsInput,
|
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.1");
|
186 - | builder = _header_serialization_settings.set_default_header(
|
187 - | builder,
|
188 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
189 - | "Config.ErrCollisions",
|
190 - | );
|
191 - | builder
|
192 - | };
|
193 - | let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_err_collisions::ser_err_collisions_input(&input)?);
|
252 + | let protocol = _cfg
|
253 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
254 + | .expect("a SharedClientProtocol is required");
|
255 + | let mut request = protocol
|
256 + | .serialize_request(&input, ErrCollisions::INPUT_SCHEMA, "", _cfg)
|
257 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
194 258 |
|
195 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
259 + | return ::std::result::Result::Ok(request);
|
196 260 | }
|
197 261 | }
|
198 262 | #[derive(Debug)]
|
199 263 | struct ErrCollisionsEndpointParamsInterceptor;
|
200 264 |
|
201 265 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ErrCollisionsEndpointParamsInterceptor {
|
202 266 | fn name(&self) -> &'static str {
|
203 267 | "ErrCollisionsEndpointParamsInterceptor"
|
204 268 | }
|
205 269 |
|