aws-sdk-quicksight 1.136.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 UpdateSpacePermissionsOutput {
    /// <p>The ID of the space.</p>
    pub space_id: ::std::string::String,
    /// <p>The ARN of the space.</p>
    pub space_arn: ::std::option::Option<::std::string::String>,
    /// <p>The updated permissions for the space.</p>
    pub permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
    /// <p>The Amazon Web Services request ID for this operation.</p>
    pub request_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateSpacePermissionsOutput {
    /// <p>The ID of the space.</p>
    pub fn space_id(&self) -> &str {
        use std::ops::Deref;
        self.space_id.deref()
    }
    /// <p>The ARN of the space.</p>
    pub fn space_arn(&self) -> ::std::option::Option<&str> {
        self.space_arn.as_deref()
    }
    /// <p>The updated permissions for the space.</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 `.permissions.is_none()`.
    pub fn permissions(&self) -> &[crate::types::ResourcePermission] {
        self.permissions.as_deref().unwrap_or_default()
    }
    /// <p>The Amazon Web Services request ID for this operation.</p>
    pub fn request_id(&self) -> ::std::option::Option<&str> {
        self.request_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for UpdateSpacePermissionsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl UpdateSpacePermissionsOutput {
    /// Creates a new builder-style object to manufacture [`UpdateSpacePermissionsOutput`](crate::operation::update_space_permissions::UpdateSpacePermissionsOutput).
    pub fn builder() -> crate::operation::update_space_permissions::builders::UpdateSpacePermissionsOutputBuilder {
        crate::operation::update_space_permissions::builders::UpdateSpacePermissionsOutputBuilder::default()
    }
}

/// A builder for [`UpdateSpacePermissionsOutput`](crate::operation::update_space_permissions::UpdateSpacePermissionsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateSpacePermissionsOutputBuilder {
    pub(crate) space_id: ::std::option::Option<::std::string::String>,
    pub(crate) space_arn: ::std::option::Option<::std::string::String>,
    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>,
    pub(crate) request_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl UpdateSpacePermissionsOutputBuilder {
    /// <p>The ID of the space.</p>
    /// This field is required.
    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
    }
    /// <p>The ID of the space.</p>
    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.space_id = input;
        self
    }
    /// <p>The ID of the space.</p>
    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_id
    }
    /// <p>The ARN of the space.</p>
    pub fn space_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.space_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the space.</p>
    pub fn set_space_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.space_arn = input;
        self
    }
    /// <p>The ARN of the space.</p>
    pub fn get_space_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.space_arn
    }
    /// Appends an item to `permissions`.
    ///
    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
    ///
    /// <p>The updated permissions for the space.</p>
    pub fn permissions(mut self, input: crate::types::ResourcePermission) -> Self {
        let mut v = self.permissions.unwrap_or_default();
        v.push(input);
        self.permissions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The updated permissions for the space.</p>
    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>>) -> Self {
        self.permissions = input;
        self
    }
    /// <p>The updated permissions for the space.</p>
    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ResourcePermission>> {
        &self.permissions
    }
    /// <p>The Amazon Web Services request ID for this operation.</p>
    pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.request_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services request ID for this operation.</p>
    pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.request_id = input;
        self
    }
    /// <p>The Amazon Web Services request ID for this operation.</p>
    pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.request_id
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`UpdateSpacePermissionsOutput`](crate::operation::update_space_permissions::UpdateSpacePermissionsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`space_id`](crate::operation::update_space_permissions::builders::UpdateSpacePermissionsOutputBuilder::space_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::update_space_permissions::UpdateSpacePermissionsOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::update_space_permissions::UpdateSpacePermissionsOutput {
            space_id: self.space_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "space_id",
                    "space_id was not specified but it is required when building UpdateSpacePermissionsOutput",
                )
            })?,
            space_arn: self.space_arn,
            permissions: self.permissions,
            request_id: self.request_id,
            _request_id: self._request_id,
        })
    }
}