aws_sdk_iotfleetwise/operation/get_fleet/
_get_fleet_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetFleetOutput {
6    pub id: ::std::string::String,
8    pub arn: ::std::string::String,
10    pub description: ::std::option::Option<::std::string::String>,
12    pub signal_catalog_arn: ::std::string::String,
14    pub creation_time: ::aws_smithy_types::DateTime,
16    pub last_modification_time: ::aws_smithy_types::DateTime,
18    _request_id: Option<String>,
19}
20impl GetFleetOutput {
21    pub fn id(&self) -> &str {
23        use std::ops::Deref;
24        self.id.deref()
25    }
26    pub fn arn(&self) -> &str {
28        use std::ops::Deref;
29        self.arn.deref()
30    }
31    pub fn description(&self) -> ::std::option::Option<&str> {
33        self.description.as_deref()
34    }
35    pub fn signal_catalog_arn(&self) -> &str {
37        use std::ops::Deref;
38        self.signal_catalog_arn.deref()
39    }
40    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
42        &self.creation_time
43    }
44    pub fn last_modification_time(&self) -> &::aws_smithy_types::DateTime {
46        &self.last_modification_time
47    }
48}
49impl ::aws_types::request_id::RequestId for GetFleetOutput {
50    fn request_id(&self) -> Option<&str> {
51        self._request_id.as_deref()
52    }
53}
54impl GetFleetOutput {
55    pub fn builder() -> crate::operation::get_fleet::builders::GetFleetOutputBuilder {
57        crate::operation::get_fleet::builders::GetFleetOutputBuilder::default()
58    }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct GetFleetOutputBuilder {
65    pub(crate) id: ::std::option::Option<::std::string::String>,
66    pub(crate) arn: ::std::option::Option<::std::string::String>,
67    pub(crate) description: ::std::option::Option<::std::string::String>,
68    pub(crate) signal_catalog_arn: ::std::option::Option<::std::string::String>,
69    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
70    pub(crate) last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
71    _request_id: Option<String>,
72}
73impl GetFleetOutputBuilder {
74    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.id = ::std::option::Option::Some(input.into());
78        self
79    }
80    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.id = input;
83        self
84    }
85    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.id
88    }
89    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.arn = ::std::option::Option::Some(input.into());
93        self
94    }
95    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.arn = input;
98        self
99    }
100    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
102        &self.arn
103    }
104    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.description = ::std::option::Option::Some(input.into());
107        self
108    }
109    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.description = input;
112        self
113    }
114    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
116        &self.description
117    }
118    pub fn signal_catalog_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.signal_catalog_arn = ::std::option::Option::Some(input.into());
122        self
123    }
124    pub fn set_signal_catalog_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.signal_catalog_arn = input;
127        self
128    }
129    pub fn get_signal_catalog_arn(&self) -> &::std::option::Option<::std::string::String> {
131        &self.signal_catalog_arn
132    }
133    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
136        self.creation_time = ::std::option::Option::Some(input);
137        self
138    }
139    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
141        self.creation_time = input;
142        self
143    }
144    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146        &self.creation_time
147    }
148    pub fn last_modification_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
151        self.last_modification_time = ::std::option::Option::Some(input);
152        self
153    }
154    pub fn set_last_modification_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
156        self.last_modification_time = input;
157        self
158    }
159    pub fn get_last_modification_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
161        &self.last_modification_time
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    pub fn build(self) -> ::std::result::Result<crate::operation::get_fleet::GetFleetOutput, ::aws_smithy_types::error::operation::BuildError> {
180        ::std::result::Result::Ok(crate::operation::get_fleet::GetFleetOutput {
181            id: self.id.ok_or_else(|| {
182                ::aws_smithy_types::error::operation::BuildError::missing_field(
183                    "id",
184                    "id was not specified but it is required when building GetFleetOutput",
185                )
186            })?,
187            arn: self.arn.ok_or_else(|| {
188                ::aws_smithy_types::error::operation::BuildError::missing_field(
189                    "arn",
190                    "arn was not specified but it is required when building GetFleetOutput",
191                )
192            })?,
193            description: self.description,
194            signal_catalog_arn: self.signal_catalog_arn.ok_or_else(|| {
195                ::aws_smithy_types::error::operation::BuildError::missing_field(
196                    "signal_catalog_arn",
197                    "signal_catalog_arn was not specified but it is required when building GetFleetOutput",
198                )
199            })?,
200            creation_time: self.creation_time.ok_or_else(|| {
201                ::aws_smithy_types::error::operation::BuildError::missing_field(
202                    "creation_time",
203                    "creation_time was not specified but it is required when building GetFleetOutput",
204                )
205            })?,
206            last_modification_time: self.last_modification_time.ok_or_else(|| {
207                ::aws_smithy_types::error::operation::BuildError::missing_field(
208                    "last_modification_time",
209                    "last_modification_time was not specified but it is required when building GetFleetOutput",
210                )
211            })?,
212            _request_id: self._request_id,
213        })
214    }
215}