aws_sdk_iotfleetwise/operation/update_vehicle/
_update_vehicle_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateVehicleInput {
6    /// <p>The unique ID of the vehicle to update.</p>
7    pub vehicle_name: ::std::option::Option<::std::string::String>,
8    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
9    pub model_manifest_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
11    pub decoder_manifest_arn: ::std::option::Option<::std::string::String>,
12    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
13    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
14    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
15    /// <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>
16    /// <p>This is required if attributes are present in the input.</p>
17    pub attribute_update_mode: ::std::option::Option<crate::types::UpdateMode>,
18    /// <p>Associate state templates with the vehicle.</p>
19    pub state_templates_to_add: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
20    /// <p>Remove state templates from the vehicle.</p>
21    pub state_templates_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
22    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
23    pub state_templates_to_update: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
24}
25impl UpdateVehicleInput {
26    /// <p>The unique ID of the vehicle to update.</p>
27    pub fn vehicle_name(&self) -> ::std::option::Option<&str> {
28        self.vehicle_name.as_deref()
29    }
30    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
31    pub fn model_manifest_arn(&self) -> ::std::option::Option<&str> {
32        self.model_manifest_arn.as_deref()
33    }
34    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
35    pub fn decoder_manifest_arn(&self) -> ::std::option::Option<&str> {
36        self.decoder_manifest_arn.as_deref()
37    }
38    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
39    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
40    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
41        self.attributes.as_ref()
42    }
43    /// <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>
44    /// <p>This is required if attributes are present in the input.</p>
45    pub fn attribute_update_mode(&self) -> ::std::option::Option<&crate::types::UpdateMode> {
46        self.attribute_update_mode.as_ref()
47    }
48    /// <p>Associate state templates with the vehicle.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.state_templates_to_add.is_none()`.
51    pub fn state_templates_to_add(&self) -> &[crate::types::StateTemplateAssociation] {
52        self.state_templates_to_add.as_deref().unwrap_or_default()
53    }
54    /// <p>Remove state templates from the vehicle.</p>
55    ///
56    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.state_templates_to_remove.is_none()`.
57    pub fn state_templates_to_remove(&self) -> &[::std::string::String] {
58        self.state_templates_to_remove.as_deref().unwrap_or_default()
59    }
60    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
61    ///
62    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.state_templates_to_update.is_none()`.
63    pub fn state_templates_to_update(&self) -> &[crate::types::StateTemplateAssociation] {
64        self.state_templates_to_update.as_deref().unwrap_or_default()
65    }
66}
67impl UpdateVehicleInput {
68    /// Creates a new builder-style object to manufacture [`UpdateVehicleInput`](crate::operation::update_vehicle::UpdateVehicleInput).
69    pub fn builder() -> crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
70        crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder::default()
71    }
72}
73
74/// A builder for [`UpdateVehicleInput`](crate::operation::update_vehicle::UpdateVehicleInput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct UpdateVehicleInputBuilder {
78    pub(crate) vehicle_name: ::std::option::Option<::std::string::String>,
79    pub(crate) model_manifest_arn: ::std::option::Option<::std::string::String>,
80    pub(crate) decoder_manifest_arn: ::std::option::Option<::std::string::String>,
81    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
82    pub(crate) attribute_update_mode: ::std::option::Option<crate::types::UpdateMode>,
83    pub(crate) state_templates_to_add: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
84    pub(crate) state_templates_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
85    pub(crate) state_templates_to_update: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
86}
87impl UpdateVehicleInputBuilder {
88    /// <p>The unique ID of the vehicle to update.</p>
89    /// This field is required.
90    pub fn vehicle_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.vehicle_name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The unique ID of the vehicle to update.</p>
95    pub fn set_vehicle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.vehicle_name = input;
97        self
98    }
99    /// <p>The unique ID of the vehicle to update.</p>
100    pub fn get_vehicle_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.vehicle_name
102    }
103    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
104    pub fn model_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.model_manifest_arn = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
109    pub fn set_model_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.model_manifest_arn = input;
111        self
112    }
113    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
114    pub fn get_model_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
115        &self.model_manifest_arn
116    }
117    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
118    pub fn decoder_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.decoder_manifest_arn = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
123    pub fn set_decoder_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.decoder_manifest_arn = input;
125        self
126    }
127    /// <p>The ARN of the decoder manifest associated with this vehicle.</p>
128    pub fn get_decoder_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
129        &self.decoder_manifest_arn
130    }
131    /// Adds a key-value pair to `attributes`.
132    ///
133    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
134    ///
135    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
136    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
137    pub fn attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
138        let mut hash_map = self.attributes.unwrap_or_default();
139        hash_map.insert(k.into(), v.into());
140        self.attributes = ::std::option::Option::Some(hash_map);
141        self
142    }
143    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
144    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
145    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
146        self.attributes = input;
147        self
148    }
149    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
150    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
151    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
152        &self.attributes
153    }
154    /// <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>
155    /// <p>This is required if attributes are present in the input.</p>
156    pub fn attribute_update_mode(mut self, input: crate::types::UpdateMode) -> Self {
157        self.attribute_update_mode = ::std::option::Option::Some(input);
158        self
159    }
160    /// <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>
161    /// <p>This is required if attributes are present in the input.</p>
162    pub fn set_attribute_update_mode(mut self, input: ::std::option::Option<crate::types::UpdateMode>) -> Self {
163        self.attribute_update_mode = input;
164        self
165    }
166    /// <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>
167    /// <p>This is required if attributes are present in the input.</p>
168    pub fn get_attribute_update_mode(&self) -> &::std::option::Option<crate::types::UpdateMode> {
169        &self.attribute_update_mode
170    }
171    /// Appends an item to `state_templates_to_add`.
172    ///
173    /// To override the contents of this collection use [`set_state_templates_to_add`](Self::set_state_templates_to_add).
174    ///
175    /// <p>Associate state templates with the vehicle.</p>
176    pub fn state_templates_to_add(mut self, input: crate::types::StateTemplateAssociation) -> Self {
177        let mut v = self.state_templates_to_add.unwrap_or_default();
178        v.push(input);
179        self.state_templates_to_add = ::std::option::Option::Some(v);
180        self
181    }
182    /// <p>Associate state templates with the vehicle.</p>
183    pub fn set_state_templates_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
184        self.state_templates_to_add = input;
185        self
186    }
187    /// <p>Associate state templates with the vehicle.</p>
188    pub fn get_state_templates_to_add(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
189        &self.state_templates_to_add
190    }
191    /// Appends an item to `state_templates_to_remove`.
192    ///
193    /// To override the contents of this collection use [`set_state_templates_to_remove`](Self::set_state_templates_to_remove).
194    ///
195    /// <p>Remove state templates from the vehicle.</p>
196    pub fn state_templates_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        let mut v = self.state_templates_to_remove.unwrap_or_default();
198        v.push(input.into());
199        self.state_templates_to_remove = ::std::option::Option::Some(v);
200        self
201    }
202    /// <p>Remove state templates from the vehicle.</p>
203    pub fn set_state_templates_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
204        self.state_templates_to_remove = input;
205        self
206    }
207    /// <p>Remove state templates from the vehicle.</p>
208    pub fn get_state_templates_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
209        &self.state_templates_to_remove
210    }
211    /// Appends an item to `state_templates_to_update`.
212    ///
213    /// To override the contents of this collection use [`set_state_templates_to_update`](Self::set_state_templates_to_update).
214    ///
215    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
216    pub fn state_templates_to_update(mut self, input: crate::types::StateTemplateAssociation) -> Self {
217        let mut v = self.state_templates_to_update.unwrap_or_default();
218        v.push(input);
219        self.state_templates_to_update = ::std::option::Option::Some(v);
220        self
221    }
222    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
223    pub fn set_state_templates_to_update(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
224        self.state_templates_to_update = input;
225        self
226    }
227    /// <p>Change the <code>stateTemplateUpdateStrategy</code> of state templates already associated with the vehicle.</p>
228    pub fn get_state_templates_to_update(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
229        &self.state_templates_to_update
230    }
231    /// Consumes the builder and constructs a [`UpdateVehicleInput`](crate::operation::update_vehicle::UpdateVehicleInput).
232    pub fn build(
233        self,
234    ) -> ::std::result::Result<crate::operation::update_vehicle::UpdateVehicleInput, ::aws_smithy_types::error::operation::BuildError> {
235        ::std::result::Result::Ok(crate::operation::update_vehicle::UpdateVehicleInput {
236            vehicle_name: self.vehicle_name,
237            model_manifest_arn: self.model_manifest_arn,
238            decoder_manifest_arn: self.decoder_manifest_arn,
239            attributes: self.attributes,
240            attribute_update_mode: self.attribute_update_mode,
241            state_templates_to_add: self.state_templates_to_add,
242            state_templates_to_remove: self.state_templates_to_remove,
243            state_templates_to_update: self.state_templates_to_update,
244        })
245    }
246}