{-# 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.LeaveTurn
(
TurnBasedMatchesLeaveTurnResource
, turnBasedMatchesLeaveTurn
, TurnBasedMatchesLeaveTurn
, tbmltLanguage
, tbmltPendingParticipantId
, tbmltMatchId
, tbmltMatchVersion
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type TurnBasedMatchesLeaveTurnResource =
"games" :>
"v1" :>
"turnbasedmatches" :>
Capture "matchId" Text :>
"leaveTurn" :>
QueryParam "matchVersion" (Textual Int32) :>
QueryParam "language" Text :>
QueryParam "pendingParticipantId" Text :>
QueryParam "alt" AltJSON :>
Put '[JSON] TurnBasedMatch
data TurnBasedMatchesLeaveTurn = TurnBasedMatchesLeaveTurn'
{ _tbmltLanguage :: !(Maybe Text)
, _tbmltPendingParticipantId :: !(Maybe Text)
, _tbmltMatchId :: !Text
, _tbmltMatchVersion :: !(Textual Int32)
} deriving (Eq,Show,Data,Typeable,Generic)
turnBasedMatchesLeaveTurn
:: Text
-> Int32
-> TurnBasedMatchesLeaveTurn
turnBasedMatchesLeaveTurn pTbmltMatchId_ pTbmltMatchVersion_ =
TurnBasedMatchesLeaveTurn'
{ _tbmltLanguage = Nothing
, _tbmltPendingParticipantId = Nothing
, _tbmltMatchId = pTbmltMatchId_
, _tbmltMatchVersion = _Coerce # pTbmltMatchVersion_
}
tbmltLanguage :: Lens' TurnBasedMatchesLeaveTurn (Maybe Text)
tbmltLanguage
= lens _tbmltLanguage
(\ s a -> s{_tbmltLanguage = a})
tbmltPendingParticipantId :: Lens' TurnBasedMatchesLeaveTurn (Maybe Text)
tbmltPendingParticipantId
= lens _tbmltPendingParticipantId
(\ s a -> s{_tbmltPendingParticipantId = a})
tbmltMatchId :: Lens' TurnBasedMatchesLeaveTurn Text
tbmltMatchId
= lens _tbmltMatchId (\ s a -> s{_tbmltMatchId = a})
tbmltMatchVersion :: Lens' TurnBasedMatchesLeaveTurn Int32
tbmltMatchVersion
= lens _tbmltMatchVersion
(\ s a -> s{_tbmltMatchVersion = a})
. _Coerce
instance GoogleRequest TurnBasedMatchesLeaveTurn
where
type Rs TurnBasedMatchesLeaveTurn = TurnBasedMatch
type Scopes TurnBasedMatchesLeaveTurn =
'["https://www.googleapis.com/auth/games"]
requestClient TurnBasedMatchesLeaveTurn'{..}
= go _tbmltMatchId (Just _tbmltMatchVersion)
_tbmltLanguage
_tbmltPendingParticipantId
(Just AltJSON)
gamesService
where go
= buildClient
(Proxy :: Proxy TurnBasedMatchesLeaveTurnResource)
mempty