Skip to main content

aws_sdk_s3control/types/
_s3_grantee.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct S3Grantee {
7    /// <p></p>
8    pub type_identifier: ::std::option::Option<crate::types::S3GranteeTypeIdentifier>,
9    /// <p></p>
10    pub identifier: ::std::option::Option<::std::string::String>,
11    /// <p></p>
12    pub display_name: ::std::option::Option<::std::string::String>,
13}
14impl S3Grantee {
15    /// <p></p>
16    pub fn type_identifier(&self) -> ::std::option::Option<&crate::types::S3GranteeTypeIdentifier> {
17        self.type_identifier.as_ref()
18    }
19    /// <p></p>
20    pub fn identifier(&self) -> ::std::option::Option<&str> {
21        self.identifier.as_deref()
22    }
23    /// <p></p>
24    pub fn display_name(&self) -> ::std::option::Option<&str> {
25        self.display_name.as_deref()
26    }
27}
28impl S3Grantee {
29    /// Creates a new builder-style object to manufacture [`S3Grantee`](crate::types::S3Grantee).
30    pub fn builder() -> crate::types::builders::S3GranteeBuilder {
31        crate::types::builders::S3GranteeBuilder::default()
32    }
33}
34
35/// A builder for [`S3Grantee`](crate::types::S3Grantee).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct S3GranteeBuilder {
39    pub(crate) type_identifier: ::std::option::Option<crate::types::S3GranteeTypeIdentifier>,
40    pub(crate) identifier: ::std::option::Option<::std::string::String>,
41    pub(crate) display_name: ::std::option::Option<::std::string::String>,
42}
43impl S3GranteeBuilder {
44    /// <p></p>
45    pub fn type_identifier(mut self, input: crate::types::S3GranteeTypeIdentifier) -> Self {
46        self.type_identifier = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p></p>
50    pub fn set_type_identifier(mut self, input: ::std::option::Option<crate::types::S3GranteeTypeIdentifier>) -> Self {
51        self.type_identifier = input;
52        self
53    }
54    /// <p></p>
55    pub fn get_type_identifier(&self) -> &::std::option::Option<crate::types::S3GranteeTypeIdentifier> {
56        &self.type_identifier
57    }
58    /// <p></p>
59    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.identifier = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p></p>
64    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.identifier = input;
66        self
67    }
68    /// <p></p>
69    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
70        &self.identifier
71    }
72    /// <p></p>
73    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.display_name = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p></p>
78    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.display_name = input;
80        self
81    }
82    /// <p></p>
83    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
84        &self.display_name
85    }
86    /// Consumes the builder and constructs a [`S3Grantee`](crate::types::S3Grantee).
87    pub fn build(self) -> crate::types::S3Grantee {
88        crate::types::S3Grantee {
89            type_identifier: self.type_identifier,
90            identifier: self.identifier,
91            display_name: self.display_name,
92        }
93    }
94}