{-# 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.Leave
(
RoomsLeaveResource
, roomsLeave
, RoomsLeave
, rlPayload
, rlRoomId
, rlLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type RoomsLeaveResource =
"games" :>
"v1" :>
"rooms" :>
Capture "roomId" Text :>
"leave" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RoomLeaveRequest :> Post '[JSON] Room
data RoomsLeave = RoomsLeave'
{ _rlPayload :: !RoomLeaveRequest
, _rlRoomId :: !Text
, _rlLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
roomsLeave
:: RoomLeaveRequest
-> Text
-> RoomsLeave
roomsLeave pRlPayload_ pRlRoomId_ =
RoomsLeave'
{ _rlPayload = pRlPayload_
, _rlRoomId = pRlRoomId_
, _rlLanguage = Nothing
}
rlPayload :: Lens' RoomsLeave RoomLeaveRequest
rlPayload
= lens _rlPayload (\ s a -> s{_rlPayload = a})
rlRoomId :: Lens' RoomsLeave Text
rlRoomId = lens _rlRoomId (\ s a -> s{_rlRoomId = a})
rlLanguage :: Lens' RoomsLeave (Maybe Text)
rlLanguage
= lens _rlLanguage (\ s a -> s{_rlLanguage = a})
instance GoogleRequest RoomsLeave where
type Rs RoomsLeave = Room
type Scopes RoomsLeave =
'["https://www.googleapis.com/auth/games"]
requestClient RoomsLeave'{..}
= go _rlRoomId _rlLanguage (Just AltJSON) _rlPayload
gamesService
where go
= buildClient (Proxy :: Proxy RoomsLeaveResource)
mempty