aws-sdk-iotthingsgraph 1.98.0

AWS SDK for AWS IoT Things Graph
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateSystemInstanceInput {
    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>A document that defines an entity.</p>
    pub definition: ::std::option::Option<crate::types::DefinitionDocument>,
    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
    pub target: ::std::option::Option<crate::types::DeploymentTarget>,
    /// <p>The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub greengrass_group_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance's resource file. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub s3_bucket_name: ::std::option::Option<::std::string::String>,
    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
    pub metrics_configuration: ::std::option::Option<crate::types::MetricsConfiguration>,
    /// <p>The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the <code>target</code> parameter is <code>CLOUD</code>.</p>
    pub flow_actions_role_arn: ::std::option::Option<::std::string::String>,
}
impl CreateSystemInstanceInput {
    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>A document that defines an entity.</p>
    pub fn definition(&self) -> ::std::option::Option<&crate::types::DefinitionDocument> {
        self.definition.as_ref()
    }
    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
    pub fn target(&self) -> ::std::option::Option<&crate::types::DeploymentTarget> {
        self.target.as_ref()
    }
    /// <p>The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn greengrass_group_name(&self) -> ::std::option::Option<&str> {
        self.greengrass_group_name.as_deref()
    }
    /// <p>The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance's resource file. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn s3_bucket_name(&self) -> ::std::option::Option<&str> {
        self.s3_bucket_name.as_deref()
    }
    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
    pub fn metrics_configuration(&self) -> ::std::option::Option<&crate::types::MetricsConfiguration> {
        self.metrics_configuration.as_ref()
    }
    /// <p>The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the <code>target</code> parameter is <code>CLOUD</code>.</p>
    pub fn flow_actions_role_arn(&self) -> ::std::option::Option<&str> {
        self.flow_actions_role_arn.as_deref()
    }
}
impl CreateSystemInstanceInput {
    /// Creates a new builder-style object to manufacture [`CreateSystemInstanceInput`](crate::operation::create_system_instance::CreateSystemInstanceInput).
    pub fn builder() -> crate::operation::create_system_instance::builders::CreateSystemInstanceInputBuilder {
        crate::operation::create_system_instance::builders::CreateSystemInstanceInputBuilder::default()
    }
}

/// A builder for [`CreateSystemInstanceInput`](crate::operation::create_system_instance::CreateSystemInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSystemInstanceInputBuilder {
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) definition: ::std::option::Option<crate::types::DefinitionDocument>,
    pub(crate) target: ::std::option::Option<crate::types::DeploymentTarget>,
    pub(crate) greengrass_group_name: ::std::option::Option<::std::string::String>,
    pub(crate) s3_bucket_name: ::std::option::Option<::std::string::String>,
    pub(crate) metrics_configuration: ::std::option::Option<crate::types::MetricsConfiguration>,
    pub(crate) flow_actions_role_arn: ::std::option::Option<::std::string::String>,
}
impl CreateSystemInstanceInputBuilder {
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>A document that defines an entity.</p>
    /// This field is required.
    pub fn definition(mut self, input: crate::types::DefinitionDocument) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>A document that defines an entity.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::DefinitionDocument>) -> Self {
        self.definition = input;
        self
    }
    /// <p>A document that defines an entity.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::DefinitionDocument> {
        &self.definition
    }
    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
    /// This field is required.
    pub fn target(mut self, input: crate::types::DeploymentTarget) -> Self {
        self.target = ::std::option::Option::Some(input);
        self
    }
    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
    pub fn set_target(mut self, input: ::std::option::Option<crate::types::DeploymentTarget>) -> Self {
        self.target = input;
        self
    }
    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
    pub fn get_target(&self) -> &::std::option::Option<crate::types::DeploymentTarget> {
        &self.target
    }
    /// <p>The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn greengrass_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.greengrass_group_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn set_greengrass_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.greengrass_group_name = input;
        self
    }
    /// <p>The name of the Greengrass group where the system instance will be deployed. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn get_greengrass_group_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.greengrass_group_name
    }
    /// <p>The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance's resource file. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.s3_bucket_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance's resource file. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.s3_bucket_name = input;
        self
    }
    /// <p>The name of the Amazon Simple Storage Service bucket that will be used to store and deploy the system instance's resource file. This value is required if the value of the <code>target</code> parameter is <code>GREENGRASS</code>.</p>
    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.s3_bucket_name
    }
    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
    pub fn metrics_configuration(mut self, input: crate::types::MetricsConfiguration) -> Self {
        self.metrics_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
    pub fn set_metrics_configuration(mut self, input: ::std::option::Option<crate::types::MetricsConfiguration>) -> Self {
        self.metrics_configuration = input;
        self
    }
    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
    pub fn get_metrics_configuration(&self) -> &::std::option::Option<crate::types::MetricsConfiguration> {
        &self.metrics_configuration
    }
    /// <p>The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the <code>target</code> parameter is <code>CLOUD</code>.</p>
    pub fn flow_actions_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.flow_actions_role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the <code>target</code> parameter is <code>CLOUD</code>.</p>
    pub fn set_flow_actions_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.flow_actions_role_arn = input;
        self
    }
    /// <p>The ARN of the IAM role that AWS IoT Things Graph will assume when it executes the flow. This role must have read and write access to AWS Lambda and AWS IoT and any other AWS services that the flow uses when it executes. This value is required if the value of the <code>target</code> parameter is <code>CLOUD</code>.</p>
    pub fn get_flow_actions_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.flow_actions_role_arn
    }
    /// Consumes the builder and constructs a [`CreateSystemInstanceInput`](crate::operation::create_system_instance::CreateSystemInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_system_instance::CreateSystemInstanceInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_system_instance::CreateSystemInstanceInput {
            tags: self.tags,
            definition: self.definition,
            target: self.target,
            greengrass_group_name: self.greengrass_group_name,
            s3_bucket_name: self.s3_bucket_name,
            metrics_configuration: self.metrics_configuration,
            flow_actions_role_arn: self.flow_actions_role_arn,
        })
    }
}