aws_sdk_s3/operation/delete_objects/
_delete_objects_output.rs

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>
7    pub 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>
11    pub 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>
13    pub 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()`.
21    pub fn deleted(&self) -> &[crate::types::DeletedObject] {
22        self.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>
27    pub fn request_charged(&self) -> ::std::option::Option<&crate::types::RequestCharged> {
28        self.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()`.
33    pub fn errors(&self) -> &[crate::types::Error] {
34        self.errors.as_deref().unwrap_or_default()
35    }
36}
37impl crate::s3_request_id::RequestIdExt for DeleteObjectsOutput {
38    fn extended_request_id(&self) -> Option<&str> {
39        self._extended_request_id.as_deref()
40    }
41}
42impl ::aws_types::request_id::RequestId for DeleteObjectsOutput {
43    fn request_id(&self) -> Option<&str> {
44        self._request_id.as_deref()
45    }
46}
47impl DeleteObjectsOutput {
48    /// Creates a new builder-style object to manufacture [`DeleteObjectsOutput`](crate::operation::delete_objects::DeleteObjectsOutput).
49    pub fn builder() -> crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder {
50        crate::operation::delete_objects::builders::DeleteObjectsOutputBuilder::default()
51    }
52}
53
54/// 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 {
58    pub(crate) deleted: ::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>>,
59    pub(crate) request_charged: ::std::option::Option<crate::types::RequestCharged>,
60    pub(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>
70    pub fn deleted(mut self, input: crate::types::DeletedObject) -> Self {
71        let mut v = self.deleted.unwrap_or_default();
72        v.push(input);
73        self.deleted = ::std::option::Option::Some(v);
74        self
75    }
76    /// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
77    pub fn set_deleted(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DeletedObject>>) -> Self {
78        self.deleted = input;
79        self
80    }
81    /// <p>Container element for a successful delete. It identifies the object that was successfully deleted.</p>
82    pub 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>
88    pub fn request_charged(mut self, input: crate::types::RequestCharged) -> Self {
89        self.request_charged = ::std::option::Option::Some(input);
90        self
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>
95    pub fn set_request_charged(mut self, input: ::std::option::Option<crate::types::RequestCharged>) -> Self {
96        self.request_charged = input;
97        self
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>
102    pub 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>
110    pub fn errors(mut self, input: crate::types::Error) -> Self {
111        let mut v = self.errors.unwrap_or_default();
112        v.push(input);
113        self.errors = ::std::option::Option::Some(v);
114        self
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>
117    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Error>>) -> Self {
118        self.errors = input;
119        self
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>
122    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Error>> {
123        &self.errors
124    }
125    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
126        self._extended_request_id = Some(extended_request_id.into());
127        self
128    }
129
130    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
131        self._extended_request_id = extended_request_id;
132        self
133    }
134    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
135        self._request_id = Some(request_id.into());
136        self
137    }
138
139    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
140        self._request_id = request_id;
141        self
142    }
143    /// Consumes the builder and constructs a [`DeleteObjectsOutput`](crate::operation::delete_objects::DeleteObjectsOutput).
144    pub fn build(self) -> crate::operation::delete_objects::DeleteObjectsOutput {
145        crate::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}