aws_sdk_iotfleethub/operation/describe_application/
_describe_application_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 DescribeApplicationOutput {
6    /// <p>The unique Id of the web application.</p>
7    pub application_id: ::std::string::String,
8    /// <p>The ARN of the web application.</p>
9    pub application_arn: ::std::string::String,
10    /// <p>The name of the web application.</p>
11    pub application_name: ::std::string::String,
12    /// <p>An optional description of the web application.</p>
13    pub application_description: ::std::option::Option<::std::string::String>,
14    /// <p>The URL of the web application.</p>
15    pub application_url: ::std::string::String,
16    /// <p>The current state of the web application.</p>
17    pub application_state: crate::types::ApplicationState,
18    /// <p>The date (in Unix epoch time) when the application was created.</p>
19    pub application_creation_date: i64,
20    /// <p>The date (in Unix epoch time) when the application was last updated.</p>
21    pub application_last_update_date: i64,
22    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p>
23    pub role_arn: ::std::string::String,
24    /// <p>The Id of the single sign-on client that you use to authenticate and authorize users on the web application.</p>
25    pub sso_client_id: ::std::option::Option<::std::string::String>,
26    /// <p>A message that explains any failures included in the <code>applicationState</code> response field. This message explains failures in the <code>CreateApplication</code> and <code>DeleteApplication</code> actions.</p>
27    pub error_message: ::std::option::Option<::std::string::String>,
28    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
29    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
30    _request_id: Option<String>,
31}
32impl DescribeApplicationOutput {
33    /// <p>The unique Id of the web application.</p>
34    pub fn application_id(&self) -> &str {
35        use std::ops::Deref;
36        self.application_id.deref()
37    }
38    /// <p>The ARN of the web application.</p>
39    pub fn application_arn(&self) -> &str {
40        use std::ops::Deref;
41        self.application_arn.deref()
42    }
43    /// <p>The name of the web application.</p>
44    pub fn application_name(&self) -> &str {
45        use std::ops::Deref;
46        self.application_name.deref()
47    }
48    /// <p>An optional description of the web application.</p>
49    pub fn application_description(&self) -> ::std::option::Option<&str> {
50        self.application_description.as_deref()
51    }
52    /// <p>The URL of the web application.</p>
53    pub fn application_url(&self) -> &str {
54        use std::ops::Deref;
55        self.application_url.deref()
56    }
57    /// <p>The current state of the web application.</p>
58    pub fn application_state(&self) -> &crate::types::ApplicationState {
59        &self.application_state
60    }
61    /// <p>The date (in Unix epoch time) when the application was created.</p>
62    pub fn application_creation_date(&self) -> i64 {
63        self.application_creation_date
64    }
65    /// <p>The date (in Unix epoch time) when the application was last updated.</p>
66    pub fn application_last_update_date(&self) -> i64 {
67        self.application_last_update_date
68    }
69    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p>
70    pub fn role_arn(&self) -> &str {
71        use std::ops::Deref;
72        self.role_arn.deref()
73    }
74    /// <p>The Id of the single sign-on client that you use to authenticate and authorize users on the web application.</p>
75    pub fn sso_client_id(&self) -> ::std::option::Option<&str> {
76        self.sso_client_id.as_deref()
77    }
78    /// <p>A message that explains any failures included in the <code>applicationState</code> response field. This message explains failures in the <code>CreateApplication</code> and <code>DeleteApplication</code> actions.</p>
79    pub fn error_message(&self) -> ::std::option::Option<&str> {
80        self.error_message.as_deref()
81    }
82    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
83    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
84        self.tags.as_ref()
85    }
86}
87impl ::aws_types::request_id::RequestId for DescribeApplicationOutput {
88    fn request_id(&self) -> Option<&str> {
89        self._request_id.as_deref()
90    }
91}
92impl DescribeApplicationOutput {
93    /// Creates a new builder-style object to manufacture [`DescribeApplicationOutput`](crate::operation::describe_application::DescribeApplicationOutput).
94    pub fn builder() -> crate::operation::describe_application::builders::DescribeApplicationOutputBuilder {
95        crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::default()
96    }
97}
98
99/// A builder for [`DescribeApplicationOutput`](crate::operation::describe_application::DescribeApplicationOutput).
100#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
101#[non_exhaustive]
102pub struct DescribeApplicationOutputBuilder {
103    pub(crate) application_id: ::std::option::Option<::std::string::String>,
104    pub(crate) application_arn: ::std::option::Option<::std::string::String>,
105    pub(crate) application_name: ::std::option::Option<::std::string::String>,
106    pub(crate) application_description: ::std::option::Option<::std::string::String>,
107    pub(crate) application_url: ::std::option::Option<::std::string::String>,
108    pub(crate) application_state: ::std::option::Option<crate::types::ApplicationState>,
109    pub(crate) application_creation_date: ::std::option::Option<i64>,
110    pub(crate) application_last_update_date: ::std::option::Option<i64>,
111    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
112    pub(crate) sso_client_id: ::std::option::Option<::std::string::String>,
113    pub(crate) error_message: ::std::option::Option<::std::string::String>,
114    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
115    _request_id: Option<String>,
116}
117impl DescribeApplicationOutputBuilder {
118    /// <p>The unique Id of the web application.</p>
119    /// This field is required.
120    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.application_id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The unique Id of the web application.</p>
125    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.application_id = input;
127        self
128    }
129    /// <p>The unique Id of the web application.</p>
130    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
131        &self.application_id
132    }
133    /// <p>The ARN of the web application.</p>
134    /// This field is required.
135    pub fn application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.application_arn = ::std::option::Option::Some(input.into());
137        self
138    }
139    /// <p>The ARN of the web application.</p>
140    pub fn set_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.application_arn = input;
142        self
143    }
144    /// <p>The ARN of the web application.</p>
145    pub fn get_application_arn(&self) -> &::std::option::Option<::std::string::String> {
146        &self.application_arn
147    }
148    /// <p>The name of the web application.</p>
149    /// This field is required.
150    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.application_name = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The name of the web application.</p>
155    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.application_name = input;
157        self
158    }
159    /// <p>The name of the web application.</p>
160    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
161        &self.application_name
162    }
163    /// <p>An optional description of the web application.</p>
164    pub fn application_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.application_description = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>An optional description of the web application.</p>
169    pub fn set_application_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.application_description = input;
171        self
172    }
173    /// <p>An optional description of the web application.</p>
174    pub fn get_application_description(&self) -> &::std::option::Option<::std::string::String> {
175        &self.application_description
176    }
177    /// <p>The URL of the web application.</p>
178    /// This field is required.
179    pub fn application_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.application_url = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>The URL of the web application.</p>
184    pub fn set_application_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.application_url = input;
186        self
187    }
188    /// <p>The URL of the web application.</p>
189    pub fn get_application_url(&self) -> &::std::option::Option<::std::string::String> {
190        &self.application_url
191    }
192    /// <p>The current state of the web application.</p>
193    /// This field is required.
194    pub fn application_state(mut self, input: crate::types::ApplicationState) -> Self {
195        self.application_state = ::std::option::Option::Some(input);
196        self
197    }
198    /// <p>The current state of the web application.</p>
199    pub fn set_application_state(mut self, input: ::std::option::Option<crate::types::ApplicationState>) -> Self {
200        self.application_state = input;
201        self
202    }
203    /// <p>The current state of the web application.</p>
204    pub fn get_application_state(&self) -> &::std::option::Option<crate::types::ApplicationState> {
205        &self.application_state
206    }
207    /// <p>The date (in Unix epoch time) when the application was created.</p>
208    /// This field is required.
209    pub fn application_creation_date(mut self, input: i64) -> Self {
210        self.application_creation_date = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>The date (in Unix epoch time) when the application was created.</p>
214    pub fn set_application_creation_date(mut self, input: ::std::option::Option<i64>) -> Self {
215        self.application_creation_date = input;
216        self
217    }
218    /// <p>The date (in Unix epoch time) when the application was created.</p>
219    pub fn get_application_creation_date(&self) -> &::std::option::Option<i64> {
220        &self.application_creation_date
221    }
222    /// <p>The date (in Unix epoch time) when the application was last updated.</p>
223    /// This field is required.
224    pub fn application_last_update_date(mut self, input: i64) -> Self {
225        self.application_last_update_date = ::std::option::Option::Some(input);
226        self
227    }
228    /// <p>The date (in Unix epoch time) when the application was last updated.</p>
229    pub fn set_application_last_update_date(mut self, input: ::std::option::Option<i64>) -> Self {
230        self.application_last_update_date = input;
231        self
232    }
233    /// <p>The date (in Unix epoch time) when the application was last updated.</p>
234    pub fn get_application_last_update_date(&self) -> &::std::option::Option<i64> {
235        &self.application_last_update_date
236    }
237    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p>
238    /// This field is required.
239    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.role_arn = ::std::option::Option::Some(input.into());
241        self
242    }
243    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p>
244    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245        self.role_arn = input;
246        self
247    }
248    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p>
249    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
250        &self.role_arn
251    }
252    /// <p>The Id of the single sign-on client that you use to authenticate and authorize users on the web application.</p>
253    pub fn sso_client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.sso_client_id = ::std::option::Option::Some(input.into());
255        self
256    }
257    /// <p>The Id of the single sign-on client that you use to authenticate and authorize users on the web application.</p>
258    pub fn set_sso_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.sso_client_id = input;
260        self
261    }
262    /// <p>The Id of the single sign-on client that you use to authenticate and authorize users on the web application.</p>
263    pub fn get_sso_client_id(&self) -> &::std::option::Option<::std::string::String> {
264        &self.sso_client_id
265    }
266    /// <p>A message that explains any failures included in the <code>applicationState</code> response field. This message explains failures in the <code>CreateApplication</code> and <code>DeleteApplication</code> actions.</p>
267    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.error_message = ::std::option::Option::Some(input.into());
269        self
270    }
271    /// <p>A message that explains any failures included in the <code>applicationState</code> response field. This message explains failures in the <code>CreateApplication</code> and <code>DeleteApplication</code> actions.</p>
272    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.error_message = input;
274        self
275    }
276    /// <p>A message that explains any failures included in the <code>applicationState</code> response field. This message explains failures in the <code>CreateApplication</code> and <code>DeleteApplication</code> actions.</p>
277    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
278        &self.error_message
279    }
280    /// Adds a key-value pair to `tags`.
281    ///
282    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
283    ///
284    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
285    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
286        let mut hash_map = self.tags.unwrap_or_default();
287        hash_map.insert(k.into(), v.into());
288        self.tags = ::std::option::Option::Some(hash_map);
289        self
290    }
291    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
292    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
293        self.tags = input;
294        self
295    }
296    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
297    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
298        &self.tags
299    }
300    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
301        self._request_id = Some(request_id.into());
302        self
303    }
304
305    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
306        self._request_id = request_id;
307        self
308    }
309    /// Consumes the builder and constructs a [`DescribeApplicationOutput`](crate::operation::describe_application::DescribeApplicationOutput).
310    /// This method will fail if any of the following fields are not set:
311    /// - [`application_id`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::application_id)
312    /// - [`application_arn`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::application_arn)
313    /// - [`application_name`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::application_name)
314    /// - [`application_url`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::application_url)
315    /// - [`application_state`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::application_state)
316    /// - [`role_arn`](crate::operation::describe_application::builders::DescribeApplicationOutputBuilder::role_arn)
317    pub fn build(
318        self,
319    ) -> ::std::result::Result<crate::operation::describe_application::DescribeApplicationOutput, ::aws_smithy_types::error::operation::BuildError>
320    {
321        ::std::result::Result::Ok(crate::operation::describe_application::DescribeApplicationOutput {
322            application_id: self.application_id.ok_or_else(|| {
323                ::aws_smithy_types::error::operation::BuildError::missing_field(
324                    "application_id",
325                    "application_id was not specified but it is required when building DescribeApplicationOutput",
326                )
327            })?,
328            application_arn: self.application_arn.ok_or_else(|| {
329                ::aws_smithy_types::error::operation::BuildError::missing_field(
330                    "application_arn",
331                    "application_arn was not specified but it is required when building DescribeApplicationOutput",
332                )
333            })?,
334            application_name: self.application_name.ok_or_else(|| {
335                ::aws_smithy_types::error::operation::BuildError::missing_field(
336                    "application_name",
337                    "application_name was not specified but it is required when building DescribeApplicationOutput",
338                )
339            })?,
340            application_description: self.application_description,
341            application_url: self.application_url.ok_or_else(|| {
342                ::aws_smithy_types::error::operation::BuildError::missing_field(
343                    "application_url",
344                    "application_url was not specified but it is required when building DescribeApplicationOutput",
345                )
346            })?,
347            application_state: self.application_state.ok_or_else(|| {
348                ::aws_smithy_types::error::operation::BuildError::missing_field(
349                    "application_state",
350                    "application_state was not specified but it is required when building DescribeApplicationOutput",
351                )
352            })?,
353            application_creation_date: self.application_creation_date.unwrap_or_default(),
354            application_last_update_date: self.application_last_update_date.unwrap_or_default(),
355            role_arn: self.role_arn.ok_or_else(|| {
356                ::aws_smithy_types::error::operation::BuildError::missing_field(
357                    "role_arn",
358                    "role_arn was not specified but it is required when building DescribeApplicationOutput",
359                )
360            })?,
361            sso_client_id: self.sso_client_id,
362            error_message: self.error_message,
363            tags: self.tags,
364            _request_id: self._request_id,
365        })
366    }
367}