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}
27impl CreateApplicationInput {
28    /// <p>The name of the application.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The namespace of the application.</p>
33    pub fn namespace(&self) -> ::std::option::Option<&str> {
34        self.namespace.as_deref()
35    }
36    /// <p>The description of the application.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The configuration for where the application should be loaded from.</p>
41    pub fn application_source_config(&self) -> ::std::option::Option<&crate::types::ApplicationSourceConfig> {
42        self.application_source_config.as_ref()
43    }
44    /// <p>The events that the application subscribes.</p>
45    ///
46    /// 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()`.
47    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
48    pub fn subscriptions(&self) -> &[crate::types::Subscription] {
49        self.subscriptions.as_deref().unwrap_or_default()
50    }
51    /// <p>The events that the application publishes.</p>
52    ///
53    /// 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()`.
54    #[deprecated(note = "Publications has been replaced with Permissions")]
55    pub fn publications(&self) -> &[crate::types::Publication] {
56        self.publications.as_deref().unwrap_or_default()
57    }
58    /// <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>
59    pub fn client_token(&self) -> ::std::option::Option<&str> {
60        self.client_token.as_deref()
61    }
62    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
63    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
64        self.tags.as_ref()
65    }
66    /// <p>The configuration of events or requests that the application has access to.</p>
67    ///
68    /// 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()`.
69    pub fn permissions(&self) -> &[::std::string::String] {
70        self.permissions.as_deref().unwrap_or_default()
71    }
72}
73impl CreateApplicationInput {
74    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
75    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
76        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
77    }
78}
79
80/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct CreateApplicationInputBuilder {
84    pub(crate) name: ::std::option::Option<::std::string::String>,
85    pub(crate) namespace: ::std::option::Option<::std::string::String>,
86    pub(crate) description: ::std::option::Option<::std::string::String>,
87    pub(crate) application_source_config: ::std::option::Option<crate::types::ApplicationSourceConfig>,
88    pub(crate) subscriptions: ::std::option::Option<::std::vec::Vec<crate::types::Subscription>>,
89    pub(crate) publications: ::std::option::Option<::std::vec::Vec<crate::types::Publication>>,
90    pub(crate) client_token: ::std::option::Option<::std::string::String>,
91    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
92    pub(crate) permissions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
93}
94impl CreateApplicationInputBuilder {
95    /// <p>The name of the application.</p>
96    /// This field is required.
97    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The name of the application.</p>
102    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.name = input;
104        self
105    }
106    /// <p>The name of the application.</p>
107    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.name
109    }
110    /// <p>The namespace of the application.</p>
111    /// This field is required.
112    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.namespace = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The namespace of the application.</p>
117    pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.namespace = input;
119        self
120    }
121    /// <p>The namespace of the application.</p>
122    pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
123        &self.namespace
124    }
125    /// <p>The description of the application.</p>
126    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.description = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The description of the application.</p>
131    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.description = input;
133        self
134    }
135    /// <p>The description of the application.</p>
136    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137        &self.description
138    }
139    /// <p>The configuration for where the application should be loaded from.</p>
140    /// This field is required.
141    pub fn application_source_config(mut self, input: crate::types::ApplicationSourceConfig) -> Self {
142        self.application_source_config = ::std::option::Option::Some(input);
143        self
144    }
145    /// <p>The configuration for where the application should be loaded from.</p>
146    pub fn set_application_source_config(mut self, input: ::std::option::Option<crate::types::ApplicationSourceConfig>) -> Self {
147        self.application_source_config = input;
148        self
149    }
150    /// <p>The configuration for where the application should be loaded from.</p>
151    pub fn get_application_source_config(&self) -> &::std::option::Option<crate::types::ApplicationSourceConfig> {
152        &self.application_source_config
153    }
154    /// Appends an item to `subscriptions`.
155    ///
156    /// To override the contents of this collection use [`set_subscriptions`](Self::set_subscriptions).
157    ///
158    /// <p>The events that the application subscribes.</p>
159    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
160    pub fn subscriptions(mut self, input: crate::types::Subscription) -> Self {
161        let mut v = self.subscriptions.unwrap_or_default();
162        v.push(input);
163        self.subscriptions = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>The events that the application subscribes.</p>
167    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
168    pub fn set_subscriptions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Subscription>>) -> Self {
169        self.subscriptions = input;
170        self
171    }
172    /// <p>The events that the application subscribes.</p>
173    #[deprecated(note = "Subscriptions has been replaced with Permissions")]
174    pub fn get_subscriptions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Subscription>> {
175        &self.subscriptions
176    }
177    /// Appends an item to `publications`.
178    ///
179    /// To override the contents of this collection use [`set_publications`](Self::set_publications).
180    ///
181    /// <p>The events that the application publishes.</p>
182    #[deprecated(note = "Publications has been replaced with Permissions")]
183    pub fn publications(mut self, input: crate::types::Publication) -> Self {
184        let mut v = self.publications.unwrap_or_default();
185        v.push(input);
186        self.publications = ::std::option::Option::Some(v);
187        self
188    }
189    /// <p>The events that the application publishes.</p>
190    #[deprecated(note = "Publications has been replaced with Permissions")]
191    pub fn set_publications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Publication>>) -> Self {
192        self.publications = input;
193        self
194    }
195    /// <p>The events that the application publishes.</p>
196    #[deprecated(note = "Publications has been replaced with Permissions")]
197    pub fn get_publications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Publication>> {
198        &self.publications
199    }
200    /// <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>
201    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.client_token = ::std::option::Option::Some(input.into());
203        self
204    }
205    /// <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>
206    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.client_token = input;
208        self
209    }
210    /// <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>
211    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
212        &self.client_token
213    }
214    /// Adds a key-value pair to `tags`.
215    ///
216    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
217    ///
218    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
219    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
220        let mut hash_map = self.tags.unwrap_or_default();
221        hash_map.insert(k.into(), v.into());
222        self.tags = ::std::option::Option::Some(hash_map);
223        self
224    }
225    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
226    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
227        self.tags = input;
228        self
229    }
230    /// <p>The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
231    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
232        &self.tags
233    }
234    /// Appends an item to `permissions`.
235    ///
236    /// To override the contents of this collection use [`set_permissions`](Self::set_permissions).
237    ///
238    /// <p>The configuration of events or requests that the application has access to.</p>
239    pub fn permissions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        let mut v = self.permissions.unwrap_or_default();
241        v.push(input.into());
242        self.permissions = ::std::option::Option::Some(v);
243        self
244    }
245    /// <p>The configuration of events or requests that the application has access to.</p>
246    pub fn set_permissions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
247        self.permissions = input;
248        self
249    }
250    /// <p>The configuration of events or requests that the application has access to.</p>
251    pub fn get_permissions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
252        &self.permissions
253    }
254    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
255    pub fn build(
256        self,
257    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
258        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
259            name: self.name,
260            namespace: self.namespace,
261            description: self.description,
262            application_source_config: self.application_source_config,
263            subscriptions: self.subscriptions,
264            publications: self.publications,
265            client_token: self.client_token,
266            tags: self.tags,
267            permissions: self.permissions,
268        })
269    }
270}