aws_sdk_codedeploy/operation/batch_get_deployment_targets/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::batch_get_deployment_targets::_batch_get_deployment_targets_output::BatchGetDeploymentTargetsOutputBuilder;
3
4pub use crate::operation::batch_get_deployment_targets::_batch_get_deployment_targets_input::BatchGetDeploymentTargetsInputBuilder;
5
6impl crate::operation::batch_get_deployment_targets::builders::BatchGetDeploymentTargetsInputBuilder {
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::batch_get_deployment_targets::BatchGetDeploymentTargetsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.batch_get_deployment_targets();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `BatchGetDeploymentTargets`.
24///
25/// <p>Returns an array of one or more targets associated with a deployment. This method works with all compute types and should be used instead of the deprecated <code>BatchGetDeploymentInstances</code>. The maximum number of targets that can be returned is 25.</p>
26/// <p>The type of targets returned depends on the deployment's compute platform or deployment method:</p>
27/// <ul>
28/// <li>
29/// <p><b>EC2/On-premises</b>: Information about Amazon EC2 instance targets.</p></li>
30/// <li>
31/// <p><b>Lambda</b>: Information about Lambda functions targets.</p></li>
32/// <li>
33/// <p><b>Amazon ECS</b>: Information about Amazon ECS service targets.</p></li>
34/// <li>
35/// <p><b>CloudFormation</b>: Information about targets of blue/green deployments initiated by a CloudFormation stack update.</p></li>
36/// </ul>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct BatchGetDeploymentTargetsFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::batch_get_deployment_targets::builders::BatchGetDeploymentTargetsInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsOutput,
46 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsError,
47 > for BatchGetDeploymentTargetsFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsOutput,
55 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl BatchGetDeploymentTargetsFluentBuilder {
62 /// Creates a new `BatchGetDeploymentTargetsFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the BatchGetDeploymentTargets as a reference.
71 pub fn as_input(&self) -> &crate::operation::batch_get_deployment_targets::builders::BatchGetDeploymentTargetsInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargets::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargets::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsOutput,
108 crate::operation::batch_get_deployment_targets::BatchGetDeploymentTargetsError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// <p>The unique ID of a deployment.</p>
123 pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.deployment_id(input.into());
125 self
126 }
127 /// <p>The unique ID of a deployment.</p>
128 pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.inner = self.inner.set_deployment_id(input);
130 self
131 }
132 /// <p>The unique ID of a deployment.</p>
133 pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_deployment_id()
135 }
136 ///
137 /// Appends an item to `targetIds`.
138 ///
139 /// To override the contents of this collection use [`set_target_ids`](Self::set_target_ids).
140 ///
141 /// <p>The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.</p>
142 /// <ul>
143 /// <li>
144 /// <p>For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is <code>instanceTarget</code>.</p></li>
145 /// <li>
146 /// <p>For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is <code>instanceTarget</code>.</p></li>
147 /// <li>
148 /// <p>For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format <code><clustername>
149 /// :
150 /// <servicename></servicename>
151 /// </clustername></code>. Their target type is <code>ecsTarget</code>.</p></li>
152 /// <li>
153 /// <p>For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is <code>cloudFormationTarget</code>.</p></li>
154 /// </ul>
155 pub fn target_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
156 self.inner = self.inner.target_ids(input.into());
157 self
158 }
159 /// <p>The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.</p>
160 /// <ul>
161 /// <li>
162 /// <p>For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is <code>instanceTarget</code>.</p></li>
163 /// <li>
164 /// <p>For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is <code>instanceTarget</code>.</p></li>
165 /// <li>
166 /// <p>For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format <code><clustername>
167 /// :
168 /// <servicename></servicename>
169 /// </clustername></code>. Their target type is <code>ecsTarget</code>.</p></li>
170 /// <li>
171 /// <p>For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is <code>cloudFormationTarget</code>.</p></li>
172 /// </ul>
173 pub fn set_target_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
174 self.inner = self.inner.set_target_ids(input);
175 self
176 }
177 /// <p>The unique IDs of the deployment targets. The compute platform of the deployment determines the type of the targets and their formats. The maximum number of deployment target IDs you can specify is 25.</p>
178 /// <ul>
179 /// <li>
180 /// <p>For deployments that use the EC2/On-premises compute platform, the target IDs are Amazon EC2 or on-premises instances IDs, and their target type is <code>instanceTarget</code>.</p></li>
181 /// <li>
182 /// <p>For deployments that use the Lambda compute platform, the target IDs are the names of Lambda functions, and their target type is <code>instanceTarget</code>.</p></li>
183 /// <li>
184 /// <p>For deployments that use the Amazon ECS compute platform, the target IDs are pairs of Amazon ECS clusters and services specified using the format <code><clustername>
185 /// :
186 /// <servicename></servicename>
187 /// </clustername></code>. Their target type is <code>ecsTarget</code>.</p></li>
188 /// <li>
189 /// <p>For deployments that are deployed with CloudFormation, the target IDs are CloudFormation stack IDs. Their target type is <code>cloudFormationTarget</code>.</p></li>
190 /// </ul>
191 pub fn get_target_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
192 self.inner.get_target_ids()
193 }
194}