aws_sdk_s3/operation/get_bucket_acl/
_get_bucket_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 GetBucketAclOutput {
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    _extended_request_id: Option<String>,
11    _request_id: Option<String>,
12}
13impl GetBucketAclOutput {
14    /// <p>Container for the bucket owner's display name and ID.</p>
15    pub fn owner(&self) -> ::std::option::Option<&crate::types::Owner> {
16        self.owner.as_ref()
17    }
18    /// <p>A list of grants.</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 `.grants.is_none()`.
21    pub fn grants(&self) -> &[crate::types::Grant] {
22        self.grants.as_deref().unwrap_or_default()
23    }
24}
25impl crate::s3_request_id::RequestIdExt for GetBucketAclOutput {
26    fn extended_request_id(&self) -> Option<&str> {
27        self._extended_request_id.as_deref()
28    }
29}
30impl ::aws_types::request_id::RequestId for GetBucketAclOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl GetBucketAclOutput {
36    /// Creates a new builder-style object to manufacture [`GetBucketAclOutput`](crate::operation::get_bucket_acl::GetBucketAclOutput).
37    pub fn builder() -> crate::operation::get_bucket_acl::builders::GetBucketAclOutputBuilder {
38        crate::operation::get_bucket_acl::builders::GetBucketAclOutputBuilder::default()
39    }
40}
41
42/// A builder for [`GetBucketAclOutput`](crate::operation::get_bucket_acl::GetBucketAclOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct GetBucketAclOutputBuilder {
46    pub(crate) owner: ::std::option::Option<crate::types::Owner>,
47    pub(crate) grants: ::std::option::Option<::std::vec::Vec<crate::types::Grant>>,
48    _extended_request_id: Option<String>,
49    _request_id: Option<String>,
50}
51impl GetBucketAclOutputBuilder {
52    /// <p>Container for the bucket owner's display name and ID.</p>
53    pub fn owner(mut self, input: crate::types::Owner) -> Self {
54        self.owner = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Container for the bucket owner's display name and ID.</p>
58    pub fn set_owner(mut self, input: ::std::option::Option<crate::types::Owner>) -> Self {
59        self.owner = input;
60        self
61    }
62    /// <p>Container for the bucket owner's display name and ID.</p>
63    pub fn get_owner(&self) -> &::std::option::Option<crate::types::Owner> {
64        &self.owner
65    }
66    /// Appends an item to `grants`.
67    ///
68    /// To override the contents of this collection use [`set_grants`](Self::set_grants).
69    ///
70    /// <p>A list of grants.</p>
71    pub fn grants(mut self, input: crate::types::Grant) -> Self {
72        let mut v = self.grants.unwrap_or_default();
73        v.push(input);
74        self.grants = ::std::option::Option::Some(v);
75        self
76    }
77    /// <p>A list of grants.</p>
78    pub fn set_grants(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Grant>>) -> Self {
79        self.grants = input;
80        self
81    }
82    /// <p>A list of grants.</p>
83    pub fn get_grants(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Grant>> {
84        &self.grants
85    }
86    pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
87        self._extended_request_id = Some(extended_request_id.into());
88        self
89    }
90
91    pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
92        self._extended_request_id = extended_request_id;
93        self
94    }
95    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
96        self._request_id = Some(request_id.into());
97        self
98    }
99
100    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
101        self._request_id = request_id;
102        self
103    }
104    /// Consumes the builder and constructs a [`GetBucketAclOutput`](crate::operation::get_bucket_acl::GetBucketAclOutput).
105    pub fn build(self) -> crate::operation::get_bucket_acl::GetBucketAclOutput {
106        crate::operation::get_bucket_acl::GetBucketAclOutput {
107            owner: self.owner,
108            grants: self.grants,
109            _extended_request_id: self._extended_request_id,
110            _request_id: self._request_id,
111        }
112    }
113}