aws_sdk_iotfleetwise/operation/get_fleet/
_get_fleet_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 GetFleetOutput {
6    /// <p>The ID of the fleet.</p>
7    pub id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the fleet.</p>
9    pub arn: ::std::string::String,
10    /// <p>A brief description of the fleet.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The ARN of a signal catalog associated with the fleet.</p>
13    pub signal_catalog_arn: ::std::string::String,
14    /// <p>The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
15    pub creation_time: ::aws_smithy_types::DateTime,
16    /// <p>The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
17    pub last_modification_time: ::aws_smithy_types::DateTime,
18    _request_id: Option<String>,
19}
20impl GetFleetOutput {
21    /// <p>The ID of the fleet.</p>
22    pub fn id(&self) -> &str {
23        use std::ops::Deref;
24        self.id.deref()
25    }
26    /// <p>The Amazon Resource Name (ARN) of the fleet.</p>
27    pub fn arn(&self) -> &str {
28        use std::ops::Deref;
29        self.arn.deref()
30    }
31    /// <p>A brief description of the fleet.</p>
32    pub fn description(&self) -> ::std::option::Option<&str> {
33        self.description.as_deref()
34    }
35    /// <p>The ARN of a signal catalog associated with the fleet.</p>
36    pub fn signal_catalog_arn(&self) -> &str {
37        use std::ops::Deref;
38        self.signal_catalog_arn.deref()
39    }
40    /// <p>The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
41    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
42        &self.creation_time
43    }
44    /// <p>The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
45    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    /// Creates a new builder-style object to manufacture [`GetFleetOutput`](crate::operation::get_fleet::GetFleetOutput).
56    pub fn builder() -> crate::operation::get_fleet::builders::GetFleetOutputBuilder {
57        crate::operation::get_fleet::builders::GetFleetOutputBuilder::default()
58    }
59}
60
61/// A builder for [`GetFleetOutput`](crate::operation::get_fleet::GetFleetOutput).
62#[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    /// <p>The ID of the fleet.</p>
75    /// This field is required.
76    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    /// <p>The ID of the fleet.</p>
81    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.id = input;
83        self
84    }
85    /// <p>The ID of the fleet.</p>
86    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.id
88    }
89    /// <p>The Amazon Resource Name (ARN) of the fleet.</p>
90    /// This field is required.
91    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    /// <p>The Amazon Resource Name (ARN) of the fleet.</p>
96    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.arn = input;
98        self
99    }
100    /// <p>The Amazon Resource Name (ARN) of the fleet.</p>
101    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
102        &self.arn
103    }
104    /// <p>A brief description of the fleet.</p>
105    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    /// <p>A brief description of the fleet.</p>
110    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.description = input;
112        self
113    }
114    /// <p>A brief description of the fleet.</p>
115    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
116        &self.description
117    }
118    /// <p>The ARN of a signal catalog associated with the fleet.</p>
119    /// This field is required.
120    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    /// <p>The ARN of a signal catalog associated with the fleet.</p>
125    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    /// <p>The ARN of a signal catalog associated with the fleet.</p>
130    pub fn get_signal_catalog_arn(&self) -> &::std::option::Option<::std::string::String> {
131        &self.signal_catalog_arn
132    }
133    /// <p>The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
134    /// This field is required.
135    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    /// <p>The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
140    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    /// <p>The time the fleet was created in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
145    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
146        &self.creation_time
147    }
148    /// <p>The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
149    /// This field is required.
150    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    /// <p>The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
155    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    /// <p>The time the fleet was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
160    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    /// Consumes the builder and constructs a [`GetFleetOutput`](crate::operation::get_fleet::GetFleetOutput).
173    /// This method will fail if any of the following fields are not set:
174    /// - [`id`](crate::operation::get_fleet::builders::GetFleetOutputBuilder::id)
175    /// - [`arn`](crate::operation::get_fleet::builders::GetFleetOutputBuilder::arn)
176    /// - [`signal_catalog_arn`](crate::operation::get_fleet::builders::GetFleetOutputBuilder::signal_catalog_arn)
177    /// - [`creation_time`](crate::operation::get_fleet::builders::GetFleetOutputBuilder::creation_time)
178    /// - [`last_modification_time`](crate::operation::get_fleet::builders::GetFleetOutputBuilder::last_modification_time)
179    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}