aws-sdk-greengrassv2 1.112.0

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

/// <p>Contains information about a component.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Component {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version.</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the component.</p>
    pub component_name: ::std::option::Option<::std::string::String>,
    /// <p>The latest version of the component and its details.</p>
    pub latest_version: ::std::option::Option<crate::types::ComponentLatestVersion>,
}
impl Component {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version.</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The name of the component.</p>
    pub fn component_name(&self) -> ::std::option::Option<&str> {
        self.component_name.as_deref()
    }
    /// <p>The latest version of the component and its details.</p>
    pub fn latest_version(&self) -> ::std::option::Option<&crate::types::ComponentLatestVersion> {
        self.latest_version.as_ref()
    }
}
impl Component {
    /// Creates a new builder-style object to manufacture [`Component`](crate::types::Component).
    pub fn builder() -> crate::types::builders::ComponentBuilder {
        crate::types::builders::ComponentBuilder::default()
    }
}

/// A builder for [`Component`](crate::types::Component).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ComponentBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) component_name: ::std::option::Option<::std::string::String>,
    pub(crate) latest_version: ::std::option::Option<crate::types::ComponentLatestVersion>,
}
impl ComponentBuilder {
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version.</p>
    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 <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the component version.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The name of the component.</p>
    pub fn component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.component_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the component.</p>
    pub fn set_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.component_name = input;
        self
    }
    /// <p>The name of the component.</p>
    pub fn get_component_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.component_name
    }
    /// <p>The latest version of the component and its details.</p>
    pub fn latest_version(mut self, input: crate::types::ComponentLatestVersion) -> Self {
        self.latest_version = ::std::option::Option::Some(input);
        self
    }
    /// <p>The latest version of the component and its details.</p>
    pub fn set_latest_version(mut self, input: ::std::option::Option<crate::types::ComponentLatestVersion>) -> Self {
        self.latest_version = input;
        self
    }
    /// <p>The latest version of the component and its details.</p>
    pub fn get_latest_version(&self) -> &::std::option::Option<crate::types::ComponentLatestVersion> {
        &self.latest_version
    }
    /// Consumes the builder and constructs a [`Component`](crate::types::Component).
    pub fn build(self) -> crate::types::Component {
        crate::types::Component {
            arn: self.arn,
            component_name: self.component_name,
            latest_version: self.latest_version,
        }
    }
}