#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateAccessGrantInput {
pub domain_id: ::std::option::Option<::std::string::String>,
pub space_id: ::std::option::Option<::std::string::String>,
pub name: ::std::option::Option<::std::string::String>,
pub principal: ::std::option::Option<crate::types::AccessGrantPrincipal>,
pub permission: ::std::option::Option<crate::types::AccessGrantPermission>,
pub scoped_actions: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>,
pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAccessGrantInput {
pub fn domain_id(&self) -> ::std::option::Option<&str> {
self.domain_id.as_deref()
}
pub fn space_id(&self) -> ::std::option::Option<&str> {
self.space_id.as_deref()
}
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
pub fn principal(&self) -> ::std::option::Option<&crate::types::AccessGrantPrincipal> {
self.principal.as_ref()
}
pub fn permission(&self) -> ::std::option::Option<&crate::types::AccessGrantPermission> {
self.permission.as_ref()
}
pub fn scoped_actions(&self) -> &[crate::types::ScopedActions] {
self.scoped_actions.as_deref().unwrap_or_default()
}
pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.tags.as_ref()
}
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
}
impl CreateAccessGrantInput {
pub fn builder() -> crate::operation::create_access_grant::builders::CreateAccessGrantInputBuilder {
crate::operation::create_access_grant::builders::CreateAccessGrantInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAccessGrantInputBuilder {
pub(crate) domain_id: ::std::option::Option<::std::string::String>,
pub(crate) space_id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) principal: ::std::option::Option<crate::types::AccessGrantPrincipal>,
pub(crate) permission: ::std::option::Option<crate::types::AccessGrantPermission>,
pub(crate) scoped_actions: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>,
pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateAccessGrantInputBuilder {
pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.domain_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.domain_id = input;
self
}
pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
&self.domain_id
}
pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.space_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.space_id = input;
self
}
pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
&self.space_id
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn principal(mut self, input: crate::types::AccessGrantPrincipal) -> Self {
self.principal = ::std::option::Option::Some(input);
self
}
pub fn set_principal(mut self, input: ::std::option::Option<crate::types::AccessGrantPrincipal>) -> Self {
self.principal = input;
self
}
pub fn get_principal(&self) -> &::std::option::Option<crate::types::AccessGrantPrincipal> {
&self.principal
}
pub fn permission(mut self, input: crate::types::AccessGrantPermission) -> Self {
self.permission = ::std::option::Option::Some(input);
self
}
pub fn set_permission(mut self, input: ::std::option::Option<crate::types::AccessGrantPermission>) -> Self {
self.permission = input;
self
}
pub fn get_permission(&self) -> &::std::option::Option<crate::types::AccessGrantPermission> {
&self.permission
}
pub fn scoped_actions(mut self, input: crate::types::ScopedActions) -> Self {
let mut v = self.scoped_actions.unwrap_or_default();
v.push(input);
self.scoped_actions = ::std::option::Option::Some(v);
self
}
pub fn set_scoped_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>>) -> Self {
self.scoped_actions = input;
self
}
pub fn get_scoped_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScopedActions>> {
&self.scoped_actions
}
pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = ::std::option::Option::Some(hash_map);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.tags
}
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_access_grant::CreateAccessGrantInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_access_grant::CreateAccessGrantInput {
domain_id: self.domain_id,
space_id: self.space_id,
name: self.name,
principal: self.principal,
permission: self.permission,
scoped_actions: self.scoped_actions,
tags: self.tags,
client_token: self.client_token,
})
}
}