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 specifies a relationship with another component type.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Relationship {
    /// <p>The ID of the target component type associated with this relationship.</p>
    pub target_component_type_id: ::std::option::Option<::std::string::String>,
    /// <p>The type of the relationship.</p>
    pub relationship_type: ::std::option::Option<::std::string::String>,
}
impl Relationship {
    /// <p>The ID of the target component type associated with this relationship.</p>
    pub fn target_component_type_id(&self) -> ::std::option::Option<&str> {
        self.target_component_type_id.as_deref()
    }
    /// <p>The type of the relationship.</p>
    pub fn relationship_type(&self) -> ::std::option::Option<&str> {
        self.relationship_type.as_deref()
    }
}
impl Relationship {
    /// Creates a new builder-style object to manufacture [`Relationship`](crate::types::Relationship).
    pub fn builder() -> crate::types::builders::RelationshipBuilder {
        crate::types::builders::RelationshipBuilder::default()
    }
}

/// A builder for [`Relationship`](crate::types::Relationship).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RelationshipBuilder {
    pub(crate) target_component_type_id: ::std::option::Option<::std::string::String>,
    pub(crate) relationship_type: ::std::option::Option<::std::string::String>,
}
impl RelationshipBuilder {
    /// <p>The ID of the target component type associated with this relationship.</p>
    pub fn target_component_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_component_type_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the target component type associated with this relationship.</p>
    pub fn set_target_component_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_component_type_id = input;
        self
    }
    /// <p>The ID of the target component type associated with this relationship.</p>
    pub fn get_target_component_type_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_component_type_id
    }
    /// <p>The type of the relationship.</p>
    pub fn relationship_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.relationship_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of the relationship.</p>
    pub fn set_relationship_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.relationship_type = input;
        self
    }
    /// <p>The type of the relationship.</p>
    pub fn get_relationship_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.relationship_type
    }
    /// Consumes the builder and constructs a [`Relationship`](crate::types::Relationship).
    pub fn build(self) -> crate::types::Relationship {
        crate::types::Relationship {
            target_component_type_id: self.target_component_type_id,
            relationship_type: self.relationship_type,
        }
    }
}