aws_sdk_appintegrations/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 application.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The namespace of the application.</p>
9    pub namespace: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the application.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The configuration for where the application should be loaded from.</p>
13    pub application_source_config: ::std::option::Option<crate::types::ApplicationSourceConfig>,
14    /// <p>The events that the application subscribes.</p>
15    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
16    pub subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::Subscription>>,
17    /// <p>The events that the application publishes.</p>
18    #[deprecated(note = "Publications has been replaced with Permissions")]
19    pub publications: ::std::option::Option<::std::vec::Vec<crate::types::Publication>>,
20    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
21    pub client_token: ::std::option::Option<::std::string::String>,
22    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
23    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
24    /// <p>The configuration of events or requests that the application has access to.</p>
25    pub permissions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
26    /// <p>Indicates whether the application is a service.</p>
27    pub is_service: ::std::option::Option<bool>,
28    /// <p>The maximum time in milliseconds allowed to establish a connection with the workspace.</p>
29    pub initialization_timeout: ::std::option::Option<i32>,
30    /// <p>The configuration settings for the application.</p>
31    pub application_config: ::std::option::Option<crate::types::ApplicationConfig>,
32    /// <p>The iframe configuration for the application.</p>
33    pub iframe_config: ::std::option::Option<crate::types::IframeConfig>,
34}
35impl CreateApplicationInput {
36    /// <p>The name of the application.</p>
37    pub fn name(&self) -> ::std::option::Option<&str> {
38        self.name.as_deref()
39    }
40    /// <p>The namespace of the application.</p>
41    pub fn namespace(&self) -> ::std::option::Option<&str> {
42        self.namespace.as_deref()
43    }
44    /// <p>The description of the application.</p>
45    pub fn description(&self) -> ::std::option::Option<&str> {
46        self.description.as_deref()
47    }
48    /// <p>The configuration for where the application should be loaded from.</p>
49    pub fn application_source_config(&self) -> ::std::option::Option<&crate::types::ApplicationSourceConfig> {
50        self.application_source_config.as_ref()
51    }
52    /// <p>The events that the application subscribes.</p>
53    ///
54    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subscriptions.is_none()`.
55    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
56    pub fn subscriptions(&self) -> &[crate::types::Subscription] {
57        self.subscriptions.as_deref().unwrap_or_default()
58    }
59    /// <p>The events that the application publishes.</p>
60    ///
61    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.publications.is_none()`.
62    #[deprecated(note = "Publications has been replaced with Permissions")]
63    pub fn publications(&self) -> &[crate::types::Publication] {
64        self.publications.as_deref().unwrap_or_default()
65    }
66    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
67    pub fn client_token(&self) -> ::std::option::Option<&str> {
68        self.client_token.as_deref()
69    }
70    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
71    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
72        self.tags.as_ref()
73    }
74    /// <p>The configuration of events or requests that the application has access to.</p>
75    ///
76    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.permissions.is_none()`.
77    pub fn permissions(&self) -> &[::std::string::String] {
78        self.permissions.as_deref().unwrap_or_default()
79    }
80    /// <p>Indicates whether the application is a service.</p>
81    pub fn is_service(&self) -> ::std::option::Option<bool> {
82        self.is_service
83    }
84    /// <p>The maximum time in milliseconds allowed to establish a connection with the workspace.</p>
85    pub fn initialization_timeout(&self) -> ::std::option::Option<i32> {
86        self.initialization_timeout
87    }
88    /// <p>The configuration settings for the application.</p>
89    pub fn application_config(&self) -> ::std::option::Option<&crate::types::ApplicationConfig> {
90        self.application_config.as_ref()
91    }
92    /// <p>The iframe configuration for the application.</p>
93    pub fn iframe_config(&self) -> ::std::option::Option<&crate::types::IframeConfig> {
94        self.iframe_config.as_ref()
95    }
96}
97impl CreateApplicationInput {
98    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
99    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
100        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
101    }
102}
103
104/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
106#[non_exhaustive]
107pub struct CreateApplicationInputBuilder {
108    pub(crate) name: ::std::option::Option<::std::string::String>,
109    pub(crate) namespace: ::std::option::Option<::std::string::String>,
110    pub(crate) description: ::std::option::Option<::std::string::String>,
111    pub(crate) application_source_config: ::std::option::Option<crate::types::ApplicationSourceConfig>,
112    pub(crate) subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::Subscription>>,
113    pub(crate) publications: ::std::option::Option<::std::vec::Vec<crate::types::Publication>>,
114    pub(crate) client_token: ::std::option::Option<::std::string::String>,
115    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
116    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
117    pub(crate) is_service: ::std::option::Option<bool>,
118    pub(crate) initialization_timeout: ::std::option::Option<i32>,
119    pub(crate) application_config: ::std::option::Option<crate::types::ApplicationConfig>,
120    pub(crate) iframe_config: ::std::option::Option<crate::types::IframeConfig>,
121}
122impl CreateApplicationInputBuilder {
123    /// <p>The name of the application.</p>
124    /// This field is required.
125    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.name = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The name of the application.</p>
130    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.name = input;
132        self
133    }
134    /// <p>The name of the application.</p>
135    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
136        &self.name
137    }
138    /// <p>The namespace of the application.</p>
139    /// This field is required.
140    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.namespace = ::std::option::Option::Some(input.into());
142        self
143    }
144    /// <p>The namespace of the application.</p>
145    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.namespace = input;
147        self
148    }
149    /// <p>The namespace of the application.</p>
150    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
151        &self.namespace
152    }
153    /// <p>The description of the application.</p>
154    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.description = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The description of the application.</p>
159    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.description = input;
161        self
162    }
163    /// <p>The description of the application.</p>
164    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
165        &self.description
166    }
167    /// <p>The configuration for where the application should be loaded from.</p>
168    /// This field is required.
169    pub fn application_source_config(mut self, input: crate::types::ApplicationSourceConfig) -> Self {
170        self.application_source_config = ::std::option::Option::Some(input);
171        self
172    }
173    /// <p>The configuration for where the application should be loaded from.</p>
174    pub fn set_application_source_config(mut self, input: ::std::option::Option<crate::types::ApplicationSourceConfig>) -> Self {
175        self.application_source_config = input;
176        self
177    }
178    /// <p>The configuration for where the application should be loaded from.</p>
179    pub fn get_application_source_config(&self) -> &::std::option::Option<crate::types::ApplicationSourceConfig> {
180        &self.application_source_config
181    }
182    /// Appends an item to `subscriptions`.
183    ///
184    /// To override the contents of this collection use [`set_subscriptions`](Self::set_subscriptions).
185    ///
186    /// <p>The events that the application subscribes.</p>
187    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
188    pub fn subscriptions(mut self, input: crate::types::Subscription) -> Self {
189        let mut v = self.subscriptions.unwrap_or_default();
190        v.push(input);
191        self.subscriptions = ::std::option::Option::Some(v);
192        self
193    }
194    /// <p>The events that the application subscribes.</p>
195    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
196    pub fn set_subscriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Subscription>>) -> Self {
197        self.subscriptions = input;
198        self
199    }
200    /// <p>The events that the application subscribes.</p>
201    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
202    pub fn get_subscriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Subscription>> {
203        &self.subscriptions
204    }
205    /// Appends an item to `publications`.
206    ///
207    /// To override the contents of this collection use [`set_publications`](Self::set_publications).
208    ///
209    /// <p>The events that the application publishes.</p>
210    #[deprecated(note = "Publications has been replaced with Permissions")]
211    pub fn publications(mut self, input: crate::types::Publication) -> Self {
212        let mut v = self.publications.unwrap_or_default();
213        v.push(input);
214        self.publications = ::std::option::Option::Some(v);
215        self
216    }
217    /// <p>The events that the application publishes.</p>
218    #[deprecated(note = "Publications has been replaced with Permissions")]
219    pub fn set_publications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Publication>>) -> Self {
220        self.publications = input;
221        self
222    }
223    /// <p>The events that the application publishes.</p>
224    #[deprecated(note = "Publications has been replaced with Permissions")]
225    pub fn get_publications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Publication>> {
226        &self.publications
227    }
228    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
229    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.client_token = ::std::option::Option::Some(input.into());
231        self
232    }
233    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
234    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.client_token = input;
236        self
237    }
238    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/">Making retries safe with idempotent APIs</a>.</p>
239    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
240        &self.client_token
241    }
242    /// Adds a key-value pair to `tags`.
243    ///
244    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
245    ///
246    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
247    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
248        let mut hash_map = self.tags.unwrap_or_default();
249        hash_map.insert(k.into(), v.into());
250        self.tags = ::std::option::Option::Some(hash_map);
251        self
252    }
253    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
254    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
255        self.tags = input;
256        self
257    }
258    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
259    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
260        &self.tags
261    }
262    /// Appends an item to `permissions`.
263    ///
264    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
265    ///
266    /// <p>The configuration of events or requests that the application has access to.</p>
267    pub fn permissions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        let mut v = self.permissions.unwrap_or_default();
269        v.push(input.into());
270        self.permissions = ::std::option::Option::Some(v);
271        self
272    }
273    /// <p>The configuration of events or requests that the application has access to.</p>
274    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
275        self.permissions = input;
276        self
277    }
278    /// <p>The configuration of events or requests that the application has access to.</p>
279    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
280        &self.permissions
281    }
282    /// <p>Indicates whether the application is a service.</p>
283    pub fn is_service(mut self, input: bool) -> Self {
284        self.is_service = ::std::option::Option::Some(input);
285        self
286    }
287    /// <p>Indicates whether the application is a service.</p>
288    pub fn set_is_service(mut self, input: ::std::option::Option<bool>) -> Self {
289        self.is_service = input;
290        self
291    }
292    /// <p>Indicates whether the application is a service.</p>
293    pub fn get_is_service(&self) -> &::std::option::Option<bool> {
294        &self.is_service
295    }
296    /// <p>The maximum time in milliseconds allowed to establish a connection with the workspace.</p>
297    pub fn initialization_timeout(mut self, input: i32) -> Self {
298        self.initialization_timeout = ::std::option::Option::Some(input);
299        self
300    }
301    /// <p>The maximum time in milliseconds allowed to establish a connection with the workspace.</p>
302    pub fn set_initialization_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
303        self.initialization_timeout = input;
304        self
305    }
306    /// <p>The maximum time in milliseconds allowed to establish a connection with the workspace.</p>
307    pub fn get_initialization_timeout(&self) -> &::std::option::Option<i32> {
308        &self.initialization_timeout
309    }
310    /// <p>The configuration settings for the application.</p>
311    pub fn application_config(mut self, input: crate::types::ApplicationConfig) -> Self {
312        self.application_config = ::std::option::Option::Some(input);
313        self
314    }
315    /// <p>The configuration settings for the application.</p>
316    pub fn set_application_config(mut self, input: ::std::option::Option<crate::types::ApplicationConfig>) -> Self {
317        self.application_config = input;
318        self
319    }
320    /// <p>The configuration settings for the application.</p>
321    pub fn get_application_config(&self) -> &::std::option::Option<crate::types::ApplicationConfig> {
322        &self.application_config
323    }
324    /// <p>The iframe configuration for the application.</p>
325    pub fn iframe_config(mut self, input: crate::types::IframeConfig) -> Self {
326        self.iframe_config = ::std::option::Option::Some(input);
327        self
328    }
329    /// <p>The iframe configuration for the application.</p>
330    pub fn set_iframe_config(mut self, input: ::std::option::Option<crate::types::IframeConfig>) -> Self {
331        self.iframe_config = input;
332        self
333    }
334    /// <p>The iframe configuration for the application.</p>
335    pub fn get_iframe_config(&self) -> &::std::option::Option<crate::types::IframeConfig> {
336        &self.iframe_config
337    }
338    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
339    pub fn build(
340        self,
341    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
342        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
343            name: self.name,
344            namespace: self.namespace,
345            description: self.description,
346            application_source_config: self.application_source_config,
347            subscriptions: self.subscriptions,
348            publications: self.publications,
349            client_token: self.client_token,
350            tags: self.tags,
351            permissions: self.permissions,
352            is_service: self.is_service,
353            initialization_timeout: self.initialization_timeout,
354            application_config: self.application_config,
355            iframe_config: self.iframe_config,
356        })
357    }
358}