aws_sdk_opsworks/operation/update_app/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_app::_update_app_output::UpdateAppOutputBuilder;
3
4pub use crate::operation::update_app::_update_app_input::UpdateAppInputBuilder;
5
6impl crate::operation::update_app::builders::UpdateAppInputBuilder {
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::update_app::UpdateAppOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_app::UpdateAppError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_app();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateApp`.
24///
25/// <p>Updates a specified app.</p>
26/// <p><b>Required Permissions</b>: To use this action, an IAM user must have a Deploy or 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 UpdateAppFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_app::builders::UpdateAppInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::update_app::UpdateAppOutput, crate::operation::update_app::UpdateAppError>
34    for UpdateAppFluentBuilder
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::update_app::UpdateAppOutput, crate::operation::update_app::UpdateAppError>,
41    > {
42        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43    }
44}
45impl UpdateAppFluentBuilder {
46    /// Creates a new `UpdateAppFluentBuilder`.
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 UpdateApp as a reference.
55    pub fn as_input(&self) -> &crate::operation::update_app::builders::UpdateAppInputBuilder {
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::update_app::UpdateAppOutput,
70        ::aws_smithy_runtime_api::client::result::SdkError<
71            crate::operation::update_app::UpdateAppError,
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::update_app::UpdateApp::operation_runtime_plugins(
80            self.handle.runtime_plugins.clone(),
81            &self.handle.conf,
82            self.config_override,
83        );
84        crate::operation::update_app::UpdateApp::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::update_app::UpdateAppOutput,
92        crate::operation::update_app::UpdateAppError,
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 app ID.</p>
107    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108        self.inner = self.inner.app_id(input.into());
109        self
110    }
111    /// <p>The app ID.</p>
112    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.inner = self.inner.set_app_id(input);
114        self
115    }
116    /// <p>The app ID.</p>
117    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
118        self.inner.get_app_id()
119    }
120    /// <p>The app name.</p>
121    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.name(input.into());
123        self
124    }
125    /// <p>The app name.</p>
126    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_name(input);
128        self
129    }
130    /// <p>The app name.</p>
131    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_name()
133    }
134    /// <p>A description of the app.</p>
135    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.description(input.into());
137        self
138    }
139    /// <p>A description of the app.</p>
140    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_description(input);
142        self
143    }
144    /// <p>A description of the app.</p>
145    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_description()
147    }
148    ///
149    /// Appends an item to `DataSources`.
150    ///
151    /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
152    ///
153    /// <p>The app's data sources.</p>
154    pub fn data_sources(mut self, input: crate::types::DataSource) -> Self {
155        self.inner = self.inner.data_sources(input);
156        self
157    }
158    /// <p>The app's data sources.</p>
159    pub fn set_data_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataSource>>) -> Self {
160        self.inner = self.inner.set_data_sources(input);
161        self
162    }
163    /// <p>The app's data sources.</p>
164    pub fn get_data_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataSource>> {
165        self.inner.get_data_sources()
166    }
167    /// <p>The app type.</p>
168    pub fn r#type(mut self, input: crate::types::AppType) -> Self {
169        self.inner = self.inner.r#type(input);
170        self
171    }
172    /// <p>The app type.</p>
173    pub fn set_type(mut self, input: ::std::option::Option<crate::types::AppType>) -> Self {
174        self.inner = self.inner.set_type(input);
175        self
176    }
177    /// <p>The app type.</p>
178    pub fn get_type(&self) -> &::std::option::Option<crate::types::AppType> {
179        self.inner.get_type()
180    }
181    /// <p>A <code>Source</code> object that specifies the app repository.</p>
182    pub fn app_source(mut self, input: crate::types::Source) -> Self {
183        self.inner = self.inner.app_source(input);
184        self
185    }
186    /// <p>A <code>Source</code> object that specifies the app repository.</p>
187    pub fn set_app_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
188        self.inner = self.inner.set_app_source(input);
189        self
190    }
191    /// <p>A <code>Source</code> object that specifies the app repository.</p>
192    pub fn get_app_source(&self) -> &::std::option::Option<crate::types::Source> {
193        self.inner.get_app_source()
194    }
195    ///
196    /// Appends an item to `Domains`.
197    ///
198    /// To override the contents of this collection use [`set_domains`](Self::set_domains).
199    ///
200    /// <p>The app's virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
201    pub fn domains(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.domains(input.into());
203        self
204    }
205    /// <p>The app's virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
206    pub fn set_domains(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
207        self.inner = self.inner.set_domains(input);
208        self
209    }
210    /// <p>The app's virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code></p>
211    pub fn get_domains(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
212        self.inner.get_domains()
213    }
214    /// <p>Whether SSL is enabled for the app.</p>
215    pub fn enable_ssl(mut self, input: bool) -> Self {
216        self.inner = self.inner.enable_ssl(input);
217        self
218    }
219    /// <p>Whether SSL is enabled for the app.</p>
220    pub fn set_enable_ssl(mut self, input: ::std::option::Option<bool>) -> Self {
221        self.inner = self.inner.set_enable_ssl(input);
222        self
223    }
224    /// <p>Whether SSL is enabled for the app.</p>
225    pub fn get_enable_ssl(&self) -> &::std::option::Option<bool> {
226        self.inner.get_enable_ssl()
227    }
228    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
229    pub fn ssl_configuration(mut self, input: crate::types::SslConfiguration) -> Self {
230        self.inner = self.inner.ssl_configuration(input);
231        self
232    }
233    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
234    pub fn set_ssl_configuration(mut self, input: ::std::option::Option<crate::types::SslConfiguration>) -> Self {
235        self.inner = self.inner.set_ssl_configuration(input);
236        self
237    }
238    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
239    pub fn get_ssl_configuration(&self) -> &::std::option::Option<crate::types::SslConfiguration> {
240        self.inner.get_ssl_configuration()
241    }
242    ///
243    /// Adds a key-value pair to `Attributes`.
244    ///
245    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
246    ///
247    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
248    pub fn attributes(mut self, k: crate::types::AppAttributesKeys, v: impl ::std::convert::Into<::std::string::String>) -> Self {
249        self.inner = self.inner.attributes(k, v.into());
250        self
251    }
252    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
253    pub fn set_attributes(
254        mut self,
255        input: ::std::option::Option<::std::collections::HashMap<crate::types::AppAttributesKeys, ::std::string::String>>,
256    ) -> Self {
257        self.inner = self.inner.set_attributes(input);
258        self
259    }
260    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
261    pub fn get_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<crate::types::AppAttributesKeys, ::std::string::String>> {
262        self.inner.get_attributes()
263    }
264    ///
265    /// Appends an item to `Environment`.
266    ///
267    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
268    ///
269    /// <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 instances.For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
270    /// <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 20 KB)."</p><note>
271    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
272    /// </note>
273    pub fn environment(mut self, input: crate::types::EnvironmentVariable) -> Self {
274        self.inner = self.inner.environment(input);
275        self
276    }
277    /// <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 instances.For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
278    /// <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 20 KB)."</p><note>
279    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
280    /// </note>
281    pub fn set_environment(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>>) -> Self {
282        self.inner = self.inner.set_environment(input);
283        self
284    }
285    /// <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 instances.For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
286    /// <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 20 KB)."</p><note>
287    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
288    /// </note>
289    pub fn get_environment(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariable>> {
290        self.inner.get_environment()
291    }
292}