147 152 | ::std::borrow::Cow::Owned(rcb)
|
148 153 | }
|
149 154 | }
|
150 155 |
|
151 156 | #[derive(Debug)]
|
152 157 | struct ListDiscoveredResourcesResponseDeserializer;
|
153 158 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListDiscoveredResourcesResponseDeserializer {
|
154 159 | fn deserialize_nonstreaming(
|
155 160 | &self,
|
156 161 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
162 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
157 163 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
158 164 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
159 - | let headers = response.headers();
|
160 - | let body = response.body().bytes().expect("body loaded");
|
161 165 | #[allow(unused_mut)]
|
162 166 | let mut force_error = false;
|
163 167 | ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
|
164 - | let parse_result = if !success && status != 200 || force_error {
|
165 - | crate::protocol_serde::shape_list_discovered_resources::de_list_discovered_resources_http_error(status, headers, body)
|
168 + | if !success && status != 200 || force_error {
|
169 + | let headers = response.headers();
|
170 + | let body = response.body().bytes().expect("body loaded");
|
171 + | #[allow(unused_mut)]
|
172 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
173 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
174 + | })?;
|
175 + | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
|
176 + | let generic = generic_builder.build();
|
177 + | let error_code = match generic.code() {
|
178 + | ::std::option::Option::Some(code) => code,
|
179 + | ::std::option::Option::None => {
|
180 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
181 + | ::aws_smithy_runtime_api::box_error::BoxError::from(
|
182 + | crate::operation::list_discovered_resources::ListDiscoveredResourcesError::unhandled(generic),
|
183 + | ),
|
184 + | ))
|
185 + | }
|
186 + | };
|
187 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
188 + | let protocol = _cfg
|
189 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
190 + | .expect("a SharedClientProtocol is required");
|
191 + | let err = match error_code {
|
192 + | "InvalidLimitException" => crate::operation::list_discovered_resources::ListDiscoveredResourcesError::InvalidLimitException({
|
193 + | let mut tmp = match protocol
|
194 + | .deserialize_response(response, crate::types::error::InvalidLimitException::SCHEMA, _cfg)
|
195 + | .and_then(|mut deser| {
|
196 + | crate::types::error::InvalidLimitException::deserialize_with_response(
|
197 + | &mut *deser,
|
198 + | response.headers(),
|
199 + | response.status().into(),
|
200 + | body,
|
201 + | )
|
202 + | }) {
|
203 + | ::std::result::Result::Ok(val) => val,
|
204 + | ::std::result::Result::Err(e) => {
|
205 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
206 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
207 + | ))
|
208 + | }
|
209 + | };
|
210 + | tmp.meta = generic;
|
211 + | if tmp.message.is_none() {
|
212 + | tmp.message = _error_message;
|
213 + | }
|
214 + | tmp
|
215 + | }),
|
216 + | "InvalidNextTokenException" => {
|
217 + | crate::operation::list_discovered_resources::ListDiscoveredResourcesError::InvalidNextTokenException({
|
218 + | let mut tmp = match protocol
|
219 + | .deserialize_response(response, crate::types::error::InvalidNextTokenException::SCHEMA, _cfg)
|
220 + | .and_then(|mut deser| {
|
221 + | crate::types::error::InvalidNextTokenException::deserialize_with_response(
|
222 + | &mut *deser,
|
223 + | response.headers(),
|
224 + | response.status().into(),
|
225 + | body,
|
226 + | )
|
227 + | }) {
|
228 + | ::std::result::Result::Ok(val) => val,
|
229 + | ::std::result::Result::Err(e) => {
|
230 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
231 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
232 + | ))
|
233 + | }
|
234 + | };
|
235 + | tmp.meta = generic;
|
236 + | if tmp.message.is_none() {
|
237 + | tmp.message = _error_message;
|
238 + | }
|
239 + | tmp
|
240 + | })
|
241 + | }
|
242 + | "NoAvailableConfigurationRecorderException" => {
|
243 + | crate::operation::list_discovered_resources::ListDiscoveredResourcesError::NoAvailableConfigurationRecorderException({
|
244 + | let mut tmp = match protocol
|
245 + | .deserialize_response(response, crate::types::error::NoAvailableConfigurationRecorderException::SCHEMA, _cfg)
|
246 + | .and_then(|mut deser| {
|
247 + | crate::types::error::NoAvailableConfigurationRecorderException::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 + | }
|
268 + | "ValidationException" => crate::operation::list_discovered_resources::ListDiscoveredResourcesError::ValidationException({
|
269 + | let mut tmp = match protocol
|
270 + | .deserialize_response(response, crate::types::error::ValidationException::SCHEMA, _cfg)
|
271 + | .and_then(|mut deser| {
|
272 + | crate::types::error::ValidationException::deserialize_with_response(
|
273 + | &mut *deser,
|
274 + | response.headers(),
|
275 + | response.status().into(),
|
276 + | body,
|
277 + | )
|
278 + | }) {
|
279 + | ::std::result::Result::Ok(val) => val,
|
280 + | ::std::result::Result::Err(e) => {
|
281 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
282 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
283 + | ))
|
284 + | }
|
285 + | };
|
286 + | tmp.meta = generic;
|
287 + | if tmp.message.is_none() {
|
288 + | tmp.message = _error_message;
|
289 + | }
|
290 + | tmp
|
291 + | }),
|
292 + | _ => crate::operation::list_discovered_resources::ListDiscoveredResourcesError::generic(generic),
|
293 + | };
|
294 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
295 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
296 + | ))
|
166 297 | } else {
|
167 - | crate::protocol_serde::shape_list_discovered_resources::de_list_discovered_resources_http_response(status, headers, body)
|
168 - | };
|
169 - | crate::protocol_serde::type_erase_result(parse_result)
|
298 + | let protocol = _cfg
|
299 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
300 + | .expect("a SharedClientProtocol is required");
|
301 + | let mut deser = protocol
|
302 + | .deserialize_response(response, ListDiscoveredResources::OUTPUT_SCHEMA, _cfg)
|
303 + | .map_err(|e| {
|
304 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
305 + | })?;
|
306 + | let body = response.body().bytes().expect("body loaded");
|
307 + | let output = crate::operation::list_discovered_resources::ListDiscoveredResourcesOutput::deserialize_with_response(
|
308 + | &mut *deser,
|
309 + | response.headers(),
|
310 + | response.status().into(),
|
311 + | body,
|
312 + | )
|
313 + | .map_err(|e| {
|
314 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
315 + | })?;
|
316 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
317 + | }
|
170 318 | }
|
171 319 | }
|
172 320 | #[derive(Debug)]
|
173 321 | struct ListDiscoveredResourcesRequestSerializer;
|
174 322 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListDiscoveredResourcesRequestSerializer {
|
175 323 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
176 324 | fn serialize_input(
|
177 325 | &self,
|
178 326 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
179 327 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
180 328 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
181 329 | let input = input
|
182 330 | .downcast::<crate::operation::list_discovered_resources::ListDiscoveredResourcesInput>()
|
183 331 | .expect("correct type");
|
184 - | let _header_serialization_settings = _cfg
|
185 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
186 - | .cloned()
|
187 - | .unwrap_or_default();
|
188 - | let mut request_builder = {
|
189 - | #[allow(clippy::uninlined_format_args)]
|
190 - | fn uri_base(
|
191 - | _input: &crate::operation::list_discovered_resources::ListDiscoveredResourcesInput,
|
192 - | output: &mut ::std::string::String,
|
193 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
194 - | use ::std::fmt::Write as _;
|
195 - | ::std::write!(output, "/").expect("formatting should succeed");
|
196 - | ::std::result::Result::Ok(())
|
197 - | }
|
198 - | #[allow(clippy::unnecessary_wraps)]
|
199 - | fn update_http_builder(
|
200 - | input: &crate::operation::list_discovered_resources::ListDiscoveredResourcesInput,
|
201 - | builder: ::http_1x::request::Builder,
|
202 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
203 - | let mut uri = ::std::string::String::new();
|
204 - | uri_base(input, &mut uri)?;
|
205 - | ::std::result::Result::Ok(builder.method("POST").uri(uri))
|
206 - | }
|
207 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
208 - | builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
|
209 - | builder = _header_serialization_settings.set_default_header(
|
210 - | builder,
|
211 - | ::http_1x::header::HeaderName::from_static("x-amz-target"),
|
212 - | "StarlingDoveService.ListDiscoveredResources",
|
213 - | );
|
214 - | builder
|
215 - | };
|
216 - | let body = ::aws_smithy_types::body::SdkBody::from(
|
217 - | crate::protocol_serde::shape_list_discovered_resources::ser_list_discovered_resources_input(&input)?,
|
218 - | );
|
219 - | if let Some(content_length) = body.content_length() {
|
220 - | let content_length = content_length.to_string();
|
221 - | request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
|
222 - | }
|
223 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
332 + | let protocol = _cfg
|
333 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
334 + | .expect("a SharedClientProtocol is required");
|
335 + | let mut request = protocol
|
336 + | .serialize_request(&input, ListDiscoveredResources::INPUT_SCHEMA, "", _cfg)
|
337 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
338 + |
|
339 + | return ::std::result::Result::Ok(request);
|
224 340 | }
|
225 341 | }
|
226 342 | #[derive(Debug)]
|
227 343 | struct ListDiscoveredResourcesEndpointParamsInterceptor;
|
228 344 |
|
229 345 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListDiscoveredResourcesEndpointParamsInterceptor {
|
230 346 | fn name(&self) -> &'static str {
|
231 347 | "ListDiscoveredResourcesEndpointParamsInterceptor"
|
232 348 | }
|
233 349 |
|