aws_sdk_iotfleetwise/operation/update_vehicle/
_update_vehicle_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateVehicleInput {
6 pub vehicle_name: ::std::option::Option<::std::string::String>,
8 pub model_manifest_arn: ::std::option::Option<::std::string::String>,
10 pub decoder_manifest_arn: ::std::option::Option<::std::string::String>,
12 pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
15 pub attribute_update_mode: ::std::option::Option<crate::types::UpdateMode>,
18 pub state_templates_to_add: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
20 pub state_templates_to_remove: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
22 pub state_templates_to_update: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
24}
25impl UpdateVehicleInput {
26 pub fn vehicle_name(&self) -> ::std::option::Option<&str> {
28 self.vehicle_name.as_deref()
29 }
30 pub fn model_manifest_arn(&self) -> ::std::option::Option<&str> {
32 self.model_manifest_arn.as_deref()
33 }
34 pub fn decoder_manifest_arn(&self) -> ::std::option::Option<&str> {
36 self.decoder_manifest_arn.as_deref()
37 }
38 pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
41 self.attributes.as_ref()
42 }
43 pub fn attribute_update_mode(&self) -> ::std::option::Option<&crate::types::UpdateMode> {
46 self.attribute_update_mode.as_ref()
47 }
48 pub fn state_templates_to_add(&self) -> &[crate::types::StateTemplateAssociation] {
52 self.state_templates_to_add.as_deref().unwrap_or_default()
53 }
54 pub fn state_templates_to_remove(&self) -> &[::std::string::String] {
58 self.state_templates_to_remove.as_deref().unwrap_or_default()
59 }
60 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 pub fn builder() -> crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder {
70 crate::operation::update_vehicle::builders::UpdateVehicleInputBuilder::default()
71 }
72}
73
74#[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 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 pub fn set_vehicle_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.vehicle_name = input;
97 self
98 }
99 pub fn get_vehicle_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.vehicle_name
102 }
103 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 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 pub fn get_model_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
115 &self.model_manifest_arn
116 }
117 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 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 pub fn get_decoder_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
129 &self.decoder_manifest_arn
130 }
131 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 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 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
152 &self.attributes
153 }
154 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 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 pub fn get_attribute_update_mode(&self) -> &::std::option::Option<crate::types::UpdateMode> {
169 &self.attribute_update_mode
170 }
171 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 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 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 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 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 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 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 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 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 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}