Struct aws_sdk_s3::output::delete_objects_output::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for DeleteObjectsOutput
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn deleted(self, input: DeletedObject) -> Self
pub fn deleted(self, input: DeletedObject) -> Self
Appends an item to deleted
.
To override the contents of this collection use set_deleted
.
Container element for a successful delete. It identifies the object that was successfully deleted.
sourcepub fn set_deleted(self, input: Option<Vec<DeletedObject>>) -> Self
pub fn set_deleted(self, input: Option<Vec<DeletedObject>>) -> Self
Container element for a successful delete. It identifies the object that was successfully deleted.
Examples found in repository?
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
pub fn deser_operation_crate_operation_delete_objects(
inp: &[u8],
mut builder: crate::output::delete_objects_output::Builder,
) -> Result<crate::output::delete_objects_output::Builder, aws_smithy_xml::decode::XmlDecodeError> {
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("DeleteResult") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected DeleteResult but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Error") /* Errors com.amazonaws.s3.synthetic#DeleteObjectsOutput$Errors */ => {
let var_16 =
Some(
Result::<std::vec::Vec<crate::model::Error>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_17 = builder.errors.take().unwrap_or_default();
list_17.push(
crate::xml_deser::deser_structure_crate_model_error(&mut tag)
?
);
list_17
})
?
)
;
builder = builder.set_errors(var_16);
}
,
s if s.matches("Deleted") /* Deleted com.amazonaws.s3.synthetic#DeleteObjectsOutput$Deleted */ => {
let var_18 =
Some(
Result::<std::vec::Vec<crate::model::DeletedObject>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_19 = builder.deleted.take().unwrap_or_default();
list_19.push(
crate::xml_deser::deser_structure_crate_model_deleted_object(&mut tag)
?
);
list_19
})
?
)
;
builder = builder.set_deleted(var_18);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn request_charged(self, input: RequestCharged) -> Self
pub fn request_charged(self, input: RequestCharged) -> Self
If present, indicates that the requester was successfully charged for the request.
sourcepub fn set_request_charged(self, input: Option<RequestCharged>) -> Self
pub fn set_request_charged(self, input: Option<RequestCharged>) -> Self
If present, indicates that the requester was successfully charged for the request.
Examples found in repository?
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
pub fn parse_delete_objects_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteObjectsOutput, crate::error::DeleteObjectsError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::delete_objects_output::Builder::default();
let _ = response;
output = crate::xml_deser::deser_operation_crate_operation_delete_objects(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeleteObjectsError::unhandled)?;
output = output.set_request_charged(
crate::http_serde::deser_header_delete_objects_delete_objects_output_request_charged(
response.headers(),
)
.map_err(|_| {
crate::error::DeleteObjectsError::unhandled(
"Failed to parse RequestCharged from header `x-amz-request-charged",
)
})?,
);
output.build()
})
}
sourcepub fn errors(self, input: Error) -> Self
pub fn errors(self, input: Error) -> Self
Appends an item to errors
.
To override the contents of this collection use set_errors
.
Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.
sourcepub fn set_errors(self, input: Option<Vec<Error>>) -> Self
pub fn set_errors(self, input: Option<Vec<Error>>) -> Self
Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.
Examples found in repository?
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414
pub fn deser_operation_crate_operation_delete_objects(
inp: &[u8],
mut builder: crate::output::delete_objects_output::Builder,
) -> Result<crate::output::delete_objects_output::Builder, aws_smithy_xml::decode::XmlDecodeError> {
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("DeleteResult") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected DeleteResult but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("Error") /* Errors com.amazonaws.s3.synthetic#DeleteObjectsOutput$Errors */ => {
let var_16 =
Some(
Result::<std::vec::Vec<crate::model::Error>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_17 = builder.errors.take().unwrap_or_default();
list_17.push(
crate::xml_deser::deser_structure_crate_model_error(&mut tag)
?
);
list_17
})
?
)
;
builder = builder.set_errors(var_16);
}
,
s if s.matches("Deleted") /* Deleted com.amazonaws.s3.synthetic#DeleteObjectsOutput$Deleted */ => {
let var_18 =
Some(
Result::<std::vec::Vec<crate::model::DeletedObject>, aws_smithy_xml::decode::XmlDecodeError>::Ok({
let mut list_19 = builder.deleted.take().unwrap_or_default();
list_19.push(
crate::xml_deser::deser_structure_crate_model_deleted_object(&mut tag)
?
);
list_19
})
?
)
;
builder = builder.set_deleted(var_18);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn build(self) -> DeleteObjectsOutput
pub fn build(self) -> DeleteObjectsOutput
Consumes the builder and constructs a DeleteObjectsOutput
.
Examples found in repository?
788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
pub fn parse_delete_objects_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::DeleteObjectsOutput, crate::error::DeleteObjectsError> {
Ok({
#[allow(unused_mut)]
let mut output = crate::output::delete_objects_output::Builder::default();
let _ = response;
output = crate::xml_deser::deser_operation_crate_operation_delete_objects(
response.body().as_ref(),
output,
)
.map_err(crate::error::DeleteObjectsError::unhandled)?;
output = output.set_request_charged(
crate::http_serde::deser_header_delete_objects_delete_objects_output_request_charged(
response.headers(),
)
.map_err(|_| {
crate::error::DeleteObjectsError::unhandled(
"Failed to parse RequestCharged from header `x-amz-request-charged",
)
})?,
);
output.build()
})
}