aws_sdk_iotfleetwise/operation/update_vehicle/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_vehicle::_update_vehicle_output::UpdateVehicleOutputBuilder;
3
4pub use crate::operation::update_vehicle::_update_vehicle_input::UpdateVehicleInputBuilder;
5
6impl crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
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::update_vehicle::UpdateVehicleOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_vehicle::UpdateVehicleError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_vehicle();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateVehicle`.
24///
25/// <p>Updates a vehicle.</p><important>
26/// <p>Access to certain Amazon Web Services IoT FleetWise features is currently gated. For more information, see <a href="https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html">Amazon Web Services Region and feature availability</a> in the <i>Amazon Web Services IoT FleetWise Developer Guide</i>.</p>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct UpdateVehicleFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::update_vehicle::UpdateVehicleOutput,
37        crate::operation::update_vehicle::UpdateVehicleError,
38    > for UpdateVehicleFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::update_vehicle::UpdateVehicleOutput,
46            crate::operation::update_vehicle::UpdateVehicleError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl UpdateVehicleFluentBuilder {
53    /// Creates a new `UpdateVehicleFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the UpdateVehicle as a reference.
62    pub fn as_input(&self) -> &crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::update_vehicle::UpdateVehicleOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::update_vehicle::UpdateVehicleError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::update_vehicle::UpdateVehicle::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::update_vehicle::UpdateVehicle::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::update_vehicle::UpdateVehicleOutput,
99        crate::operation::update_vehicle::UpdateVehicleError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The unique ID of the vehicle to update.</p>
114    pub fn vehicle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.vehicle_name(input.into());
116        self
117    }
118    /// <p>The unique ID of the vehicle to update.</p>
119    pub fn set_vehicle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_vehicle_name(input);
121        self
122    }
123    /// <p>The unique ID of the vehicle to update.</p>
124    pub fn get_vehicle_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_vehicle_name()
126    }
127    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
128    pub fn model_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.model_manifest_arn(input.into());
130        self
131    }
132    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
133    pub fn set_model_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_model_manifest_arn(input);
135        self
136    }
137    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
138    pub fn get_model_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_model_manifest_arn()
140    }
141    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
142    pub fn decoder_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.decoder_manifest_arn(input.into());
144        self
145    }
146    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
147    pub fn set_decoder_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_decoder_manifest_arn(input);
149        self
150    }
151    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
152    pub fn get_decoder_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_decoder_manifest_arn()
154    }
155    ///
156    /// Adds a key-value pair to `attributes`.
157    ///
158    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
159    ///
160    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
161    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
162    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.attributes(k.into(), v.into());
164        self
165    }
166    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
167    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
168    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
169        self.inner = self.inner.set_attributes(input);
170        self
171    }
172    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
173    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
174    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
175        self.inner.get_attributes()
176    }
177    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
178    /// <p>This is required if attributes are present in the input.</p>
179    pub fn attribute_update_mode(mut self, input: crate::types::UpdateMode) -> Self {
180        self.inner = self.inner.attribute_update_mode(input);
181        self
182    }
183    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
184    /// <p>This is required if attributes are present in the input.</p>
185    pub fn set_attribute_update_mode(mut self, input: ::std::option::Option<crate::types::UpdateMode>) -> Self {
186        self.inner = self.inner.set_attribute_update_mode(input);
187        self
188    }
189    /// <p>The method the specified attributes will update the existing attributes on the vehicle. Use<code>Overwite</code> to replace the vehicle attributes with the specified attributes. Or use <code>Merge</code> to combine all attributes.</p>
190    /// <p>This is required if attributes are present in the input.</p>
191    pub fn get_attribute_update_mode(&self) -> &::std::option::Option<crate::types::UpdateMode> {
192        self.inner.get_attribute_update_mode()
193    }
194    ///
195    /// Appends an item to `stateTemplatesToAdd`.
196    ///
197    /// To override the contents of this collection use [`set_state_templates_to_add`](Self::set_state_templates_to_add).
198    ///
199    /// <p>Associate state templates with the vehicle.</p>
200    pub fn state_templates_to_add(mut self, input: crate::types::StateTemplateAssociation) -> Self {
201        self.inner = self.inner.state_templates_to_add(input);
202        self
203    }
204    /// <p>Associate state templates with the vehicle.</p>
205    pub fn set_state_templates_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
206        self.inner = self.inner.set_state_templates_to_add(input);
207        self
208    }
209    /// <p>Associate state templates with the vehicle.</p>
210    pub fn get_state_templates_to_add(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
211        self.inner.get_state_templates_to_add()
212    }
213    ///
214    /// Appends an item to `stateTemplatesToRemove`.
215    ///
216    /// To override the contents of this collection use [`set_state_templates_to_remove`](Self::set_state_templates_to_remove).
217    ///
218    /// <p>Remove state templates from the vehicle.</p>
219    pub fn state_templates_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.inner = self.inner.state_templates_to_remove(input.into());
221        self
222    }
223    /// <p>Remove state templates from the vehicle.</p>
224    pub fn set_state_templates_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
225        self.inner = self.inner.set_state_templates_to_remove(input);
226        self
227    }
228    /// <p>Remove state templates from the vehicle.</p>
229    pub fn get_state_templates_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
230        self.inner.get_state_templates_to_remove()
231    }
232    ///
233    /// Appends an item to `stateTemplatesToUpdate`.
234    ///
235    /// To override the contents of this collection use [`set_state_templates_to_update`](Self::set_state_templates_to_update).
236    ///
237    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
238    pub fn state_templates_to_update(mut self, input: crate::types::StateTemplateAssociation) -> Self {
239        self.inner = self.inner.state_templates_to_update(input);
240        self
241    }
242    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
243    pub fn set_state_templates_to_update(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
244        self.inner = self.inner.set_state_templates_to_update(input);
245        self
246    }
247    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
248    pub fn get_state_templates_to_update(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
249        self.inner.get_state_templates_to_update()
250    }
251}