aws-sdk-gamelift 0.26.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_output::DescribePlayerSessionsOutputBuilder;

pub use crate::operation::describe_player_sessions::_describe_player_sessions_input::DescribePlayerSessionsInputBuilder;

/// Fluent builder constructing a request to `DescribePlayerSessions`.
///
/// <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. 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,
}
impl DescribePlayerSessionsFluentBuilder {
    /// Creates a new `DescribePlayerSessions`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::describe_player_sessions::DescribePlayerSessions,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::describe_player_sessions::DescribePlayerSessionsError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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_http::result::SdkError<
            crate::operation::describe_player_sessions::DescribePlayerSessionsError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// Create a paginator for this request
    ///
    /// Paginators are used by calling [`send().await`](crate::operation::describe_player_sessions::paginator::DescribePlayerSessionsPaginator::send) which returns a `Stream`.
    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>A unique identifier for the game session to retrieve player sessions for.</p>
    pub fn game_session_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.game_session_id(input.into());
        self
    }
    /// <p>A unique identifier for the game session to retrieve player sessions for.</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>A unique identifier for a player to retrieve player sessions for.</p>
    pub fn player_id(mut self, input: impl 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 session to retrieve.</p>
    pub fn player_session_id(mut self, input: impl 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>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 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>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>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 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
    }
}