aws_sdk_iotfleetwise/operation/get_vehicle/
_get_vehicle_output.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 GetVehicleOutput {
6    /// <p>The ID of the vehicle.</p>
7    pub vehicle_name: ::std::option::Option<::std::string::String>,
8    /// <p>The Amazon Resource Name (ARN) of the vehicle to retrieve information about.</p>
9    pub arn: ::std::option::Option<::std::string::String>,
10    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
11    pub model_manifest_arn: ::std::option::Option<::std::string::String>,
12    /// <p>The ARN of a decoder manifest associated with the vehicle.</p>
13    pub decoder_manifest_arn: ::std::option::Option<::std::string::String>,
14    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
15    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
16    pub attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17    /// <p>State templates associated with the vehicle.</p>
18    pub state_templates: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
19    /// <p>The time the vehicle was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
20    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
21    /// <p>The time the vehicle was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
22    pub last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
23    _request_id: Option<String>,
24}
25impl GetVehicleOutput {
26    /// <p>The ID of the vehicle.</p>
27    pub fn vehicle_name(&self) -> ::std::option::Option<&str> {
28        self.vehicle_name.as_deref()
29    }
30    /// <p>The Amazon Resource Name (ARN) of the vehicle to retrieve information about.</p>
31    pub fn arn(&self) -> ::std::option::Option<&str> {
32        self.arn.as_deref()
33    }
34    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
35    pub fn model_manifest_arn(&self) -> ::std::option::Option<&str> {
36        self.model_manifest_arn.as_deref()
37    }
38    /// <p>The ARN of a decoder manifest associated with the vehicle.</p>
39    pub fn decoder_manifest_arn(&self) -> ::std::option::Option<&str> {
40        self.decoder_manifest_arn.as_deref()
41    }
42    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
43    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
44    pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
45        self.attributes.as_ref()
46    }
47    /// <p>State templates associated with the vehicle.</p>
48    ///
49    /// 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.is_none()`.
50    pub fn state_templates(&self) -> &[crate::types::StateTemplateAssociation] {
51        self.state_templates.as_deref().unwrap_or_default()
52    }
53    /// <p>The time the vehicle was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
54    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
55        self.creation_time.as_ref()
56    }
57    /// <p>The time the vehicle was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
58    pub fn last_modification_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
59        self.last_modification_time.as_ref()
60    }
61}
62impl ::aws_types::request_id::RequestId for GetVehicleOutput {
63    fn request_id(&self) -> Option<&str> {
64        self._request_id.as_deref()
65    }
66}
67impl GetVehicleOutput {
68    /// Creates a new builder-style object to manufacture [`GetVehicleOutput`](crate::operation::get_vehicle::GetVehicleOutput).
69    pub fn builder() -> crate::operation::get_vehicle::builders::GetVehicleOutputBuilder {
70        crate::operation::get_vehicle::builders::GetVehicleOutputBuilder::default()
71    }
72}
73
74/// A builder for [`GetVehicleOutput`](crate::operation::get_vehicle::GetVehicleOutput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct GetVehicleOutputBuilder {
78    pub(crate) vehicle_name: ::std::option::Option<::std::string::String>,
79    pub(crate) arn: ::std::option::Option<::std::string::String>,
80    pub(crate) model_manifest_arn: ::std::option::Option<::std::string::String>,
81    pub(crate) decoder_manifest_arn: ::std::option::Option<::std::string::String>,
82    pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
83    pub(crate) state_templates: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>,
84    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
85    pub(crate) last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
86    _request_id: Option<String>,
87}
88impl GetVehicleOutputBuilder {
89    /// <p>The ID of the vehicle.</p>
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 ID of the vehicle.</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 ID of the vehicle.</p>
100    pub fn get_vehicle_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.vehicle_name
102    }
103    /// <p>The Amazon Resource Name (ARN) of the vehicle to retrieve information about.</p>
104    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.arn = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>The Amazon Resource Name (ARN) of the vehicle to retrieve information about.</p>
109    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.arn = input;
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the vehicle to retrieve information about.</p>
114    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
115        &self.arn
116    }
117    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
118    pub fn model_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.model_manifest_arn = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
123    pub fn set_model_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.model_manifest_arn = input;
125        self
126    }
127    /// <p>The ARN of a vehicle model (model manifest) associated with the vehicle.</p>
128    pub fn get_model_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
129        &self.model_manifest_arn
130    }
131    /// <p>The ARN of a decoder manifest associated with the vehicle.</p>
132    pub fn decoder_manifest_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.decoder_manifest_arn = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>The ARN of a decoder manifest associated with the vehicle.</p>
137    pub fn set_decoder_manifest_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.decoder_manifest_arn = input;
139        self
140    }
141    /// <p>The ARN of a decoder manifest associated with the vehicle.</p>
142    pub fn get_decoder_manifest_arn(&self) -> &::std::option::Option<::std::string::String> {
143        &self.decoder_manifest_arn
144    }
145    /// Adds a key-value pair to `attributes`.
146    ///
147    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
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 attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
152        let mut hash_map = self.attributes.unwrap_or_default();
153        hash_map.insert(k.into(), v.into());
154        self.attributes = ::std::option::Option::Some(hash_map);
155        self
156    }
157    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
158    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
159    pub fn set_attributes(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
160        self.attributes = input;
161        self
162    }
163    /// <p>Static information about a vehicle in a key-value pair. For example:</p>
164    /// <p><code>"engineType"</code> : <code>"1.3 L R2"</code></p>
165    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
166        &self.attributes
167    }
168    /// Appends an item to `state_templates`.
169    ///
170    /// To override the contents of this collection use [`set_state_templates`](Self::set_state_templates).
171    ///
172    /// <p>State templates associated with the vehicle.</p>
173    pub fn state_templates(mut self, input: crate::types::StateTemplateAssociation) -> Self {
174        let mut v = self.state_templates.unwrap_or_default();
175        v.push(input);
176        self.state_templates = ::std::option::Option::Some(v);
177        self
178    }
179    /// <p>State templates associated with the vehicle.</p>
180    pub fn set_state_templates(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>>) -> Self {
181        self.state_templates = input;
182        self
183    }
184    /// <p>State templates associated with the vehicle.</p>
185    pub fn get_state_templates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StateTemplateAssociation>> {
186        &self.state_templates
187    }
188    /// <p>The time the vehicle was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
189    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
190        self.creation_time = ::std::option::Option::Some(input);
191        self
192    }
193    /// <p>The time the vehicle was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
194    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
195        self.creation_time = input;
196        self
197    }
198    /// <p>The time the vehicle was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
199    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
200        &self.creation_time
201    }
202    /// <p>The time the vehicle was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
203    pub fn last_modification_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
204        self.last_modification_time = ::std::option::Option::Some(input);
205        self
206    }
207    /// <p>The time the vehicle was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
208    pub fn set_last_modification_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
209        self.last_modification_time = input;
210        self
211    }
212    /// <p>The time the vehicle was last updated in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
213    pub fn get_last_modification_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
214        &self.last_modification_time
215    }
216    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
217        self._request_id = Some(request_id.into());
218        self
219    }
220
221    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
222        self._request_id = request_id;
223        self
224    }
225    /// Consumes the builder and constructs a [`GetVehicleOutput`](crate::operation::get_vehicle::GetVehicleOutput).
226    pub fn build(self) -> crate::operation::get_vehicle::GetVehicleOutput {
227        crate::operation::get_vehicle::GetVehicleOutput {
228            vehicle_name: self.vehicle_name,
229            arn: self.arn,
230            model_manifest_arn: self.model_manifest_arn,
231            decoder_manifest_arn: self.decoder_manifest_arn,
232            attributes: self.attributes,
233            state_templates: self.state_templates,
234            creation_time: self.creation_time,
235            last_modification_time: self.last_modification_time,
236            _request_id: self._request_id,
237        }
238    }
239}