aws_sdk_gamelift/operation/start_match_backfill/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_match_backfill::_start_match_backfill_output::StartMatchBackfillOutputBuilder;
3
4pub use crate::operation::start_match_backfill::_start_match_backfill_input::StartMatchBackfillInputBuilder;
5
6impl crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder {
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::start_match_backfill::StartMatchBackfillOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_match_backfill::StartMatchBackfillError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_match_backfill();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartMatchBackfill`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <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>
27/// <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>
28/// <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>
29/// <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>
30/// <p>Only game sessions created by FlexMatch are supported for match backfill.</p>
31/// <p><b>Learn more</b></p>
32/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html"> Backfill existing games with FlexMatch</a></p>
33/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-events.html"> Matchmaking events</a> (reference)</p>
34/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/gamelift-match.html"> How Amazon GameLift Servers FlexMatch works</a></p>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct StartMatchBackfillFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::start_match_backfill::StartMatchBackfillOutput,
44 crate::operation::start_match_backfill::StartMatchBackfillError,
45 > for StartMatchBackfillFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::start_match_backfill::StartMatchBackfillOutput,
53 crate::operation::start_match_backfill::StartMatchBackfillError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl StartMatchBackfillFluentBuilder {
60 /// Creates a new `StartMatchBackfillFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the StartMatchBackfill as a reference.
69 pub fn as_input(&self) -> &crate::operation::start_match_backfill::builders::StartMatchBackfillInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::start_match_backfill::StartMatchBackfillOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::start_match_backfill::StartMatchBackfillError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::start_match_backfill::StartMatchBackfill::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::start_match_backfill::StartMatchBackfill::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::start_match_backfill::StartMatchBackfillOutput,
106 crate::operation::start_match_backfill::StartMatchBackfillError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <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>
121 pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.ticket_id(input.into());
123 self
124 }
125 /// <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>
126 pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_ticket_id(input);
128 self
129 }
130 /// <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>
131 pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_ticket_id()
133 }
134 /// <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>
135 pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.configuration_name(input.into());
137 self
138 }
139 /// <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>
140 pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_configuration_name(input);
142 self
143 }
144 /// <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>
145 pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_configuration_name()
147 }
148 /// <p>A unique identifier for the game session. Use the game session ID. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
149 pub fn game_session_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.game_session_arn(input.into());
151 self
152 }
153 /// <p>A unique identifier for the game session. Use the game session ID. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
154 pub fn set_game_session_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_game_session_arn(input);
156 self
157 }
158 /// <p>A unique identifier for the game session. Use the game session ID. When using FlexMatch as a standalone matchmaking solution, this parameter is not needed.</p>
159 pub fn get_game_session_arn(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_game_session_arn()
161 }
162 ///
163 /// Appends an item to `Players`.
164 ///
165 /// To override the contents of this collection use [`set_players`](Self::set_players).
166 ///
167 /// <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>
168 /// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
169 /// <ul>
170 /// <li>
171 /// <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>
172 /// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
173 /// <li>
174 /// <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>
175 /// </ul>
176 pub fn players(mut self, input: crate::types::Player) -> Self {
177 self.inner = self.inner.players(input);
178 self
179 }
180 /// <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>
181 /// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
182 /// <ul>
183 /// <li>
184 /// <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>
185 /// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
186 /// <li>
187 /// <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>
188 /// </ul>
189 pub fn set_players(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Player>>) -> Self {
190 self.inner = self.inner.set_players(input);
191 self
192 }
193 /// <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>
194 /// <p>You can include up to 199 <code>Players</code> in a <code>StartMatchBackfill</code> request.</p>
195 /// <ul>
196 /// <li>
197 /// <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>
198 /// <p>The backfill request must specify the team membership for every player. Do not specify team if you are not using backfill.</p></li>
199 /// <li>
200 /// <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>
201 /// </ul>
202 pub fn get_players(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Player>> {
203 self.inner.get_players()
204 }
205}