aws_sdk_ec2/operation/describe_placement_groups/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_placement_groups::_describe_placement_groups_output::DescribePlacementGroupsOutputBuilder;
3
4pub use crate::operation::describe_placement_groups::_describe_placement_groups_input::DescribePlacementGroupsInputBuilder;
5
6impl crate::operation::describe_placement_groups::builders::DescribePlacementGroupsInputBuilder {
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::describe_placement_groups::DescribePlacementGroupsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_placement_groups::DescribePlacementGroupsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_placement_groups();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribePlacementGroups`.
24///
25/// <p>Describes the specified placement groups or all of your placement groups.</p><note>
26/// <p>To describe a specific placement group that is <i>shared</i> with your account, you must specify the ID of the placement group using the <code>GroupId</code> parameter. Specifying the name of a <i>shared</i> placement group using the <code>GroupNames</code> parameter will result in an error.</p>
27/// </note>
28/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html">Placement groups</a> in the <i>Amazon EC2 User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DescribePlacementGroupsFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::describe_placement_groups::builders::DescribePlacementGroupsInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::describe_placement_groups::DescribePlacementGroupsOutput,
38        crate::operation::describe_placement_groups::DescribePlacementGroupsError,
39    > for DescribePlacementGroupsFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::describe_placement_groups::DescribePlacementGroupsOutput,
47            crate::operation::describe_placement_groups::DescribePlacementGroupsError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl DescribePlacementGroupsFluentBuilder {
54    /// Creates a new `DescribePlacementGroupsFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the DescribePlacementGroups as a reference.
63    pub fn as_input(&self) -> &crate::operation::describe_placement_groups::builders::DescribePlacementGroupsInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::describe_placement_groups::DescribePlacementGroupsOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::describe_placement_groups::DescribePlacementGroupsError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::describe_placement_groups::DescribePlacementGroups::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::describe_placement_groups::DescribePlacementGroups::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::describe_placement_groups::DescribePlacementGroupsOutput,
100        crate::operation::describe_placement_groups::DescribePlacementGroupsError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    ///
115    /// Appends an item to `GroupIds`.
116    ///
117    /// To override the contents of this collection use [`set_group_ids`](Self::set_group_ids).
118    ///
119    /// <p>The IDs of the placement groups.</p>
120    pub fn group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.group_ids(input.into());
122        self
123    }
124    /// <p>The IDs of the placement groups.</p>
125    pub fn set_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
126        self.inner = self.inner.set_group_ids(input);
127        self
128    }
129    /// <p>The IDs of the placement groups.</p>
130    pub fn get_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
131        self.inner.get_group_ids()
132    }
133    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
134    pub fn dry_run(mut self, input: bool) -> Self {
135        self.inner = self.inner.dry_run(input);
136        self
137    }
138    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
139    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
140        self.inner = self.inner.set_dry_run(input);
141        self
142    }
143    /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
144    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
145        self.inner.get_dry_run()
146    }
147    ///
148    /// Appends an item to `GroupNames`.
149    ///
150    /// To override the contents of this collection use [`set_group_names`](Self::set_group_names).
151    ///
152    /// <p>The names of the placement groups.</p>
153    /// <p>Constraints:</p>
154    /// <ul>
155    /// <li>
156    /// <p>You can specify a name only if the placement group is owned by your account.</p></li>
157    /// <li>
158    /// <p>If a placement group is <i>shared</i> with your account, specifying the name results in an error. You must use the <code>GroupId</code> parameter instead.</p></li>
159    /// </ul>
160    pub fn group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.group_names(input.into());
162        self
163    }
164    /// <p>The names of the placement groups.</p>
165    /// <p>Constraints:</p>
166    /// <ul>
167    /// <li>
168    /// <p>You can specify a name only if the placement group is owned by your account.</p></li>
169    /// <li>
170    /// <p>If a placement group is <i>shared</i> with your account, specifying the name results in an error. You must use the <code>GroupId</code> parameter instead.</p></li>
171    /// </ul>
172    pub fn set_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
173        self.inner = self.inner.set_group_names(input);
174        self
175    }
176    /// <p>The names of the placement groups.</p>
177    /// <p>Constraints:</p>
178    /// <ul>
179    /// <li>
180    /// <p>You can specify a name only if the placement group is owned by your account.</p></li>
181    /// <li>
182    /// <p>If a placement group is <i>shared</i> with your account, specifying the name results in an error. You must use the <code>GroupId</code> parameter instead.</p></li>
183    /// </ul>
184    pub fn get_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
185        self.inner.get_group_names()
186    }
187    ///
188    /// Appends an item to `Filters`.
189    ///
190    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
191    ///
192    /// <p>The filters.</p>
193    /// <ul>
194    /// <li>
195    /// <p><code>group-name</code> - The name of the placement group.</p></li>
196    /// <li>
197    /// <p><code>group-arn</code> - The Amazon Resource Name (ARN) of the placement group.</p></li>
198    /// <li>
199    /// <p><code>spread-level</code> - The spread level for the placement group (<code>host</code> | <code>rack</code>).</p></li>
200    /// <li>
201    /// <p><code>state</code> - The state of the placement group (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
202    /// <li>
203    /// <p><code>strategy</code> - The strategy of the placement group (<code>cluster</code> | <code>spread</code> | <code>partition</code>).</p></li>
204    /// <li>
205    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
206    /// <li>
207    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.</p></li>
208    /// </ul>
209    pub fn filters(mut self, input: crate::types::Filter) -> Self {
210        self.inner = self.inner.filters(input);
211        self
212    }
213    /// <p>The filters.</p>
214    /// <ul>
215    /// <li>
216    /// <p><code>group-name</code> - The name of the placement group.</p></li>
217    /// <li>
218    /// <p><code>group-arn</code> - The Amazon Resource Name (ARN) of the placement group.</p></li>
219    /// <li>
220    /// <p><code>spread-level</code> - The spread level for the placement group (<code>host</code> | <code>rack</code>).</p></li>
221    /// <li>
222    /// <p><code>state</code> - The state of the placement group (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
223    /// <li>
224    /// <p><code>strategy</code> - The strategy of the placement group (<code>cluster</code> | <code>spread</code> | <code>partition</code>).</p></li>
225    /// <li>
226    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
227    /// <li>
228    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.</p></li>
229    /// </ul>
230    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
231        self.inner = self.inner.set_filters(input);
232        self
233    }
234    /// <p>The filters.</p>
235    /// <ul>
236    /// <li>
237    /// <p><code>group-name</code> - The name of the placement group.</p></li>
238    /// <li>
239    /// <p><code>group-arn</code> - The Amazon Resource Name (ARN) of the placement group.</p></li>
240    /// <li>
241    /// <p><code>spread-level</code> - The spread level for the placement group (<code>host</code> | <code>rack</code>).</p></li>
242    /// <li>
243    /// <p><code>state</code> - The state of the placement group (<code>pending</code> | <code>available</code> | <code>deleting</code> | <code>deleted</code>).</p></li>
244    /// <li>
245    /// <p><code>strategy</code> - The strategy of the placement group (<code>cluster</code> | <code>spread</code> | <code>partition</code>).</p></li>
246    /// <li>
247    /// <p><code>tag:<key></key></code> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p></li>
248    /// <li>
249    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources that have a tag with a specific key, regardless of the tag value.</p></li>
250    /// </ul>
251    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
252        self.inner.get_filters()
253    }
254}