// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_game_session_placement::_start_game_session_placement_input::StartGameSessionPlacementInputBuilder;
pub use crate::operation::start_game_session_placement::_start_game_session_placement_output::StartGameSessionPlacementOutputBuilder;
impl crate::operation::start_game_session_placement::builders::StartGameSessionPlacementInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::start_game_session_placement::StartGameSessionPlacementOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_game_session_placement::StartGameSessionPlacementError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.start_game_session_placement();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `StartGameSessionPlacement`.
///
/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
/// <p>Makes a request to start a new game session using a game session queue. When processing a placement request, Amazon GameLift Servers looks for the best possible available resource to host the game session, based on how the queue is configured to prioritize factors such as resource cost, latency, and location. After selecting an available resource, Amazon GameLift Servers prompts the resource to start a game session. A placement request can include a list of players to create a set of player sessions. The request can also include information to pass to the new game session, such as to specify a game map or other options.</p>
/// <p><b>Request options</b></p>
/// <p>Use this operation to make the following types of requests.</p>
/// <ul>
/// <li>
/// <p>Request a placement using the queue's default prioritization process (see the default prioritization described in <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_PriorityConfiguration.html">PriorityConfiguration</a>). Include these required parameters:</p>
/// <ul>
/// <li>
/// <p><code>GameSessionQueueName</code></p></li>
/// <li>
/// <p><code>MaximumPlayerSessionCount</code></p></li>
/// <li>
/// <p><code>PlacementID</code></p></li>
/// </ul></li>
/// <li>
/// <p>Request a placement and prioritize based on latency. Include these parameters:</p>
/// <ul>
/// <li>
/// <p>Required parameters <code>GameSessionQueueName</code>, <code>MaximumPlayerSessionCount</code>, <code>PlacementID</code>.</p></li>
/// <li>
/// <p><code>PlayerLatencies</code>. Include a set of latency values for destinations in the queue. When a request includes latency data, Amazon GameLift Servers automatically reorder the queue's locations priority list based on lowest available latency values. If a request includes latency data for multiple players, Amazon GameLift Servers calculates each location's average latency for all players and reorders to find the lowest latency across all players.</p></li>
/// <li>
/// <p>Don't include <code>PriorityConfigurationOverride</code>.</p></li>
/// </ul>
/// <ul>
/// <li>
/// <p>Prioritize based on a custom list of locations. If you're using a queue that's configured to prioritize location first (see <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_PriorityConfiguration.html">PriorityConfiguration</a> for game session queues), you can optionally use the <i>PriorityConfigurationOverride</i> parameter to substitute a different location priority list for this placement request. Amazon GameLift Servers searches each location on the priority override list to find an available hosting resource for the new game session. Specify a fallback strategy to use in the event that Amazon GameLift Servers fails to place the game session in any of the locations on the override list.</p></li>
/// </ul></li>
/// <li>
/// <p>Request a placement and prioritized based on a custom list of locations.</p></li>
/// <li>
/// <p>You can request new player sessions for a group of players. Include the <i>DesiredPlayerSessions</i> parameter and include at minimum a unique player ID for each. You can also include player-specific data to pass to the new game session.</p></li>
/// </ul>
/// <p><b>Result</b></p>
/// <p>If successful, this operation generates a new game session placement request and adds it to the game session queue for processing. You can track the status of individual placement requests by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionPlacement.html">DescribeGameSessionPlacement</a> or by monitoring queue notifications. When the request status is <code>FULFILLED</code>, a new game session has started and the placement request is updated with connection information for the game session (IP address and port). If the request included player session data, Amazon GameLift Servers creates a player session for each player ID in the request.</p>
/// <p>The request results in a <code>InvalidRequestException</code> in the following situations:</p>
/// <ul>
/// <li>
/// <p>If the request includes both <i>PlayerLatencies</i> and <i>PriorityConfigurationOverride</i> parameters.</p></li>
/// <li>
/// <p>If the request includes the <i>PriorityConfigurationOverride</i> parameter and specifies a queue that doesn't prioritize locations.</p></li>
/// </ul>
/// <p>Amazon GameLift Servers continues to retry each placement request until it reaches the queue's timeout setting. If a request times out, you can resubmit the request to the same queue or try a different queue.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartGameSessionPlacementFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::start_game_session_placement::builders::StartGameSessionPlacementInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::start_game_session_placement::StartGameSessionPlacementOutput,
crate::operation::start_game_session_placement::StartGameSessionPlacementError,
> for StartGameSessionPlacementFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::start_game_session_placement::StartGameSessionPlacementOutput,
crate::operation::start_game_session_placement::StartGameSessionPlacementError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl StartGameSessionPlacementFluentBuilder {
/// Creates a new `StartGameSessionPlacementFluentBuilder`.
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 StartGameSessionPlacement as a reference.
pub fn as_input(&self) -> &crate::operation::start_game_session_placement::builders::StartGameSessionPlacementInputBuilder {
&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::start_game_session_placement::StartGameSessionPlacementOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_game_session_placement::StartGameSessionPlacementError,
::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::start_game_session_placement::StartGameSessionPlacement::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::start_game_session_placement::StartGameSessionPlacement::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::start_game_session_placement::StartGameSessionPlacementOutput,
crate::operation::start_game_session_placement::StartGameSessionPlacementError,
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
}
/// <p>A unique identifier to assign to the new game session placement. This value is developer-defined. The value must be unique across all Regions and cannot be reused.</p>
pub fn placement_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.placement_id(input.into());
self
}
/// <p>A unique identifier to assign to the new game session placement. This value is developer-defined. The value must be unique across all Regions and cannot be reused.</p>
pub fn set_placement_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_placement_id(input);
self
}
/// <p>A unique identifier to assign to the new game session placement. This value is developer-defined. The value must be unique across all Regions and cannot be reused.</p>
pub fn get_placement_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_placement_id()
}
/// <p>Name of the queue to use to place the new game session. You can use either the queue name or ARN value.</p>
pub fn game_session_queue_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.game_session_queue_name(input.into());
self
}
/// <p>Name of the queue to use to place the new game session. You can use either the queue name or ARN value.</p>
pub fn set_game_session_queue_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_game_session_queue_name(input);
self
}
/// <p>Name of the queue to use to place the new game session. You can use either the queue name or ARN value.</p>
pub fn get_game_session_queue_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_game_session_queue_name()
}
///
/// Appends an item to `GameProperties`.
///
/// To override the contents of this collection use [`set_game_properties`](Self::set_game_properties).
///
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn game_properties(mut self, input: crate::types::GameProperty) -> Self {
self.inner = self.inner.game_properties(input);
self
}
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn set_game_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GameProperty>>) -> Self {
self.inner = self.inner.set_game_properties(input);
self
}
/// <p>A set of key-value pairs that can store custom data in a game session. For example: <code>{"Key": "difficulty", "Value": "novice"}</code>.</p><note>
/// <ul>
/// <li>
/// <p>Avoid using periods (".") in property keys if you plan to search for game sessions by properties. Property keys containing periods cannot be searched and will be filtered out from search results due to search index limitations.</p></li>
/// <li>
/// <p>If you use SearchGameSessions API, there is a limit of 500 game property keys across all game sessions and all fleets per region. If the limit is exceeded, there will potentially be game session entries missing from SearchGameSessions API results.</p></li>
/// </ul>
/// </note>
pub fn get_game_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GameProperty>> {
self.inner.get_game_properties()
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn maximum_player_session_count(mut self, input: i32) -> Self {
self.inner = self.inner.maximum_player_session_count(input);
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn set_maximum_player_session_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_maximum_player_session_count(input);
self
}
/// <p>The maximum number of players that can be connected simultaneously to the game session.</p>
pub fn get_maximum_player_session_count(&self) -> &::std::option::Option<i32> {
self.inner.get_maximum_player_session_count()
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn game_session_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.game_session_name(input.into());
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn set_game_session_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_game_session_name(input);
self
}
/// <p>A descriptive label that is associated with a game session. Session names do not need to be unique.</p>
pub fn get_game_session_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_game_session_name()
}
///
/// Appends an item to `PlayerLatencies`.
///
/// To override the contents of this collection use [`set_player_latencies`](Self::set_player_latencies).
///
/// <p>A set of values, expressed in milliseconds, that indicates the amount of latency that a player experiences when connected to a fleet location (Amazon Web Services Regions or custom locations for Amazon GameLift Servers Anywhere fleets). This information is used to try to place the new game session where it can offer the best possible gameplay experience for the players.</p>
pub fn player_latencies(mut self, input: crate::types::PlayerLatency) -> Self {
self.inner = self.inner.player_latencies(input);
self
}
/// <p>A set of values, expressed in milliseconds, that indicates the amount of latency that a player experiences when connected to a fleet location (Amazon Web Services Regions or custom locations for Amazon GameLift Servers Anywhere fleets). This information is used to try to place the new game session where it can offer the best possible gameplay experience for the players.</p>
pub fn set_player_latencies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlayerLatency>>) -> Self {
self.inner = self.inner.set_player_latencies(input);
self
}
/// <p>A set of values, expressed in milliseconds, that indicates the amount of latency that a player experiences when connected to a fleet location (Amazon Web Services Regions or custom locations for Amazon GameLift Servers Anywhere fleets). This information is used to try to place the new game session where it can offer the best possible gameplay experience for the players.</p>
pub fn get_player_latencies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlayerLatency>> {
self.inner.get_player_latencies()
}
///
/// Appends an item to `DesiredPlayerSessions`.
///
/// To override the contents of this collection use [`set_desired_player_sessions`](Self::set_desired_player_sessions).
///
/// <p>Set of information on each player to create a player session for.</p>
pub fn desired_player_sessions(mut self, input: crate::types::DesiredPlayerSession) -> Self {
self.inner = self.inner.desired_player_sessions(input);
self
}
/// <p>Set of information on each player to create a player session for.</p>
pub fn set_desired_player_sessions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DesiredPlayerSession>>) -> Self {
self.inner = self.inner.set_desired_player_sessions(input);
self
}
/// <p>Set of information on each player to create a player session for.</p>
pub fn get_desired_player_sessions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DesiredPlayerSession>> {
self.inner.get_desired_player_sessions()
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session. For more information, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a game session</a>.</p>
pub fn game_session_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.game_session_data(input.into());
self
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session. For more information, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a game session</a>.</p>
pub fn set_game_session_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_game_session_data(input);
self
}
/// <p>A set of custom game session properties, formatted as a single string value. This data is passed to a game server process with a request to start a new game session. For more information, see <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession">Start a game session</a>.</p>
pub fn get_game_session_data(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_game_session_data()
}
/// <p>A prioritized list of locations to use for the game session placement and instructions on how to use it. This list overrides a queue's prioritized location list for this game session placement request only. You can include Amazon Web Services Regions, local zones, and custom locations (for Anywhere fleets). You can choose to limit placements to locations on the override list only, or you can prioritize locations on the override list first and then fall back to the queue's other locations if needed. Choose a fallback strategy to use in the event that Amazon GameLift Servers fails to place a game session in any of the locations on the priority override list.</p>
pub fn priority_configuration_override(mut self, input: crate::types::PriorityConfigurationOverride) -> Self {
self.inner = self.inner.priority_configuration_override(input);
self
}
/// <p>A prioritized list of locations to use for the game session placement and instructions on how to use it. This list overrides a queue's prioritized location list for this game session placement request only. You can include Amazon Web Services Regions, local zones, and custom locations (for Anywhere fleets). You can choose to limit placements to locations on the override list only, or you can prioritize locations on the override list first and then fall back to the queue's other locations if needed. Choose a fallback strategy to use in the event that Amazon GameLift Servers fails to place a game session in any of the locations on the priority override list.</p>
pub fn set_priority_configuration_override(mut self, input: ::std::option::Option<crate::types::PriorityConfigurationOverride>) -> Self {
self.inner = self.inner.set_priority_configuration_override(input);
self
}
/// <p>A prioritized list of locations to use for the game session placement and instructions on how to use it. This list overrides a queue's prioritized location list for this game session placement request only. You can include Amazon Web Services Regions, local zones, and custom locations (for Anywhere fleets). You can choose to limit placements to locations on the override list only, or you can prioritize locations on the override list first and then fall back to the queue's other locations if needed. Choose a fallback strategy to use in the event that Amazon GameLift Servers fails to place a game session in any of the locations on the priority override list.</p>
pub fn get_priority_configuration_override(&self) -> &::std::option::Option<crate::types::PriorityConfigurationOverride> {
self.inner.get_priority_configuration_override()
}
}