{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.Games.Scores.Get
(
ScoresGetResource
, scoresGet
, ScoresGet
, sgTimeSpan
, sgLeaderboardId
, sgIncludeRankType
, sgLanguage
, sgPageToken
, sgPlayerId
, sgMaxResults
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type ScoresGetResource =
"games" :>
"v1" :>
"players" :>
Capture "playerId" Text :>
"leaderboards" :>
Capture "leaderboardId" Text :>
"scores" :>
Capture "timeSpan" ScoresGetTimeSpan :>
QueryParam "includeRankType" ScoresGetIncludeRankType
:>
QueryParam "language" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Int32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] PlayerLeaderboardScoreListResponse
data ScoresGet = ScoresGet'
{ _sgTimeSpan :: !ScoresGetTimeSpan
, _sgLeaderboardId :: !Text
, _sgIncludeRankType :: !(Maybe ScoresGetIncludeRankType)
, _sgLanguage :: !(Maybe Text)
, _sgPageToken :: !(Maybe Text)
, _sgPlayerId :: !Text
, _sgMaxResults :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
scoresGet
:: ScoresGetTimeSpan
-> Text
-> Text
-> ScoresGet
scoresGet pSgTimeSpan_ pSgLeaderboardId_ pSgPlayerId_ =
ScoresGet'
{ _sgTimeSpan = pSgTimeSpan_
, _sgLeaderboardId = pSgLeaderboardId_
, _sgIncludeRankType = Nothing
, _sgLanguage = Nothing
, _sgPageToken = Nothing
, _sgPlayerId = pSgPlayerId_
, _sgMaxResults = Nothing
}
sgTimeSpan :: Lens' ScoresGet ScoresGetTimeSpan
sgTimeSpan
= lens _sgTimeSpan (\ s a -> s{_sgTimeSpan = a})
sgLeaderboardId :: Lens' ScoresGet Text
sgLeaderboardId
= lens _sgLeaderboardId
(\ s a -> s{_sgLeaderboardId = a})
sgIncludeRankType :: Lens' ScoresGet (Maybe ScoresGetIncludeRankType)
sgIncludeRankType
= lens _sgIncludeRankType
(\ s a -> s{_sgIncludeRankType = a})
sgLanguage :: Lens' ScoresGet (Maybe Text)
sgLanguage
= lens _sgLanguage (\ s a -> s{_sgLanguage = a})
sgPageToken :: Lens' ScoresGet (Maybe Text)
sgPageToken
= lens _sgPageToken (\ s a -> s{_sgPageToken = a})
sgPlayerId :: Lens' ScoresGet Text
sgPlayerId
= lens _sgPlayerId (\ s a -> s{_sgPlayerId = a})
sgMaxResults :: Lens' ScoresGet (Maybe Int32)
sgMaxResults
= lens _sgMaxResults (\ s a -> s{_sgMaxResults = a})
. mapping _Coerce
instance GoogleRequest ScoresGet where
type Rs ScoresGet =
PlayerLeaderboardScoreListResponse
type Scopes ScoresGet =
'["https://www.googleapis.com/auth/games"]
requestClient ScoresGet'{..}
= go _sgPlayerId _sgLeaderboardId _sgTimeSpan
_sgIncludeRankType
_sgLanguage
_sgPageToken
_sgMaxResults
(Just AltJSON)
gamesService
where go
= buildClient (Proxy :: Proxy ScoresGetResource)
mempty