{-# 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.Leaderboards.Get
(
LeaderboardsGetResource
, leaderboardsGet
, LeaderboardsGet
, lgLeaderboardId
, lgLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type LeaderboardsGetResource =
"games" :>
"v1" :>
"leaderboards" :>
Capture "leaderboardId" Text :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :> Get '[JSON] Leaderboard
data LeaderboardsGet = LeaderboardsGet'
{ _lgLeaderboardId :: !Text
, _lgLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
leaderboardsGet
:: Text
-> LeaderboardsGet
leaderboardsGet pLgLeaderboardId_ =
LeaderboardsGet'
{ _lgLeaderboardId = pLgLeaderboardId_
, _lgLanguage = Nothing
}
lgLeaderboardId :: Lens' LeaderboardsGet Text
lgLeaderboardId
= lens _lgLeaderboardId
(\ s a -> s{_lgLeaderboardId = a})
lgLanguage :: Lens' LeaderboardsGet (Maybe Text)
lgLanguage
= lens _lgLanguage (\ s a -> s{_lgLanguage = a})
instance GoogleRequest LeaderboardsGet where
type Rs LeaderboardsGet = Leaderboard
type Scopes LeaderboardsGet =
'["https://www.googleapis.com/auth/games"]
requestClient LeaderboardsGet'{..}
= go _lgLeaderboardId _lgLanguage (Just AltJSON)
gamesService
where go
= buildClient
(Proxy :: Proxy LeaderboardsGetResource)
mempty