{-# 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.Submit
(
ScoresSubmitResource
, scoresSubmit
, ScoresSubmit
, ssScoreTag
, ssScore
, ssLeaderboardId
, ssLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type ScoresSubmitResource =
"games" :>
"v1" :>
"leaderboards" :>
Capture "leaderboardId" Text :>
"scores" :>
QueryParam "score" (Textual Int64) :>
QueryParam "scoreTag" Text :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
Post '[JSON] PlayerScoreResponse
data ScoresSubmit = ScoresSubmit'
{ _ssScoreTag :: !(Maybe Text)
, _ssScore :: !(Textual Int64)
, _ssLeaderboardId :: !Text
, _ssLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
scoresSubmit
:: Int64
-> Text
-> ScoresSubmit
scoresSubmit pSsScore_ pSsLeaderboardId_ =
ScoresSubmit'
{ _ssScoreTag = Nothing
, _ssScore = _Coerce # pSsScore_
, _ssLeaderboardId = pSsLeaderboardId_
, _ssLanguage = Nothing
}
ssScoreTag :: Lens' ScoresSubmit (Maybe Text)
ssScoreTag
= lens _ssScoreTag (\ s a -> s{_ssScoreTag = a})
ssScore :: Lens' ScoresSubmit Int64
ssScore
= lens _ssScore (\ s a -> s{_ssScore = a}) . _Coerce
ssLeaderboardId :: Lens' ScoresSubmit Text
ssLeaderboardId
= lens _ssLeaderboardId
(\ s a -> s{_ssLeaderboardId = a})
ssLanguage :: Lens' ScoresSubmit (Maybe Text)
ssLanguage
= lens _ssLanguage (\ s a -> s{_ssLanguage = a})
instance GoogleRequest ScoresSubmit where
type Rs ScoresSubmit = PlayerScoreResponse
type Scopes ScoresSubmit =
'["https://www.googleapis.com/auth/games"]
requestClient ScoresSubmit'{..}
= go _ssLeaderboardId (Just _ssScore) _ssScoreTag
_ssLanguage
(Just AltJSON)
gamesService
where go
= buildClient (Proxy :: Proxy ScoresSubmitResource)
mempty