use std::fmt::Write;
pub mod find_lobby_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) game_modes: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) regions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) prevent_auto_create_lobby: std::option::Option<bool>,
pub(crate) captcha: std::option::Option<crate::model::CaptchaConfig>,
pub(crate) origin: std::option::Option<std::string::String>,
}
impl Builder {
pub fn game_modes(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.game_modes.unwrap_or_default();
v.push(input.into());
self.game_modes = Some(v);
self
}
pub fn set_game_modes(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.game_modes = input;
self
}
pub fn regions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.regions.unwrap_or_default();
v.push(input.into());
self.regions = Some(v);
self
}
pub fn set_regions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.regions = input;
self
}
pub fn prevent_auto_create_lobby(mut self, input: bool) -> Self {
self.prevent_auto_create_lobby = Some(input);
self
}
pub fn set_prevent_auto_create_lobby(mut self, input: std::option::Option<bool>) -> Self {
self.prevent_auto_create_lobby = input;
self
}
pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self {
self.captcha = Some(input);
self
}
pub fn set_captcha(
mut self,
input: std::option::Option<crate::model::CaptchaConfig>,
) -> Self {
self.captcha = input;
self
}
#[allow(missing_docs)] pub fn origin(mut self, input: impl Into<std::string::String>) -> Self {
self.origin = Some(input.into());
self
}
#[allow(missing_docs)] pub fn set_origin(mut self, input: std::option::Option<std::string::String>) -> Self {
self.origin = input;
self
}
pub fn build(
self,
) -> std::result::Result<crate::input::FindLobbyInput, aws_smithy_http::operation::BuildError>
{
Ok(crate::input::FindLobbyInput {
game_modes: self.game_modes,
regions: self.regions,
prevent_auto_create_lobby: self.prevent_auto_create_lobby,
captcha: self.captcha,
origin: self.origin,
})
}
}
}
#[doc(hidden)]
pub type FindLobbyInputOperationOutputAlias = crate::operation::FindLobby;
#[doc(hidden)]
pub type FindLobbyInputOperationRetryAlias = ();
impl FindLobbyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::FindLobby, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::FindLobbyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/lobbies/find").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::FindLobbyInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
let builder = crate::http_serde::add_headers_find_lobby(input, builder)?;
Ok(builder.method("POST").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_find_lobby(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::FindLobby::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"FindLobby",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::find_lobby_input::Builder {
crate::input::find_lobby_input::Builder::default()
}
}
pub mod join_lobby_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) lobby_id: std::option::Option<std::string::String>,
pub(crate) captcha: std::option::Option<crate::model::CaptchaConfig>,
}
impl Builder {
pub fn lobby_id(mut self, input: impl Into<std::string::String>) -> Self {
self.lobby_id = Some(input.into());
self
}
pub fn set_lobby_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.lobby_id = input;
self
}
pub fn captcha(mut self, input: crate::model::CaptchaConfig) -> Self {
self.captcha = Some(input);
self
}
pub fn set_captcha(
mut self,
input: std::option::Option<crate::model::CaptchaConfig>,
) -> Self {
self.captcha = input;
self
}
pub fn build(
self,
) -> std::result::Result<crate::input::JoinLobbyInput, aws_smithy_http::operation::BuildError>
{
Ok(crate::input::JoinLobbyInput {
lobby_id: self.lobby_id,
captcha: self.captcha,
})
}
}
}
#[doc(hidden)]
pub type JoinLobbyInputOperationOutputAlias = crate::operation::JoinLobby;
#[doc(hidden)]
pub type JoinLobbyInputOperationRetryAlias = ();
impl JoinLobbyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::JoinLobby, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::JoinLobbyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/lobbies/join").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::JoinLobbyInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("POST").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_join_lobby(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::JoinLobby::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"JoinLobby",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::join_lobby_input::Builder {
crate::input::join_lobby_input::Builder::default()
}
}
pub mod list_lobbies_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> std::result::Result<
crate::input::ListLobbiesInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListLobbiesInput {})
}
}
}
#[doc(hidden)]
pub type ListLobbiesInputOperationOutputAlias = crate::operation::ListLobbies;
#[doc(hidden)]
pub type ListLobbiesInputOperationRetryAlias = ();
impl ListLobbiesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::ListLobbies, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::ListLobbiesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/lobbies/list").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListLobbiesInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("GET").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListLobbies::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListLobbies",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::list_lobbies_input::Builder {
crate::input::list_lobbies_input::Builder::default()
}
}
pub mod list_regions_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> std::result::Result<
crate::input::ListRegionsInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::ListRegionsInput {})
}
}
}
#[doc(hidden)]
pub type ListRegionsInputOperationOutputAlias = crate::operation::ListRegions;
#[doc(hidden)]
pub type ListRegionsInputOperationRetryAlias = ();
impl ListRegionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::ListRegions, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::ListRegionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/regions").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListRegionsInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("GET").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListRegions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListRegions",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::list_regions_input::Builder {
crate::input::list_regions_input::Builder::default()
}
}
pub mod lobby_ready_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> std::result::Result<
crate::input::LobbyReadyInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::LobbyReadyInput {})
}
}
}
#[doc(hidden)]
pub type LobbyReadyInputOperationOutputAlias = crate::operation::LobbyReady;
#[doc(hidden)]
pub type LobbyReadyInputOperationRetryAlias = ();
impl LobbyReadyInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::LobbyReady, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::LobbyReadyInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/lobbies/ready").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::LobbyReadyInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("POST").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("{}");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::LobbyReady::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"LobbyReady",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::lobby_ready_input::Builder {
crate::input::lobby_ready_input::Builder::default()
}
}
pub mod player_connected_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) player_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn player_token(mut self, input: impl Into<std::string::String>) -> Self {
self.player_token = Some(input.into());
self
}
pub fn set_player_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.player_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::PlayerConnectedInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::PlayerConnectedInput {
player_token: self.player_token,
})
}
}
}
#[doc(hidden)]
pub type PlayerConnectedInputOperationOutputAlias = crate::operation::PlayerConnected;
#[doc(hidden)]
pub type PlayerConnectedInputOperationRetryAlias = ();
impl PlayerConnectedInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::PlayerConnected, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::PlayerConnectedInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/players/connected").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PlayerConnectedInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("POST").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_player_connected(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PlayerConnected::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PlayerConnected",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::player_connected_input::Builder {
crate::input::player_connected_input::Builder::default()
}
}
pub mod player_disconnected_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) player_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn player_token(mut self, input: impl Into<std::string::String>) -> Self {
self.player_token = Some(input.into());
self
}
pub fn set_player_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.player_token = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::PlayerDisconnectedInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::PlayerDisconnectedInput {
player_token: self.player_token,
})
}
}
}
#[doc(hidden)]
pub type PlayerDisconnectedInputOperationOutputAlias = crate::operation::PlayerDisconnected;
#[doc(hidden)]
pub type PlayerDisconnectedInputOperationRetryAlias = ();
impl PlayerDisconnectedInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::PlayerDisconnected, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::PlayerDisconnectedInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/players/disconnected").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PlayerDisconnectedInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("POST").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_player_disconnected(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::PlayerDisconnected::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PlayerDisconnected",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::player_disconnected_input::Builder {
crate::input::player_disconnected_input::Builder::default()
}
}
pub mod set_lobby_closed_input {
#[non_exhaustive]
#[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Builder {
pub(crate) is_closed: std::option::Option<bool>,
}
impl Builder {
#[allow(missing_docs)] pub fn is_closed(mut self, input: bool) -> Self {
self.is_closed = Some(input);
self
}
#[allow(missing_docs)] pub fn set_is_closed(mut self, input: std::option::Option<bool>) -> Self {
self.is_closed = input;
self
}
pub fn build(
self,
) -> std::result::Result<
crate::input::SetLobbyClosedInput,
aws_smithy_http::operation::BuildError,
> {
Ok(crate::input::SetLobbyClosedInput {
is_closed: self.is_closed,
})
}
}
}
#[doc(hidden)]
pub type SetLobbyClosedInputOperationOutputAlias = crate::operation::SetLobbyClosed;
#[doc(hidden)]
pub type SetLobbyClosedInputOperationRetryAlias = ();
impl SetLobbyClosedInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<crate::operation::SetLobbyClosed, ()>,
aws_smithy_http::operation::BuildError,
> {
let mut request = {
fn uri_base(
_input: &crate::input::SetLobbyClosedInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::BuildError> {
write!(output, "/lobbies/closed").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetLobbyClosedInput,
_config: &crate::config::Config,
builder: http::request::Builder,
) -> std::result::Result<http::request::Builder, aws_smithy_http::operation::BuildError>
{
let mut _uri = String::new();
_uri = format!("{}{}", _config.uri.clone(), _uri);
uri_base(input, &mut _uri)?;
Ok(builder.method("PUT").uri(_uri))
}
let mut builder = update_http_builder(&self, _config, http::request::Builder::new())?;
let mut builder = if let Some(auth) = &_config.auth {
builder.header(http::header::AUTHORIZATION, auth.clone())
} else {
builder
};
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_set_lobby_closed(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SetLobbyClosed::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetLobbyClosed",
"MatchmakerService",
));
Ok(op)
}
pub fn builder() -> crate::input::set_lobby_closed_input::Builder {
crate::input::set_lobby_closed_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListRegionsInput {}
impl std::fmt::Debug for ListRegionsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListRegionsInput");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PlayerDisconnectedInput {
pub player_token: std::option::Option<std::string::String>,
}
impl PlayerDisconnectedInput {
pub fn player_token(&self) -> std::option::Option<&str> {
self.player_token.as_deref()
}
}
impl std::fmt::Debug for PlayerDisconnectedInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PlayerDisconnectedInput");
formatter.field("player_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct PlayerConnectedInput {
pub player_token: std::option::Option<std::string::String>,
}
impl PlayerConnectedInput {
pub fn player_token(&self) -> std::option::Option<&str> {
self.player_token.as_deref()
}
}
impl std::fmt::Debug for PlayerConnectedInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("PlayerConnectedInput");
formatter.field("player_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SetLobbyClosedInput {
#[allow(missing_docs)] pub is_closed: std::option::Option<bool>,
}
impl SetLobbyClosedInput {
#[allow(missing_docs)] pub fn is_closed(&self) -> std::option::Option<bool> {
self.is_closed
}
}
impl std::fmt::Debug for SetLobbyClosedInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SetLobbyClosedInput");
formatter.field("is_closed", &self.is_closed);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListLobbiesInput {}
impl std::fmt::Debug for ListLobbiesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListLobbiesInput");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FindLobbyInput {
pub game_modes: std::option::Option<std::vec::Vec<std::string::String>>,
pub regions: std::option::Option<std::vec::Vec<std::string::String>>,
pub prevent_auto_create_lobby: std::option::Option<bool>,
pub captcha: std::option::Option<crate::model::CaptchaConfig>,
#[allow(missing_docs)] pub origin: std::option::Option<std::string::String>,
}
impl FindLobbyInput {
pub fn game_modes(&self) -> std::option::Option<&[std::string::String]> {
self.game_modes.as_deref()
}
pub fn regions(&self) -> std::option::Option<&[std::string::String]> {
self.regions.as_deref()
}
pub fn prevent_auto_create_lobby(&self) -> std::option::Option<bool> {
self.prevent_auto_create_lobby
}
pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> {
self.captcha.as_ref()
}
#[allow(missing_docs)] pub fn origin(&self) -> std::option::Option<&str> {
self.origin.as_deref()
}
}
impl std::fmt::Debug for FindLobbyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("FindLobbyInput");
formatter.field("game_modes", &self.game_modes);
formatter.field("regions", &self.regions);
formatter.field("prevent_auto_create_lobby", &self.prevent_auto_create_lobby);
formatter.field("captcha", &self.captcha);
formatter.field("origin", &self.origin);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct JoinLobbyInput {
pub lobby_id: std::option::Option<std::string::String>,
pub captcha: std::option::Option<crate::model::CaptchaConfig>,
}
impl JoinLobbyInput {
pub fn lobby_id(&self) -> std::option::Option<&str> {
self.lobby_id.as_deref()
}
pub fn captcha(&self) -> std::option::Option<&crate::model::CaptchaConfig> {
self.captcha.as_ref()
}
}
impl std::fmt::Debug for JoinLobbyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("JoinLobbyInput");
formatter.field("lobby_id", &self.lobby_id);
formatter.field("captcha", &self.captcha);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct LobbyReadyInput {}
impl std::fmt::Debug for LobbyReadyInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("LobbyReadyInput");
formatter.finish()
}
}