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::describe_player_sessions::_describe_player_sessions_input::DescribePlayerSessionsInputBuilder;

pub use crate::operation::describe_player_sessions::_describe_player_sessions_output::DescribePlayerSessionsOutputBuilder;

impl crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_player_sessions::DescribePlayerSessionsError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.describe_player_sessions();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `DescribePlayerSessions`.
///
/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
/// <p>Retrieves properties for one or more player sessions.</p>
/// <p>This action can be used in the following ways:</p>
/// <ul>
/// <li>
/// <p>To retrieve a specific player session, provide the player session ID only.</p></li>
/// <li>
/// <p>To retrieve all player sessions in a game session, provide the game session ID only.</p></li>
/// <li>
/// <p>To retrieve all player sessions for a specific player, provide a player ID only.</p></li>
/// </ul>
/// <p>To request player sessions, specify either a player session ID, game session ID, or player ID. You can filter this request by player session status. If you provide a specific <code>PlayerSessionId</code> or <code>PlayerId</code>, Amazon GameLift Servers ignores the filter criteria. Use the pagination parameters to retrieve results as a set of sequential pages.</p>
/// <p>If successful, a <code>PlayerSession</code> object is returned for each session that matches the request.</p>
/// <p><b>Related actions</b></p>
/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct DescribePlayerSessionsFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
        crate::operation::describe_player_sessions::DescribePlayerSessionsError,
    > for DescribePlayerSessionsFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::describe_player_sessions::DescribePlayerSessionsOutput,
            crate::operation::describe_player_sessions::DescribePlayerSessionsError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl DescribePlayerSessionsFluentBuilder {
    /// Creates a new `DescribePlayerSessionsFluentBuilder`.
    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 DescribePlayerSessions as a reference.
    pub fn as_input(&self) -> &crate::operation::describe_player_sessions::builders::DescribePlayerSessionsInputBuilder {
        &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::describe_player_sessions::DescribePlayerSessionsOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::describe_player_sessions::DescribePlayerSessionsError,
            ::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::describe_player_sessions::DescribePlayerSessions::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::describe_player_sessions::DescribePlayerSessions::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::describe_player_sessions::DescribePlayerSessionsOutput,
        crate::operation::describe_player_sessions::DescribePlayerSessionsError,
        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
    }
    /// Create a paginator for this request
    ///
    /// Paginators are used by calling [`send().await`](crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
    pub fn into_paginator(self) -> crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator {
        crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator::new(self.handle, self.inner)
    }
    /// <p>An identifier for the game session that is unique across all regions to retrieve player sessions for. 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 to retrieve player sessions for. 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 to retrieve player sessions for. 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()
    }
    /// <p>A unique identifier for a player to retrieve player sessions for.</p>
    pub fn player_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.player_id(input.into());
        self
    }
    /// <p>A unique identifier for a player to retrieve player sessions for.</p>
    pub fn set_player_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_player_id(input);
        self
    }
    /// <p>A unique identifier for a player to retrieve player sessions for.</p>
    pub fn get_player_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_player_id()
    }
    /// <p>A unique identifier for a player session to retrieve.</p>
    pub fn player_session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.player_session_id(input.into());
        self
    }
    /// <p>A unique identifier for a player session to retrieve.</p>
    pub fn set_player_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_player_session_id(input);
        self
    }
    /// <p>A unique identifier for a player session to retrieve.</p>
    pub fn get_player_session_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_player_session_id()
    }
    /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
    /// <p>Possible player session statuses include the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
    /// <li>
    /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
    /// <li>
    /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
    /// </ul>
    pub fn player_session_status_filter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.player_session_status_filter(input.into());
        self
    }
    /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
    /// <p>Possible player session statuses include the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
    /// <li>
    /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
    /// <li>
    /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
    /// </ul>
    pub fn set_player_session_status_filter(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_player_session_status_filter(input);
        self
    }
    /// <p>Player session status to filter results on. Note that when a PlayerSessionId or PlayerId is provided in a DescribePlayerSessions request, then the PlayerSessionStatusFilter has no effect on the response.</p>
    /// <p>Possible player session statuses include the following:</p>
    /// <ul>
    /// <li>
    /// <p><b>RESERVED</b> -- The player session request has been received, but the player has not yet connected to the server process and/or been validated.</p></li>
    /// <li>
    /// <p><b>ACTIVE</b> -- The player has been validated by the server process and is currently connected.</p></li>
    /// <li>
    /// <p><b>COMPLETED</b> -- The player connection has been dropped.</p></li>
    /// <li>
    /// <p><b>TIMEDOUT</b> -- A player session request was received, but the player did not connect and/or was not validated within the timeout limit (60 seconds).</p></li>
    /// </ul>
    pub fn get_player_session_status_filter(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_player_session_status_filter()
    }
    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
    pub fn limit(mut self, input: i32) -> Self {
        self.inner = self.inner.limit(input);
        self
    }
    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_limit(input);
        self
    }
    /// <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages. If a player session ID is specified, this parameter is ignored.</p>
    pub fn get_limit(&self) -> &::std::option::Option<i32> {
        self.inner.get_limit()
    }
    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value. If a player session ID is specified, this parameter is ignored.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value. If a player session ID is specified, this parameter is ignored.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value. If a player session ID is specified, this parameter is ignored.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
}