aws_sdk_iotthingsgraph/operation/deploy_system_instance/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::deploy_system_instance::_deploy_system_instance_output::DeploySystemInstanceOutputBuilder;
3
4pub use crate::operation::deploy_system_instance::_deploy_system_instance_input::DeploySystemInstanceInputBuilder;
5
6impl crate::operation::deploy_system_instance::builders::DeploySystemInstanceInputBuilder {
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::deploy_system_instance::DeploySystemInstanceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::deploy_system_instance::DeploySystemInstanceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.deploy_system_instance();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeploySystemInstance`.
24///
25/// <p><b>Greengrass and Cloud Deployments</b></p>
26/// <p>Deploys the system instance to the target specified in <code>CreateSystemInstance</code>.</p>
27/// <p><b>Greengrass Deployments</b></p>
28/// <p>If the system or any workflows and entities have been updated before this action is called, then the deployment will create a new Amazon Simple Storage Service resource file and then deploy it.</p>
29/// <p>Since this action creates a Greengrass deployment on the caller's behalf, the calling identity must have write permissions to the specified Greengrass group. Otherwise, the call will fail with an authorization error.</p>
30/// <p>For information about the artifacts that get added to your Greengrass core device when you use this API, see <a href="https://docs.aws.amazon.com/thingsgraph/latest/ug/iot-tg-greengrass.html">AWS IoT Things Graph and AWS IoT Greengrass</a>.</p>
31#[deprecated(note = "since: 2022-08-30")]
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct DeploySystemInstanceFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::deploy_system_instance::builders::DeploySystemInstanceInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::deploy_system_instance::DeploySystemInstanceOutput,
41        crate::operation::deploy_system_instance::DeploySystemInstanceError,
42    > for DeploySystemInstanceFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::deploy_system_instance::DeploySystemInstanceOutput,
50            crate::operation::deploy_system_instance::DeploySystemInstanceError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl DeploySystemInstanceFluentBuilder {
57    /// Creates a new `DeploySystemInstanceFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the DeploySystemInstance as a reference.
66    pub fn as_input(&self) -> &crate::operation::deploy_system_instance::builders::DeploySystemInstanceInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::deploy_system_instance::DeploySystemInstanceOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::deploy_system_instance::DeploySystemInstanceError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::deploy_system_instance::DeploySystemInstance::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::deploy_system_instance::DeploySystemInstance::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::deploy_system_instance::DeploySystemInstanceOutput,
103        crate::operation::deploy_system_instance::DeploySystemInstanceError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.</p>
118    /// <p>The ID should be in the following format.</p>
119    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code></p>
120    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.id(input.into());
122        self
123    }
124    /// <p>The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.</p>
125    /// <p>The ID should be in the following format.</p>
126    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code></p>
127    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_id(input);
129        self
130    }
131    /// <p>The ID of the system instance. This value is returned by the <code>CreateSystemInstance</code> action.</p>
132    /// <p>The ID should be in the following format.</p>
133    /// <p><code>urn:tdm:REGION/ACCOUNT ID/default:deployment:DEPLOYMENTNAME</code></p>
134    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_id()
136    }
137}