aws-sdk-quicksight 1.145.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 DescribeSpaceOutput {
    /// <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 details of the space.</p>
    pub space: ::std::option::Option<crate::types::SpaceDetails>,
    /// <p>A list of contributors to the space.</p>
    pub contributors: ::std::option::Option<::std::vec::Vec<crate::types::SpaceContributor>>,
    /// <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 DescribeSpaceOutput {
    /// <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 details of the space.</p>
    pub fn space(&self) -> ::std::option::Option<&crate::types::SpaceDetails> {
        self.space.as_ref()
    }
    /// <p>A list of contributors to 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 `.contributors.is_none()`.
    pub fn contributors(&self) -> &[crate::types::SpaceContributor] {
        self.contributors.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 DescribeSpaceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribeSpaceOutput {
    /// Creates a new builder-style object to manufacture [`DescribeSpaceOutput`](crate::operation::describe_space::DescribeSpaceOutput).
    pub fn builder() -> crate::operation::describe_space::builders::DescribeSpaceOutputBuilder {
        crate::operation::describe_space::builders::DescribeSpaceOutputBuilder::default()
    }
}

/// A builder for [`DescribeSpaceOutput`](crate::operation::describe_space::DescribeSpaceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeSpaceOutputBuilder {
    pub(crate) space_id: ::std::option::Option<::std::string::String>,
    pub(crate) space_arn: ::std::option::Option<::std::string::String>,
    pub(crate) space: ::std::option::Option<crate::types::SpaceDetails>,
    pub(crate) contributors: ::std::option::Option<::std::vec::Vec<crate::types::SpaceContributor>>,
    pub(crate) request_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl DescribeSpaceOutputBuilder {
    /// <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
    }
    /// <p>The details of the space.</p>
    /// This field is required.
    pub fn space(mut self, input: crate::types::SpaceDetails) -> Self {
        self.space = ::std::option::Option::Some(input);
        self
    }
    /// <p>The details of the space.</p>
    pub fn set_space(mut self, input: ::std::option::Option<crate::types::SpaceDetails>) -> Self {
        self.space = input;
        self
    }
    /// <p>The details of the space.</p>
    pub fn get_space(&self) -> &::std::option::Option<crate::types::SpaceDetails> {
        &self.space
    }
    /// Appends an item to `contributors`.
    ///
    /// To override the contents of this collection use [`set_contributors`](Self::set_contributors).
    ///
    /// <p>A list of contributors to the space.</p>
    pub fn contributors(mut self, input: crate::types::SpaceContributor) -> Self {
        let mut v = self.contributors.unwrap_or_default();
        v.push(input);
        self.contributors = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of contributors to the space.</p>
    pub fn set_contributors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SpaceContributor>>) -> Self {
        self.contributors = input;
        self
    }
    /// <p>A list of contributors to the space.</p>
    pub fn get_contributors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SpaceContributor>> {
        &self.contributors
    }
    /// <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 [`DescribeSpaceOutput`](crate::operation::describe_space::DescribeSpaceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`space_id`](crate::operation::describe_space::builders::DescribeSpaceOutputBuilder::space_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_space::DescribeSpaceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::describe_space::DescribeSpaceOutput {
            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 DescribeSpaceOutput",
                )
            })?,
            space_arn: self.space_arn,
            space: self.space,
            contributors: self.contributors,
            request_id: self.request_id,
            _request_id: self._request_id,
        })
    }
}