aws_sdk_opsworks/operation/create_app/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_app::_create_app_output::CreateAppOutputBuilder;
3
4pub use crate::operation::create_app::_create_app_input::CreateAppInputBuilder;
5
6impl crate::operation::create_app::builders::CreateAppInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::create_app::CreateAppOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_app::CreateAppError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_app();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateApp`.
24///
25/// <p>Creates an app for a specified stack. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html">Creating Apps</a>.</p>
26/// <p><b>Required Permissions</b>: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateAppFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::create_app::builders::CreateAppInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::create_app::CreateAppOutput, crate::operation::create_app::CreateAppError>
34 for CreateAppFluentBuilder
35{
36 fn send(
37 self,
38 config_override: crate::config::Builder,
39 ) -> crate::client::customize::internal::BoxFuture<
40 crate::client::customize::internal::SendResult<crate::operation::create_app::CreateAppOutput, crate::operation::create_app::CreateAppError>,
41 > {
42 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43 }
44}
45impl CreateAppFluentBuilder {
46 /// Creates a new `CreateAppFluentBuilder`.
47 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
48 Self {
49 handle,
50 inner: ::std::default::Default::default(),
51 config_override: ::std::option::Option::None,
52 }
53 }
54 /// Access the CreateApp as a reference.
55 pub fn as_input(&self) -> &crate::operation::create_app::builders::CreateAppInputBuilder {
56 &self.inner
57 }
58 /// Sends the request and returns the response.
59 ///
60 /// If an error occurs, an `SdkError` will be returned with additional details that
61 /// can be matched against.
62 ///
63 /// By default, any retryable failures will be retried twice. Retry behavior
64 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
65 /// set when configuring the client.
66 pub async fn send(
67 self,
68 ) -> ::std::result::Result<
69 crate::operation::create_app::CreateAppOutput,
70 ::aws_smithy_runtime_api::client::result::SdkError<
71 crate::operation::create_app::CreateAppError,
72 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
73 >,
74 > {
75 let input = self
76 .inner
77 .build()
78 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79 let runtime_plugins = crate::operation::create_app::CreateApp::operation_runtime_plugins(
80 self.handle.runtime_plugins.clone(),
81 &self.handle.conf,
82 self.config_override,
83 );
84 crate::operation::create_app::CreateApp::orchestrate(&runtime_plugins, input).await
85 }
86
87 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
88 pub fn customize(
89 self,
90 ) -> crate::client::customize::CustomizableOperation<
91 crate::operation::create_app::CreateAppOutput,
92 crate::operation::create_app::CreateAppError,
93 Self,
94 > {
95 crate::client::customize::CustomizableOperation::new(self)
96 }
97 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
98 self.set_config_override(::std::option::Option::Some(config_override.into()));
99 self
100 }
101
102 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
103 self.config_override = config_override;
104 self
105 }
106 /// <p>The stack ID.</p>
107 pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.inner = self.inner.stack_id(input.into());
109 self
110 }
111 /// <p>The stack ID.</p>
112 pub fn set_stack_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.inner = self.inner.set_stack_id(input);
114 self
115 }
116 /// <p>The stack ID.</p>
117 pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> {
118 self.inner.get_stack_id()
119 }
120 /// <p>The app's short name.</p>
121 pub fn shortname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.shortname(input.into());
123 self
124 }
125 /// <p>The app's short name.</p>
126 pub fn set_shortname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_shortname(input);
128 self
129 }
130 /// <p>The app's short name.</p>
131 pub fn get_shortname(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_shortname()
133 }
134 /// <p>The app name.</p>
135 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.name(input.into());
137 self
138 }
139 /// <p>The app name.</p>
140 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_name(input);
142 self
143 }
144 /// <p>The app name.</p>
145 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_name()
147 }
148 /// <p>A description of the app.</p>
149 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.description(input.into());
151 self
152 }
153 /// <p>A description of the app.</p>
154 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_description(input);
156 self
157 }
158 /// <p>A description of the app.</p>
159 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_description()
161 }
162 ///
163 /// Appends an item to `DataSources`.
164 ///
165 /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
166 ///
167 /// <p>The app's data source.</p>
168 pub fn data_sources(mut self, input: crate::types::DataSource) -> Self {
169 self.inner = self.inner.data_sources(input);
170 self
171 }
172 /// <p>The app's data source.</p>
173 pub fn set_data_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>) -> Self {
174 self.inner = self.inner.set_data_sources(input);
175 self
176 }
177 /// <p>The app's data source.</p>
178 pub fn get_data_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSource>> {
179 self.inner.get_data_sources()
180 }
181 /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
182 pub fn r#type(mut self, input: crate::types::AppType) -> Self {
183 self.inner = self.inner.r#type(input);
184 self
185 }
186 /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
187 pub fn set_type(mut self, input: ::std::option::Option<crate::types::AppType>) -> Self {
188 self.inner = self.inner.set_type(input);
189 self
190 }
191 /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
192 pub fn get_type(&self) -> &::std::option::Option<crate::types::AppType> {
193 self.inner.get_type()
194 }
195 /// <p>A <code>Source</code> object that specifies the app repository.</p>
196 pub fn app_source(mut self, input: crate::types::Source) -> Self {
197 self.inner = self.inner.app_source(input);
198 self
199 }
200 /// <p>A <code>Source</code> object that specifies the app repository.</p>
201 pub fn set_app_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
202 self.inner = self.inner.set_app_source(input);
203 self
204 }
205 /// <p>A <code>Source</code> object that specifies the app repository.</p>
206 pub fn get_app_source(&self) -> &::std::option::Option<crate::types::Source> {
207 self.inner.get_app_source()
208 }
209 ///
210 /// Appends an item to `Domains`.
211 ///
212 /// To override the contents of this collection use [`set_domains`](Self::set_domains).
213 ///
214 /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
215 pub fn domains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.inner = self.inner.domains(input.into());
217 self
218 }
219 /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
220 pub fn set_domains(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
221 self.inner = self.inner.set_domains(input);
222 self
223 }
224 /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
225 pub fn get_domains(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
226 self.inner.get_domains()
227 }
228 /// <p>Whether to enable SSL for the app.</p>
229 pub fn enable_ssl(mut self, input: bool) -> Self {
230 self.inner = self.inner.enable_ssl(input);
231 self
232 }
233 /// <p>Whether to enable SSL for the app.</p>
234 pub fn set_enable_ssl(mut self, input: ::std::option::Option<bool>) -> Self {
235 self.inner = self.inner.set_enable_ssl(input);
236 self
237 }
238 /// <p>Whether to enable SSL for the app.</p>
239 pub fn get_enable_ssl(&self) -> &::std::option::Option<bool> {
240 self.inner.get_enable_ssl()
241 }
242 /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
243 pub fn ssl_configuration(mut self, input: crate::types::SslConfiguration) -> Self {
244 self.inner = self.inner.ssl_configuration(input);
245 self
246 }
247 /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
248 pub fn set_ssl_configuration(mut self, input: ::std::option::Option<crate::types::SslConfiguration>) -> Self {
249 self.inner = self.inner.set_ssl_configuration(input);
250 self
251 }
252 /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
253 pub fn get_ssl_configuration(&self) -> &::std::option::Option<crate::types::SslConfiguration> {
254 self.inner.get_ssl_configuration()
255 }
256 ///
257 /// Adds a key-value pair to `Attributes`.
258 ///
259 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
260 ///
261 /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
262 pub fn attributes(mut self, k: crate::types::AppAttributesKeys, v: impl ::std::convert::Into<::std::string::String>) -> Self {
263 self.inner = self.inner.attributes(k, v.into());
264 self
265 }
266 /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
267 pub fn set_attributes(
268 mut self,
269 input: ::std::option::Option<::std::collections::HashMap<crate::types::AppAttributesKeys, ::std::string::String>>,
270 ) -> Self {
271 self.inner = self.inner.set_attributes(input);
272 self
273 }
274 /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
275 pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::AppAttributesKeys, ::std::string::String>> {
276 self.inner.get_attributes()
277 }
278 ///
279 /// Appends an item to `Environment`.
280 ///
281 /// To override the contents of this collection use [`set_environment`](Self::set_environment).
282 ///
283 /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
284 /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p><note>
285 /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
286 /// </note>
287 pub fn environment(mut self, input: crate::types::EnvironmentVariable) -> Self {
288 self.inner = self.inner.environment(input);
289 self
290 }
291 /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
292 /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p><note>
293 /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
294 /// </note>
295 pub fn set_environment(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>>) -> Self {
296 self.inner = self.inner.set_environment(input);
297 self
298 }
299 /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
300 /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p><note>
301 /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
302 /// </note>
303 pub fn get_environment(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>> {
304 self.inner.get_environment()
305 }
306}