aws-sdk-greengrass 1.98.0

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

/// Information about a resource.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Resource {
    /// The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub id: ::std::option::Option<::std::string::String>,
    /// The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Max length 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub name: ::std::option::Option<::std::string::String>,
    /// A container of data for all resource types.
    pub resource_data_container: ::std::option::Option<crate::types::ResourceDataContainer>,
}
impl Resource {
    /// The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Max length 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// A container of data for all resource types.
    pub fn resource_data_container(&self) -> ::std::option::Option<&crate::types::ResourceDataContainer> {
        self.resource_data_container.as_ref()
    }
}
impl Resource {
    /// Creates a new builder-style object to manufacture [`Resource`](crate::types::Resource).
    pub fn builder() -> crate::types::builders::ResourceBuilder {
        crate::types::builders::ResourceBuilder::default()
    }
}

/// A builder for [`Resource`](crate::types::Resource).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ResourceBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) resource_data_container: ::std::option::Option<crate::types::ResourceDataContainer>,
}
impl ResourceBuilder {
    /// The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// The resource ID, used to refer to a resource in the Lambda function configuration. Max length is 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Max length 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Max length 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The descriptive resource name, which is displayed on the AWS IoT Greengrass console. Max length 128 characters with pattern ''\[a-zA-Z0-9:_-\]+''. This must be unique within a Greengrass group.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// A container of data for all resource types.
    /// This field is required.
    pub fn resource_data_container(mut self, input: crate::types::ResourceDataContainer) -> Self {
        self.resource_data_container = ::std::option::Option::Some(input);
        self
    }
    /// A container of data for all resource types.
    pub fn set_resource_data_container(mut self, input: ::std::option::Option<crate::types::ResourceDataContainer>) -> Self {
        self.resource_data_container = input;
        self
    }
    /// A container of data for all resource types.
    pub fn get_resource_data_container(&self) -> &::std::option::Option<crate::types::ResourceDataContainer> {
        &self.resource_data_container
    }
    /// Consumes the builder and constructs a [`Resource`](crate::types::Resource).
    pub fn build(self) -> crate::types::Resource {
        crate::types::Resource {
            id: self.id,
            name: self.name,
            resource_data_container: self.resource_data_container,
        }
    }
}