aws_sdk_s3/types/
_grantee.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Container for the person being granted permissions.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Grantee {
7    /// <p>Screen name of the grantee.</p>
8    pub display_name: ::std::option::Option<::std::string::String>,
9    /// <p>Email address of the grantee.</p><note>
10    /// <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:</p>
11    /// <ul>
12    /// <li>
13    /// <p>US East (N. Virginia)</p></li>
14    /// <li>
15    /// <p>US West (N. California)</p></li>
16    /// <li>
17    /// <p>US West (Oregon)</p></li>
18    /// <li>
19    /// <p>Asia Pacific (Singapore)</p></li>
20    /// <li>
21    /// <p>Asia Pacific (Sydney)</p></li>
22    /// <li>
23    /// <p>Asia Pacific (Tokyo)</p></li>
24    /// <li>
25    /// <p>Europe (Ireland)</p></li>
26    /// <li>
27    /// <p>South America (São Paulo)</p></li>
28    /// </ul>
29    /// <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
30    /// </note>
31    pub email_address: ::std::option::Option<::std::string::String>,
32    /// <p>The canonical user ID of the grantee.</p>
33    pub id: ::std::option::Option<::std::string::String>,
34    /// <p>URI of the grantee group.</p>
35    pub uri: ::std::option::Option<::std::string::String>,
36    /// <p>Type of grantee</p>
37    pub r#type: crate::types::Type,
38}
39impl Grantee {
40    /// <p>Screen name of the grantee.</p>
41    pub fn display_name(&self) -> ::std::option::Option<&str> {
42        self.display_name.as_deref()
43    }
44    /// <p>Email address of the grantee.</p><note>
45    /// <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:</p>
46    /// <ul>
47    /// <li>
48    /// <p>US East (N. Virginia)</p></li>
49    /// <li>
50    /// <p>US West (N. California)</p></li>
51    /// <li>
52    /// <p>US West (Oregon)</p></li>
53    /// <li>
54    /// <p>Asia Pacific (Singapore)</p></li>
55    /// <li>
56    /// <p>Asia Pacific (Sydney)</p></li>
57    /// <li>
58    /// <p>Asia Pacific (Tokyo)</p></li>
59    /// <li>
60    /// <p>Europe (Ireland)</p></li>
61    /// <li>
62    /// <p>South America (São Paulo)</p></li>
63    /// </ul>
64    /// <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
65    /// </note>
66    pub fn email_address(&self) -> ::std::option::Option<&str> {
67        self.email_address.as_deref()
68    }
69    /// <p>The canonical user ID of the grantee.</p>
70    pub fn id(&self) -> ::std::option::Option<&str> {
71        self.id.as_deref()
72    }
73    /// <p>URI of the grantee group.</p>
74    pub fn uri(&self) -> ::std::option::Option<&str> {
75        self.uri.as_deref()
76    }
77    /// <p>Type of grantee</p>
78    pub fn r#type(&self) -> &crate::types::Type {
79        &self.r#type
80    }
81}
82impl Grantee {
83    /// Creates a new builder-style object to manufacture [`Grantee`](crate::types::Grantee).
84    pub fn builder() -> crate::types::builders::GranteeBuilder {
85        crate::types::builders::GranteeBuilder::default()
86    }
87}
88
89/// A builder for [`Grantee`](crate::types::Grantee).
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct GranteeBuilder {
93    pub(crate) display_name: ::std::option::Option<::std::string::String>,
94    pub(crate) email_address: ::std::option::Option<::std::string::String>,
95    pub(crate) id: ::std::option::Option<::std::string::String>,
96    pub(crate) uri: ::std::option::Option<::std::string::String>,
97    pub(crate) r#type: ::std::option::Option<crate::types::Type>,
98}
99impl GranteeBuilder {
100    /// <p>Screen name of the grantee.</p>
101    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
102        self.display_name = ::std::option::Option::Some(input.into());
103        self
104    }
105    /// <p>Screen name of the grantee.</p>
106    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
107        self.display_name = input;
108        self
109    }
110    /// <p>Screen name of the grantee.</p>
111    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
112        &self.display_name
113    }
114    /// <p>Email address of the grantee.</p><note>
115    /// <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:</p>
116    /// <ul>
117    /// <li>
118    /// <p>US East (N. Virginia)</p></li>
119    /// <li>
120    /// <p>US West (N. California)</p></li>
121    /// <li>
122    /// <p>US West (Oregon)</p></li>
123    /// <li>
124    /// <p>Asia Pacific (Singapore)</p></li>
125    /// <li>
126    /// <p>Asia Pacific (Sydney)</p></li>
127    /// <li>
128    /// <p>Asia Pacific (Tokyo)</p></li>
129    /// <li>
130    /// <p>Europe (Ireland)</p></li>
131    /// <li>
132    /// <p>South America (São Paulo)</p></li>
133    /// </ul>
134    /// <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
135    /// </note>
136    pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.email_address = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>Email address of the grantee.</p><note>
141    /// <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:</p>
142    /// <ul>
143    /// <li>
144    /// <p>US East (N. Virginia)</p></li>
145    /// <li>
146    /// <p>US West (N. California)</p></li>
147    /// <li>
148    /// <p>US West (Oregon)</p></li>
149    /// <li>
150    /// <p>Asia Pacific (Singapore)</p></li>
151    /// <li>
152    /// <p>Asia Pacific (Sydney)</p></li>
153    /// <li>
154    /// <p>Asia Pacific (Tokyo)</p></li>
155    /// <li>
156    /// <p>Europe (Ireland)</p></li>
157    /// <li>
158    /// <p>South America (São Paulo)</p></li>
159    /// </ul>
160    /// <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
161    /// </note>
162    pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.email_address = input;
164        self
165    }
166    /// <p>Email address of the grantee.</p><note>
167    /// <p>Using email addresses to specify a grantee is only supported in the following Amazon Web Services Regions:</p>
168    /// <ul>
169    /// <li>
170    /// <p>US East (N. Virginia)</p></li>
171    /// <li>
172    /// <p>US West (N. California)</p></li>
173    /// <li>
174    /// <p>US West (Oregon)</p></li>
175    /// <li>
176    /// <p>Asia Pacific (Singapore)</p></li>
177    /// <li>
178    /// <p>Asia Pacific (Sydney)</p></li>
179    /// <li>
180    /// <p>Asia Pacific (Tokyo)</p></li>
181    /// <li>
182    /// <p>Europe (Ireland)</p></li>
183    /// <li>
184    /// <p>South America (São Paulo)</p></li>
185    /// </ul>
186    /// <p>For a list of all the Amazon S3 supported Regions and endpoints, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a> in the Amazon Web Services General Reference.</p>
187    /// </note>
188    pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
189        &self.email_address
190    }
191    /// <p>The canonical user ID of the grantee.</p>
192    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.id = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <p>The canonical user ID of the grantee.</p>
197    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.id = input;
199        self
200    }
201    /// <p>The canonical user ID of the grantee.</p>
202    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
203        &self.id
204    }
205    /// <p>URI of the grantee group.</p>
206    pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.uri = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>URI of the grantee group.</p>
211    pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.uri = input;
213        self
214    }
215    /// <p>URI of the grantee group.</p>
216    pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
217        &self.uri
218    }
219    /// <p>Type of grantee</p>
220    /// This field is required.
221    pub fn r#type(mut self, input: crate::types::Type) -> Self {
222        self.r#type = ::std::option::Option::Some(input);
223        self
224    }
225    /// <p>Type of grantee</p>
226    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
227        self.r#type = input;
228        self
229    }
230    /// <p>Type of grantee</p>
231    pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
232        &self.r#type
233    }
234    /// Consumes the builder and constructs a [`Grantee`](crate::types::Grantee).
235    /// This method will fail if any of the following fields are not set:
236    /// - [`r#type`](crate::types::builders::GranteeBuilder::type)
237    pub fn build(self) -> ::std::result::Result<crate::types::Grantee, ::aws_smithy_types::error::operation::BuildError> {
238        ::std::result::Result::Ok(crate::types::Grantee {
239            display_name: self.display_name,
240            email_address: self.email_address,
241            id: self.id,
242            uri: self.uri,
243            r#type: self.r#type.ok_or_else(|| {
244                ::aws_smithy_types::error::operation::BuildError::missing_field(
245                    "r#type",
246                    "r#type was not specified but it is required when building Grantee",
247                )
248            })?,
249        })
250    }
251}