{-# 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.TurnBasedMatches.TakeTurn
(
TurnBasedMatchesTakeTurnResource
, turnBasedMatchesTakeTurn
, TurnBasedMatchesTakeTurn
, tbmttPayload
, tbmttLanguage
, tbmttMatchId
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type TurnBasedMatchesTakeTurnResource =
"games" :>
"v1" :>
"turnbasedmatches" :>
Capture "matchId" Text :>
"turn" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TurnBasedMatchTurn :>
Put '[JSON] TurnBasedMatch
data TurnBasedMatchesTakeTurn = TurnBasedMatchesTakeTurn'
{ _tbmttPayload :: !TurnBasedMatchTurn
, _tbmttLanguage :: !(Maybe Text)
, _tbmttMatchId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
turnBasedMatchesTakeTurn
:: TurnBasedMatchTurn
-> Text
-> TurnBasedMatchesTakeTurn
turnBasedMatchesTakeTurn pTbmttPayload_ pTbmttMatchId_ =
TurnBasedMatchesTakeTurn'
{ _tbmttPayload = pTbmttPayload_
, _tbmttLanguage = Nothing
, _tbmttMatchId = pTbmttMatchId_
}
tbmttPayload :: Lens' TurnBasedMatchesTakeTurn TurnBasedMatchTurn
tbmttPayload
= lens _tbmttPayload (\ s a -> s{_tbmttPayload = a})
tbmttLanguage :: Lens' TurnBasedMatchesTakeTurn (Maybe Text)
tbmttLanguage
= lens _tbmttLanguage
(\ s a -> s{_tbmttLanguage = a})
tbmttMatchId :: Lens' TurnBasedMatchesTakeTurn Text
tbmttMatchId
= lens _tbmttMatchId (\ s a -> s{_tbmttMatchId = a})
instance GoogleRequest TurnBasedMatchesTakeTurn where
type Rs TurnBasedMatchesTakeTurn = TurnBasedMatch
type Scopes TurnBasedMatchesTakeTurn =
'["https://www.googleapis.com/auth/games"]
requestClient TurnBasedMatchesTakeTurn'{..}
= go _tbmttMatchId _tbmttLanguage (Just AltJSON)
_tbmttPayload
gamesService
where go
= buildClient
(Proxy :: Proxy TurnBasedMatchesTakeTurnResource)
mempty