aws_sdk_ec2/operation/describe_instance_topology/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_instance_topology::_describe_instance_topology_output::DescribeInstanceTopologyOutputBuilder;
3
4pub use crate::operation::describe_instance_topology::_describe_instance_topology_input::DescribeInstanceTopologyInputBuilder;
5
6impl crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder {
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_instance_topology::DescribeInstanceTopologyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_instance_topology();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeInstanceTopology`.
24///
25/// <p>Describes a tree-based hierarchy that represents the physical host placement of your EC2 instances within an Availability Zone or Local Zone. You can use this information to determine the relative proximity of your EC2 instances within the Amazon Web Services network to support your tightly coupled workloads.</p>
26/// <p class="title"><b>Limitations</b></p>
27/// <ul>
28/// <li>
29/// <p>Supported zones</p>
30/// <ul>
31/// <li>
32/// <p>Availability Zone</p></li>
33/// <li>
34/// <p>Local Zone</p></li>
35/// </ul></li>
36/// <li>
37/// <p>Supported instance types</p>
38/// <ul>
39/// <li>
40/// <p><code>hpc6a.48xlarge</code> | <code>hpc6id.32xlarge</code> | <code>hpc7a.12xlarge</code> | <code>hpc7a.24xlarge</code> | <code>hpc7a.48xlarge</code> | <code>hpc7a.96xlarge</code> | <code>hpc7g.4xlarge</code> | <code>hpc7g.8xlarge</code> | <code>hpc7g.16xlarge</code></p></li>
41/// <li>
42/// <p><code>p3dn.24xlarge</code> | <code>p4d.24xlarge</code> | <code>p4de.24xlarge</code> | <code>p5.48xlarge</code> | <code>p5e.48xlarge</code> | <code>p5en.48xlarge</code></p></li>
43/// <li>
44/// <p><code>trn1.2xlarge</code> | <code>trn1.32xlarge</code> | <code>trn1n.32xlarge</code> | <code>trn2.48xlarge</code> | <code>trn2u.48xlarge</code></p></li>
45/// </ul></li>
46/// </ul>
47/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html">Amazon EC2 instance topology</a> in the <i>Amazon EC2 User Guide</i>.</p>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct DescribeInstanceTopologyFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
57        crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
58    > for DescribeInstanceTopologyFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
66            crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl DescribeInstanceTopologyFluentBuilder {
73    /// Creates a new `DescribeInstanceTopologyFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the DescribeInstanceTopology as a reference.
82    pub fn as_input(&self) -> &crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::describe_instance_topology::DescribeInstanceTopology::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::describe_instance_topology::DescribeInstanceTopology::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
119        crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// Create a paginator for this request
134    ///
135    /// Paginators are used by calling [`send().await`](crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
136    pub fn into_paginator(self) -> crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator {
137        crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator::new(self.handle, self.inner)
138    }
139    /// <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>
140    pub fn dry_run(mut self, input: bool) -> Self {
141        self.inner = self.inner.dry_run(input);
142        self
143    }
144    /// <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>
145    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
146        self.inner = self.inner.set_dry_run(input);
147        self
148    }
149    /// <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>
150    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
151        self.inner.get_dry_run()
152    }
153    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
154    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.next_token(input.into());
156        self
157    }
158    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
159    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_next_token(input);
161        self
162    }
163    /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
164    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_next_token()
166    }
167    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
168    /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
169    /// <p>Default: <code>20</code></p>
170    pub fn max_results(mut self, input: i32) -> Self {
171        self.inner = self.inner.max_results(input);
172        self
173    }
174    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
175    /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
176    /// <p>Default: <code>20</code></p>
177    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
178        self.inner = self.inner.set_max_results(input);
179        self
180    }
181    /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
182    /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
183    /// <p>Default: <code>20</code></p>
184    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
185        self.inner.get_max_results()
186    }
187    ///
188    /// Appends an item to `InstanceIds`.
189    ///
190    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
191    ///
192    /// <p>The instance IDs.</p>
193    /// <p>Default: Describes all your instances.</p>
194    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
195    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.inner = self.inner.instance_ids(input.into());
197        self
198    }
199    /// <p>The instance IDs.</p>
200    /// <p>Default: Describes all your instances.</p>
201    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
202    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
203        self.inner = self.inner.set_instance_ids(input);
204        self
205    }
206    /// <p>The instance IDs.</p>
207    /// <p>Default: Describes all your instances.</p>
208    /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
209    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
210        self.inner.get_instance_ids()
211    }
212    ///
213    /// Appends an item to `GroupNames`.
214    ///
215    /// To override the contents of this collection use [`set_group_names`](Self::set_group_names).
216    ///
217    /// <p>The name of the placement group that each instance is in.</p>
218    /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
219    pub fn group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.inner = self.inner.group_names(input.into());
221        self
222    }
223    /// <p>The name of the placement group that each instance is in.</p>
224    /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
225    pub fn set_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
226        self.inner = self.inner.set_group_names(input);
227        self
228    }
229    /// <p>The name of the placement group that each instance is in.</p>
230    /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
231    pub fn get_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
232        self.inner.get_group_names()
233    }
234    ///
235    /// Appends an item to `Filters`.
236    ///
237    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
238    ///
239    /// <p>The filters.</p>
240    /// <ul>
241    /// <li>
242    /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
243    /// <li>
244    /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
245    /// <li>
246    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
247    /// </ul>
248    pub fn filters(mut self, input: crate::types::Filter) -> Self {
249        self.inner = self.inner.filters(input);
250        self
251    }
252    /// <p>The filters.</p>
253    /// <ul>
254    /// <li>
255    /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
256    /// <li>
257    /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
258    /// <li>
259    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
260    /// </ul>
261    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
262        self.inner = self.inner.set_filters(input);
263        self
264    }
265    /// <p>The filters.</p>
266    /// <ul>
267    /// <li>
268    /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
269    /// <li>
270    /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
271    /// <li>
272    /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
273    /// </ul>
274    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
275        self.inner.get_filters()
276    }
277}