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.
pub use crate::operation::get_player_connection_details::_get_player_connection_details_input::GetPlayerConnectionDetailsInputBuilder;

pub use crate::operation::get_player_connection_details::_get_player_connection_details_output::GetPlayerConnectionDetailsOutputBuilder;

impl crate::operation::get_player_connection_details::builders::GetPlayerConnectionDetailsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_player_connection_details::GetPlayerConnectionDetailsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.get_player_connection_details();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `GetPlayerConnectionDetails`.
///
/// <p><b>This API works with the following fleet types:</b> EC2 (server SDK 5.x or later), Container</p>
/// <p>Retrieves connection details for game clients to connect to game sessions.</p>
/// <p><b>Player gateway benefits:</b> DDoS protection with negligible impact to latency.</p>
/// <p>To enable player gateway on your fleet, set <code>PlayerGatewayMode</code> to <code>ENABLED</code> or <code>REQUIRED</code> when calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateFleet.html">CreateFleet</a> or <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateContainerFleet.html">CreateContainerFleet</a>.</p>
/// <p><b>How to use:</b> After creating a game session and adding players, call this operation with the game session ID and player IDs. When player gateway is enabled, the response includes connection endpoints and player gateway tokens that your game clients can use to connect to the game session through player gateway. To learn more about player gateway integration, see <a href="https://docs.aws.amazon.com/gameliftservers/latest/developerguide/ddos-protection-intro.html">DDoS protection with Amazon GameLift Servers player gateway</a>.</p>
/// <p>When player gateway is disabled or in locations where player gateway is not supported, this operation returns game server connection information without player gateway tokens, so that your game clients directly connect to the game server endpoint.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetPlayerConnectionDetailsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::get_player_connection_details::builders::GetPlayerConnectionDetailsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsOutput,
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsError,
    > for GetPlayerConnectionDetailsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::get_player_connection_details::GetPlayerConnectionDetailsOutput,
            crate::operation::get_player_connection_details::GetPlayerConnectionDetailsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl GetPlayerConnectionDetailsFluentBuilder {
    /// Creates a new `GetPlayerConnectionDetailsFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the GetPlayerConnectionDetails as a reference.
    pub fn as_input(&self) -> &crate::operation::get_player_connection_details::builders::GetPlayerConnectionDetailsInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::get_player_connection_details::GetPlayerConnectionDetailsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::get_player_connection_details::GetPlayerConnectionDetails::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::get_player_connection_details::GetPlayerConnectionDetails::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsOutput,
        crate::operation::get_player_connection_details::GetPlayerConnectionDetailsError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>An identifier for the game session that is unique across all regions for which to retrieve player connection details. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn game_session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.game_session_id(input.into());
        self
    }
    /// <p>An identifier for the game session that is unique across all regions for which to retrieve player connection details. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn set_game_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_game_session_id(input);
        self
    }
    /// <p>An identifier for the game session that is unique across all regions for which to retrieve player connection details. The value is always a full ARN in the following format: For Home Region game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <id string></id>
    /// </fleet>
    /// </home_region></code>. For Remote Location game session - <code>arn:aws:gamelift:<home_region>
    /// ::gamesession/
    /// <fleet id>
    /// /
    /// <location>
    /// /
    /// <id string></id>
    /// </location>
    /// </fleet>
    /// </home_region></code>.</p>
    pub fn get_game_session_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_game_session_id()
    }
    ///
    /// Appends an item to `PlayerIds`.
    ///
    /// To override the contents of this collection use [`set_player_ids`](Self::set_player_ids).
    ///
    /// <p>List of unique identifiers for players. Connection details are returned for each player in this list.</p>
    pub fn player_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.player_ids(input.into());
        self
    }
    /// <p>List of unique identifiers for players. Connection details are returned for each player in this list.</p>
    pub fn set_player_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.inner = self.inner.set_player_ids(input);
        self
    }
    /// <p>List of unique identifiers for players. Connection details are returned for each player in this list.</p>
    pub fn get_player_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        self.inner.get_player_ids()
    }
}