rivet_matchmaker/
input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2use std::fmt::Write;
3/// See [`FindLobbyInput`](crate::input::FindLobbyInput)
4pub mod find_lobby_input {
5	/// A builder for [`FindLobbyInput`](crate::input::FindLobbyInput)
6	#[non_exhaustive]
7	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
8	pub struct Builder {
9		pub(crate) game_modes: std::option::Option<std::vec::Vec<std::string::String>>,
10		pub(crate) regions: std::option::Option<std::vec::Vec<std::string::String>>,
11		pub(crate) prevent_auto_create_lobby: std::option::Option<bool>,
12		pub(crate) captcha: std::option::Option<crate::model::CaptchaConfig>,
13		pub(crate) origin: std::option::Option<std::string::String>,
14	}
15	impl Builder {
16		/// Appends an item to `game_modes`.
17		///
18		/// To override the contents of this collection use [`set_game_modes`](Self::set_game_modes).
19		///
20		/// Game modes to match lobbies against.
21		pub fn game_modes(mut self, input: impl Into<std::string::String>) -> Self {
22			let mut v = self.game_modes.unwrap_or_default();
23			v.push(input.into());
24			self.game_modes = Some(v);
25			self
26		}
27		/// Game modes to match lobbies against.
28		pub fn set_game_modes(
29			mut self,
30			input: std::option::Option<std::vec::Vec<std::string::String>>,
31		) -> Self {
32			self.game_modes = input;
33			self
34		}
35		/// Appends an item to `regions`.
36		///
37		/// To override the contents of this collection use [`set_regions`](Self::set_regions).
38		///
39		/// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region.
40		pub fn regions(mut self, input: impl Into<std::string::String>) -> Self {
41			let mut v = self.regions.unwrap_or_default();
42			v.push(input.into());
43			self.regions = Some(v);
44			self
45		}
46		/// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region.
47		pub fn set_regions(
48			mut self,
49			input: std::option::Option<std::vec::Vec<std::string::String>>,
50		) -> Self {
51			self.regions = input;
52			self
53		}
54		/// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown.
55		pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self {
56			self.prevent_auto_create_lobby = Some(input);
57			self
58		}
59		/// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown.
60		pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option<bool>) -> Self {
61			self.prevent_auto_create_lobby = input;
62			self
63		}
64		/// Methods to verify a captcha.
65		pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self {
66			self.captcha = Some(input);
67			self
68		}
69		/// Methods to verify a captcha.
70		pub fn set_captcha(
71			mut self,
72			input: std::option::Option<crate::model::CaptchaConfig>,
73		) -> Self {
74			self.captcha = input;
75			self
76		}
77		#[allow(missing_docs)] // documentation missing in model
78		pub fn origin(mut self, input: impl Into<std::string::String>) -> Self {
79			self.origin = Some(input.into());
80			self
81		}
82		#[allow(missing_docs)] // documentation missing in model
83		pub fn set_origin(mut self, input: std::option::Option<std::string::String>) -> Self {
84			self.origin = input;
85			self
86		}
87		/// Consumes the builder and constructs a [`FindLobbyInput`](crate::input::FindLobbyInput)
88		pub fn build(
89			self,
90		) -> std::result::Result<crate::input::FindLobbyInput, aws_smithy_http::operation::BuildError>
91		{
92			Ok(crate::input::FindLobbyInput {
93				game_modes: self.game_modes,
94				regions: self.regions,
95				prevent_auto_create_lobby: self.prevent_auto_create_lobby,
96				captcha: self.captcha,
97				origin: self.origin,
98			})
99		}
100	}
101}
102#[doc(hidden)]
103pub type FindLobbyInputOperationOutputAlias = crate::operation::FindLobby;
104#[doc(hidden)]
105pub type FindLobbyInputOperationRetryAlias = ();
106impl FindLobbyInput {
107	/// Consumes the builder and constructs an Operation<[`FindLobby`](crate::operation::FindLobby)>
108	#[allow(unused_mut)]
109	#[allow(clippy::let_and_return)]
110	#[allow(clippy::needless_borrow)]
111	pub async fn make_operation(
112		&self,
113		_config: &crate::config::Config,
114	) -> std::result::Result<
115		aws_smithy_http::operation::Operation<crate::operation::FindLobby, ()>,
116		aws_smithy_http::operation::BuildError,
117	> {
118		let mut request = {
119			fn uri_base(
120				_input: &crate::input::FindLobbyInput,
121				output: &mut String,
122			) -> Result<(), aws_smithy_http::operation::BuildError> {
123				write!(output, "/lobbies/find").expect("formatting should succeed");
124				Ok(())
125			}
126			#[allow(clippy::unnecessary_wraps)]
127			fn update_http_builder(
128				input: &crate::input::FindLobbyInput,
129				_config: &crate::config::Config,
130				builder: http::request::Builder,
131			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
132			{
133				let mut _uri = String::new();
134				_uri = format!("{}{}", _config.uri.clone(), _uri);
135				uri_base(input, &mut _uri)?;
136				let builder = crate::http_serde::add_headers_find_lobby(input, builder)?;
137				Ok(builder.method("POST").uri(_uri))
138			}
139			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
140			let mut builder = if let Some(auth) = &_config.auth {
141				builder.header(http::header::AUTHORIZATION, auth.clone())
142			} else {
143				builder
144			};
145			builder = aws_smithy_http::header::set_request_header_if_absent(
146				builder,
147				http::header::CONTENT_TYPE,
148				"application/json",
149			);
150			builder
151		};
152		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
153		#[allow(clippy::useless_conversion)]
154		let body = aws_smithy_http::body::SdkBody::from(
155			crate::operation_ser::serialize_operation_crate_operation_find_lobby(&self)?,
156		);
157		if let Some(content_length) = body.content_length() {
158			request = aws_smithy_http::header::set_request_header_if_absent(
159				request,
160				http::header::CONTENT_LENGTH,
161				content_length,
162			);
163		}
164		let request = request.body(body).expect("should be valid request");
165		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
166		request
167			.properties_mut()
168			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
169		let op =
170			aws_smithy_http::operation::Operation::new(request, crate::operation::FindLobby::new())
171				.with_metadata(aws_smithy_http::operation::Metadata::new(
172					"FindLobby",
173					"MatchmakerService",
174				));
175		Ok(op)
176	}
177	/// Creates a new builder-style object to manufacture [`FindLobbyInput`](crate::input::FindLobbyInput)
178	pub fn builder() -> crate::input::find_lobby_input::Builder {
179		crate::input::find_lobby_input::Builder::default()
180	}
181}
182
183/// See [`JoinLobbyInput`](crate::input::JoinLobbyInput)
184pub mod join_lobby_input {
185	/// A builder for [`JoinLobbyInput`](crate::input::JoinLobbyInput)
186	#[non_exhaustive]
187	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
188	pub struct Builder {
189		pub(crate) lobby_id: std::option::Option<std::string::String>,
190		pub(crate) captcha: std::option::Option<crate::model::CaptchaConfig>,
191	}
192	impl Builder {
193		/// A universally unique identifier.
194		pub fn lobby_id(mut self, input: impl Into<std::string::String>) -> Self {
195			self.lobby_id = Some(input.into());
196			self
197		}
198		/// A universally unique identifier.
199		pub fn set_lobby_id(mut self, input: std::option::Option<std::string::String>) -> Self {
200			self.lobby_id = input;
201			self
202		}
203		/// Methods to verify a captcha.
204		pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self {
205			self.captcha = Some(input);
206			self
207		}
208		/// Methods to verify a captcha.
209		pub fn set_captcha(
210			mut self,
211			input: std::option::Option<crate::model::CaptchaConfig>,
212		) -> Self {
213			self.captcha = input;
214			self
215		}
216		/// Consumes the builder and constructs a [`JoinLobbyInput`](crate::input::JoinLobbyInput)
217		pub fn build(
218			self,
219		) -> std::result::Result<crate::input::JoinLobbyInput, aws_smithy_http::operation::BuildError>
220		{
221			Ok(crate::input::JoinLobbyInput {
222				lobby_id: self.lobby_id,
223				captcha: self.captcha,
224			})
225		}
226	}
227}
228#[doc(hidden)]
229pub type JoinLobbyInputOperationOutputAlias = crate::operation::JoinLobby;
230#[doc(hidden)]
231pub type JoinLobbyInputOperationRetryAlias = ();
232impl JoinLobbyInput {
233	/// Consumes the builder and constructs an Operation<[`JoinLobby`](crate::operation::JoinLobby)>
234	#[allow(unused_mut)]
235	#[allow(clippy::let_and_return)]
236	#[allow(clippy::needless_borrow)]
237	pub async fn make_operation(
238		&self,
239		_config: &crate::config::Config,
240	) -> std::result::Result<
241		aws_smithy_http::operation::Operation<crate::operation::JoinLobby, ()>,
242		aws_smithy_http::operation::BuildError,
243	> {
244		let mut request = {
245			fn uri_base(
246				_input: &crate::input::JoinLobbyInput,
247				output: &mut String,
248			) -> Result<(), aws_smithy_http::operation::BuildError> {
249				write!(output, "/lobbies/join").expect("formatting should succeed");
250				Ok(())
251			}
252			#[allow(clippy::unnecessary_wraps)]
253			fn update_http_builder(
254				input: &crate::input::JoinLobbyInput,
255				_config: &crate::config::Config,
256				builder: http::request::Builder,
257			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
258			{
259				let mut _uri = String::new();
260				_uri = format!("{}{}", _config.uri.clone(), _uri);
261				uri_base(input, &mut _uri)?;
262				Ok(builder.method("POST").uri(_uri))
263			}
264			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
265			let mut builder = if let Some(auth) = &_config.auth {
266				builder.header(http::header::AUTHORIZATION, auth.clone())
267			} else {
268				builder
269			};
270			builder = aws_smithy_http::header::set_request_header_if_absent(
271				builder,
272				http::header::CONTENT_TYPE,
273				"application/json",
274			);
275			builder
276		};
277		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
278		#[allow(clippy::useless_conversion)]
279		let body = aws_smithy_http::body::SdkBody::from(
280			crate::operation_ser::serialize_operation_crate_operation_join_lobby(&self)?,
281		);
282		if let Some(content_length) = body.content_length() {
283			request = aws_smithy_http::header::set_request_header_if_absent(
284				request,
285				http::header::CONTENT_LENGTH,
286				content_length,
287			);
288		}
289		let request = request.body(body).expect("should be valid request");
290		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
291		request
292			.properties_mut()
293			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
294		let op =
295			aws_smithy_http::operation::Operation::new(request, crate::operation::JoinLobby::new())
296				.with_metadata(aws_smithy_http::operation::Metadata::new(
297					"JoinLobby",
298					"MatchmakerService",
299				));
300		Ok(op)
301	}
302	/// Creates a new builder-style object to manufacture [`JoinLobbyInput`](crate::input::JoinLobbyInput)
303	pub fn builder() -> crate::input::join_lobby_input::Builder {
304		crate::input::join_lobby_input::Builder::default()
305	}
306}
307
308/// See [`ListLobbiesInput`](crate::input::ListLobbiesInput)
309pub mod list_lobbies_input {
310	/// A builder for [`ListLobbiesInput`](crate::input::ListLobbiesInput)
311	#[non_exhaustive]
312	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
313	pub struct Builder {}
314	impl Builder {
315		/// Consumes the builder and constructs a [`ListLobbiesInput`](crate::input::ListLobbiesInput)
316		pub fn build(
317			self,
318		) -> std::result::Result<
319			crate::input::ListLobbiesInput,
320			aws_smithy_http::operation::BuildError,
321		> {
322			Ok(crate::input::ListLobbiesInput {})
323		}
324	}
325}
326#[doc(hidden)]
327pub type ListLobbiesInputOperationOutputAlias = crate::operation::ListLobbies;
328#[doc(hidden)]
329pub type ListLobbiesInputOperationRetryAlias = ();
330impl ListLobbiesInput {
331	/// Consumes the builder and constructs an Operation<[`ListLobbies`](crate::operation::ListLobbies)>
332	#[allow(unused_mut)]
333	#[allow(clippy::let_and_return)]
334	#[allow(clippy::needless_borrow)]
335	pub async fn make_operation(
336		&self,
337		_config: &crate::config::Config,
338	) -> std::result::Result<
339		aws_smithy_http::operation::Operation<crate::operation::ListLobbies, ()>,
340		aws_smithy_http::operation::BuildError,
341	> {
342		let mut request = {
343			fn uri_base(
344				_input: &crate::input::ListLobbiesInput,
345				output: &mut String,
346			) -> Result<(), aws_smithy_http::operation::BuildError> {
347				write!(output, "/lobbies/list").expect("formatting should succeed");
348				Ok(())
349			}
350			#[allow(clippy::unnecessary_wraps)]
351			fn update_http_builder(
352				input: &crate::input::ListLobbiesInput,
353				_config: &crate::config::Config,
354				builder: http::request::Builder,
355			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
356			{
357				let mut _uri = String::new();
358				_uri = format!("{}{}", _config.uri.clone(), _uri);
359				uri_base(input, &mut _uri)?;
360				Ok(builder.method("GET").uri(_uri))
361			}
362			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
363			let mut builder = if let Some(auth) = &_config.auth {
364				builder.header(http::header::AUTHORIZATION, auth.clone())
365			} else {
366				builder
367			};
368			builder
369		};
370		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
371		#[allow(clippy::useless_conversion)]
372		let body = aws_smithy_http::body::SdkBody::from("");
373		let request = request.body(body).expect("should be valid request");
374		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
375		request
376			.properties_mut()
377			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
378		let op = aws_smithy_http::operation::Operation::new(
379			request,
380			crate::operation::ListLobbies::new(),
381		)
382		.with_metadata(aws_smithy_http::operation::Metadata::new(
383			"ListLobbies",
384			"MatchmakerService",
385		));
386		Ok(op)
387	}
388	/// Creates a new builder-style object to manufacture [`ListLobbiesInput`](crate::input::ListLobbiesInput)
389	pub fn builder() -> crate::input::list_lobbies_input::Builder {
390		crate::input::list_lobbies_input::Builder::default()
391	}
392}
393
394/// See [`ListRegionsInput`](crate::input::ListRegionsInput)
395pub mod list_regions_input {
396	/// A builder for [`ListRegionsInput`](crate::input::ListRegionsInput)
397	#[non_exhaustive]
398	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
399	pub struct Builder {}
400	impl Builder {
401		/// Consumes the builder and constructs a [`ListRegionsInput`](crate::input::ListRegionsInput)
402		pub fn build(
403			self,
404		) -> std::result::Result<
405			crate::input::ListRegionsInput,
406			aws_smithy_http::operation::BuildError,
407		> {
408			Ok(crate::input::ListRegionsInput {})
409		}
410	}
411}
412#[doc(hidden)]
413pub type ListRegionsInputOperationOutputAlias = crate::operation::ListRegions;
414#[doc(hidden)]
415pub type ListRegionsInputOperationRetryAlias = ();
416impl ListRegionsInput {
417	/// Consumes the builder and constructs an Operation<[`ListRegions`](crate::operation::ListRegions)>
418	#[allow(unused_mut)]
419	#[allow(clippy::let_and_return)]
420	#[allow(clippy::needless_borrow)]
421	pub async fn make_operation(
422		&self,
423		_config: &crate::config::Config,
424	) -> std::result::Result<
425		aws_smithy_http::operation::Operation<crate::operation::ListRegions, ()>,
426		aws_smithy_http::operation::BuildError,
427	> {
428		let mut request = {
429			fn uri_base(
430				_input: &crate::input::ListRegionsInput,
431				output: &mut String,
432			) -> Result<(), aws_smithy_http::operation::BuildError> {
433				write!(output, "/regions").expect("formatting should succeed");
434				Ok(())
435			}
436			#[allow(clippy::unnecessary_wraps)]
437			fn update_http_builder(
438				input: &crate::input::ListRegionsInput,
439				_config: &crate::config::Config,
440				builder: http::request::Builder,
441			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
442			{
443				let mut _uri = String::new();
444				_uri = format!("{}{}", _config.uri.clone(), _uri);
445				uri_base(input, &mut _uri)?;
446				Ok(builder.method("GET").uri(_uri))
447			}
448			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
449			let mut builder = if let Some(auth) = &_config.auth {
450				builder.header(http::header::AUTHORIZATION, auth.clone())
451			} else {
452				builder
453			};
454			builder
455		};
456		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
457		#[allow(clippy::useless_conversion)]
458		let body = aws_smithy_http::body::SdkBody::from("");
459		let request = request.body(body).expect("should be valid request");
460		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
461		request
462			.properties_mut()
463			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
464		let op = aws_smithy_http::operation::Operation::new(
465			request,
466			crate::operation::ListRegions::new(),
467		)
468		.with_metadata(aws_smithy_http::operation::Metadata::new(
469			"ListRegions",
470			"MatchmakerService",
471		));
472		Ok(op)
473	}
474	/// Creates a new builder-style object to manufacture [`ListRegionsInput`](crate::input::ListRegionsInput)
475	pub fn builder() -> crate::input::list_regions_input::Builder {
476		crate::input::list_regions_input::Builder::default()
477	}
478}
479
480/// See [`LobbyReadyInput`](crate::input::LobbyReadyInput)
481pub mod lobby_ready_input {
482	/// A builder for [`LobbyReadyInput`](crate::input::LobbyReadyInput)
483	#[non_exhaustive]
484	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
485	pub struct Builder {}
486	impl Builder {
487		/// Consumes the builder and constructs a [`LobbyReadyInput`](crate::input::LobbyReadyInput)
488		pub fn build(
489			self,
490		) -> std::result::Result<
491			crate::input::LobbyReadyInput,
492			aws_smithy_http::operation::BuildError,
493		> {
494			Ok(crate::input::LobbyReadyInput {})
495		}
496	}
497}
498#[doc(hidden)]
499pub type LobbyReadyInputOperationOutputAlias = crate::operation::LobbyReady;
500#[doc(hidden)]
501pub type LobbyReadyInputOperationRetryAlias = ();
502impl LobbyReadyInput {
503	/// Consumes the builder and constructs an Operation<[`LobbyReady`](crate::operation::LobbyReady)>
504	#[allow(unused_mut)]
505	#[allow(clippy::let_and_return)]
506	#[allow(clippy::needless_borrow)]
507	pub async fn make_operation(
508		&self,
509		_config: &crate::config::Config,
510	) -> std::result::Result<
511		aws_smithy_http::operation::Operation<crate::operation::LobbyReady, ()>,
512		aws_smithy_http::operation::BuildError,
513	> {
514		let mut request = {
515			fn uri_base(
516				_input: &crate::input::LobbyReadyInput,
517				output: &mut String,
518			) -> Result<(), aws_smithy_http::operation::BuildError> {
519				write!(output, "/lobbies/ready").expect("formatting should succeed");
520				Ok(())
521			}
522			#[allow(clippy::unnecessary_wraps)]
523			fn update_http_builder(
524				input: &crate::input::LobbyReadyInput,
525				_config: &crate::config::Config,
526				builder: http::request::Builder,
527			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
528			{
529				let mut _uri = String::new();
530				_uri = format!("{}{}", _config.uri.clone(), _uri);
531				uri_base(input, &mut _uri)?;
532				Ok(builder.method("POST").uri(_uri))
533			}
534			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
535			let mut builder = if let Some(auth) = &_config.auth {
536				builder.header(http::header::AUTHORIZATION, auth.clone())
537			} else {
538				builder
539			};
540			builder
541		};
542		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
543		#[allow(clippy::useless_conversion)]
544		let body = aws_smithy_http::body::SdkBody::from("{}");
545		let request = request.body(body).expect("should be valid request");
546		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
547		request
548			.properties_mut()
549			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
550		let op = aws_smithy_http::operation::Operation::new(
551			request,
552			crate::operation::LobbyReady::new(),
553		)
554		.with_metadata(aws_smithy_http::operation::Metadata::new(
555			"LobbyReady",
556			"MatchmakerService",
557		));
558		Ok(op)
559	}
560	/// Creates a new builder-style object to manufacture [`LobbyReadyInput`](crate::input::LobbyReadyInput)
561	pub fn builder() -> crate::input::lobby_ready_input::Builder {
562		crate::input::lobby_ready_input::Builder::default()
563	}
564}
565
566/// See [`PlayerConnectedInput`](crate::input::PlayerConnectedInput)
567pub mod player_connected_input {
568	/// A builder for [`PlayerConnectedInput`](crate::input::PlayerConnectedInput)
569	#[non_exhaustive]
570	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
571	pub struct Builder {
572		pub(crate) player_token: std::option::Option<std::string::String>,
573	}
574	impl Builder {
575		/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
576		pub fn player_token(mut self, input: impl Into<std::string::String>) -> Self {
577			self.player_token = Some(input.into());
578			self
579		}
580		/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
581		pub fn set_player_token(mut self, input: std::option::Option<std::string::String>) -> Self {
582			self.player_token = input;
583			self
584		}
585		/// Consumes the builder and constructs a [`PlayerConnectedInput`](crate::input::PlayerConnectedInput)
586		pub fn build(
587			self,
588		) -> std::result::Result<
589			crate::input::PlayerConnectedInput,
590			aws_smithy_http::operation::BuildError,
591		> {
592			Ok(crate::input::PlayerConnectedInput {
593				player_token: self.player_token,
594			})
595		}
596	}
597}
598#[doc(hidden)]
599pub type PlayerConnectedInputOperationOutputAlias = crate::operation::PlayerConnected;
600#[doc(hidden)]
601pub type PlayerConnectedInputOperationRetryAlias = ();
602impl PlayerConnectedInput {
603	/// Consumes the builder and constructs an Operation<[`PlayerConnected`](crate::operation::PlayerConnected)>
604	#[allow(unused_mut)]
605	#[allow(clippy::let_and_return)]
606	#[allow(clippy::needless_borrow)]
607	pub async fn make_operation(
608		&self,
609		_config: &crate::config::Config,
610	) -> std::result::Result<
611		aws_smithy_http::operation::Operation<crate::operation::PlayerConnected, ()>,
612		aws_smithy_http::operation::BuildError,
613	> {
614		let mut request = {
615			fn uri_base(
616				_input: &crate::input::PlayerConnectedInput,
617				output: &mut String,
618			) -> Result<(), aws_smithy_http::operation::BuildError> {
619				write!(output, "/players/connected").expect("formatting should succeed");
620				Ok(())
621			}
622			#[allow(clippy::unnecessary_wraps)]
623			fn update_http_builder(
624				input: &crate::input::PlayerConnectedInput,
625				_config: &crate::config::Config,
626				builder: http::request::Builder,
627			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
628			{
629				let mut _uri = String::new();
630				_uri = format!("{}{}", _config.uri.clone(), _uri);
631				uri_base(input, &mut _uri)?;
632				Ok(builder.method("POST").uri(_uri))
633			}
634			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
635			let mut builder = if let Some(auth) = &_config.auth {
636				builder.header(http::header::AUTHORIZATION, auth.clone())
637			} else {
638				builder
639			};
640			builder = aws_smithy_http::header::set_request_header_if_absent(
641				builder,
642				http::header::CONTENT_TYPE,
643				"application/json",
644			);
645			builder
646		};
647		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
648		#[allow(clippy::useless_conversion)]
649		let body = aws_smithy_http::body::SdkBody::from(
650			crate::operation_ser::serialize_operation_crate_operation_player_connected(&self)?,
651		);
652		if let Some(content_length) = body.content_length() {
653			request = aws_smithy_http::header::set_request_header_if_absent(
654				request,
655				http::header::CONTENT_LENGTH,
656				content_length,
657			);
658		}
659		let request = request.body(body).expect("should be valid request");
660		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
661		request
662			.properties_mut()
663			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
664		let op = aws_smithy_http::operation::Operation::new(
665			request,
666			crate::operation::PlayerConnected::new(),
667		)
668		.with_metadata(aws_smithy_http::operation::Metadata::new(
669			"PlayerConnected",
670			"MatchmakerService",
671		));
672		Ok(op)
673	}
674	/// Creates a new builder-style object to manufacture [`PlayerConnectedInput`](crate::input::PlayerConnectedInput)
675	pub fn builder() -> crate::input::player_connected_input::Builder {
676		crate::input::player_connected_input::Builder::default()
677	}
678}
679
680/// See [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput)
681pub mod player_disconnected_input {
682	/// A builder for [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput)
683	#[non_exhaustive]
684	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
685	pub struct Builder {
686		pub(crate) player_token: std::option::Option<std::string::String>,
687	}
688	impl Builder {
689		/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
690		pub fn player_token(mut self, input: impl Into<std::string::String>) -> Self {
691			self.player_token = Some(input.into());
692			self
693		}
694		/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
695		pub fn set_player_token(mut self, input: std::option::Option<std::string::String>) -> Self {
696			self.player_token = input;
697			self
698		}
699		/// Consumes the builder and constructs a [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput)
700		pub fn build(
701			self,
702		) -> std::result::Result<
703			crate::input::PlayerDisconnectedInput,
704			aws_smithy_http::operation::BuildError,
705		> {
706			Ok(crate::input::PlayerDisconnectedInput {
707				player_token: self.player_token,
708			})
709		}
710	}
711}
712#[doc(hidden)]
713pub type PlayerDisconnectedInputOperationOutputAlias = crate::operation::PlayerDisconnected;
714#[doc(hidden)]
715pub type PlayerDisconnectedInputOperationRetryAlias = ();
716impl PlayerDisconnectedInput {
717	/// Consumes the builder and constructs an Operation<[`PlayerDisconnected`](crate::operation::PlayerDisconnected)>
718	#[allow(unused_mut)]
719	#[allow(clippy::let_and_return)]
720	#[allow(clippy::needless_borrow)]
721	pub async fn make_operation(
722		&self,
723		_config: &crate::config::Config,
724	) -> std::result::Result<
725		aws_smithy_http::operation::Operation<crate::operation::PlayerDisconnected, ()>,
726		aws_smithy_http::operation::BuildError,
727	> {
728		let mut request = {
729			fn uri_base(
730				_input: &crate::input::PlayerDisconnectedInput,
731				output: &mut String,
732			) -> Result<(), aws_smithy_http::operation::BuildError> {
733				write!(output, "/players/disconnected").expect("formatting should succeed");
734				Ok(())
735			}
736			#[allow(clippy::unnecessary_wraps)]
737			fn update_http_builder(
738				input: &crate::input::PlayerDisconnectedInput,
739				_config: &crate::config::Config,
740				builder: http::request::Builder,
741			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
742			{
743				let mut _uri = String::new();
744				_uri = format!("{}{}", _config.uri.clone(), _uri);
745				uri_base(input, &mut _uri)?;
746				Ok(builder.method("POST").uri(_uri))
747			}
748			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
749			let mut builder = if let Some(auth) = &_config.auth {
750				builder.header(http::header::AUTHORIZATION, auth.clone())
751			} else {
752				builder
753			};
754			builder = aws_smithy_http::header::set_request_header_if_absent(
755				builder,
756				http::header::CONTENT_TYPE,
757				"application/json",
758			);
759			builder
760		};
761		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
762		#[allow(clippy::useless_conversion)]
763		let body = aws_smithy_http::body::SdkBody::from(
764			crate::operation_ser::serialize_operation_crate_operation_player_disconnected(&self)?,
765		);
766		if let Some(content_length) = body.content_length() {
767			request = aws_smithy_http::header::set_request_header_if_absent(
768				request,
769				http::header::CONTENT_LENGTH,
770				content_length,
771			);
772		}
773		let request = request.body(body).expect("should be valid request");
774		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
775		request
776			.properties_mut()
777			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
778		let op = aws_smithy_http::operation::Operation::new(
779			request,
780			crate::operation::PlayerDisconnected::new(),
781		)
782		.with_metadata(aws_smithy_http::operation::Metadata::new(
783			"PlayerDisconnected",
784			"MatchmakerService",
785		));
786		Ok(op)
787	}
788	/// Creates a new builder-style object to manufacture [`PlayerDisconnectedInput`](crate::input::PlayerDisconnectedInput)
789	pub fn builder() -> crate::input::player_disconnected_input::Builder {
790		crate::input::player_disconnected_input::Builder::default()
791	}
792}
793
794/// See [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput)
795pub mod set_lobby_closed_input {
796	/// A builder for [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput)
797	#[non_exhaustive]
798	#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
799	pub struct Builder {
800		pub(crate) is_closed: std::option::Option<bool>,
801	}
802	impl Builder {
803		#[allow(missing_docs)] // documentation missing in model
804		pub fn is_closed(mut self, input: bool) -> Self {
805			self.is_closed = Some(input);
806			self
807		}
808		#[allow(missing_docs)] // documentation missing in model
809		pub fn set_is_closed(mut self, input: std::option::Option<bool>) -> Self {
810			self.is_closed = input;
811			self
812		}
813		/// Consumes the builder and constructs a [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput)
814		pub fn build(
815			self,
816		) -> std::result::Result<
817			crate::input::SetLobbyClosedInput,
818			aws_smithy_http::operation::BuildError,
819		> {
820			Ok(crate::input::SetLobbyClosedInput {
821				is_closed: self.is_closed,
822			})
823		}
824	}
825}
826#[doc(hidden)]
827pub type SetLobbyClosedInputOperationOutputAlias = crate::operation::SetLobbyClosed;
828#[doc(hidden)]
829pub type SetLobbyClosedInputOperationRetryAlias = ();
830impl SetLobbyClosedInput {
831	/// Consumes the builder and constructs an Operation<[`SetLobbyClosed`](crate::operation::SetLobbyClosed)>
832	#[allow(unused_mut)]
833	#[allow(clippy::let_and_return)]
834	#[allow(clippy::needless_borrow)]
835	pub async fn make_operation(
836		&self,
837		_config: &crate::config::Config,
838	) -> std::result::Result<
839		aws_smithy_http::operation::Operation<crate::operation::SetLobbyClosed, ()>,
840		aws_smithy_http::operation::BuildError,
841	> {
842		let mut request = {
843			fn uri_base(
844				_input: &crate::input::SetLobbyClosedInput,
845				output: &mut String,
846			) -> Result<(), aws_smithy_http::operation::BuildError> {
847				write!(output, "/lobbies/closed").expect("formatting should succeed");
848				Ok(())
849			}
850			#[allow(clippy::unnecessary_wraps)]
851			fn update_http_builder(
852				input: &crate::input::SetLobbyClosedInput,
853				_config: &crate::config::Config,
854				builder: http::request::Builder,
855			) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
856			{
857				let mut _uri = String::new();
858				_uri = format!("{}{}", _config.uri.clone(), _uri);
859				uri_base(input, &mut _uri)?;
860				Ok(builder.method("PUT").uri(_uri))
861			}
862			let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
863			let mut builder = if let Some(auth) = &_config.auth {
864				builder.header(http::header::AUTHORIZATION, auth.clone())
865			} else {
866				builder
867			};
868			builder = aws_smithy_http::header::set_request_header_if_absent(
869				builder,
870				http::header::CONTENT_TYPE,
871				"application/json",
872			);
873			builder
874		};
875		let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
876		#[allow(clippy::useless_conversion)]
877		let body = aws_smithy_http::body::SdkBody::from(
878			crate::operation_ser::serialize_operation_crate_operation_set_lobby_closed(&self)?,
879		);
880		if let Some(content_length) = body.content_length() {
881			request = aws_smithy_http::header::set_request_header_if_absent(
882				request,
883				http::header::CONTENT_LENGTH,
884				content_length,
885			);
886		}
887		let request = request.body(body).expect("should be valid request");
888		let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
889		request
890			.properties_mut()
891			.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
892		let op = aws_smithy_http::operation::Operation::new(
893			request,
894			crate::operation::SetLobbyClosed::new(),
895		)
896		.with_metadata(aws_smithy_http::operation::Metadata::new(
897			"SetLobbyClosed",
898			"MatchmakerService",
899		));
900		Ok(op)
901	}
902	/// Creates a new builder-style object to manufacture [`SetLobbyClosedInput`](crate::input::SetLobbyClosedInput)
903	pub fn builder() -> crate::input::set_lobby_closed_input::Builder {
904		crate::input::set_lobby_closed_input::Builder::default()
905	}
906}
907
908#[allow(missing_docs)] // documentation missing in model
909#[non_exhaustive]
910#[derive(std::clone::Clone, std::cmp::PartialEq)]
911pub struct ListRegionsInput {}
912impl std::fmt::Debug for ListRegionsInput {
913	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
914		let mut formatter = f.debug_struct("ListRegionsInput");
915		formatter.finish()
916	}
917}
918
919#[allow(missing_docs)] // documentation missing in model
920#[non_exhaustive]
921#[derive(std::clone::Clone, std::cmp::PartialEq)]
922pub struct PlayerDisconnectedInput {
923	/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
924	pub player_token: std::option::Option<std::string::String>,
925}
926impl PlayerDisconnectedInput {
927	/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
928	pub fn player_token(&self) -> std::option::Option<&str> {
929		self.player_token.as_deref()
930	}
931}
932impl std::fmt::Debug for PlayerDisconnectedInput {
933	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
934		let mut formatter = f.debug_struct("PlayerDisconnectedInput");
935		formatter.field("player_token", &"*** Sensitive Data Redacted ***");
936		formatter.finish()
937	}
938}
939
940#[allow(missing_docs)] // documentation missing in model
941#[non_exhaustive]
942#[derive(std::clone::Clone, std::cmp::PartialEq)]
943pub struct PlayerConnectedInput {
944	/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
945	pub player_token: std::option::Option<std::string::String>,
946}
947impl PlayerConnectedInput {
948	/// A JSON Web Token. Slightly modified to include a description prefix and use Protobufs of JSON.
949	pub fn player_token(&self) -> std::option::Option<&str> {
950		self.player_token.as_deref()
951	}
952}
953impl std::fmt::Debug for PlayerConnectedInput {
954	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
955		let mut formatter = f.debug_struct("PlayerConnectedInput");
956		formatter.field("player_token", &"*** Sensitive Data Redacted ***");
957		formatter.finish()
958	}
959}
960
961#[allow(missing_docs)] // documentation missing in model
962#[non_exhaustive]
963#[derive(std::clone::Clone, std::cmp::PartialEq)]
964pub struct SetLobbyClosedInput {
965	#[allow(missing_docs)] // documentation missing in model
966	pub is_closed: std::option::Option<bool>,
967}
968impl SetLobbyClosedInput {
969	#[allow(missing_docs)] // documentation missing in model
970	pub fn is_closed(&self) -> std::option::Option<bool> {
971		self.is_closed
972	}
973}
974impl std::fmt::Debug for SetLobbyClosedInput {
975	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
976		let mut formatter = f.debug_struct("SetLobbyClosedInput");
977		formatter.field("is_closed", &self.is_closed);
978		formatter.finish()
979	}
980}
981
982#[allow(missing_docs)] // documentation missing in model
983#[non_exhaustive]
984#[derive(std::clone::Clone, std::cmp::PartialEq)]
985pub struct ListLobbiesInput {}
986impl std::fmt::Debug for ListLobbiesInput {
987	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
988		let mut formatter = f.debug_struct("ListLobbiesInput");
989		formatter.finish()
990	}
991}
992
993#[allow(missing_docs)] // documentation missing in model
994#[non_exhaustive]
995#[derive(std::clone::Clone, std::cmp::PartialEq)]
996pub struct FindLobbyInput {
997	/// Game modes to match lobbies against.
998	pub game_modes: std::option::Option<std::vec::Vec<std::string::String>>,
999	/// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region.
1000	pub regions: std::option::Option<std::vec::Vec<std::string::String>>,
1001	/// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown.
1002	pub prevent_auto_create_lobby: std::option::Option<bool>,
1003	/// Methods to verify a captcha.
1004	pub captcha: std::option::Option<crate::model::CaptchaConfig>,
1005	#[allow(missing_docs)] // documentation missing in model
1006	pub origin: std::option::Option<std::string::String>,
1007}
1008impl FindLobbyInput {
1009	/// Game modes to match lobbies against.
1010	pub fn game_modes(&self) -> std::option::Option<&[std::string::String]> {
1011		self.game_modes.as_deref()
1012	}
1013	/// Regions to match lobbies against. If not specified, the optimal region will be determined and will attempt to find lobbies in that region.
1014	pub fn regions(&self) -> std::option::Option<&[std::string::String]> {
1015		self.regions.as_deref()
1016	}
1017	/// Prevents a new lobby from being created when finding a lobby. If no lobby is found, a `MATCHMAKER_LOBBY_NOT_FOUND` error will be thrown.
1018	pub fn prevent_auto_create_lobby(&self) -> std::option::Option<bool> {
1019		self.prevent_auto_create_lobby
1020	}
1021	/// Methods to verify a captcha.
1022	pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> {
1023		self.captcha.as_ref()
1024	}
1025	#[allow(missing_docs)] // documentation missing in model
1026	pub fn origin(&self) -> std::option::Option<&str> {
1027		self.origin.as_deref()
1028	}
1029}
1030impl std::fmt::Debug for FindLobbyInput {
1031	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1032		let mut formatter = f.debug_struct("FindLobbyInput");
1033		formatter.field("game_modes", &self.game_modes);
1034		formatter.field("regions", &self.regions);
1035		formatter.field("prevent_auto_create_lobby", &self.prevent_auto_create_lobby);
1036		formatter.field("captcha", &self.captcha);
1037		formatter.field("origin", &self.origin);
1038		formatter.finish()
1039	}
1040}
1041
1042#[allow(missing_docs)] // documentation missing in model
1043#[non_exhaustive]
1044#[derive(std::clone::Clone, std::cmp::PartialEq)]
1045pub struct JoinLobbyInput {
1046	/// A universally unique identifier.
1047	pub lobby_id: std::option::Option<std::string::String>,
1048	/// Methods to verify a captcha.
1049	pub captcha: std::option::Option<crate::model::CaptchaConfig>,
1050}
1051impl JoinLobbyInput {
1052	/// A universally unique identifier.
1053	pub fn lobby_id(&self) -> std::option::Option<&str> {
1054		self.lobby_id.as_deref()
1055	}
1056	/// Methods to verify a captcha.
1057	pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> {
1058		self.captcha.as_ref()
1059	}
1060}
1061impl std::fmt::Debug for JoinLobbyInput {
1062	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1063		let mut formatter = f.debug_struct("JoinLobbyInput");
1064		formatter.field("lobby_id", &self.lobby_id);
1065		formatter.field("captcha", &self.captcha);
1066		formatter.finish()
1067	}
1068}
1069
1070#[allow(missing_docs)] // documentation missing in model
1071#[non_exhaustive]
1072#[derive(std::clone::Clone, std::cmp::PartialEq)]
1073pub struct LobbyReadyInput {}
1074impl std::fmt::Debug for LobbyReadyInput {
1075	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1076		let mut formatter = f.debug_struct("LobbyReadyInput");
1077		formatter.finish()
1078	}
1079}