138 142 | crate::operation::list_parts::ListPartsError,
|
139 143 | >::new());
|
140 144 |
|
141 145 | ::std::borrow::Cow::Owned(rcb)
|
142 146 | }
|
143 147 | }
|
144 148 |
|
145 149 | #[derive(Debug)]
|
146 150 | struct ListPartsResponseDeserializer;
|
147 151 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListPartsResponseDeserializer {
|
148 - | fn deserialize_nonstreaming(
|
152 + | fn deserialize_nonstreaming_with_config(
|
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_list_parts::de_list_parts_http_error(status, headers, body)
|
160 - | } else {
|
161 - | crate::protocol_serde::shape_list_parts::de_list_parts_http_response(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(crate::operation::list_parts::ListPartsError::unhandled(generic)),
|
175 + | ))
|
176 + | }
|
177 + | };
|
178 + | let _error_message = generic.message().map(|msg| msg.to_owned());
|
179 + | let protocol = _cfg
|
180 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
181 + | .expect("a SharedClientProtocol is required");
|
182 + | let err = match error_code {
|
183 + | "InvalidParameterValueException" => crate::operation::list_parts::ListPartsError::InvalidParameterValueException({
|
184 + | let mut tmp = match protocol
|
185 + | .deserialize_response(response, crate::types::error::InvalidParameterValueException::SCHEMA, _cfg)
|
186 + | .and_then(|mut deser| {
|
187 + | crate::types::error::InvalidParameterValueException::deserialize_with_response(
|
188 + | &mut *deser,
|
189 + | response.headers(),
|
190 + | response.status().into(),
|
191 + | body,
|
192 + | )
|
193 + | }) {
|
194 + | ::std::result::Result::Ok(val) => val,
|
195 + | ::std::result::Result::Err(e) => {
|
196 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
197 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
198 + | ))
|
199 + | }
|
200 + | };
|
201 + | tmp.meta = generic;
|
202 + | if tmp.message.is_none() {
|
203 + | tmp.message = _error_message;
|
204 + | }
|
205 + | tmp
|
206 + | }),
|
207 + | "MissingParameterValueException" => crate::operation::list_parts::ListPartsError::MissingParameterValueException({
|
208 + | let mut tmp = match protocol
|
209 + | .deserialize_response(response, crate::types::error::MissingParameterValueException::SCHEMA, _cfg)
|
210 + | .and_then(|mut deser| {
|
211 + | crate::types::error::MissingParameterValueException::deserialize_with_response(
|
212 + | &mut *deser,
|
213 + | response.headers(),
|
214 + | response.status().into(),
|
215 + | body,
|
216 + | )
|
217 + | }) {
|
218 + | ::std::result::Result::Ok(val) => val,
|
219 + | ::std::result::Result::Err(e) => {
|
220 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
221 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
222 + | ))
|
223 + | }
|
224 + | };
|
225 + | tmp.meta = generic;
|
226 + | if tmp.message.is_none() {
|
227 + | tmp.message = _error_message;
|
228 + | }
|
229 + | tmp
|
230 + | }),
|
231 + | "ResourceNotFoundException" => crate::operation::list_parts::ListPartsError::ResourceNotFoundException({
|
232 + | let mut tmp = match protocol
|
233 + | .deserialize_response(response, crate::types::error::ResourceNotFoundException::SCHEMA, _cfg)
|
234 + | .and_then(|mut deser| {
|
235 + | crate::types::error::ResourceNotFoundException::deserialize_with_response(
|
236 + | &mut *deser,
|
237 + | response.headers(),
|
238 + | response.status().into(),
|
239 + | body,
|
240 + | )
|
241 + | }) {
|
242 + | ::std::result::Result::Ok(val) => val,
|
243 + | ::std::result::Result::Err(e) => {
|
244 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
245 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
246 + | ))
|
247 + | }
|
248 + | };
|
249 + | tmp.meta = generic;
|
250 + | if tmp.message.is_none() {
|
251 + | tmp.message = _error_message;
|
252 + | }
|
253 + | tmp
|
254 + | }),
|
255 + | "ServiceUnavailableException" => crate::operation::list_parts::ListPartsError::ServiceUnavailableException({
|
256 + | let mut tmp = match protocol
|
257 + | .deserialize_response(response, crate::types::error::ServiceUnavailableException::SCHEMA, _cfg)
|
258 + | .and_then(|mut deser| {
|
259 + | crate::types::error::ServiceUnavailableException::deserialize_with_response(
|
260 + | &mut *deser,
|
261 + | response.headers(),
|
262 + | response.status().into(),
|
263 + | body,
|
264 + | )
|
265 + | }) {
|
266 + | ::std::result::Result::Ok(val) => val,
|
267 + | ::std::result::Result::Err(e) => {
|
268 + | return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
|
269 + | ::aws_smithy_runtime_api::box_error::BoxError::from(e),
|
270 + | ))
|
271 + | }
|
162 272 | };
|
163 - | crate::protocol_serde::type_erase_result(parse_result)
|
273 + | tmp.meta = generic;
|
274 + | if tmp.message.is_none() {
|
275 + | tmp.message = _error_message;
|
276 + | }
|
277 + | tmp
|
278 + | }),
|
279 + | _ => crate::operation::list_parts::ListPartsError::generic(generic),
|
280 + | };
|
281 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
282 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
|
283 + | ))
|
284 + | } else {
|
285 + | let protocol = _cfg
|
286 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
287 + | .expect("a SharedClientProtocol is required");
|
288 + | let mut deser = protocol.deserialize_response(response, ListParts::OUTPUT_SCHEMA, _cfg).map_err(|e| {
|
289 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
290 + | })?;
|
291 + | let body = response.body().bytes().expect("body loaded");
|
292 + | let output = crate::operation::list_parts::ListPartsOutput::deserialize_with_response(
|
293 + | &mut *deser,
|
294 + | response.headers(),
|
295 + | response.status().into(),
|
296 + | body,
|
297 + | )
|
298 + | .map_err(|e| {
|
299 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
300 + | })?;
|
301 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
302 + | }
|
164 303 | }
|
165 304 | }
|
166 305 | #[derive(Debug)]
|
167 306 | struct ListPartsRequestSerializer;
|
168 307 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ListPartsRequestSerializer {
|
169 308 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
170 309 | fn serialize_input(
|
171 310 | &self,
|
172 311 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
173 312 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
174 313 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
175 314 | let input = input.downcast::<crate::operation::list_parts::ListPartsInput>().expect("correct type");
|
176 - | let _header_serialization_settings = _cfg
|
177 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
178 - | .cloned()
|
179 - | .unwrap_or_default();
|
180 - | let mut request_builder = {
|
181 - | #[allow(clippy::uninlined_format_args)]
|
182 - | fn uri_base(
|
183 - | _input: &crate::operation::list_parts::ListPartsInput,
|
184 - | output: &mut ::std::string::String,
|
185 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
186 - | use ::std::fmt::Write as _;
|
187 - | let input_1 = &_input.account_id;
|
188 - | let input_1 = input_1
|
189 - | .as_ref()
|
190 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("account_id", "cannot be empty or unset"))?;
|
191 - | let account_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
|
192 - | if account_id.is_empty() {
|
193 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
194 - | "account_id",
|
195 - | "cannot be empty or unset",
|
196 - | ));
|
197 - | }
|
198 - | let input_2 = &_input.vault_name;
|
199 - | let input_2 = input_2
|
200 - | .as_ref()
|
201 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("vault_name", "cannot be empty or unset"))?;
|
202 - | let vault_name = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default);
|
203 - | if vault_name.is_empty() {
|
204 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
205 - | "vault_name",
|
206 - | "cannot be empty or unset",
|
207 - | ));
|
208 - | }
|
209 - | let input_3 = &_input.upload_id;
|
210 - | let input_3 = input_3
|
211 - | .as_ref()
|
212 - | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("upload_id", "cannot be empty or unset"))?;
|
213 - | let upload_id = ::aws_smithy_http::label::fmt_string(input_3, ::aws_smithy_http::label::EncodingStrategy::Default);
|
214 - | if upload_id.is_empty() {
|
215 - | return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
|
216 - | "upload_id",
|
217 - | "cannot be empty or unset",
|
218 - | ));
|
219 - | }
|
220 - | ::std::write!(
|
221 - | output,
|
222 - | "/{accountId}/vaults/{vaultName}/multipart-uploads/{uploadId}",
|
223 - | accountId = account_id,
|
224 - | vaultName = vault_name,
|
225 - | uploadId = upload_id
|
226 - | )
|
227 - | .expect("formatting should succeed");
|
228 - | ::std::result::Result::Ok(())
|
229 - | }
|
230 - | fn uri_query(
|
231 - | _input: &crate::operation::list_parts::ListPartsInput,
|
232 - | mut output: &mut ::std::string::String,
|
233 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
234 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
235 - | if let ::std::option::Option::Some(inner_4) = &_input.marker {
|
236 - | {
|
237 - | query.push_kv("marker", &::aws_smithy_http::query::fmt_string(inner_4));
|
238 - | }
|
239 - | }
|
240 - | if let ::std::option::Option::Some(inner_5) = &_input.limit {
|
241 - | {
|
242 - | query.push_kv("limit", ::aws_smithy_types::primitive::Encoder::from(*inner_5).encode());
|
243 - | }
|
244 - | }
|
245 - | ::std::result::Result::Ok(())
|
246 - | }
|
247 - | #[allow(clippy::unnecessary_wraps)]
|
248 - | fn update_http_builder(
|
249 - | input: &crate::operation::list_parts::ListPartsInput,
|
250 - | builder: ::http_1x::request::Builder,
|
251 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
252 - | let mut uri = ::std::string::String::new();
|
253 - | uri_base(input, &mut uri)?;
|
254 - | uri_query(input, &mut uri)?;
|
255 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
256 - | }
|
257 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
258 - | builder
|
259 - | };
|
260 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
315 + | let protocol = _cfg
|
316 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
317 + | .expect("a SharedClientProtocol is required");
|
318 + | let mut request = protocol
|
319 + | .serialize_request(&input, ListParts::INPUT_SCHEMA, "", _cfg)
|
320 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
261 321 |
|
262 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
322 + | return ::std::result::Result::Ok(request);
|
263 323 | }
|
264 324 | }
|
265 325 | #[derive(Debug)]
|
266 326 | struct ListPartsEndpointParamsInterceptor;
|
267 327 |
|
268 328 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListPartsEndpointParamsInterceptor {
|
269 329 | fn name(&self) -> &'static str {
|
270 330 | "ListPartsEndpointParamsInterceptor"
|
271 331 | }
|
272 332 |
|