aws-sdk-iotthingsgraph 1.97.0

AWS SDK for AWS IoT Things Graph
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An AWS IoT thing.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Thing {
    /// <p>The ARN of the thing.</p>
    pub thing_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the thing.</p>
    pub thing_name: ::std::option::Option<::std::string::String>,
}
impl Thing {
    /// <p>The ARN of the thing.</p>
    pub fn thing_arn(&self) -> ::std::option::Option<&str> {
        self.thing_arn.as_deref()
    }
    /// <p>The name of the thing.</p>
    pub fn thing_name(&self) -> ::std::option::Option<&str> {
        self.thing_name.as_deref()
    }
}
impl Thing {
    /// Creates a new builder-style object to manufacture [`Thing`](crate::types::Thing).
    pub fn builder() -> crate::types::builders::ThingBuilder {
        crate::types::builders::ThingBuilder::default()
    }
}

/// A builder for [`Thing`](crate::types::Thing).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ThingBuilder {
    pub(crate) thing_arn: ::std::option::Option<::std::string::String>,
    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
}
impl ThingBuilder {
    /// <p>The ARN of the thing.</p>
    pub fn thing_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the thing.</p>
    pub fn set_thing_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_arn = input;
        self
    }
    /// <p>The ARN of the thing.</p>
    pub fn get_thing_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_arn
    }
    /// <p>The name of the thing.</p>
    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.thing_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the thing.</p>
    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.thing_name = input;
        self
    }
    /// <p>The name of the thing.</p>
    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.thing_name
    }
    /// Consumes the builder and constructs a [`Thing`](crate::types::Thing).
    pub fn build(self) -> crate::types::Thing {
        crate::types::Thing {
            thing_arn: self.thing_arn,
            thing_name: self.thing_name,
        }
    }
}