{-# 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.Rooms.Create
(
RoomsCreateResource
, roomsCreate
, RoomsCreate
, rcPayload
, rcLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type RoomsCreateResource =
"games" :>
"v1" :>
"rooms" :>
"create" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RoomCreateRequest :>
Post '[JSON] Room
data RoomsCreate = RoomsCreate'
{ _rcPayload :: !RoomCreateRequest
, _rcLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
roomsCreate
:: RoomCreateRequest
-> RoomsCreate
roomsCreate pRcPayload_ =
RoomsCreate'
{ _rcPayload = pRcPayload_
, _rcLanguage = Nothing
}
rcPayload :: Lens' RoomsCreate RoomCreateRequest
rcPayload
= lens _rcPayload (\ s a -> s{_rcPayload = a})
rcLanguage :: Lens' RoomsCreate (Maybe Text)
rcLanguage
= lens _rcLanguage (\ s a -> s{_rcLanguage = a})
instance GoogleRequest RoomsCreate where
type Rs RoomsCreate = Room
type Scopes RoomsCreate =
'["https://www.googleapis.com/auth/games"]
requestClient RoomsCreate'{..}
= go _rcLanguage (Just AltJSON) _rcPayload
gamesService
where go
= buildClient (Proxy :: Proxy RoomsCreateResource)
mempty