aws_sdk_elasticbeanstalk/operation/create_application_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_application_version::_create_application_version_output::CreateApplicationVersionOutputBuilder;
3
4pub use crate::operation::create_application_version::_create_application_version_input::CreateApplicationVersionInputBuilder;
5
6impl crate::operation::create_application_version::builders::CreateApplicationVersionInputBuilder {
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_application_version::CreateApplicationVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_application_version::CreateApplicationVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_application_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateApplicationVersion`.
24///
25/// <p>Creates an application version for the specified application. You can create an application version from a source bundle in Amazon S3, a commit in AWS CodeCommit, or the output of an AWS CodeBuild build as follows:</p>
26/// <p>Specify a commit in an AWS CodeCommit repository with <code>SourceBuildInformation</code>.</p>
27/// <p>Specify a build in an AWS CodeBuild with <code>SourceBuildInformation</code> and <code>BuildConfiguration</code>.</p>
28/// <p>Specify a source bundle in S3 with <code>SourceBundle</code></p>
29/// <p>Omit both <code>SourceBuildInformation</code> and <code>SourceBundle</code> to use the default sample application.</p><note>
30/// <p>After you create an application version with a specified Amazon S3 bucket and key location, you can't change that Amazon S3 location. If you change the Amazon S3 location, you receive an exception when you attempt to launch an environment from the application version.</p>
31/// </note>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct CreateApplicationVersionFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::create_application_version::builders::CreateApplicationVersionInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::create_application_version::CreateApplicationVersionOutput,
41        crate::operation::create_application_version::CreateApplicationVersionError,
42    > for CreateApplicationVersionFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::create_application_version::CreateApplicationVersionOutput,
50            crate::operation::create_application_version::CreateApplicationVersionError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl CreateApplicationVersionFluentBuilder {
57    /// Creates a new `CreateApplicationVersionFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the CreateApplicationVersion as a reference.
66    pub fn as_input(&self) -> &crate::operation::create_application_version::builders::CreateApplicationVersionInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::create_application_version::CreateApplicationVersionOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::create_application_version::CreateApplicationVersionError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::create_application_version::CreateApplicationVersion::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::create_application_version::CreateApplicationVersion::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::create_application_version::CreateApplicationVersionOutput,
103        crate::operation::create_application_version::CreateApplicationVersionError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The name of the application. If no application is found with this name, and <code>AutoCreateApplication</code> is <code>false</code>, returns an <code>InvalidParameterValue</code> error.</p>
118    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.application_name(input.into());
120        self
121    }
122    /// <p>The name of the application. If no application is found with this name, and <code>AutoCreateApplication</code> is <code>false</code>, returns an <code>InvalidParameterValue</code> error.</p>
123    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_application_name(input);
125        self
126    }
127    /// <p>The name of the application. If no application is found with this name, and <code>AutoCreateApplication</code> is <code>false</code>, returns an <code>InvalidParameterValue</code> error.</p>
128    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_application_name()
130    }
131    /// <p>A label identifying this version.</p>
132    /// <p>Constraint: Must be unique per application. If an application version already exists with this label for the specified application, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
133    pub fn version_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.version_label(input.into());
135        self
136    }
137    /// <p>A label identifying this version.</p>
138    /// <p>Constraint: Must be unique per application. If an application version already exists with this label for the specified application, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
139    pub fn set_version_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_version_label(input);
141        self
142    }
143    /// <p>A label identifying this version.</p>
144    /// <p>Constraint: Must be unique per application. If an application version already exists with this label for the specified application, AWS Elastic Beanstalk returns an <code>InvalidParameterValue</code> error.</p>
145    pub fn get_version_label(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_version_label()
147    }
148    /// <p>A description of this application version.</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 this application version.</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 this application version.</p>
159    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_description()
161    }
162    /// <p>Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.</p>
163    pub fn source_build_information(mut self, input: crate::types::SourceBuildInformation) -> Self {
164        self.inner = self.inner.source_build_information(input);
165        self
166    }
167    /// <p>Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.</p>
168    pub fn set_source_build_information(mut self, input: ::std::option::Option<crate::types::SourceBuildInformation>) -> Self {
169        self.inner = self.inner.set_source_build_information(input);
170        self
171    }
172    /// <p>Specify a commit in an AWS CodeCommit Git repository to use as the source code for the application version.</p>
173    pub fn get_source_build_information(&self) -> &::std::option::Option<crate::types::SourceBuildInformation> {
174        self.inner.get_source_build_information()
175    }
176    /// <p>The Amazon S3 bucket and key that identify the location of the source bundle for this version.</p><note>
177    /// <p>The Amazon S3 bucket must be in the same region as the environment.</p>
178    /// </note>
179    /// <p>Specify a source bundle in S3 or a commit in an AWS CodeCommit repository (with <code>SourceBuildInformation</code>), but not both. If neither <code>SourceBundle</code> nor <code>SourceBuildInformation</code> are provided, Elastic Beanstalk uses a sample application.</p>
180    pub fn source_bundle(mut self, input: crate::types::S3Location) -> Self {
181        self.inner = self.inner.source_bundle(input);
182        self
183    }
184    /// <p>The Amazon S3 bucket and key that identify the location of the source bundle for this version.</p><note>
185    /// <p>The Amazon S3 bucket must be in the same region as the environment.</p>
186    /// </note>
187    /// <p>Specify a source bundle in S3 or a commit in an AWS CodeCommit repository (with <code>SourceBuildInformation</code>), but not both. If neither <code>SourceBundle</code> nor <code>SourceBuildInformation</code> are provided, Elastic Beanstalk uses a sample application.</p>
188    pub fn set_source_bundle(mut self, input: ::std::option::Option<crate::types::S3Location>) -> Self {
189        self.inner = self.inner.set_source_bundle(input);
190        self
191    }
192    /// <p>The Amazon S3 bucket and key that identify the location of the source bundle for this version.</p><note>
193    /// <p>The Amazon S3 bucket must be in the same region as the environment.</p>
194    /// </note>
195    /// <p>Specify a source bundle in S3 or a commit in an AWS CodeCommit repository (with <code>SourceBuildInformation</code>), but not both. If neither <code>SourceBundle</code> nor <code>SourceBuildInformation</code> are provided, Elastic Beanstalk uses a sample application.</p>
196    pub fn get_source_bundle(&self) -> &::std::option::Option<crate::types::S3Location> {
197        self.inner.get_source_bundle()
198    }
199    /// <p>Settings for an AWS CodeBuild build.</p>
200    pub fn build_configuration(mut self, input: crate::types::BuildConfiguration) -> Self {
201        self.inner = self.inner.build_configuration(input);
202        self
203    }
204    /// <p>Settings for an AWS CodeBuild build.</p>
205    pub fn set_build_configuration(mut self, input: ::std::option::Option<crate::types::BuildConfiguration>) -> Self {
206        self.inner = self.inner.set_build_configuration(input);
207        self
208    }
209    /// <p>Settings for an AWS CodeBuild build.</p>
210    pub fn get_build_configuration(&self) -> &::std::option::Option<crate::types::BuildConfiguration> {
211        self.inner.get_build_configuration()
212    }
213    /// <p>Set to <code>true</code> to create an application with the specified name if it doesn't already exist.</p>
214    pub fn auto_create_application(mut self, input: bool) -> Self {
215        self.inner = self.inner.auto_create_application(input);
216        self
217    }
218    /// <p>Set to <code>true</code> to create an application with the specified name if it doesn't already exist.</p>
219    pub fn set_auto_create_application(mut self, input: ::std::option::Option<bool>) -> Self {
220        self.inner = self.inner.set_auto_create_application(input);
221        self
222    }
223    /// <p>Set to <code>true</code> to create an application with the specified name if it doesn't already exist.</p>
224    pub fn get_auto_create_application(&self) -> &::std::option::Option<bool> {
225        self.inner.get_auto_create_application()
226    }
227    /// <p>Pre-processes and validates the environment manifest (<code>env.yaml</code>) and configuration files (<code>*.config</code> files in the <code>.ebextensions</code> folder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.</p>
228    /// <p>You must turn processing on for application versions that you create using AWS CodeBuild or AWS CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.</p><note>
229    /// <p>The <code>Process</code> option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.</p>
230    /// </note>
231    pub fn process(mut self, input: bool) -> Self {
232        self.inner = self.inner.process(input);
233        self
234    }
235    /// <p>Pre-processes and validates the environment manifest (<code>env.yaml</code>) and configuration files (<code>*.config</code> files in the <code>.ebextensions</code> folder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.</p>
236    /// <p>You must turn processing on for application versions that you create using AWS CodeBuild or AWS CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.</p><note>
237    /// <p>The <code>Process</code> option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.</p>
238    /// </note>
239    pub fn set_process(mut self, input: ::std::option::Option<bool>) -> Self {
240        self.inner = self.inner.set_process(input);
241        self
242    }
243    /// <p>Pre-processes and validates the environment manifest (<code>env.yaml</code>) and configuration files (<code>*.config</code> files in the <code>.ebextensions</code> folder) in the source bundle. Validating configuration files can identify issues prior to deploying the application version to an environment.</p>
244    /// <p>You must turn processing on for application versions that you create using AWS CodeBuild or AWS CodeCommit. For application versions built from a source bundle in Amazon S3, processing is optional.</p><note>
245    /// <p>The <code>Process</code> option validates Elastic Beanstalk configuration files. It doesn't validate your application's configuration files, like proxy server or Docker configuration.</p>
246    /// </note>
247    pub fn get_process(&self) -> &::std::option::Option<bool> {
248        self.inner.get_process()
249    }
250    ///
251    /// Appends an item to `Tags`.
252    ///
253    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
254    ///
255    /// <p>Specifies the tags applied to the application version.</p>
256    /// <p>Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.</p>
257    pub fn tags(mut self, input: crate::types::Tag) -> Self {
258        self.inner = self.inner.tags(input);
259        self
260    }
261    /// <p>Specifies the tags applied to the application version.</p>
262    /// <p>Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.</p>
263    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
264        self.inner = self.inner.set_tags(input);
265        self
266    }
267    /// <p>Specifies the tags applied to the application version.</p>
268    /// <p>Elastic Beanstalk applies these tags only to the application version. Environments that use the application version don't inherit the tags.</p>
269    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
270        self.inner.get_tags()
271    }
272}