#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Grantee {
pub display_name: ::std::option::Option<::std::string::String>,
pub email_address: ::std::option::Option<::std::string::String>,
pub id: ::std::option::Option<::std::string::String>,
pub uri: ::std::option::Option<::std::string::String>,
pub r#type: crate::types::Type,
}
impl Grantee {
pub fn display_name(&self) -> ::std::option::Option<&str> {
self.display_name.as_deref()
}
pub fn email_address(&self) -> ::std::option::Option<&str> {
self.email_address.as_deref()
}
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
pub fn uri(&self) -> ::std::option::Option<&str> {
self.uri.as_deref()
}
pub fn r#type(&self) -> &crate::types::Type {
&self.r#type
}
}
impl Grantee {
pub fn builder() -> crate::types::builders::GranteeBuilder {
crate::types::builders::GranteeBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GranteeBuilder {
pub(crate) display_name: ::std::option::Option<::std::string::String>,
pub(crate) email_address: ::std::option::Option<::std::string::String>,
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) uri: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::Type>,
}
impl GranteeBuilder {
pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.display_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.display_name = input;
self
}
pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
&self.display_name
}
pub fn email_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.email_address = ::std::option::Option::Some(input.into());
self
}
pub fn set_email_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.email_address = input;
self
}
pub fn get_email_address(&self) -> &::std::option::Option<::std::string::String> {
&self.email_address
}
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
pub fn uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.uri = ::std::option::Option::Some(input.into());
self
}
pub fn set_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.uri = input;
self
}
pub fn get_uri(&self) -> &::std::option::Option<::std::string::String> {
&self.uri
}
pub fn r#type(mut self, input: crate::types::Type) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
&self.r#type
}
pub fn build(self) -> ::std::result::Result<crate::types::Grantee, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Grantee {
display_name: self.display_name,
email_address: self.email_address,
id: self.id,
uri: self.uri,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Grantee",
)
})?,
})
}
}