aws_sdk_gamelift/operation/start_matchmaking/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_matchmaking::_start_matchmaking_output::StartMatchmakingOutputBuilder;
3
4pub use crate::operation::start_matchmaking::_start_matchmaking_input::StartMatchmakingInputBuilder;
5
6impl crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder {
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_matchmaking::StartMatchmakingOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_matchmaking::StartMatchmakingError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_matchmaking();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartMatchmaking`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Uses FlexMatch to create a game match for a group of players based on custom matchmaking rules. With games that use Amazon GameLift Servers managed hosting, this operation also triggers Amazon GameLift Servers to find hosting resources and start a new game session for the new match. Each matchmaking request includes information on one or more players and specifies the FlexMatch matchmaker to use. When a request is for multiple players, FlexMatch attempts to build a match that includes all players in the request, placing them in the same team and finding additional players as needed to fill the match.</p>
27/// <p>To start matchmaking, provide a unique ticket ID, specify a matchmaking configuration, and include the players to be matched. You must also include any player attributes that are required by the matchmaking configuration's rule set. If successful, a matchmaking ticket is returned with status set to <code>QUEUED</code>.</p>
28/// <p>Track matchmaking events to respond as needed and acquire game session connection information for successfully completed matches. Ticket status updates are tracked using event notification through Amazon Simple Notification Service, which is defined in the matchmaking configuration.</p>
29/// <p><b>Learn more</b></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-client.html"> Add FlexMatch to a game client</a></p>
31/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-notification.html"> Set Up FlexMatch event notification</a></p>
32/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/gamelift-match.html"> How Amazon GameLift Servers FlexMatch works</a></p>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct StartMatchmakingFluentBuilder {
35 handle: ::std::sync::Arc<crate::client::Handle>,
36 inner: crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder,
37 config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40 crate::client::customize::internal::CustomizableSend<
41 crate::operation::start_matchmaking::StartMatchmakingOutput,
42 crate::operation::start_matchmaking::StartMatchmakingError,
43 > for StartMatchmakingFluentBuilder
44{
45 fn send(
46 self,
47 config_override: crate::config::Builder,
48 ) -> crate::client::customize::internal::BoxFuture<
49 crate::client::customize::internal::SendResult<
50 crate::operation::start_matchmaking::StartMatchmakingOutput,
51 crate::operation::start_matchmaking::StartMatchmakingError,
52 >,
53 > {
54 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55 }
56}
57impl StartMatchmakingFluentBuilder {
58 /// Creates a new `StartMatchmakingFluentBuilder`.
59 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60 Self {
61 handle,
62 inner: ::std::default::Default::default(),
63 config_override: ::std::option::Option::None,
64 }
65 }
66 /// Access the StartMatchmaking as a reference.
67 pub fn as_input(&self) -> &crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder {
68 &self.inner
69 }
70 /// Sends the request and returns the response.
71 ///
72 /// If an error occurs, an `SdkError` will be returned with additional details that
73 /// can be matched against.
74 ///
75 /// By default, any retryable failures will be retried twice. Retry behavior
76 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77 /// set when configuring the client.
78 pub async fn send(
79 self,
80 ) -> ::std::result::Result<
81 crate::operation::start_matchmaking::StartMatchmakingOutput,
82 ::aws_smithy_runtime_api::client::result::SdkError<
83 crate::operation::start_matchmaking::StartMatchmakingError,
84 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85 >,
86 > {
87 let input = self
88 .inner
89 .build()
90 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91 let runtime_plugins = crate::operation::start_matchmaking::StartMatchmaking::operation_runtime_plugins(
92 self.handle.runtime_plugins.clone(),
93 &self.handle.conf,
94 self.config_override,
95 );
96 crate::operation::start_matchmaking::StartMatchmaking::orchestrate(&runtime_plugins, input).await
97 }
98
99 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100 pub fn customize(
101 self,
102 ) -> crate::client::customize::CustomizableOperation<
103 crate::operation::start_matchmaking::StartMatchmakingOutput,
104 crate::operation::start_matchmaking::StartMatchmakingError,
105 Self,
106 > {
107 crate::client::customize::CustomizableOperation::new(self)
108 }
109 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110 self.set_config_override(::std::option::Option::Some(config_override.into()));
111 self
112 }
113
114 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115 self.config_override = config_override;
116 self
117 }
118 /// <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 matchmaking ticket status and retrieve match results.</p>
119 pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.inner = self.inner.ticket_id(input.into());
121 self
122 }
123 /// <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 matchmaking ticket status and retrieve match results.</p>
124 pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.inner = self.inner.set_ticket_id(input);
126 self
127 }
128 /// <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 matchmaking ticket status and retrieve match results.</p>
129 pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
130 self.inner.get_ticket_id()
131 }
132 /// <p>Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same Region as this request. You can use either the configuration name or ARN value.</p>
133 pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.configuration_name(input.into());
135 self
136 }
137 /// <p>Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same Region as this request. You can use either the configuration name or ARN value.</p>
138 pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.inner = self.inner.set_configuration_name(input);
140 self
141 }
142 /// <p>Name of the matchmaking configuration to use for this request. Matchmaking configurations must exist in the same Region as this request. You can use either the configuration name or ARN value.</p>
143 pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
144 self.inner.get_configuration_name()
145 }
146 ///
147 /// Appends an item to `Players`.
148 ///
149 /// To override the contents of this collection use [`set_players`](Self::set_players).
150 ///
151 /// <p>Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, <code>Player</code> objects contain the name of the team the player is assigned to.</p>
152 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
153 pub fn players(mut self, input: crate::types::Player) -> Self {
154 self.inner = self.inner.players(input);
155 self
156 }
157 /// <p>Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, <code>Player</code> objects contain the name of the team the player is assigned to.</p>
158 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
159 pub fn set_players(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Player>>) -> Self {
160 self.inner = self.inner.set_players(input);
161 self
162 }
163 /// <p>Information on each player to be matched. This information must include a player ID, and may contain player attributes and latency data to be used in the matchmaking process. After a successful match, <code>Player</code> objects contain the name of the team the player is assigned to.</p>
164 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
165 pub fn get_players(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Player>> {
166 self.inner.get_players()
167 }
168}