aws_sdk_gamelift/operation/describe_player_sessions/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_player_sessions::_describe_player_sessions_output::DescribePlayerSessionsOutputBuilder;
3
4pub use crate::operation::describe_player_sessions::_describe_player_sessions_input::DescribePlayerSessionsInputBuilder;
5
6impl crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder {
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_player_sessions::DescribePlayerSessionsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_player_sessions::DescribePlayerSessionsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_player_sessions();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribePlayerSessions`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Retrieves properties for one or more player sessions.</p>
27/// <p>This action can be used in the following ways:</p>
28/// <ul>
29/// <li>
30/// <p>To retrieve a specific player session, provide the player session ID only.</p></li>
31/// <li>
32/// <p>To retrieve all player sessions in a game session, provide the game session ID only.</p></li>
33/// <li>
34/// <p>To retrieve all player sessions for a specific player, provide a player ID only.</p></li>
35/// </ul>
36/// <p>To request player sessions, specify either a player session ID, game session ID, or player ID. You can filter this request by player session status. If you provide a specific <code>PlayerSessionId</code> or <code>PlayerId</code>, Amazon GameLift Servers ignores the filter criteria. Use the pagination parameters to retrieve results as a set of sequential pages.</p>
37/// <p>If successful, a <code>PlayerSession</code> object is returned for each session that matches the request.</p>
38/// <p><b>Related actions</b></p>
39/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
40#[derive(::std::clone::Clone, ::std::fmt::Debug)]
41pub struct DescribePlayerSessionsFluentBuilder {
42 handle: ::std::sync::Arc<crate::client::Handle>,
43 inner: crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder,
44 config_override: ::std::option::Option<crate::config::Builder>,
45}
46impl
47 crate::client::customize::internal::CustomizableSend<
48 crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
49 crate::operation::describe_player_sessions::DescribePlayerSessionsError,
50 > for DescribePlayerSessionsFluentBuilder
51{
52 fn send(
53 self,
54 config_override: crate::config::Builder,
55 ) -> crate::client::customize::internal::BoxFuture<
56 crate::client::customize::internal::SendResult<
57 crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
58 crate::operation::describe_player_sessions::DescribePlayerSessionsError,
59 >,
60 > {
61 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
62 }
63}
64impl DescribePlayerSessionsFluentBuilder {
65 /// Creates a new `DescribePlayerSessionsFluentBuilder`.
66 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
67 Self {
68 handle,
69 inner: ::std::default::Default::default(),
70 config_override: ::std::option::Option::None,
71 }
72 }
73 /// Access the DescribePlayerSessions as a reference.
74 pub fn as_input(&self) -> &crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder {
75 &self.inner
76 }
77 /// Sends the request and returns the response.
78 ///
79 /// If an error occurs, an `SdkError` will be returned with additional details that
80 /// can be matched against.
81 ///
82 /// By default, any retryable failures will be retried twice. Retry behavior
83 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
84 /// set when configuring the client.
85 pub async fn send(
86 self,
87 ) -> ::std::result::Result<
88 crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
89 ::aws_smithy_runtime_api::client::result::SdkError<
90 crate::operation::describe_player_sessions::DescribePlayerSessionsError,
91 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
92 >,
93 > {
94 let input = self
95 .inner
96 .build()
97 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
98 let runtime_plugins = crate::operation::describe_player_sessions::DescribePlayerSessions::operation_runtime_plugins(
99 self.handle.runtime_plugins.clone(),
100 &self.handle.conf,
101 self.config_override,
102 );
103 crate::operation::describe_player_sessions::DescribePlayerSessions::orchestrate(&runtime_plugins, input).await
104 }
105
106 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107 pub fn customize(
108 self,
109 ) -> crate::client::customize::CustomizableOperation<
110 crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
111 crate::operation::describe_player_sessions::DescribePlayerSessionsError,
112 Self,
113 > {
114 crate::client::customize::CustomizableOperation::new(self)
115 }
116 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117 self.set_config_override(::std::option::Option::Some(config_override.into()));
118 self
119 }
120
121 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122 self.config_override = config_override;
123 self
124 }
125 /// Create a paginator for this request
126 ///
127 /// Paginators are used by calling [`send().await`](crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
128 pub fn into_paginator(self) -> crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator {
129 crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator::new(self.handle, self.inner)
130 }
131 /// <p>A unique identifier for the game session to retrieve player sessions for.</p>
132 pub fn game_session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.inner = self.inner.game_session_id(input.into());
134 self
135 }
136 /// <p>A unique identifier for the game session to retrieve player sessions for.</p>
137 pub fn set_game_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.inner = self.inner.set_game_session_id(input);
139 self
140 }
141 /// <p>A unique identifier for the game session to retrieve player sessions for.</p>
142 pub fn get_game_session_id(&self) -> &::std::option::Option<::std::string::String> {
143 self.inner.get_game_session_id()
144 }
145 /// <p>A unique identifier for a player to retrieve player sessions for.</p>
146 pub fn player_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.inner = self.inner.player_id(input.into());
148 self
149 }
150 /// <p>A unique identifier for a player to retrieve player sessions for.</p>
151 pub fn set_player_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.inner = self.inner.set_player_id(input);
153 self
154 }
155 /// <p>A unique identifier for a player to retrieve player sessions for.</p>
156 pub fn get_player_id(&self) -> &::std::option::Option<::std::string::String> {
157 self.inner.get_player_id()
158 }
159 /// <p>A unique identifier for a player session to retrieve.</p>
160 pub fn player_session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.player_session_id(input.into());
162 self
163 }
164 /// <p>A unique identifier for a player session to retrieve.</p>
165 pub fn set_player_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.inner = self.inner.set_player_session_id(input);
167 self
168 }
169 /// <p>A unique identifier for a player session to retrieve.</p>
170 pub fn get_player_session_id(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_player_session_id()
172 }
173 /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
174 /// <p>Possible player session statuses include the following:</p>
175 /// <ul>
176 /// <li>
177 /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
178 /// <li>
179 /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
180 /// <li>
181 /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
182 /// <li>
183 /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
184 /// </ul>
185 pub fn player_session_status_filter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.player_session_status_filter(input.into());
187 self
188 }
189 /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
190 /// <p>Possible player session statuses include the following:</p>
191 /// <ul>
192 /// <li>
193 /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
194 /// <li>
195 /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
196 /// <li>
197 /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
198 /// <li>
199 /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
200 /// </ul>
201 pub fn set_player_session_status_filter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202 self.inner = self.inner.set_player_session_status_filter(input);
203 self
204 }
205 /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
206 /// <p>Possible player session statuses include the following:</p>
207 /// <ul>
208 /// <li>
209 /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
210 /// <li>
211 /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
212 /// <li>
213 /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
214 /// <li>
215 /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
216 /// </ul>
217 pub fn get_player_session_status_filter(&self) -> &::std::option::Option<::std::string::String> {
218 self.inner.get_player_session_status_filter()
219 }
220 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
221 pub fn limit(mut self, input: i32) -> Self {
222 self.inner = self.inner.limit(input);
223 self
224 }
225 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
226 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
227 self.inner = self.inner.set_limit(input);
228 self
229 }
230 /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
231 pub fn get_limit(&self) -> &::std::option::Option<i32> {
232 self.inner.get_limit()
233 }
234 /// <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. If a player session ID is specified, this parameter is ignored.</p>
235 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236 self.inner = self.inner.next_token(input.into());
237 self
238 }
239 /// <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. If a player session ID is specified, this parameter is ignored.</p>
240 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241 self.inner = self.inner.set_next_token(input);
242 self
243 }
244 /// <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. If a player session ID is specified, this parameter is ignored.</p>
245 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
246 self.inner.get_next_token()
247 }
248}