aws_sdk_s3/operation/get_object_acl/
_get_object_acl_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 GetObjectAclOutput {
6    /// <p>Container for the bucket owner's display name and ID.</p>
7    pub owner: ::std::option::Option<crate::types::Owner>,
8    /// <p>A list of grants.</p>
9    pub grants: ::std::option::Option<::std::vec::Vec<crate::types::Grant>>,
10    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
11    /// <p>This functionality is not supported for directory buckets.</p>
12    /// </note>
13    pub request_charged: ::std::option::Option<crate::types::RequestCharged>,
14    _extended_request_id: Option<String>,
15    _request_id: Option<String>,
16}
17impl GetObjectAclOutput {
18    /// <p>Container for the bucket owner's display name and ID.</p>
19    pub fn owner(&self) -> ::std::option::Option<&crate::types::Owner> {
20        self.owner.as_ref()
21    }
22    /// <p>A list of grants.</p>
23    ///
24    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grants.is_none()`.
25    pub fn grants(&self) -> &[crate::types::Grant] {
26        self.grants.as_deref().unwrap_or_default()
27    }
28    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
29    /// <p>This functionality is not supported for directory buckets.</p>
30    /// </note>
31    pub fn request_charged(&self) -> ::std::option::Option<&crate::types::RequestCharged> {
32        self.request_charged.as_ref()
33    }
34}
35impl crate::s3_request_id::RequestIdExt for GetObjectAclOutput {
36    fn extended_request_id(&self) -> Option<&str> {
37        self._extended_request_id.as_deref()
38    }
39}
40impl ::aws_types::request_id::RequestId for GetObjectAclOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl GetObjectAclOutput {
46    /// Creates a new builder-style object to manufacture [`GetObjectAclOutput`](crate::operation::get_object_acl::GetObjectAclOutput).
47    pub fn builder() -> crate::operation::get_object_acl::builders::GetObjectAclOutputBuilder {
48        crate::operation::get_object_acl::builders::GetObjectAclOutputBuilder::default()
49    }
50}
51
52/// A builder for [`GetObjectAclOutput`](crate::operation::get_object_acl::GetObjectAclOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct GetObjectAclOutputBuilder {
56    pub(crate) owner: ::std::option::Option<crate::types::Owner>,
57    pub(crate) grants: ::std::option::Option<::std::vec::Vec<crate::types::Grant>>,
58    pub(crate) request_charged: ::std::option::Option<crate::types::RequestCharged>,
59    _extended_request_id: Option<String>,
60    _request_id: Option<String>,
61}
62impl GetObjectAclOutputBuilder {
63    /// <p>Container for the bucket owner's display name and ID.</p>
64    pub fn owner(mut self, input: crate::types::Owner) -> Self {
65        self.owner = ::std::option::Option::Some(input);
66        self
67    }
68    /// <p>Container for the bucket owner's display name and ID.</p>
69    pub fn set_owner(mut self, input: ::std::option::Option<crate::types::Owner>) -> Self {
70        self.owner = input;
71        self
72    }
73    /// <p>Container for the bucket owner's display name and ID.</p>
74    pub fn get_owner(&self) -> &::std::option::Option<crate::types::Owner> {
75        &self.owner
76    }
77    /// Appends an item to `grants`.
78    ///
79    /// To override the contents of this collection use [`set_grants`](Self::set_grants).
80    ///
81    /// <p>A list of grants.</p>
82    pub fn grants(mut self, input: crate::types::Grant) -> Self {
83        let mut v = self.grants.unwrap_or_default();
84        v.push(input);
85        self.grants = ::std::option::Option::Some(v);
86        self
87    }
88    /// <p>A list of grants.</p>
89    pub fn set_grants(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Grant>>) -> Self {
90        self.grants = input;
91        self
92    }
93    /// <p>A list of grants.</p>
94    pub fn get_grants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Grant>> {
95        &self.grants
96    }
97    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
98    /// <p>This functionality is not supported for directory buckets.</p>
99    /// </note>
100    pub fn request_charged(mut self, input: crate::types::RequestCharged) -> Self {
101        self.request_charged = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
105    /// <p>This functionality is not supported for directory buckets.</p>
106    /// </note>
107    pub fn set_request_charged(mut self, input: ::std::option::Option<crate::types::RequestCharged>) -> Self {
108        self.request_charged = input;
109        self
110    }
111    /// <p>If present, indicates that the requester was successfully charged for the request.</p><note>
112    /// <p>This functionality is not supported for directory buckets.</p>
113    /// </note>
114    pub fn get_request_charged(&self) -> &::std::option::Option<crate::types::RequestCharged> {
115        &self.request_charged
116    }
117    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
118        self._extended_request_id = Some(extended_request_id.into());
119        self
120    }
121
122    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
123        self._extended_request_id = extended_request_id;
124        self
125    }
126    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
127        self._request_id = Some(request_id.into());
128        self
129    }
130
131    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
132        self._request_id = request_id;
133        self
134    }
135    /// Consumes the builder and constructs a [`GetObjectAclOutput`](crate::operation::get_object_acl::GetObjectAclOutput).
136    pub fn build(self) -> crate::operation::get_object_acl::GetObjectAclOutput {
137        crate::operation::get_object_acl::GetObjectAclOutput {
138            owner: self.owner,
139            grants: self.grants,
140            request_charged: self.request_charged,
141            _extended_request_id: self._extended_request_id,
142            _request_id: self._request_id,
143        }
144    }
145}