{-# 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.Finish
(
TurnBasedMatchesFinishResource
, turnBasedMatchesFinish
, TurnBasedMatchesFinish
, tbmfPayload
, tbmfLanguage
, tbmfMatchId
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type TurnBasedMatchesFinishResource =
"games" :>
"v1" :>
"turnbasedmatches" :>
Capture "matchId" Text :>
"finish" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TurnBasedMatchResults :>
Put '[JSON] TurnBasedMatch
data TurnBasedMatchesFinish = TurnBasedMatchesFinish'
{ _tbmfPayload :: !TurnBasedMatchResults
, _tbmfLanguage :: !(Maybe Text)
, _tbmfMatchId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
turnBasedMatchesFinish
:: TurnBasedMatchResults
-> Text
-> TurnBasedMatchesFinish
turnBasedMatchesFinish pTbmfPayload_ pTbmfMatchId_ =
TurnBasedMatchesFinish'
{ _tbmfPayload = pTbmfPayload_
, _tbmfLanguage = Nothing
, _tbmfMatchId = pTbmfMatchId_
}
tbmfPayload :: Lens' TurnBasedMatchesFinish TurnBasedMatchResults
tbmfPayload
= lens _tbmfPayload (\ s a -> s{_tbmfPayload = a})
tbmfLanguage :: Lens' TurnBasedMatchesFinish (Maybe Text)
tbmfLanguage
= lens _tbmfLanguage (\ s a -> s{_tbmfLanguage = a})
tbmfMatchId :: Lens' TurnBasedMatchesFinish Text
tbmfMatchId
= lens _tbmfMatchId (\ s a -> s{_tbmfMatchId = a})
instance GoogleRequest TurnBasedMatchesFinish where
type Rs TurnBasedMatchesFinish = TurnBasedMatch
type Scopes TurnBasedMatchesFinish =
'["https://www.googleapis.com/auth/games"]
requestClient TurnBasedMatchesFinish'{..}
= go _tbmfMatchId _tbmfLanguage (Just AltJSON)
_tbmfPayload
gamesService
where go
= buildClient
(Proxy :: Proxy TurnBasedMatchesFinishResource)
mempty