aws_sdk_gamelift/operation/start_matchmaking/_start_matchmaking_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct StartMatchmakingInput {
6 /// <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>
7 pub ticket_id: ::std::option::Option<::std::string::String>,
8 /// <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>
9 pub configuration_name: ::std::option::Option<::std::string::String>,
10 /// <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>
11 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
12 pub players: ::std::option::Option<::std::vec::Vec<crate::types::Player>>,
13}
14impl StartMatchmakingInput {
15 /// <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>
16 pub fn ticket_id(&self) -> ::std::option::Option<&str> {
17 self.ticket_id.as_deref()
18 }
19 /// <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>
20 pub fn configuration_name(&self) -> ::std::option::Option<&str> {
21 self.configuration_name.as_deref()
22 }
23 /// <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>
24 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
25 ///
26 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.players.is_none()`.
27 pub fn players(&self) -> &[crate::types::Player] {
28 self.players.as_deref().unwrap_or_default()
29 }
30}
31impl StartMatchmakingInput {
32 /// Creates a new builder-style object to manufacture [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
33 pub fn builder() -> crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder {
34 crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder::default()
35 }
36}
37
38/// A builder for [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct StartMatchmakingInputBuilder {
42 pub(crate) ticket_id: ::std::option::Option<::std::string::String>,
43 pub(crate) configuration_name: ::std::option::Option<::std::string::String>,
44 pub(crate) players: ::std::option::Option<::std::vec::Vec<crate::types::Player>>,
45}
46impl StartMatchmakingInputBuilder {
47 /// <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>
48 pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49 self.ticket_id = ::std::option::Option::Some(input.into());
50 self
51 }
52 /// <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>
53 pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54 self.ticket_id = input;
55 self
56 }
57 /// <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>
58 pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
59 &self.ticket_id
60 }
61 /// <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>
62 /// This field is required.
63 pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64 self.configuration_name = ::std::option::Option::Some(input.into());
65 self
66 }
67 /// <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>
68 pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69 self.configuration_name = input;
70 self
71 }
72 /// <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>
73 pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
74 &self.configuration_name
75 }
76 /// Appends an item to `players`.
77 ///
78 /// To override the contents of this collection use [`set_players`](Self::set_players).
79 ///
80 /// <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>
81 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
82 pub fn players(mut self, input: crate::types::Player) -> Self {
83 let mut v = self.players.unwrap_or_default();
84 v.push(input);
85 self.players = ::std::option::Option::Some(v);
86 self
87 }
88 /// <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>
89 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
90 pub fn set_players(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Player>>) -> Self {
91 self.players = input;
92 self
93 }
94 /// <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>
95 /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
96 pub fn get_players(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Player>> {
97 &self.players
98 }
99 /// Consumes the builder and constructs a [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
100 pub fn build(
101 self,
102 ) -> ::std::result::Result<crate::operation::start_matchmaking::StartMatchmakingInput, ::aws_smithy_types::error::operation::BuildError> {
103 ::std::result::Result::Ok(crate::operation::start_matchmaking::StartMatchmakingInput {
104 ticket_id: self.ticket_id,
105 configuration_name: self.configuration_name,
106 players: self.players,
107 })
108 }
109}