aws_sdk_iotthingsgraph/operation/create_system_instance/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_system_instance::_create_system_instance_output::CreateSystemInstanceOutputBuilder;
3
4pub use crate::operation::create_system_instance::_create_system_instance_input::CreateSystemInstanceInputBuilder;
5
6impl crate::operation::create_system_instance::builders::CreateSystemInstanceInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_system_instance::CreateSystemInstanceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_system_instance::CreateSystemInstanceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_system_instance();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSystemInstance`.
24///
25/// <p>Creates a system instance.</p>
26/// <p>This action validates the system instance, prepares the deployment-related resources. For Greengrass deployments, it updates the Greengrass group that is specified by the <code>greengrassGroupName</code> parameter. It also adds a file to the S3 bucket specified by the <code>s3BucketName</code> parameter. You need to call <code>DeploySystemInstance</code> after running this action.</p>
27/// <p>For Greengrass deployments, since this action modifies and adds resources to a Greengrass group and an S3 bucket on the caller's behalf, the calling identity must have write permissions to both the specified Greengrass group and S3 bucket. Otherwise, the call will fail with an authorization error.</p>
28/// <p>For cloud deployments, this action requires a <code>flowActionsRoleArn</code> value. This is an IAM role that has permissions to access AWS services, such as AWS Lambda and AWS IoT, that the flow uses when it executes.</p>
29/// <p>If the definition document doesn't specify a version of the user's namespace, the latest version will be used by default.</p>
30#[deprecated(note = "since: 2022-08-30")]
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateSystemInstanceFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::create_system_instance::builders::CreateSystemInstanceInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::create_system_instance::CreateSystemInstanceOutput,
40        crate::operation::create_system_instance::CreateSystemInstanceError,
41    > for CreateSystemInstanceFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::create_system_instance::CreateSystemInstanceOutput,
49            crate::operation::create_system_instance::CreateSystemInstanceError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl CreateSystemInstanceFluentBuilder {
56    /// Creates a new `CreateSystemInstanceFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the CreateSystemInstance as a reference.
65    pub fn as_input(&self) -> &crate::operation::create_system_instance::builders::CreateSystemInstanceInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::create_system_instance::CreateSystemInstanceOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::create_system_instance::CreateSystemInstanceError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::create_system_instance::CreateSystemInstance::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::create_system_instance::CreateSystemInstance::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::create_system_instance::CreateSystemInstanceOutput,
102        crate::operation::create_system_instance::CreateSystemInstanceError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    ///
117    /// Appends an item to `tags`.
118    ///
119    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
120    ///
121    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
122    pub fn tags(mut self, input: crate::types::Tag) -> Self {
123        self.inner = self.inner.tags(input);
124        self
125    }
126    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
127    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
128        self.inner = self.inner.set_tags(input);
129        self
130    }
131    /// <p>Metadata, consisting of key-value pairs, that can be used to categorize your system instances.</p>
132    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
133        self.inner.get_tags()
134    }
135    /// <p>A document that defines an entity.</p>
136    pub fn definition(mut self, input: crate::types::DefinitionDocument) -> Self {
137        self.inner = self.inner.definition(input);
138        self
139    }
140    /// <p>A document that defines an entity.</p>
141    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::DefinitionDocument>) -> Self {
142        self.inner = self.inner.set_definition(input);
143        self
144    }
145    /// <p>A document that defines an entity.</p>
146    pub fn get_definition(&self) -> &::std::option::Option<crate::types::DefinitionDocument> {
147        self.inner.get_definition()
148    }
149    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
150    pub fn target(mut self, input: crate::types::DeploymentTarget) -> Self {
151        self.inner = self.inner.target(input);
152        self
153    }
154    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
155    pub fn set_target(mut self, input: ::std::option::Option<crate::types::DeploymentTarget>) -> Self {
156        self.inner = self.inner.set_target(input);
157        self
158    }
159    /// <p>The target type of the deployment. Valid values are <code>GREENGRASS</code> and <code>CLOUD</code>.</p>
160    pub fn get_target(&self) -> &::std::option::Option<crate::types::DeploymentTarget> {
161        self.inner.get_target()
162    }
163    /// <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>
164    pub fn greengrass_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.greengrass_group_name(input.into());
166        self
167    }
168    /// <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>
169    pub fn set_greengrass_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.inner = self.inner.set_greengrass_group_name(input);
171        self
172    }
173    /// <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>
174    pub fn get_greengrass_group_name(&self) -> &::std::option::Option<::std::string::String> {
175        self.inner.get_greengrass_group_name()
176    }
177    /// <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>
178    pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.s3_bucket_name(input.into());
180        self
181    }
182    /// <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>
183    pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_s3_bucket_name(input);
185        self
186    }
187    /// <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>
188    pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
189        self.inner.get_s3_bucket_name()
190    }
191    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
192    pub fn metrics_configuration(mut self, input: crate::types::MetricsConfiguration) -> Self {
193        self.inner = self.inner.metrics_configuration(input);
194        self
195    }
196    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
197    pub fn set_metrics_configuration(mut self, input: ::std::option::Option<crate::types::MetricsConfiguration>) -> Self {
198        self.inner = self.inner.set_metrics_configuration(input);
199        self
200    }
201    /// <p>An object that specifies whether cloud metrics are collected in a deployment and, if so, what role is used to collect metrics.</p>
202    pub fn get_metrics_configuration(&self) -> &::std::option::Option<crate::types::MetricsConfiguration> {
203        self.inner.get_metrics_configuration()
204    }
205    /// <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>
206    pub fn flow_actions_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.flow_actions_role_arn(input.into());
208        self
209    }
210    /// <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>
211    pub fn set_flow_actions_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_flow_actions_role_arn(input);
213        self
214    }
215    /// <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>
216    pub fn get_flow_actions_role_arn(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_flow_actions_role_arn()
218    }
219}