{-# 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.Create
(
TurnBasedMatchesCreateResource
, turnBasedMatchesCreate
, TurnBasedMatchesCreate
, tbmcPayload
, tbmcLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type TurnBasedMatchesCreateResource =
"games" :>
"v1" :>
"turnbasedmatches" :>
"create" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] TurnBasedMatchCreateRequest :>
Post '[JSON] TurnBasedMatch
data TurnBasedMatchesCreate = TurnBasedMatchesCreate'
{ _tbmcPayload :: !TurnBasedMatchCreateRequest
, _tbmcLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
turnBasedMatchesCreate
:: TurnBasedMatchCreateRequest
-> TurnBasedMatchesCreate
turnBasedMatchesCreate pTbmcPayload_ =
TurnBasedMatchesCreate'
{ _tbmcPayload = pTbmcPayload_
, _tbmcLanguage = Nothing
}
tbmcPayload :: Lens' TurnBasedMatchesCreate TurnBasedMatchCreateRequest
tbmcPayload
= lens _tbmcPayload (\ s a -> s{_tbmcPayload = a})
tbmcLanguage :: Lens' TurnBasedMatchesCreate (Maybe Text)
tbmcLanguage
= lens _tbmcLanguage (\ s a -> s{_tbmcLanguage = a})
instance GoogleRequest TurnBasedMatchesCreate where
type Rs TurnBasedMatchesCreate = TurnBasedMatch
type Scopes TurnBasedMatchesCreate =
'["https://www.googleapis.com/auth/games"]
requestClient TurnBasedMatchesCreate'{..}
= go _tbmcLanguage (Just AltJSON) _tbmcPayload
gamesService
where go
= buildClient
(Proxy :: Proxy TurnBasedMatchesCreateResource)
mempty