Struct google_games1::api::ScoreMethods
source · pub struct ScoreMethods<'a, S>where
S: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on score resources.
It is not used directly, but through the Games
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_games1 as games1;
use std::default::Default;
use games1::{Games, oauth2, hyper, hyper_rustls, chrono, FieldMask};
let secret: oauth2::ApplicationSecret = Default::default();
let auth = oauth2::InstalledFlowAuthenticator::builder(
secret,
oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let mut hub = Games::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `get(...)`, `list(...)`, `list_window(...)`, `submit(...)` and `submit_multiple(...)`
// to build up your call.
let rb = hub.scores();
Implementations§
source§impl<'a, S> ScoreMethods<'a, S>
impl<'a, S> ScoreMethods<'a, S>
sourcepub fn get(
&self,
player_id: &str,
leaderboard_id: &str,
time_span: &str
) -> ScoreGetCall<'a, S>
pub fn get( &self, player_id: &str, leaderboard_id: &str, time_span: &str ) -> ScoreGetCall<'a, S>
Create a builder to help you perform the following task:
Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId
can be set to ALL
to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for ‘ALL’ leaderboards and ‘ALL’ timeSpans in the same request; only one parameter may be set to ‘ALL’.
§Arguments
playerId
- A player ID. A value ofme
may be used in place of the authenticated player’s ID.leaderboardId
- The ID of the leaderboard. Can be set to ‘ALL’ to retrieve data for all leaderboards for this application.timeSpan
- The time span for the scores and ranks you’re requesting.
sourcepub fn list(
&self,
leaderboard_id: &str,
collection: &str,
time_span: &str
) -> ScoreListCall<'a, S>
pub fn list( &self, leaderboard_id: &str, collection: &str, time_span: &str ) -> ScoreListCall<'a, S>
Create a builder to help you perform the following task:
Lists the scores in a leaderboard, starting from the top.
§Arguments
leaderboardId
- The ID of the leaderboard.collection
- The collection of scores you’re requesting.timeSpan
- Required. The time span for the scores and ranks you’re requesting.
sourcepub fn list_window(
&self,
leaderboard_id: &str,
collection: &str,
time_span: &str
) -> ScoreListWindowCall<'a, S>
pub fn list_window( &self, leaderboard_id: &str, collection: &str, time_span: &str ) -> ScoreListWindowCall<'a, S>
Create a builder to help you perform the following task:
Lists the scores in a leaderboard around (and including) a player’s score.
§Arguments
leaderboardId
- The ID of the leaderboard.collection
- The collection of scores you’re requesting.timeSpan
- Required. The time span for the scores and ranks you’re requesting.
sourcepub fn submit(&self, leaderboard_id: &str, score: i64) -> ScoreSubmitCall<'a, S>
pub fn submit(&self, leaderboard_id: &str, score: i64) -> ScoreSubmitCall<'a, S>
Create a builder to help you perform the following task:
Submits a score to the specified leaderboard.
§Arguments
leaderboardId
- The ID of the leaderboard.score
- Required. The score you’re submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.
sourcepub fn submit_multiple(
&self,
request: PlayerScoreSubmissionList
) -> ScoreSubmitMultipleCall<'a, S>
pub fn submit_multiple( &self, request: PlayerScoreSubmissionList ) -> ScoreSubmitMultipleCall<'a, S>
Create a builder to help you perform the following task:
Submits multiple scores to leaderboards.
§Arguments
request
- No description provided.