aws_sdk_greengrass/operation/create_software_update_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_software_update_job::_create_software_update_job_output::CreateSoftwareUpdateJobOutputBuilder;
3
4pub use crate::operation::create_software_update_job::_create_software_update_job_input::CreateSoftwareUpdateJobInputBuilder;
5
6impl crate::operation::create_software_update_job::builders::CreateSoftwareUpdateJobInputBuilder {
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_software_update_job::CreateSoftwareUpdateJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_software_update_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSoftwareUpdateJob`.
24///
25/// Creates a software update for a core or group of cores (specified as an IoT thing group.) Use this to update the OTA Agent as well as the Greengrass core software. It makes use of the IoT Jobs feature which provides additional commands to manage a Greengrass core software update job.
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateSoftwareUpdateJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_software_update_job::builders::CreateSoftwareUpdateJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
35        crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
36    > for CreateSoftwareUpdateJobFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
44            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateSoftwareUpdateJobFluentBuilder {
51    /// Creates a new `CreateSoftwareUpdateJobFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateSoftwareUpdateJob as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_software_update_job::builders::CreateSoftwareUpdateJobInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_software_update_job::CreateSoftwareUpdateJob::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_software_update_job::CreateSoftwareUpdateJob::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_software_update_job::CreateSoftwareUpdateJobOutput,
97        crate::operation::create_software_update_job::CreateSoftwareUpdateJobError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// A client token used to correlate requests and responses.
112    pub fn amzn_client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.amzn_client_token(input.into());
114        self
115    }
116    /// A client token used to correlate requests and responses.
117    pub fn set_amzn_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_amzn_client_token(input);
119        self
120    }
121    /// A client token used to correlate requests and responses.
122    pub fn get_amzn_client_token(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_amzn_client_token()
124    }
125    /// The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
126    pub fn s3_url_signer_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.s3_url_signer_role(input.into());
128        self
129    }
130    /// The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
131    pub fn set_s3_url_signer_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_s3_url_signer_role(input);
133        self
134    }
135    /// The IAM Role that Greengrass will use to create pre-signed URLs pointing towards the update artifact.
136    pub fn get_s3_url_signer_role(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_s3_url_signer_role()
138    }
139    /// The piece of software on the Greengrass core that will be updated.
140    pub fn software_to_update(mut self, input: crate::types::SoftwareToUpdate) -> Self {
141        self.inner = self.inner.software_to_update(input);
142        self
143    }
144    /// The piece of software on the Greengrass core that will be updated.
145    pub fn set_software_to_update(mut self, input: ::std::option::Option<crate::types::SoftwareToUpdate>) -> Self {
146        self.inner = self.inner.set_software_to_update(input);
147        self
148    }
149    /// The piece of software on the Greengrass core that will be updated.
150    pub fn get_software_to_update(&self) -> &::std::option::Option<crate::types::SoftwareToUpdate> {
151        self.inner.get_software_to_update()
152    }
153    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
154    pub fn update_agent_log_level(mut self, input: crate::types::UpdateAgentLogLevel) -> Self {
155        self.inner = self.inner.update_agent_log_level(input);
156        self
157    }
158    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
159    pub fn set_update_agent_log_level(mut self, input: ::std::option::Option<crate::types::UpdateAgentLogLevel>) -> Self {
160        self.inner = self.inner.set_update_agent_log_level(input);
161        self
162    }
163    /// The minimum level of log statements that should be logged by the OTA Agent during an update.
164    pub fn get_update_agent_log_level(&self) -> &::std::option::Option<crate::types::UpdateAgentLogLevel> {
165        self.inner.get_update_agent_log_level()
166    }
167    ///
168    /// Appends an item to `UpdateTargets`.
169    ///
170    /// To override the contents of this collection use [`set_update_targets`](Self::set_update_targets).
171    ///
172    /// The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
173    pub fn update_targets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.update_targets(input.into());
175        self
176    }
177    /// The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
178    pub fn set_update_targets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
179        self.inner = self.inner.set_update_targets(input);
180        self
181    }
182    /// The ARNs of the targets (IoT things or IoT thing groups) that this update will be applied to.
183    pub fn get_update_targets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
184        self.inner.get_update_targets()
185    }
186    /// The architecture of the cores which are the targets of an update.
187    pub fn update_targets_architecture(mut self, input: crate::types::UpdateTargetsArchitecture) -> Self {
188        self.inner = self.inner.update_targets_architecture(input);
189        self
190    }
191    /// The architecture of the cores which are the targets of an update.
192    pub fn set_update_targets_architecture(mut self, input: ::std::option::Option<crate::types::UpdateTargetsArchitecture>) -> Self {
193        self.inner = self.inner.set_update_targets_architecture(input);
194        self
195    }
196    /// The architecture of the cores which are the targets of an update.
197    pub fn get_update_targets_architecture(&self) -> &::std::option::Option<crate::types::UpdateTargetsArchitecture> {
198        self.inner.get_update_targets_architecture()
199    }
200    /// The operating system of the cores which are the targets of an update.
201    pub fn update_targets_operating_system(mut self, input: crate::types::UpdateTargetsOperatingSystem) -> Self {
202        self.inner = self.inner.update_targets_operating_system(input);
203        self
204    }
205    /// The operating system of the cores which are the targets of an update.
206    pub fn set_update_targets_operating_system(mut self, input: ::std::option::Option<crate::types::UpdateTargetsOperatingSystem>) -> Self {
207        self.inner = self.inner.set_update_targets_operating_system(input);
208        self
209    }
210    /// The operating system of the cores which are the targets of an update.
211    pub fn get_update_targets_operating_system(&self) -> &::std::option::Option<crate::types::UpdateTargetsOperatingSystem> {
212        self.inner.get_update_targets_operating_system()
213    }
214}