aws-sdk-iottwinmaker 1.101.0

AWS SDK for AWS IoT TwinMaker
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 GetWorkspaceOutput {
    /// <p>The ID of the workspace.</p>
    pub workspace_id: ::std::string::String,
    /// <p>The ARN of the workspace.</p>
    pub arn: ::std::string::String,
    /// <p>The description of the workspace.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>A list of services that are linked to the workspace.</p>
    pub linked_services: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
    pub s3_location: ::std::option::Option<::std::string::String>,
    /// <p>The ARN of the execution role associated with the workspace.</p>
    pub role: ::std::option::Option<::std::string::String>,
    /// <p>The date and time when the workspace was created.</p>
    pub creation_date_time: ::aws_smithy_types::DateTime,
    /// <p>The date and time when the workspace was last updated.</p>
    pub update_date_time: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl GetWorkspaceOutput {
    /// <p>The ID of the workspace.</p>
    pub fn workspace_id(&self) -> &str {
        use std::ops::Deref;
        self.workspace_id.deref()
    }
    /// <p>The ARN of the workspace.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>The description of the workspace.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>A list of services that are linked to the workspace.</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 `.linked_services.is_none()`.
    pub fn linked_services(&self) -> &[::std::string::String] {
        self.linked_services.as_deref().unwrap_or_default()
    }
    /// <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
    pub fn s3_location(&self) -> ::std::option::Option<&str> {
        self.s3_location.as_deref()
    }
    /// <p>The ARN of the execution role associated with the workspace.</p>
    pub fn role(&self) -> ::std::option::Option<&str> {
        self.role.as_deref()
    }
    /// <p>The date and time when the workspace was created.</p>
    pub fn creation_date_time(&self) -> &::aws_smithy_types::DateTime {
        &self.creation_date_time
    }
    /// <p>The date and time when the workspace was last updated.</p>
    pub fn update_date_time(&self) -> &::aws_smithy_types::DateTime {
        &self.update_date_time
    }
}
impl ::aws_types::request_id::RequestId for GetWorkspaceOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetWorkspaceOutput {
    /// Creates a new builder-style object to manufacture [`GetWorkspaceOutput`](crate::operation::get_workspace::GetWorkspaceOutput).
    pub fn builder() -> crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder {
        crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder::default()
    }
}

/// A builder for [`GetWorkspaceOutput`](crate::operation::get_workspace::GetWorkspaceOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetWorkspaceOutputBuilder {
    pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) linked_services: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) s3_location: ::std::option::Option<::std::string::String>,
    pub(crate) role: ::std::option::Option<::std::string::String>,
    pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) update_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl GetWorkspaceOutputBuilder {
    /// <p>The ID of the workspace.</p>
    /// This field is required.
    pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.workspace_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the workspace.</p>
    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.workspace_id = input;
        self
    }
    /// <p>The ID of the workspace.</p>
    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.workspace_id
    }
    /// <p>The ARN of the workspace.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the workspace.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the workspace.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The description of the workspace.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the workspace.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the workspace.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `linked_services`.
    ///
    /// To override the contents of this collection use [`set_linked_services`](Self::set_linked_services).
    ///
    /// <p>A list of services that are linked to the workspace.</p>
    pub fn linked_services(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.linked_services.unwrap_or_default();
        v.push(input.into());
        self.linked_services = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of services that are linked to the workspace.</p>
    pub fn set_linked_services(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.linked_services = input;
        self
    }
    /// <p>A list of services that are linked to the workspace.</p>
    pub fn get_linked_services(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.linked_services
    }
    /// <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
    pub fn s3_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.s3_location = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
    pub fn set_s3_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.s3_location = input;
        self
    }
    /// <p>The ARN of the S3 bucket where resources associated with the workspace are stored.</p>
    pub fn get_s3_location(&self) -> &::std::option::Option<::std::string::String> {
        &self.s3_location
    }
    /// <p>The ARN of the execution role associated with the workspace.</p>
    pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the execution role associated with the workspace.</p>
    pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role = input;
        self
    }
    /// <p>The ARN of the execution role associated with the workspace.</p>
    pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.role
    }
    /// <p>The date and time when the workspace was created.</p>
    /// This field is required.
    pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.creation_date_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the workspace was created.</p>
    pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.creation_date_time = input;
        self
    }
    /// <p>The date and time when the workspace was created.</p>
    pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.creation_date_time
    }
    /// <p>The date and time when the workspace was last updated.</p>
    /// This field is required.
    pub fn update_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.update_date_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the workspace was last updated.</p>
    pub fn set_update_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.update_date_time = input;
        self
    }
    /// <p>The date and time when the workspace was last updated.</p>
    pub fn get_update_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.update_date_time
    }
    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 [`GetWorkspaceOutput`](crate::operation::get_workspace::GetWorkspaceOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`workspace_id`](crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder::workspace_id)
    /// - [`arn`](crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder::arn)
    /// - [`creation_date_time`](crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder::creation_date_time)
    /// - [`update_date_time`](crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder::update_date_time)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_workspace::GetWorkspaceOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_workspace::GetWorkspaceOutput {
            workspace_id: self.workspace_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "workspace_id",
                    "workspace_id was not specified but it is required when building GetWorkspaceOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building GetWorkspaceOutput",
                )
            })?,
            description: self.description,
            linked_services: self.linked_services,
            s3_location: self.s3_location,
            role: self.role,
            creation_date_time: self.creation_date_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "creation_date_time",
                    "creation_date_time was not specified but it is required when building GetWorkspaceOutput",
                )
            })?,
            update_date_time: self.update_date_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "update_date_time",
                    "update_date_time was not specified but it is required when building GetWorkspaceOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}