aws_sdk_ssmsap/operation/register_application/
_register_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 RegisterApplicationInput {
6    /// <p>The ID of the application.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The type of the application.</p>
9    pub application_type: ::std::option::Option<crate::types::ApplicationType>,
10    /// <p>The Amazon EC2 instances on which your SAP application is running.</p>
11    pub instances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12    /// <p>The SAP instance number of the application.</p>
13    pub sap_instance_number: ::std::option::Option<::std::string::String>,
14    /// <p>The System ID of the application.</p>
15    pub sid: ::std::option::Option<::std::string::String>,
16    /// <p>The tags to be attached to the SAP application.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18    /// <p>The credentials of the SAP application.</p>
19    pub credentials: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>,
20    /// <p>The Amazon Resource Name of the SAP HANA database.</p>
21    pub database_arn: ::std::option::Option<::std::string::String>,
22    /// <p>This is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.</p>
23    /// <p>This is an array of ApplicationComponent objects. You may input 0 to 5 items.</p>
24    pub components_info: ::std::option::Option<::std::vec::Vec<crate::types::ComponentInfo>>,
25}
26impl RegisterApplicationInput {
27    /// <p>The ID of the application.</p>
28    pub fn application_id(&self) -> ::std::option::Option<&str> {
29        self.application_id.as_deref()
30    }
31    /// <p>The type of the application.</p>
32    pub fn application_type(&self) -> ::std::option::Option<&crate::types::ApplicationType> {
33        self.application_type.as_ref()
34    }
35    /// <p>The Amazon EC2 instances on which your SAP application is running.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instances.is_none()`.
38    pub fn instances(&self) -> &[::std::string::String] {
39        self.instances.as_deref().unwrap_or_default()
40    }
41    /// <p>The SAP instance number of the application.</p>
42    pub fn sap_instance_number(&self) -> ::std::option::Option<&str> {
43        self.sap_instance_number.as_deref()
44    }
45    /// <p>The System ID of the application.</p>
46    pub fn sid(&self) -> ::std::option::Option<&str> {
47        self.sid.as_deref()
48    }
49    /// <p>The tags to be attached to the SAP application.</p>
50    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
51        self.tags.as_ref()
52    }
53    /// <p>The credentials of the SAP application.</p>
54    ///
55    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.credentials.is_none()`.
56    pub fn credentials(&self) -> &[crate::types::ApplicationCredential] {
57        self.credentials.as_deref().unwrap_or_default()
58    }
59    /// <p>The Amazon Resource Name of the SAP HANA database.</p>
60    pub fn database_arn(&self) -> ::std::option::Option<&str> {
61        self.database_arn.as_deref()
62    }
63    /// <p>This is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.</p>
64    /// <p>This is an array of ApplicationComponent objects. You may input 0 to 5 items.</p>
65    ///
66    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.components_info.is_none()`.
67    pub fn components_info(&self) -> &[crate::types::ComponentInfo] {
68        self.components_info.as_deref().unwrap_or_default()
69    }
70}
71impl RegisterApplicationInput {
72    /// Creates a new builder-style object to manufacture [`RegisterApplicationInput`](crate::operation::register_application::RegisterApplicationInput).
73    pub fn builder() -> crate::operation::register_application::builders::RegisterApplicationInputBuilder {
74        crate::operation::register_application::builders::RegisterApplicationInputBuilder::default()
75    }
76}
77
78/// A builder for [`RegisterApplicationInput`](crate::operation::register_application::RegisterApplicationInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct RegisterApplicationInputBuilder {
82    pub(crate) application_id: ::std::option::Option<::std::string::String>,
83    pub(crate) application_type: ::std::option::Option<crate::types::ApplicationType>,
84    pub(crate) instances: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
85    pub(crate) sap_instance_number: ::std::option::Option<::std::string::String>,
86    pub(crate) sid: ::std::option::Option<::std::string::String>,
87    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
88    pub(crate) credentials: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>,
89    pub(crate) database_arn: ::std::option::Option<::std::string::String>,
90    pub(crate) components_info: ::std::option::Option<::std::vec::Vec<crate::types::ComponentInfo>>,
91}
92impl RegisterApplicationInputBuilder {
93    /// <p>The ID of the application.</p>
94    /// This field is required.
95    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.application_id = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The ID of the application.</p>
100    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.application_id = input;
102        self
103    }
104    /// <p>The ID of the application.</p>
105    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
106        &self.application_id
107    }
108    /// <p>The type of the application.</p>
109    /// This field is required.
110    pub fn application_type(mut self, input: crate::types::ApplicationType) -> Self {
111        self.application_type = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>The type of the application.</p>
115    pub fn set_application_type(mut self, input: ::std::option::Option<crate::types::ApplicationType>) -> Self {
116        self.application_type = input;
117        self
118    }
119    /// <p>The type of the application.</p>
120    pub fn get_application_type(&self) -> &::std::option::Option<crate::types::ApplicationType> {
121        &self.application_type
122    }
123    /// Appends an item to `instances`.
124    ///
125    /// To override the contents of this collection use [`set_instances`](Self::set_instances).
126    ///
127    /// <p>The Amazon EC2 instances on which your SAP application is running.</p>
128    pub fn instances(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut v = self.instances.unwrap_or_default();
130        v.push(input.into());
131        self.instances = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>The Amazon EC2 instances on which your SAP application is running.</p>
135    pub fn set_instances(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.instances = input;
137        self
138    }
139    /// <p>The Amazon EC2 instances on which your SAP application is running.</p>
140    pub fn get_instances(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
141        &self.instances
142    }
143    /// <p>The SAP instance number of the application.</p>
144    pub fn sap_instance_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.sap_instance_number = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The SAP instance number of the application.</p>
149    pub fn set_sap_instance_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.sap_instance_number = input;
151        self
152    }
153    /// <p>The SAP instance number of the application.</p>
154    pub fn get_sap_instance_number(&self) -> &::std::option::Option<::std::string::String> {
155        &self.sap_instance_number
156    }
157    /// <p>The System ID of the application.</p>
158    pub fn sid(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.sid = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The System ID of the application.</p>
163    pub fn set_sid(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.sid = input;
165        self
166    }
167    /// <p>The System ID of the application.</p>
168    pub fn get_sid(&self) -> &::std::option::Option<::std::string::String> {
169        &self.sid
170    }
171    /// Adds a key-value pair to `tags`.
172    ///
173    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
174    ///
175    /// <p>The tags to be attached to the SAP application.</p>
176    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
177        let mut hash_map = self.tags.unwrap_or_default();
178        hash_map.insert(k.into(), v.into());
179        self.tags = ::std::option::Option::Some(hash_map);
180        self
181    }
182    /// <p>The tags to be attached to the SAP application.</p>
183    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
184        self.tags = input;
185        self
186    }
187    /// <p>The tags to be attached to the SAP application.</p>
188    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
189        &self.tags
190    }
191    /// Appends an item to `credentials`.
192    ///
193    /// To override the contents of this collection use [`set_credentials`](Self::set_credentials).
194    ///
195    /// <p>The credentials of the SAP application.</p>
196    pub fn credentials(mut self, input: crate::types::ApplicationCredential) -> Self {
197        let mut v = self.credentials.unwrap_or_default();
198        v.push(input);
199        self.credentials = ::std::option::Option::Some(v);
200        self
201    }
202    /// <p>The credentials of the SAP application.</p>
203    pub fn set_credentials(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>>) -> Self {
204        self.credentials = input;
205        self
206    }
207    /// <p>The credentials of the SAP application.</p>
208    pub fn get_credentials(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ApplicationCredential>> {
209        &self.credentials
210    }
211    /// <p>The Amazon Resource Name of the SAP HANA database.</p>
212    pub fn database_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.database_arn = ::std::option::Option::Some(input.into());
214        self
215    }
216    /// <p>The Amazon Resource Name of the SAP HANA database.</p>
217    pub fn set_database_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.database_arn = input;
219        self
220    }
221    /// <p>The Amazon Resource Name of the SAP HANA database.</p>
222    pub fn get_database_arn(&self) -> &::std::option::Option<::std::string::String> {
223        &self.database_arn
224    }
225    /// Appends an item to `components_info`.
226    ///
227    /// To override the contents of this collection use [`set_components_info`](Self::set_components_info).
228    ///
229    /// <p>This is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.</p>
230    /// <p>This is an array of ApplicationComponent objects. You may input 0 to 5 items.</p>
231    pub fn components_info(mut self, input: crate::types::ComponentInfo) -> Self {
232        let mut v = self.components_info.unwrap_or_default();
233        v.push(input);
234        self.components_info = ::std::option::Option::Some(v);
235        self
236    }
237    /// <p>This is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.</p>
238    /// <p>This is an array of ApplicationComponent objects. You may input 0 to 5 items.</p>
239    pub fn set_components_info(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComponentInfo>>) -> Self {
240        self.components_info = input;
241        self
242    }
243    /// <p>This is an optional parameter for component details to which the SAP ABAP application is attached, such as Web Dispatcher.</p>
244    /// <p>This is an array of ApplicationComponent objects. You may input 0 to 5 items.</p>
245    pub fn get_components_info(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComponentInfo>> {
246        &self.components_info
247    }
248    /// Consumes the builder and constructs a [`RegisterApplicationInput`](crate::operation::register_application::RegisterApplicationInput).
249    pub fn build(
250        self,
251    ) -> ::std::result::Result<crate::operation::register_application::RegisterApplicationInput, ::aws_smithy_types::error::operation::BuildError>
252    {
253        ::std::result::Result::Ok(crate::operation::register_application::RegisterApplicationInput {
254            application_id: self.application_id,
255            application_type: self.application_type,
256            instances: self.instances,
257            sap_instance_number: self.sap_instance_number,
258            sid: self.sid,
259            tags: self.tags,
260            credentials: self.credentials,
261            database_arn: self.database_arn,
262            components_info: self.components_info,
263        })
264    }
265}