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