aws-sdk-gamelift 1.119.0

AWS SDK for Amazon GameLift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartMatchmakingInput {
    /// <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>
    pub ticket_id: ::std::option::Option<::std::string::String>,
    /// <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>
    pub configuration_name: ::std::option::Option<::std::string::String>,
    /// <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>
    /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
    pub players: ::std::option::Option<::std::vec::Vec<crate::types::Player>>,
}
impl StartMatchmakingInput {
    /// <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>
    pub fn ticket_id(&self) -> ::std::option::Option<&str> {
        self.ticket_id.as_deref()
    }
    /// <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>
    pub fn configuration_name(&self) -> ::std::option::Option<&str> {
        self.configuration_name.as_deref()
    }
    /// <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>
    /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
    ///
    /// 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()`.
    pub fn players(&self) -> &[crate::types::Player] {
        self.players.as_deref().unwrap_or_default()
    }
}
impl StartMatchmakingInput {
    /// Creates a new builder-style object to manufacture [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
    pub fn builder() -> crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder {
        crate::operation::start_matchmaking::builders::StartMatchmakingInputBuilder::default()
    }
}

/// A builder for [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartMatchmakingInputBuilder {
    pub(crate) ticket_id: ::std::option::Option<::std::string::String>,
    pub(crate) configuration_name: ::std::option::Option<::std::string::String>,
    pub(crate) players: ::std::option::Option<::std::vec::Vec<crate::types::Player>>,
}
impl StartMatchmakingInputBuilder {
    /// <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>
    pub fn ticket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.ticket_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_ticket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.ticket_id = input;
        self
    }
    /// <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>
    pub fn get_ticket_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.ticket_id
    }
    /// <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>
    /// This field is required.
    pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.configuration_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <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>
    pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.configuration_name = input;
        self
    }
    /// <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>
    pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.configuration_name
    }
    /// Appends an item to `players`.
    ///
    /// To override the contents of this collection use [`set_players`](Self::set_players).
    ///
    /// <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>
    /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
    pub fn players(mut self, input: crate::types::Player) -> Self {
        let mut v = self.players.unwrap_or_default();
        v.push(input);
        self.players = ::std::option::Option::Some(v);
        self
    }
    /// <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>
    /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
    pub fn set_players(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Player>>) -> Self {
        self.players = input;
        self
    }
    /// <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>
    /// <p>You can include up to 10 <code>Players</code> in a <code>StartMatchmaking</code> request.</p>
    pub fn get_players(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Player>> {
        &self.players
    }
    /// Consumes the builder and constructs a [`StartMatchmakingInput`](crate::operation::start_matchmaking::StartMatchmakingInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_matchmaking::StartMatchmakingInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::start_matchmaking::StartMatchmakingInput {
            ticket_id: self.ticket_id,
            configuration_name: self.configuration_name,
            players: self.players,
        })
    }
}