aws_sdk_m2/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 unique identifier of the application.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The description of the application.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The type of the target platform for this application.</p>
11    pub engine_type: ::std::option::Option<crate::types::EngineType>,
12    /// <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
13    pub definition: ::std::option::Option<crate::types::Definition>,
14    /// <p>A list of tags to apply to the application.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18    /// <p>The identifier of a customer managed key.</p>
19    pub kms_key_id: ::std::option::Option<::std::string::String>,
20    /// <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.</p>
21    pub role_arn: ::std::option::Option<::std::string::String>,
22}
23impl CreateApplicationInput {
24    /// <p>The unique identifier of the application.</p>
25    pub fn name(&self) -> ::std::option::Option<&str> {
26        self.name.as_deref()
27    }
28    /// <p>The description of the application.</p>
29    pub fn description(&self) -> ::std::option::Option<&str> {
30        self.description.as_deref()
31    }
32    /// <p>The type of the target platform for this application.</p>
33    pub fn engine_type(&self) -> ::std::option::Option<&crate::types::EngineType> {
34        self.engine_type.as_ref()
35    }
36    /// <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
37    pub fn definition(&self) -> ::std::option::Option<&crate::types::Definition> {
38        self.definition.as_ref()
39    }
40    /// <p>A list of tags to apply to the application.</p>
41    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42        self.tags.as_ref()
43    }
44    /// <p>A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.</p>
45    pub fn client_token(&self) -> ::std::option::Option<&str> {
46        self.client_token.as_deref()
47    }
48    /// <p>The identifier of a customer managed key.</p>
49    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
50        self.kms_key_id.as_deref()
51    }
52    /// <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.</p>
53    pub fn role_arn(&self) -> ::std::option::Option<&str> {
54        self.role_arn.as_deref()
55    }
56}
57impl CreateApplicationInput {
58    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
59    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
60        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
61    }
62}
63
64/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CreateApplicationInputBuilder {
68    pub(crate) name: ::std::option::Option<::std::string::String>,
69    pub(crate) description: ::std::option::Option<::std::string::String>,
70    pub(crate) engine_type: ::std::option::Option<crate::types::EngineType>,
71    pub(crate) definition: ::std::option::Option<crate::types::Definition>,
72    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
73    pub(crate) client_token: ::std::option::Option<::std::string::String>,
74    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
75    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
76}
77impl CreateApplicationInputBuilder {
78    /// <p>The unique identifier of the application.</p>
79    /// This field is required.
80    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The unique identifier of the application.</p>
85    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.name = input;
87        self
88    }
89    /// <p>The unique identifier of the application.</p>
90    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.name
92    }
93    /// <p>The description of the application.</p>
94    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.description = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The description of the application.</p>
99    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.description = input;
101        self
102    }
103    /// <p>The description of the application.</p>
104    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
105        &self.description
106    }
107    /// <p>The type of the target platform for this application.</p>
108    /// This field is required.
109    pub fn engine_type(mut self, input: crate::types::EngineType) -> Self {
110        self.engine_type = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The type of the target platform for this application.</p>
114    pub fn set_engine_type(mut self, input: ::std::option::Option<crate::types::EngineType>) -> Self {
115        self.engine_type = input;
116        self
117    }
118    /// <p>The type of the target platform for this application.</p>
119    pub fn get_engine_type(&self) -> &::std::option::Option<crate::types::EngineType> {
120        &self.engine_type
121    }
122    /// <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
123    /// This field is required.
124    pub fn definition(mut self, input: crate::types::Definition) -> Self {
125        self.definition = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
129    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::Definition>) -> Self {
130        self.definition = input;
131        self
132    }
133    /// <p>The application definition for this application. You can specify either inline JSON or an S3 bucket location.</p>
134    pub fn get_definition(&self) -> &::std::option::Option<crate::types::Definition> {
135        &self.definition
136    }
137    /// Adds a key-value pair to `tags`.
138    ///
139    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
140    ///
141    /// <p>A list of tags to apply to the application.</p>
142    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
143        let mut hash_map = self.tags.unwrap_or_default();
144        hash_map.insert(k.into(), v.into());
145        self.tags = ::std::option::Option::Some(hash_map);
146        self
147    }
148    /// <p>A list of tags to apply to the application.</p>
149    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
150        self.tags = input;
151        self
152    }
153    /// <p>A list of tags to apply to the application.</p>
154    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
155        &self.tags
156    }
157    /// <p>A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.</p>
158    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.client_token = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.</p>
163    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.client_token = input;
165        self
166    }
167    /// <p>A client token is a unique, case-sensitive string of up to 128 ASCII characters with ASCII values of 33-126 inclusive. It's generated by the client to ensure idempotent operations, allowing for safe retries without unintended side effects.</p>
168    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
169        &self.client_token
170    }
171    /// <p>The identifier of a customer managed key.</p>
172    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.kms_key_id = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The identifier of a customer managed key.</p>
177    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.kms_key_id = input;
179        self
180    }
181    /// <p>The identifier of a customer managed key.</p>
182    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
183        &self.kms_key_id
184    }
185    /// <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.</p>
186    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.role_arn = ::std::option::Option::Some(input.into());
188        self
189    }
190    /// <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.</p>
191    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.role_arn = input;
193        self
194    }
195    /// <p>The Amazon Resource Name (ARN) that identifies a role that the application uses to access Amazon Web Services resources that are not part of the application or are in a different Amazon Web Services account.</p>
196    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
197        &self.role_arn
198    }
199    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
200    pub fn build(
201        self,
202    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
203        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
204            name: self.name,
205            description: self.description,
206            engine_type: self.engine_type,
207            definition: self.definition,
208            tags: self.tags,
209            client_token: self.client_token,
210            kms_key_id: self.kms_key_id,
211            role_arn: self.role_arn,
212        })
213    }
214}