aws_sdk_iotfleethub/operation/create_application/
_create_application_input.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 CreateApplicationInput {
6    /// <p>The name of the web application.</p>
7    pub application_name: ::std::option::Option<::std::string::String>,
8    /// <p>An optional description of the web application.</p>
9    pub application_description: ::std::option::Option<::std::string::String>,
10    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p><note>
13    /// <p>The name of the role must be in the form <code>AWSIotFleetHub_<i>random_string</i> </code>.</p>
14    /// </note>
15    pub role_arn: ::std::option::Option<::std::string::String>,
16    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateApplicationInput {
20    /// <p>The name of the web application.</p>
21    pub fn application_name(&self) -> ::std::option::Option<&str> {
22        self.application_name.as_deref()
23    }
24    /// <p>An optional description of the web application.</p>
25    pub fn application_description(&self) -> ::std::option::Option<&str> {
26        self.application_description.as_deref()
27    }
28    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
29    pub fn client_token(&self) -> ::std::option::Option<&str> {
30        self.client_token.as_deref()
31    }
32    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p><note>
33    /// <p>The name of the role must be in the form <code>AWSIotFleetHub_<i>random_string</i> </code>.</p>
34    /// </note>
35    pub fn role_arn(&self) -> ::std::option::Option<&str> {
36        self.role_arn.as_deref()
37    }
38    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
39    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
40        self.tags.as_ref()
41    }
42}
43impl CreateApplicationInput {
44    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
45    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
46        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateApplicationInputBuilder {
54    pub(crate) application_name: ::std::option::Option<::std::string::String>,
55    pub(crate) application_description: ::std::option::Option<::std::string::String>,
56    pub(crate) client_token: ::std::option::Option<::std::string::String>,
57    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
58    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
59}
60impl CreateApplicationInputBuilder {
61    /// <p>The name of the web application.</p>
62    /// This field is required.
63    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.application_name = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The name of the web application.</p>
68    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.application_name = input;
70        self
71    }
72    /// <p>The name of the web application.</p>
73    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
74        &self.application_name
75    }
76    /// <p>An optional description of the web application.</p>
77    pub fn application_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.application_description = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>An optional description of the web application.</p>
82    pub fn set_application_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.application_description = input;
84        self
85    }
86    /// <p>An optional description of the web application.</p>
87    pub fn get_application_description(&self) -> &::std::option::Option<::std::string::String> {
88        &self.application_description
89    }
90    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
91    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.client_token = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
96    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.client_token = input;
98        self
99    }
100    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
101    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
102        &self.client_token
103    }
104    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p><note>
105    /// <p>The name of the role must be in the form <code>AWSIotFleetHub_<i>random_string</i> </code>.</p>
106    /// </note>
107    /// This field is required.
108    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.role_arn = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p><note>
113    /// <p>The name of the role must be in the form <code>AWSIotFleetHub_<i>random_string</i> </code>.</p>
114    /// </note>
115    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.role_arn = input;
117        self
118    }
119    /// <p>The ARN of the role that the web application assumes when it interacts with Amazon Web Services IoT Core.</p><note>
120    /// <p>The name of the role must be in the form <code>AWSIotFleetHub_<i>random_string</i> </code>.</p>
121    /// </note>
122    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
123        &self.role_arn
124    }
125    /// Adds a key-value pair to `tags`.
126    ///
127    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
128    ///
129    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
130    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
131        let mut hash_map = self.tags.unwrap_or_default();
132        hash_map.insert(k.into(), v.into());
133        self.tags = ::std::option::Option::Some(hash_map);
134        self
135    }
136    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
137    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
138        self.tags = input;
139        self
140    }
141    /// <p>A set of key/value pairs that you can use to manage the web application resource.</p>
142    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
143        &self.tags
144    }
145    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
146    pub fn build(
147        self,
148    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
149        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
150            application_name: self.application_name,
151            application_description: self.application_description,
152            client_token: self.client_token,
153            role_arn: self.role_arn,
154            tags: self.tags,
155        })
156    }
157}