1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::search_game_sessions::_search_game_sessions_output::SearchGameSessionsOutputBuilder;
pub use crate::operation::search_game_sessions::_search_game_sessions_input::SearchGameSessionsInputBuilder;
impl crate::operation::search_game_sessions::builders::SearchGameSessionsInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::search_game_sessions::SearchGameSessionsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::search_game_sessions::SearchGameSessionsError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.search_game_sessions();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `SearchGameSessions`.
///
/// <p>Retrieves all active game sessions that match a set of search criteria and sorts them into a specified order.</p>
/// <p>This operation is not designed to continually track game session status because that practice can cause you to exceed your API limit and generate errors. Instead, configure an Amazon Simple Notification Service (Amazon SNS) topic to receive notifications from a matchmaker or a game session placement queue.</p>
/// <p>When searching for game sessions, you specify exactly where you want to search and provide a search filter expression, a sort expression, or both. A search request can search only one fleet, but it can search all of a fleet's locations.</p>
/// <p>This operation can be used in the following ways:</p>
/// <ul>
/// <li>
/// <p>To search all game sessions that are currently running on all locations in a fleet, provide a fleet or alias ID. This approach returns game sessions in the fleet's home Region and all remote locations that fit the search criteria.</p></li>
/// <li>
/// <p>To search all game sessions that are currently running on a specific fleet location, provide a fleet or alias ID and a location name. For location, you can specify a fleet's home Region or any remote location.</p></li>
/// </ul>
/// <p>Use the pagination parameters to retrieve results as a set of sequential pages.</p>
/// <p>If successful, a <code>GameSession</code> object is returned for each game session that matches the request. Search finds game sessions that are in <code>ACTIVE</code> status only. To retrieve information on game sessions in other statuses, use <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessions.html">DescribeGameSessions</a> .</p>
/// <p>To set search and sort criteria, create a filter expression using the following game session attributes. For game session search examples, see the Examples section of this topic.</p>
/// <ul>
/// <li>
/// <p><b>gameSessionId</b> -- A unique identifier for the game session. You can use either a <code>GameSessionId</code> or <code>GameSessionArn</code> value.</p></li>
/// <li>
/// <p><b>gameSessionName</b> -- Name assigned to a game session. Game session names do not need to be unique to a game session.</p></li>
/// <li>
/// <p><b>gameSessionProperties</b> -- A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>. The filter expression must specify the <code>GameProperty</code> -- a <code>Key</code> and a string <code>Value</code> to search for the game sessions.</p>
/// <p>For example, to search for the above key-value pair, specify the following search filter: <code>gameSessionProperties.difficulty = "novice"</code>. All game property values are searched as strings.</p>
/// <p>For examples of searching game sessions, see the ones below, and also see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#game-properties-search">Search game sessions by game property</a>.</p></li>
/// <li>
/// <p><b>maximumSessions</b> -- Maximum number of player sessions allowed for a game session.</p></li>
/// <li>
/// <p><b>creationTimeMillis</b> -- Value indicating when a game session was created. It is expressed in Unix time as milliseconds.</p></li>
/// <li>
/// <p><b>playerSessionCount</b> -- Number of players currently connected to a game session. This value changes rapidly as players join the session or drop out.</p></li>
/// <li>
/// <p><b>hasAvailablePlayerSessions</b> -- Boolean value indicating whether a game session has reached its maximum number of players. It is highly recommended that all search requests include this filter attribute to optimize search performance and return only sessions that players can join.</p></li>
/// </ul><note>
/// <p>Returned values for <code>playerSessionCount</code> and <code>hasAvailablePlayerSessions</code> change quickly as players join sessions and others drop out. Results should be considered a snapshot in time. Be sure to refresh search results often, and handle sessions that fill up before a player can join.</p>
/// </note>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SearchGameSessionsFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::search_game_sessions::builders::SearchGameSessionsInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::search_game_sessions::SearchGameSessionsOutput,
crate::operation::search_game_sessions::SearchGameSessionsError,
> for SearchGameSessionsFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::search_game_sessions::SearchGameSessionsOutput,
crate::operation::search_game_sessions::SearchGameSessionsError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl SearchGameSessionsFluentBuilder {
/// Creates a new `SearchGameSessionsFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the SearchGameSessions as a reference.
pub fn as_input(&self) -> &crate::operation::search_game_sessions::builders::SearchGameSessionsInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::search_game_sessions::SearchGameSessionsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::search_game_sessions::SearchGameSessionsError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::search_game_sessions::SearchGameSessions::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::search_game_sessions::SearchGameSessions::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::search_game_sessions::SearchGameSessionsOutput,
crate::operation::search_game_sessions::SearchGameSessionsError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// Create a paginator for this request
///
/// Paginators are used by calling [`send().await`](crate::operation::search_game_sessions::paginator::SearchGameSessionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
pub fn into_paginator(self) -> crate::operation::search_game_sessions::paginator::SearchGameSessionsPaginator {
crate::operation::search_game_sessions::paginator::SearchGameSessionsPaginator::new(self.handle, self.inner)
}
/// <p>A unique identifier for the fleet to search for active game sessions. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn fleet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.fleet_id(input.into());
self
}
/// <p>A unique identifier for the fleet to search for active game sessions. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn set_fleet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_fleet_id(input);
self
}
/// <p>A unique identifier for the fleet to search for active game sessions. You can use either the fleet ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn get_fleet_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_fleet_id()
}
/// <p>A unique identifier for the alias associated with the fleet to search for active game sessions. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn alias_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.alias_id(input.into());
self
}
/// <p>A unique identifier for the alias associated with the fleet to search for active game sessions. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn set_alias_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_alias_id(input);
self
}
/// <p>A unique identifier for the alias associated with the fleet to search for active game sessions. You can use either the alias ID or ARN value. Each request must reference either a fleet ID or alias ID, but not both.</p>
pub fn get_alias_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_alias_id()
}
/// <p>A fleet location to search for game sessions. You can specify a fleet's home Region or a remote location. Use the Amazon Web Services Region code format, such as <code>us-west-2</code>.</p>
pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.location(input.into());
self
}
/// <p>A fleet location to search for game sessions. You can specify a fleet's home Region or a remote location. Use the Amazon Web Services Region code format, such as <code>us-west-2</code>.</p>
pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_location(input);
self
}
/// <p>A fleet location to search for game sessions. You can specify a fleet's home Region or a remote location. Use the Amazon Web Services Region code format, such as <code>us-west-2</code>.</p>
pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_location()
}
/// <p>String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in <code>ACTIVE</code> status.</p>
/// <p>A filter expression can contain one or multiple conditions. Each condition consists of the following:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Comparator</b> -- Valid comparators are: <code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>.</p></li>
/// <li>
/// <p><b>Value</b> -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators <code>=</code> and <code><></code>. For example, the following filter expression searches on <code>gameSessionName</code>: "<code>FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'"</code>.</p></li>
/// </ul>
/// <p>To chain multiple conditions in a single expression, use the logical keywords <code>AND</code>, <code>OR</code>, and <code>NOT</code> and parentheses as needed. For example: <code>x AND y AND NOT z</code>, <code>NOT (x OR y)</code>.</p>
/// <p>Session search evaluates conditions from left to right using the following precedence rules:</p>
/// <ol>
/// <li>
/// <p><code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code></p></li>
/// <li>
/// <p>Parentheses</p></li>
/// <li>
/// <p>NOT</p></li>
/// <li>
/// <p>AND</p></li>
/// <li>
/// <p>OR</p></li>
/// </ol>
/// <p>For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: <code>"maximumSessions>=10 AND hasAvailablePlayerSessions=true"</code>.</p>
pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.filter_expression(input.into());
self
}
/// <p>String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in <code>ACTIVE</code> status.</p>
/// <p>A filter expression can contain one or multiple conditions. Each condition consists of the following:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Comparator</b> -- Valid comparators are: <code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>.</p></li>
/// <li>
/// <p><b>Value</b> -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators <code>=</code> and <code><></code>. For example, the following filter expression searches on <code>gameSessionName</code>: "<code>FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'"</code>.</p></li>
/// </ul>
/// <p>To chain multiple conditions in a single expression, use the logical keywords <code>AND</code>, <code>OR</code>, and <code>NOT</code> and parentheses as needed. For example: <code>x AND y AND NOT z</code>, <code>NOT (x OR y)</code>.</p>
/// <p>Session search evaluates conditions from left to right using the following precedence rules:</p>
/// <ol>
/// <li>
/// <p><code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code></p></li>
/// <li>
/// <p>Parentheses</p></li>
/// <li>
/// <p>NOT</p></li>
/// <li>
/// <p>AND</p></li>
/// <li>
/// <p>OR</p></li>
/// </ol>
/// <p>For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: <code>"maximumSessions>=10 AND hasAvailablePlayerSessions=true"</code>.</p>
pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_filter_expression(input);
self
}
/// <p>String containing the search criteria for the session search. If no filter expression is included, the request returns results for all game sessions in the fleet that are in <code>ACTIVE</code> status.</p>
/// <p>A filter expression can contain one or multiple conditions. Each condition consists of the following:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Comparator</b> -- Valid comparators are: <code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>.</p></li>
/// <li>
/// <p><b>Value</b> -- Value to be searched for. Values may be numbers, boolean values (true/false) or strings depending on the operand. String values are case sensitive and must be enclosed in single quotes. Special characters must be escaped. Boolean and string values can only be used with the comparators <code>=</code> and <code><></code>. For example, the following filter expression searches on <code>gameSessionName</code>: "<code>FilterExpression": "gameSessionName = 'Matt\\'s Awesome Game 1'"</code>.</p></li>
/// </ul>
/// <p>To chain multiple conditions in a single expression, use the logical keywords <code>AND</code>, <code>OR</code>, and <code>NOT</code> and parentheses as needed. For example: <code>x AND y AND NOT z</code>, <code>NOT (x OR y)</code>.</p>
/// <p>Session search evaluates conditions from left to right using the following precedence rules:</p>
/// <ol>
/// <li>
/// <p><code>=</code>, <code><></code>, <code><</code>, <code>></code>, <code><=</code>, <code>>=</code></p></li>
/// <li>
/// <p>Parentheses</p></li>
/// <li>
/// <p>NOT</p></li>
/// <li>
/// <p>AND</p></li>
/// <li>
/// <p>OR</p></li>
/// </ol>
/// <p>For example, this filter expression retrieves game sessions hosting at least ten players that have an open player slot: <code>"maximumSessions>=10 AND hasAvailablePlayerSessions=true"</code>.</p>
pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_filter_expression()
}
/// <p>Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Order</b> -- Valid sort orders are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p></li>
/// </ul>
/// <p>For example, this sort expression returns the oldest active sessions first: <code>"SortExpression": "creationTimeMillis ASC"</code>. Results with a null value for the sort operand are returned at the end of the list.</p>
pub fn sort_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.sort_expression(input.into());
self
}
/// <p>Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Order</b> -- Valid sort orders are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p></li>
/// </ul>
/// <p>For example, this sort expression returns the oldest active sessions first: <code>"SortExpression": "creationTimeMillis ASC"</code>. Results with a null value for the sort operand are returned at the end of the list.</p>
pub fn set_sort_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_sort_expression(input);
self
}
/// <p>Instructions on how to sort the search results. If no sort expression is included, the request returns results in random order. A sort expression consists of the following elements:</p>
/// <ul>
/// <li>
/// <p><b>Operand</b> -- Name of a game session attribute. Valid values are <code>gameSessionName</code>, <code>gameSessionId</code>, <code>gameSessionProperties</code>, <code>maximumSessions</code>, <code>creationTimeMillis</code>, <code>playerSessionCount</code>, <code>hasAvailablePlayerSessions</code>.</p></li>
/// <li>
/// <p><b>Order</b> -- Valid sort orders are <code>ASC</code> (ascending) and <code>DESC</code> (descending).</p></li>
/// </ul>
/// <p>For example, this sort expression returns the oldest active sessions first: <code>"SortExpression": "creationTimeMillis ASC"</code>. Results with a null value for the sort operand are returned at the end of the list.</p>
pub fn get_sort_expression(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_sort_expression()
}
/// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.</p>
pub fn limit(mut self, input: i32) -> Self {
self.inner = self.inner.limit(input);
self
}
/// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.</p>
pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_limit(input);
self
}
/// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. The maximum number of results returned is 20, even if this value is not set or is set higher than 20.</p>
pub fn get_limit(&self) -> &::std::option::Option<i32> {
self.inner.get_limit()
}
/// <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>
pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.next_token(input.into());
self
}
/// <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>
pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_next_token(input);
self
}
/// <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>
pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_next_token()
}
}