1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::create_deployment::_create_deployment_output::CreateDeploymentOutputBuilder;

pub use crate::operation::create_deployment::_create_deployment_input::CreateDeploymentInputBuilder;

impl crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::create_deployment::CreateDeploymentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_deployment::CreateDeploymentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.create_deployment();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `CreateDeployment`.
///
/// <p>Deploys an application revision through the specified deployment group.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct CreateDeploymentFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::create_deployment::builders::CreateDeploymentInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::create_deployment::CreateDeploymentOutput,
        crate::operation::create_deployment::CreateDeploymentError,
    > for CreateDeploymentFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::create_deployment::CreateDeploymentOutput,
            crate::operation::create_deployment::CreateDeploymentError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl CreateDeploymentFluentBuilder {
    /// Creates a new `CreateDeploymentFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the CreateDeployment as a reference.
    pub fn as_input(&self) -> &crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_deployment::CreateDeploymentOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::create_deployment::CreateDeploymentError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::create_deployment::CreateDeployment::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::create_deployment::CreateDeployment::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::create_deployment::CreateDeploymentOutput,
        crate::operation::create_deployment::CreateDeploymentError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.application_name(input.into());
        self
    }
    /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_application_name(input);
        self
    }
    /// <p>The name of an CodeDeploy application associated with the user or Amazon Web Services account.</p>
    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_application_name()
    }
    /// <p>The name of the deployment group.</p>
    pub fn deployment_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.deployment_group_name(input.into());
        self
    }
    /// <p>The name of the deployment group.</p>
    pub fn set_deployment_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_deployment_group_name(input);
        self
    }
    /// <p>The name of the deployment group.</p>
    pub fn get_deployment_group_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_deployment_group_name()
    }
    /// <p>The type and location of the revision to deploy.</p>
    pub fn revision(mut self, input: crate::types::RevisionLocation) -> Self {
        self.inner = self.inner.revision(input);
        self
    }
    /// <p>The type and location of the revision to deploy.</p>
    pub fn set_revision(mut self, input: ::std::option::Option<crate::types::RevisionLocation>) -> Self {
        self.inner = self.inner.set_revision(input);
        self
    }
    /// <p>The type and location of the revision to deploy.</p>
    pub fn get_revision(&self) -> &::std::option::Option<crate::types::RevisionLocation> {
        self.inner.get_revision()
    }
    /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
    /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
    pub fn deployment_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.deployment_config_name(input.into());
        self
    }
    /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
    /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
    pub fn set_deployment_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_deployment_config_name(input);
        self
    }
    /// <p>The name of a deployment configuration associated with the user or Amazon Web Services account.</p>
    /// <p>If not specified, the value configured in the deployment group is used as the default. If the deployment group does not have a deployment configuration associated with it, <code>CodeDeployDefault</code>.<code>OneAtATime</code> is used by default.</p>
    pub fn get_deployment_config_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_deployment_config_name()
    }
    /// <p>A comment about the deployment.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// <p>A comment about the deployment.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// <p>A comment about the deployment.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
    /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
    /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
    /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
    pub fn ignore_application_stop_failures(mut self, input: bool) -> Self {
        self.inner = self.inner.ignore_application_stop_failures(input);
        self
    }
    /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
    /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
    /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
    /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
    pub fn set_ignore_application_stop_failures(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_ignore_application_stop_failures(input);
        self
    }
    /// <p>If true, then if an <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, or <code>AfterBlockTraffic</code> deployment lifecycle event to an instance fails, then the deployment continues to the next deployment lifecycle event. For example, if <code>ApplicationStop</code> fails, the deployment continues with <code>DownloadBundle</code>. If <code>BeforeBlockTraffic</code> fails, the deployment continues with <code>BlockTraffic</code>. If <code>AfterBlockTraffic</code> fails, the deployment continues with <code>ApplicationStop</code>.</p>
    /// <p>If false or not specified, then if a lifecycle event fails during a deployment to an instance, that deployment fails. If deployment to that instance is part of an overall deployment and the number of healthy hosts is not less than the minimum number of healthy hosts, then a deployment to the next instance is attempted.</p>
    /// <p>During a deployment, the CodeDeploy agent runs the scripts specified for <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> in the AppSpec file from the previous successful deployment. (All other scripts are run from the AppSpec file in the current deployment.) If one of these scripts contains an error and does not run successfully, the deployment can fail.</p>
    /// <p>If the cause of the failure is a script from the last successful deployment that will never run successfully, create a new deployment and use <code>ignoreApplicationStopFailures</code> to specify that the <code>ApplicationStop</code>, <code>BeforeBlockTraffic</code>, and <code>AfterBlockTraffic</code> failures should be ignored.</p>
    pub fn get_ignore_application_stop_failures(&self) -> &::std::option::Option<bool> {
        self.inner.get_ignore_application_stop_failures()
    }
    /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
    pub fn target_instances(mut self, input: crate::types::TargetInstances) -> Self {
        self.inner = self.inner.target_instances(input);
        self
    }
    /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
    pub fn set_target_instances(mut self, input: ::std::option::Option<crate::types::TargetInstances>) -> Self {
        self.inner = self.inner.set_target_instances(input);
        self
    }
    /// <p>Information about the instances that belong to the replacement environment in a blue/green deployment.</p>
    pub fn get_target_instances(&self) -> &::std::option::Option<crate::types::TargetInstances> {
        self.inner.get_target_instances()
    }
    /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
    pub fn auto_rollback_configuration(mut self, input: crate::types::AutoRollbackConfiguration) -> Self {
        self.inner = self.inner.auto_rollback_configuration(input);
        self
    }
    /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
    pub fn set_auto_rollback_configuration(mut self, input: ::std::option::Option<crate::types::AutoRollbackConfiguration>) -> Self {
        self.inner = self.inner.set_auto_rollback_configuration(input);
        self
    }
    /// <p>Configuration information for an automatic rollback that is added when a deployment is created.</p>
    pub fn get_auto_rollback_configuration(&self) -> &::std::option::Option<crate::types::AutoRollbackConfiguration> {
        self.inner.get_auto_rollback_configuration()
    }
    /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
    pub fn update_outdated_instances_only(mut self, input: bool) -> Self {
        self.inner = self.inner.update_outdated_instances_only(input);
        self
    }
    /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
    pub fn set_update_outdated_instances_only(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_update_outdated_instances_only(input);
        self
    }
    /// <p>Indicates whether to deploy to all instances or only to instances that are not running the latest application revision.</p>
    pub fn get_update_outdated_instances_only(&self) -> &::std::option::Option<bool> {
        self.inner.get_update_outdated_instances_only()
    }
    /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
    /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
    /// <ul>
    /// <li>
    /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
    /// <li>
    /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
    /// <li>
    /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
    /// </ul>
    pub fn file_exists_behavior(mut self, input: crate::types::FileExistsBehavior) -> Self {
        self.inner = self.inner.file_exists_behavior(input);
        self
    }
    /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
    /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
    /// <ul>
    /// <li>
    /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
    /// <li>
    /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
    /// <li>
    /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
    /// </ul>
    pub fn set_file_exists_behavior(mut self, input: ::std::option::Option<crate::types::FileExistsBehavior>) -> Self {
        self.inner = self.inner.set_file_exists_behavior(input);
        self
    }
    /// <p>Information about how CodeDeploy handles files that already exist in a deployment target location but weren't part of the previous successful deployment.</p>
    /// <p>The <code>fileExistsBehavior</code> parameter takes any of the following values:</p>
    /// <ul>
    /// <li>
    /// <p>DISALLOW: The deployment fails. This is also the default behavior if no option is specified.</p></li>
    /// <li>
    /// <p>OVERWRITE: The version of the file from the application revision currently being deployed replaces the version already on the instance.</p></li>
    /// <li>
    /// <p>RETAIN: The version of the file already on the instance is kept and used as part of the new deployment.</p></li>
    /// </ul>
    pub fn get_file_exists_behavior(&self) -> &::std::option::Option<crate::types::FileExistsBehavior> {
        self.inner.get_file_exists_behavior()
    }
    /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
    /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
    /// </note>
    pub fn override_alarm_configuration(mut self, input: crate::types::AlarmConfiguration) -> Self {
        self.inner = self.inner.override_alarm_configuration(input);
        self
    }
    /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
    /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
    /// </note>
    pub fn set_override_alarm_configuration(mut self, input: ::std::option::Option<crate::types::AlarmConfiguration>) -> Self {
        self.inner = self.inner.set_override_alarm_configuration(input);
        self
    }
    /// <p>Allows you to specify information about alarms associated with a deployment. The alarm configuration that you specify here will override the alarm configuration at the deployment group level. Consider overriding the alarm configuration if you have set up alarms at the deployment group level that are causing deployment failures. In this case, you would call <code>CreateDeployment</code> to create a new deployment that uses a previous application revision that is known to work, and set its alarm configuration to turn off alarm polling. Turning off alarm polling ensures that the new deployment proceeds without being blocked by the alarm that was generated by the previous, failed, deployment.</p><note>
    /// <p>If you specify an <code>overrideAlarmConfiguration</code>, you need the <code>UpdateDeploymentGroup</code> IAM permission when calling <code>CreateDeployment</code>.</p>
    /// </note>
    pub fn get_override_alarm_configuration(&self) -> &::std::option::Option<crate::types::AlarmConfiguration> {
        self.inner.get_override_alarm_configuration()
    }
}