aws_sdk_codedeploy/operation/create_deployment_config/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_deployment_config::_create_deployment_config_output::CreateDeploymentConfigOutputBuilder;
3
4pub use crate::operation::create_deployment_config::_create_deployment_config_input::CreateDeploymentConfigInputBuilder;
5
6impl crate::operation::create_deployment_config::builders::CreateDeploymentConfigInputBuilder {
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_deployment_config::CreateDeploymentConfigOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_deployment_config::CreateDeploymentConfigError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_deployment_config();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateDeploymentConfig`.
24///
25/// <p>Creates a deployment configuration.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateDeploymentConfigFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_deployment_config::builders::CreateDeploymentConfigInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_deployment_config::CreateDeploymentConfigOutput,
35 crate::operation::create_deployment_config::CreateDeploymentConfigError,
36 > for CreateDeploymentConfigFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::create_deployment_config::CreateDeploymentConfigOutput,
44 crate::operation::create_deployment_config::CreateDeploymentConfigError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateDeploymentConfigFluentBuilder {
51 /// Creates a new `CreateDeploymentConfigFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the CreateDeploymentConfig as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_deployment_config::builders::CreateDeploymentConfigInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::create_deployment_config::CreateDeploymentConfigOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_deployment_config::CreateDeploymentConfigError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::create_deployment_config::CreateDeploymentConfig::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_deployment_config::CreateDeploymentConfig::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::create_deployment_config::CreateDeploymentConfigOutput,
97 crate::operation::create_deployment_config::CreateDeploymentConfigError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of the deployment configuration to create.</p>
112 pub fn deployment_config_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.deployment_config_name(input.into());
114 self
115 }
116 /// <p>The name of the deployment configuration to create.</p>
117 pub fn set_deployment_config_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_deployment_config_name(input);
119 self
120 }
121 /// <p>The name of the deployment configuration to create.</p>
122 pub fn get_deployment_config_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_deployment_config_name()
124 }
125 /// <p>The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value.</p>
126 /// <p>The type parameter takes either of the following values:</p>
127 /// <ul>
128 /// <li>
129 /// <p>HOST_COUNT: The value parameter represents the minimum number of healthy instances as an absolute value.</p></li>
130 /// <li>
131 /// <p>FLEET_PERCENT: The value parameter represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, CodeDeploy converts the percentage to the equivalent number of instances and rounds up fractional instances.</p></li>
132 /// </ul>
133 /// <p>The value parameter takes an integer.</p>
134 /// <p>For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95.</p>
135 pub fn minimum_healthy_hosts(mut self, input: crate::types::MinimumHealthyHosts) -> Self {
136 self.inner = self.inner.minimum_healthy_hosts(input);
137 self
138 }
139 /// <p>The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value.</p>
140 /// <p>The type parameter takes either of the following values:</p>
141 /// <ul>
142 /// <li>
143 /// <p>HOST_COUNT: The value parameter represents the minimum number of healthy instances as an absolute value.</p></li>
144 /// <li>
145 /// <p>FLEET_PERCENT: The value parameter represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, CodeDeploy converts the percentage to the equivalent number of instances and rounds up fractional instances.</p></li>
146 /// </ul>
147 /// <p>The value parameter takes an integer.</p>
148 /// <p>For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95.</p>
149 pub fn set_minimum_healthy_hosts(mut self, input: ::std::option::Option<crate::types::MinimumHealthyHosts>) -> Self {
150 self.inner = self.inner.set_minimum_healthy_hosts(input);
151 self
152 }
153 /// <p>The minimum number of healthy instances that should be available at any time during the deployment. There are two parameters expected in the input: type and value.</p>
154 /// <p>The type parameter takes either of the following values:</p>
155 /// <ul>
156 /// <li>
157 /// <p>HOST_COUNT: The value parameter represents the minimum number of healthy instances as an absolute value.</p></li>
158 /// <li>
159 /// <p>FLEET_PERCENT: The value parameter represents the minimum number of healthy instances as a percentage of the total number of instances in the deployment. If you specify FLEET_PERCENT, at the start of the deployment, CodeDeploy converts the percentage to the equivalent number of instances and rounds up fractional instances.</p></li>
160 /// </ul>
161 /// <p>The value parameter takes an integer.</p>
162 /// <p>For example, to set a minimum of 95% healthy instance, specify a type of FLEET_PERCENT and a value of 95.</p>
163 pub fn get_minimum_healthy_hosts(&self) -> &::std::option::Option<crate::types::MinimumHealthyHosts> {
164 self.inner.get_minimum_healthy_hosts()
165 }
166 /// <p>The configuration that specifies how the deployment traffic is routed.</p>
167 pub fn traffic_routing_config(mut self, input: crate::types::TrafficRoutingConfig) -> Self {
168 self.inner = self.inner.traffic_routing_config(input);
169 self
170 }
171 /// <p>The configuration that specifies how the deployment traffic is routed.</p>
172 pub fn set_traffic_routing_config(mut self, input: ::std::option::Option<crate::types::TrafficRoutingConfig>) -> Self {
173 self.inner = self.inner.set_traffic_routing_config(input);
174 self
175 }
176 /// <p>The configuration that specifies how the deployment traffic is routed.</p>
177 pub fn get_traffic_routing_config(&self) -> &::std::option::Option<crate::types::TrafficRoutingConfig> {
178 self.inner.get_traffic_routing_config()
179 }
180 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
181 pub fn compute_platform(mut self, input: crate::types::ComputePlatform) -> Self {
182 self.inner = self.inner.compute_platform(input);
183 self
184 }
185 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
186 pub fn set_compute_platform(mut self, input: ::std::option::Option<crate::types::ComputePlatform>) -> Self {
187 self.inner = self.inner.set_compute_platform(input);
188 self
189 }
190 /// <p>The destination platform type for the deployment (<code>Lambda</code>, <code>Server</code>, or <code>ECS</code>).</p>
191 pub fn get_compute_platform(&self) -> &::std::option::Option<crate::types::ComputePlatform> {
192 self.inner.get_compute_platform()
193 }
194 /// <p>Configure the <code>ZonalConfig</code> object if you want CodeDeploy to deploy your application to one <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones">Availability Zone</a> at a time, within an Amazon Web Services Region.</p>
195 /// <p>For more information about the zonal configuration feature, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations-create.html#zonal-config">zonal configuration</a> in the <i>CodeDeploy User Guide</i>.</p>
196 pub fn zonal_config(mut self, input: crate::types::ZonalConfig) -> Self {
197 self.inner = self.inner.zonal_config(input);
198 self
199 }
200 /// <p>Configure the <code>ZonalConfig</code> object if you want CodeDeploy to deploy your application to one <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones">Availability Zone</a> at a time, within an Amazon Web Services Region.</p>
201 /// <p>For more information about the zonal configuration feature, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations-create.html#zonal-config">zonal configuration</a> in the <i>CodeDeploy User Guide</i>.</p>
202 pub fn set_zonal_config(mut self, input: ::std::option::Option<crate::types::ZonalConfig>) -> Self {
203 self.inner = self.inner.set_zonal_config(input);
204 self
205 }
206 /// <p>Configure the <code>ZonalConfig</code> object if you want CodeDeploy to deploy your application to one <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-availability-zones">Availability Zone</a> at a time, within an Amazon Web Services Region.</p>
207 /// <p>For more information about the zonal configuration feature, see <a href="https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-configurations-create.html#zonal-config">zonal configuration</a> in the <i>CodeDeploy User Guide</i>.</p>
208 pub fn get_zonal_config(&self) -> &::std::option::Option<crate::types::ZonalConfig> {
209 self.inner.get_zonal_config()
210 }
211}