aws-sdk-quicksight 1.134.0

AWS SDK for Amazon QuickSight
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateThemePermissionsInput {
    /// <p>The ID of the Amazon Web Services account that contains the theme.</p>
    pub aws_account_id: ::std::option::Option<::std::string::String>,
    /// <p>The ID for the theme.</p>
    pub theme_id: ::std::option::Option<::std::string::String>,
    /// <p>A list of resource permissions to be granted for the theme.</p>
    pub grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
    /// <p>A list of resource permissions to be revoked from the theme.</p>
    pub revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateThemePermissionsInput {
    /// <p>The ID of the Amazon Web Services account that contains the theme.</p>
    pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
        self.aws_account_id.as_deref()
    }
    /// <p>The ID for the theme.</p>
    pub fn theme_id(&self) -> ::std::option::Option<&str> {
        self.theme_id.as_deref()
    }
    /// <p>A list of resource permissions to be granted for the theme.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.grant_permissions.is_none()`.
    pub fn grant_permissions(&self) -> &[crate::types::ResourcePermission] {
        self.grant_permissions.as_deref().unwrap_or_default()
    }
    /// <p>A list of resource permissions to be revoked from the theme.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.revoke_permissions.is_none()`.
    pub fn revoke_permissions(&self) -> &[crate::types::ResourcePermission] {
        self.revoke_permissions.as_deref().unwrap_or_default()
    }
}
impl UpdateThemePermissionsInput {
    /// Creates a new builder-style object to manufacture [`UpdateThemePermissionsInput`](crate::operation::update_theme_permissions::UpdateThemePermissionsInput).
    pub fn builder() -> crate::operation::update_theme_permissions::builders::UpdateThemePermissionsInputBuilder {
        crate::operation::update_theme_permissions::builders::UpdateThemePermissionsInputBuilder::default()
    }
}

/// A builder for [`UpdateThemePermissionsInput`](crate::operation::update_theme_permissions::UpdateThemePermissionsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateThemePermissionsInputBuilder {
    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
    pub(crate) theme_id: ::std::option::Option<::std::string::String>,
    pub(crate) grant_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
    pub(crate) revoke_permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
}
impl UpdateThemePermissionsInputBuilder {
    /// <p>The ID of the Amazon Web Services account that contains the theme.</p>
    /// This field is required.
    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.aws_account_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the Amazon Web Services account that contains the theme.</p>
    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.aws_account_id = input;
        self
    }
    /// <p>The ID of the Amazon Web Services account that contains the theme.</p>
    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.aws_account_id
    }
    /// <p>The ID for the theme.</p>
    /// This field is required.
    pub fn theme_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.theme_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID for the theme.</p>
    pub fn set_theme_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.theme_id = input;
        self
    }
    /// <p>The ID for the theme.</p>
    pub fn get_theme_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.theme_id
    }
    /// Appends an item to `grant_permissions`.
    ///
    /// To override the contents of this collection use [`set_grant_permissions`](Self::set_grant_permissions).
    ///
    /// <p>A list of resource permissions to be granted for the theme.</p>
    pub fn grant_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
        let mut v = self.grant_permissions.unwrap_or_default();
        v.push(input);
        self.grant_permissions = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of resource permissions to be granted for the theme.</p>
    pub fn set_grant_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
        self.grant_permissions = input;
        self
    }
    /// <p>A list of resource permissions to be granted for the theme.</p>
    pub fn get_grant_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
        &self.grant_permissions
    }
    /// Appends an item to `revoke_permissions`.
    ///
    /// To override the contents of this collection use [`set_revoke_permissions`](Self::set_revoke_permissions).
    ///
    /// <p>A list of resource permissions to be revoked from the theme.</p>
    pub fn revoke_permissions(mut self, input: crate::types::ResourcePermission) -> Self {
        let mut v = self.revoke_permissions.unwrap_or_default();
        v.push(input);
        self.revoke_permissions = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of resource permissions to be revoked from the theme.</p>
    pub fn set_revoke_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
        self.revoke_permissions = input;
        self
    }
    /// <p>A list of resource permissions to be revoked from the theme.</p>
    pub fn get_revoke_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
        &self.revoke_permissions
    }
    /// Consumes the builder and constructs a [`UpdateThemePermissionsInput`](crate::operation::update_theme_permissions::UpdateThemePermissionsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_theme_permissions::UpdateThemePermissionsInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_theme_permissions::UpdateThemePermissionsInput {
            aws_account_id: self.aws_account_id,
            theme_id: self.theme_id,
            grant_permissions: self.grant_permissions,
            revoke_permissions: self.revoke_permissions,
        })
    }
}