1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteObjectsOutput {
6/// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
7pub deleted: ::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>>,
8/// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
9 /// <p>This functionality is not supported for directory buckets.</p>
10 /// </note>
11pub request_charged: ::std::option::Option<crate::types::RequestCharged>,
12/// <p>Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.</p>
13pub errors: ::std::option::Option<::std::vec::Vec<crate::types::Error>>,
14 _extended_request_id: Option<String>,
15 _request_id: Option<String>,
16}
17impl DeleteObjectsOutput {
18/// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
19 ///
20 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.deleted.is_none()`.
21pub fn deleted(&self) -> &[crate::types::DeletedObject] {
22self.deleted.as_deref().unwrap_or_default()
23 }
24/// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
25 /// <p>This functionality is not supported for directory buckets.</p>
26 /// </note>
27pub fn request_charged(&self) -> ::std::option::Option<&crate::types::RequestCharged> {
28self.request_charged.as_ref()
29 }
30/// <p>Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.</p>
31 ///
32 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
33pub fn errors(&self) -> &[crate::types::Error] {
34self.errors.as_deref().unwrap_or_default()
35 }
36}
37impl crate::s3_request_id::RequestIdExt for DeleteObjectsOutput {
38fn extended_request_id(&self) -> Option<&str> {
39self._extended_request_id.as_deref()
40 }
41}
42impl ::aws_types::request_id::RequestId for DeleteObjectsOutput {
43fn request_id(&self) -> Option<&str> {
44self._request_id.as_deref()
45 }
46}
47impl DeleteObjectsOutput {
48/// Creates a new builder-style object to manufacture [`DeleteObjectsOutput`](crate::operation::delete_objects::DeleteObjectsOutput).
49pub fn builder() -> crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder {
50crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder::default()
51 }
52}
5354/// A builder for [`DeleteObjectsOutput`](crate::operation::delete_objects::DeleteObjectsOutput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct DeleteObjectsOutputBuilder {
58pub(crate) deleted: ::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>>,
59pub(crate) request_charged: ::std::option::Option<crate::types::RequestCharged>,
60pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::Error>>,
61 _extended_request_id: Option<String>,
62 _request_id: Option<String>,
63}
64impl DeleteObjectsOutputBuilder {
65/// Appends an item to `deleted`.
66 ///
67 /// To override the contents of this collection use [`set_deleted`](Self::set_deleted).
68 ///
69 /// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
70pub fn deleted(mut self, input: crate::types::DeletedObject) -> Self {
71let mut v = self.deleted.unwrap_or_default();
72 v.push(input);
73self.deleted = ::std::option::Option::Some(v);
74self
75}
76/// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
77pub fn set_deleted(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>>) -> Self {
78self.deleted = input;
79self
80}
81/// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
82pub fn get_deleted(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>> {
83&self.deleted
84 }
85/// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
86 /// <p>This functionality is not supported for directory buckets.</p>
87 /// </note>
88pub fn request_charged(mut self, input: crate::types::RequestCharged) -> Self {
89self.request_charged = ::std::option::Option::Some(input);
90self
91}
92/// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
93 /// <p>This functionality is not supported for directory buckets.</p>
94 /// </note>
95pub fn set_request_charged(mut self, input: ::std::option::Option<crate::types::RequestCharged>) -> Self {
96self.request_charged = input;
97self
98}
99/// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
100 /// <p>This functionality is not supported for directory buckets.</p>
101 /// </note>
102pub fn get_request_charged(&self) -> &::std::option::Option<crate::types::RequestCharged> {
103&self.request_charged
104 }
105/// Appends an item to `errors`.
106 ///
107 /// To override the contents of this collection use [`set_errors`](Self::set_errors).
108 ///
109 /// <p>Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.</p>
110pub fn errors(mut self, input: crate::types::Error) -> Self {
111let mut v = self.errors.unwrap_or_default();
112 v.push(input);
113self.errors = ::std::option::Option::Some(v);
114self
115}
116/// <p>Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.</p>
117pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Error>>) -> Self {
118self.errors = input;
119self
120}
121/// <p>Container for a failed delete action that describes the object that Amazon S3 attempted to delete and the error it encountered.</p>
122pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Error>> {
123&self.errors
124 }
125pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
126self._extended_request_id = Some(extended_request_id.into());
127self
128}
129130pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
131self._extended_request_id = extended_request_id;
132self
133}
134pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
135self._request_id = Some(request_id.into());
136self
137}
138139pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
140self._request_id = request_id;
141self
142}
143/// Consumes the builder and constructs a [`DeleteObjectsOutput`](crate::operation::delete_objects::DeleteObjectsOutput).
144pub fn build(self) -> crate::operation::delete_objects::DeleteObjectsOutput {
145crate::operation::delete_objects::DeleteObjectsOutput {
146 deleted: self.deleted,
147 request_charged: self.request_charged,
148 errors: self.errors,
149 _extended_request_id: self._extended_request_id,
150 _request_id: self._request_id,
151 }
152 }
153}