aws_sdk_gamelift/operation/describe_game_server_instances/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_game_server_instances::_describe_game_server_instances_output::DescribeGameServerInstancesOutputBuilder;
3
4pub use crate::operation::describe_game_server_instances::_describe_game_server_instances_input::DescribeGameServerInstancesInputBuilder;
5
6impl crate::operation::describe_game_server_instances::builders::DescribeGameServerInstancesInputBuilder {
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_game_server_instances::DescribeGameServerInstancesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_game_server_instances::DescribeGameServerInstancesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_game_server_instances();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeGameServerInstances`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p>
26/// <p>Retrieves status information about the Amazon EC2 instances associated with a Amazon GameLift Servers FleetIQ game server group. Use this operation to detect when instances are active or not available to host new game servers.</p>
27/// <p>To request status for all instances in the game server group, provide a game server group ID only. To request status for specific instances, provide the game server group ID and one or more instance IDs. Use the pagination parameters to retrieve results in sequential segments. If successful, a collection of <code>GameServerInstance</code> objects is returned.</p>
28/// <p>This operation is not designed to be called with every game server claim request; this practice can cause you to exceed your API limit, which results in errors. Instead, as a best practice, cache the results and refresh your cache no more than once every 10 seconds.</p>
29/// <p><b>Learn more</b></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html">Amazon GameLift Servers FleetIQ Guide</a></p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct DescribeGameServerInstancesFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::describe_game_server_instances::builders::DescribeGameServerInstancesInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::describe_game_server_instances::DescribeGameServerInstancesOutput,
40        crate::operation::describe_game_server_instances::DescribeGameServerInstancesError,
41    > for DescribeGameServerInstancesFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::describe_game_server_instances::DescribeGameServerInstancesOutput,
49            crate::operation::describe_game_server_instances::DescribeGameServerInstancesError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl DescribeGameServerInstancesFluentBuilder {
56    /// Creates a new `DescribeGameServerInstancesFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the DescribeGameServerInstances as a reference.
65    pub fn as_input(&self) -> &crate::operation::describe_game_server_instances::builders::DescribeGameServerInstancesInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::describe_game_server_instances::DescribeGameServerInstancesOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::describe_game_server_instances::DescribeGameServerInstancesError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::describe_game_server_instances::DescribeGameServerInstances::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::describe_game_server_instances::DescribeGameServerInstances::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::describe_game_server_instances::DescribeGameServerInstancesOutput,
102        crate::operation::describe_game_server_instances::DescribeGameServerInstancesError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// Create a paginator for this request
117    ///
118    /// Paginators are used by calling [`send().await`](crate::operation::describe_game_server_instances::paginator::DescribeGameServerInstancesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
119    pub fn into_paginator(self) -> crate::operation::describe_game_server_instances::paginator::DescribeGameServerInstancesPaginator {
120        crate::operation::describe_game_server_instances::paginator::DescribeGameServerInstancesPaginator::new(self.handle, self.inner)
121    }
122    /// <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
123    pub fn game_server_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.inner = self.inner.game_server_group_name(input.into());
125        self
126    }
127    /// <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
128    pub fn set_game_server_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_game_server_group_name(input);
130        self
131    }
132    /// <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
133    pub fn get_game_server_group_name(&self) -> &::std::option::Option<::std::string::String> {
134        self.inner.get_game_server_group_name()
135    }
136    ///
137    /// Appends an item to `InstanceIds`.
138    ///
139    /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
140    ///
141    /// <p>The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: <code>i-1234567890abcdef0</code>. To retrieve all instances in the game server group, leave this parameter empty.</p>
142    pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.instance_ids(input.into());
144        self
145    }
146    /// <p>The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: <code>i-1234567890abcdef0</code>. To retrieve all instances in the game server group, leave this parameter empty.</p>
147    pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
148        self.inner = self.inner.set_instance_ids(input);
149        self
150    }
151    /// <p>The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: <code>i-1234567890abcdef0</code>. To retrieve all instances in the game server group, leave this parameter empty.</p>
152    pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
153        self.inner.get_instance_ids()
154    }
155    /// <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>
156    pub fn limit(mut self, input: i32) -> Self {
157        self.inner = self.inner.limit(input);
158        self
159    }
160    /// <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>
161    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
162        self.inner = self.inner.set_limit(input);
163        self
164    }
165    /// <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>
166    pub fn get_limit(&self) -> &::std::option::Option<i32> {
167        self.inner.get_limit()
168    }
169    /// <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>
170    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.next_token(input.into());
172        self
173    }
174    /// <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>
175    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_next_token(input);
177        self
178    }
179    /// <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>
180    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_next_token()
182    }
183}