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.

/// <p>An object that represents the status of an entity, component, component type, or workspace.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Status {
    /// <p>The current state of the entity, component, component type, or workspace.</p>
    pub state: ::std::option::Option<crate::types::State>,
    /// <p>The error message.</p>
    pub error: ::std::option::Option<crate::types::ErrorDetails>,
}
impl Status {
    /// <p>The current state of the entity, component, component type, or workspace.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::State> {
        self.state.as_ref()
    }
    /// <p>The error message.</p>
    pub fn error(&self) -> ::std::option::Option<&crate::types::ErrorDetails> {
        self.error.as_ref()
    }
}
impl Status {
    /// Creates a new builder-style object to manufacture [`Status`](crate::types::Status).
    pub fn builder() -> crate::types::builders::StatusBuilder {
        crate::types::builders::StatusBuilder::default()
    }
}

/// A builder for [`Status`](crate::types::Status).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StatusBuilder {
    pub(crate) state: ::std::option::Option<crate::types::State>,
    pub(crate) error: ::std::option::Option<crate::types::ErrorDetails>,
}
impl StatusBuilder {
    /// <p>The current state of the entity, component, component type, or workspace.</p>
    pub fn state(mut self, input: crate::types::State) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current state of the entity, component, component type, or workspace.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::State>) -> Self {
        self.state = input;
        self
    }
    /// <p>The current state of the entity, component, component type, or workspace.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::State> {
        &self.state
    }
    /// <p>The error message.</p>
    pub fn error(mut self, input: crate::types::ErrorDetails) -> Self {
        self.error = ::std::option::Option::Some(input);
        self
    }
    /// <p>The error message.</p>
    pub fn set_error(mut self, input: ::std::option::Option<crate::types::ErrorDetails>) -> Self {
        self.error = input;
        self
    }
    /// <p>The error message.</p>
    pub fn get_error(&self) -> &::std::option::Option<crate::types::ErrorDetails> {
        &self.error
    }
    /// Consumes the builder and constructs a [`Status`](crate::types::Status).
    pub fn build(self) -> crate::types::Status {
        crate::types::Status {
            state: self.state,
            error: self.error,
        }
    }
}