aws_sdk_gamelift/operation/describe_instances/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_instances::_describe_instances_output::DescribeInstancesOutputBuilder;
3
4pub use crate::operation::describe_instances::_describe_instances_input::DescribeInstancesInputBuilder;
5
6impl crate::operation::describe_instances::builders::DescribeInstancesInputBuilder {
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_instances::DescribeInstancesOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_instances::DescribeInstancesError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_instances();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeInstances`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2</p>
26/// <p>Retrieves information about the EC2 instances in an Amazon GameLift Servers managed fleet, including instance ID, connection data, and status. You can use this operation with a multi-location fleet to get location-specific instance information. As an alternative, use the operations <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute">https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute</a> and <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeCompute">https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeCompute</a> to retrieve information for compute resources, including EC2 and Anywhere fleets.</p>
27/// <p>You can call this operation in the following ways:</p>
28/// <ul>
29/// <li>
30/// <p>To get information on all instances in a fleet's home Region, specify the fleet ID.</p></li>
31/// <li>
32/// <p>To get information on all instances in a fleet's remote location, specify the fleet ID and location name.</p></li>
33/// <li>
34/// <p>To get information on a specific instance in a fleet, specify the fleet ID and instance ID.</p></li>
35/// </ul>
36/// <p>Use the pagination parameters to retrieve results as a set of sequential pages.</p>
37/// <p>If successful, this operation returns <code>Instance</code> objects for each requested instance, listed in no particular order. If you call this operation for an Anywhere fleet, you receive an InvalidRequestException.</p>
38/// <p><b>Learn more</b></p>
39/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-remote-access.html">Remotely connect to fleet instances</a></p>
40/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html">Debug fleet issues</a></p>
41/// <p><b>Related actions</b></p>
42/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct DescribeInstancesFluentBuilder {
45 handle: ::std::sync::Arc<crate::client::Handle>,
46 inner: crate::operation::describe_instances::builders::DescribeInstancesInputBuilder,
47 config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50 crate::client::customize::internal::CustomizableSend<
51 crate::operation::describe_instances::DescribeInstancesOutput,
52 crate::operation::describe_instances::DescribeInstancesError,
53 > for DescribeInstancesFluentBuilder
54{
55 fn send(
56 self,
57 config_override: crate::config::Builder,
58 ) -> crate::client::customize::internal::BoxFuture<
59 crate::client::customize::internal::SendResult<
60 crate::operation::describe_instances::DescribeInstancesOutput,
61 crate::operation::describe_instances::DescribeInstancesError,
62 >,
63 > {
64 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65 }
66}
67impl DescribeInstancesFluentBuilder {
68 /// Creates a new `DescribeInstancesFluentBuilder`.
69 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70 Self {
71 handle,
72 inner: ::std::default::Default::default(),
73 config_override: ::std::option::Option::None,
74 }
75 }
76 /// Access the DescribeInstances as a reference.
77 pub fn as_input(&self) -> &crate::operation::describe_instances::builders::DescribeInstancesInputBuilder {
78 &self.inner
79 }
80 /// Sends the request and returns the response.
81 ///
82 /// If an error occurs, an `SdkError` will be returned with additional details that
83 /// can be matched against.
84 ///
85 /// By default, any retryable failures will be retried twice. Retry behavior
86 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87 /// set when configuring the client.
88 pub async fn send(
89 self,
90 ) -> ::std::result::Result<
91 crate::operation::describe_instances::DescribeInstancesOutput,
92 ::aws_smithy_runtime_api::client::result::SdkError<
93 crate::operation::describe_instances::DescribeInstancesError,
94 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95 >,
96 > {
97 let input = self
98 .inner
99 .build()
100 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101 let runtime_plugins = crate::operation::describe_instances::DescribeInstances::operation_runtime_plugins(
102 self.handle.runtime_plugins.clone(),
103 &self.handle.conf,
104 self.config_override,
105 );
106 crate::operation::describe_instances::DescribeInstances::orchestrate(&runtime_plugins, input).await
107 }
108
109 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110 pub fn customize(
111 self,
112 ) -> crate::client::customize::CustomizableOperation<
113 crate::operation::describe_instances::DescribeInstancesOutput,
114 crate::operation::describe_instances::DescribeInstancesError,
115 Self,
116 > {
117 crate::client::customize::CustomizableOperation::new(self)
118 }
119 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120 self.set_config_override(::std::option::Option::Some(config_override.into()));
121 self
122 }
123
124 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125 self.config_override = config_override;
126 self
127 }
128 /// Create a paginator for this request
129 ///
130 /// Paginators are used by calling [`send().await`](crate::operation::describe_instances::paginator::DescribeInstancesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
131 pub fn into_paginator(self) -> crate::operation::describe_instances::paginator::DescribeInstancesPaginator {
132 crate::operation::describe_instances::paginator::DescribeInstancesPaginator::new(self.handle, self.inner)
133 }
134 /// <p>A unique identifier for the fleet to retrieve instance information for. You can use either the fleet ID or ARN value.</p>
135 pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.fleet_id(input.into());
137 self
138 }
139 /// <p>A unique identifier for the fleet to retrieve instance information for. You can use either the fleet ID or ARN value.</p>
140 pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_fleet_id(input);
142 self
143 }
144 /// <p>A unique identifier for the fleet to retrieve instance information for. You can use either the fleet ID or ARN value.</p>
145 pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_fleet_id()
147 }
148 /// <p>A unique identifier for an instance to retrieve. Specify an instance ID or leave blank to retrieve all instances in the fleet.</p>
149 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.instance_id(input.into());
151 self
152 }
153 /// <p>A unique identifier for an instance to retrieve. Specify an instance ID or leave blank to retrieve all instances in the fleet.</p>
154 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_instance_id(input);
156 self
157 }
158 /// <p>A unique identifier for an instance to retrieve. Specify an instance ID or leave blank to retrieve all instances in the fleet.</p>
159 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_instance_id()
161 }
162 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
163 pub fn limit(mut self, input: i32) -> Self {
164 self.inner = self.inner.limit(input);
165 self
166 }
167 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
168 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
169 self.inner = self.inner.set_limit(input);
170 self
171 }
172 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
173 pub fn get_limit(&self) -> &::std::option::Option<i32> {
174 self.inner.get_limit()
175 }
176 /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
177 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.inner = self.inner.next_token(input.into());
179 self
180 }
181 /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
182 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.inner = self.inner.set_next_token(input);
184 self
185 }
186 /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</p>
187 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
188 self.inner.get_next_token()
189 }
190 /// <p>The name of a location to retrieve instance information for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
191 pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192 self.inner = self.inner.location(input.into());
193 self
194 }
195 /// <p>The name of a location to retrieve instance information for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
196 pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.inner = self.inner.set_location(input);
198 self
199 }
200 /// <p>The name of a location to retrieve instance information for, in the form of an Amazon Web Services Region code such as <code>us-west-2</code>.</p>
201 pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
202 self.inner.get_location()
203 }
204}