// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_match_backfill::_start_match_backfill_input::StartMatchBackfillInputBuilder;
pub use crate::operation::start_match_backfill::_start_match_backfill_output::StartMatchBackfillOutputBuilder;
impl crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder {
/// 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_match_backfill::StartMatchBackfillOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_match_backfill::StartMatchBackfillError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.start_match_backfill();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `StartMatchBackfill`.
///
/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
/// <p>Finds new players to fill open slots in currently running game sessions. The backfill match process is essentially identical to the process of forming new matches. Backfill requests use the same matchmaker that was used to make the original match, and they provide matchmaking data for all players currently in the game session. FlexMatch uses this information to select new players so that backfilled match continues to meet the original match requirements.</p>
/// <p>When using FlexMatch with Amazon GameLift Servers managed hosting, you can request a backfill match from a client service by calling this operation with a <code>GameSessions</code> ID. You also have the option of making backfill requests directly from your game server. In response to a request, FlexMatch creates player sessions for the new players, updates the <code>GameSession</code> resource, and sends updated matchmaking data to the game server. You can request a backfill match at any point after a game session is started. Each game session can have only one active backfill request at a time; a subsequent request automatically replaces the earlier request.</p>
/// <p>When using FlexMatch as a standalone component, request a backfill match by calling this operation without a game session identifier. As with newly formed matches, matchmaking results are returned in a matchmaking event so that your game can update the game session that is being backfilled.</p>
/// <p>To request a backfill match, specify a unique ticket ID, the original matchmaking configuration, and matchmaking data for all current players in the game session being backfilled. Optionally, specify the <code>GameSession</code> ARN. If successful, a match backfill ticket is created and returned with status set to QUEUED. Track the status of backfill tickets using the same method for tracking tickets for new matches.</p>
/// <p>Only game sessions created by FlexMatch are supported for match backfill.</p>
/// <p><b>Learn more</b></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html"> Backfill existing games with FlexMatch</a></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-events.html"> Matchmaking events</a> (reference)</p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/gamelift-match.html"> How Amazon GameLift Servers FlexMatch works</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartMatchBackfillFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::start_match_backfill::StartMatchBackfillOutput,
crate::operation::start_match_backfill::StartMatchBackfillError,
> for StartMatchBackfillFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::start_match_backfill::StartMatchBackfillOutput,
crate::operation::start_match_backfill::StartMatchBackfillError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl StartMatchBackfillFluentBuilder {
/// Creates a new `StartMatchBackfillFluentBuilder`.
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 StartMatchBackfill as a reference.
pub fn as_input(&self) -> &crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder {
&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_match_backfill::StartMatchBackfillOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_match_backfill::StartMatchBackfillError,
::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_match_backfill::StartMatchBackfill::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::start_match_backfill::StartMatchBackfill::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_match_backfill::StartMatchBackfillOutput,
crate::operation::start_match_backfill::StartMatchBackfillError,
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 for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift Servers will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status and retrieve match results.</p>
pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.ticket_id(input.into());
self
}
/// <p>A unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift Servers will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status and retrieve match results.</p>
pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_ticket_id(input);
self
}
/// <p>A unique identifier for a matchmaking ticket. If no ticket ID is specified here, Amazon GameLift Servers will generate one in the form of a UUID. Use this identifier to track the match backfill ticket status and retrieve match results.</p>
pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_ticket_id()
}
/// <p>Name of the matchmaker to use for this request. You can use either the configuration name or ARN value. The ARN of the matchmaker that was used with the original game session is listed in the <code>GameSession</code> object, <code>MatchmakerData</code> property.</p>
pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.configuration_name(input.into());
self
}
/// <p>Name of the matchmaker to use for this request. You can use either the configuration name or ARN value. The ARN of the matchmaker that was used with the original game session is listed in the <code>GameSession</code> object, <code>MatchmakerData</code> property.</p>
pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_configuration_name(input);
self
}
/// <p>Name of the matchmaker to use for this request. You can use either the configuration name or ARN value. The ARN of the matchmaker that was used with the original game session is listed in the <code>GameSession</code> object, <code>MatchmakerData</code> property.</p>
pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_configuration_name()
}
/// <p>An identifier for the game session that is unique across all regions. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <id string></id>
/// </fleet>
/// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <location>
/// /
/// <id string></id>
/// </location>
/// </fleet>
/// </home_region></code>. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
pub fn game_session_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.game_session_arn(input.into());
self
}
/// <p>An identifier for the game session that is unique across all regions. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <id string></id>
/// </fleet>
/// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <location>
/// /
/// <id string></id>
/// </location>
/// </fleet>
/// </home_region></code>. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
pub fn set_game_session_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_game_session_arn(input);
self
}
/// <p>An identifier for the game session that is unique across all regions. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <id string></id>
/// </fleet>
/// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
/// ::gamesession/
/// <fleet id>
/// /
/// <location>
/// /
/// <id string></id>
/// </location>
/// </fleet>
/// </home_region></code>. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
pub fn get_game_session_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_game_session_arn()
}
///
/// Appends an item to `Players`.
///
/// To override the contents of this collection use [`set_players`](Self::set_players).
///
/// <p>Match information on all players that are currently assigned to the game session. This information is used by the matchmaker to find new players and add them to the existing game.</p>
/// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
/// <ul>
/// <li>
/// <p>PlayerID, PlayerAttributes, Team -- This information is maintained in the <code>GameSession</code> object, <code>MatchmakerData</code> property, for all players who are currently assigned to the game session. The matchmaker data is in JSON syntax, formatted as a string. For more details, see <a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data"> Match Data</a>.</p>
/// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
/// <li>
/// <p>LatencyInMs -- If the matchmaker uses player latency, include a latency value, in milliseconds, for the Region that the game session is currently in. Do not include latency values for any other Region.</p></li>
/// </ul>
pub fn players(mut self, input: crate::types::Player) -> Self {
self.inner = self.inner.players(input);
self
}
/// <p>Match information on all players that are currently assigned to the game session. This information is used by the matchmaker to find new players and add them to the existing game.</p>
/// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
/// <ul>
/// <li>
/// <p>PlayerID, PlayerAttributes, Team -- This information is maintained in the <code>GameSession</code> object, <code>MatchmakerData</code> property, for all players who are currently assigned to the game session. The matchmaker data is in JSON syntax, formatted as a string. For more details, see <a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data"> Match Data</a>.</p>
/// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
/// <li>
/// <p>LatencyInMs -- If the matchmaker uses player latency, include a latency value, in milliseconds, for the Region that the game session is currently in. Do not include latency values for any other Region.</p></li>
/// </ul>
pub fn set_players(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Player>>) -> Self {
self.inner = self.inner.set_players(input);
self
}
/// <p>Match information on all players that are currently assigned to the game session. This information is used by the matchmaker to find new players and add them to the existing game.</p>
/// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
/// <ul>
/// <li>
/// <p>PlayerID, PlayerAttributes, Team -- This information is maintained in the <code>GameSession</code> object, <code>MatchmakerData</code> property, for all players who are currently assigned to the game session. The matchmaker data is in JSON syntax, formatted as a string. For more details, see <a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data"> Match Data</a>.</p>
/// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
/// <li>
/// <p>LatencyInMs -- If the matchmaker uses player latency, include a latency value, in milliseconds, for the Region that the game session is currently in. Do not include latency values for any other Region.</p></li>
/// </ul>
pub fn get_players(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Player>> {
self.inner.get_players()
}
}