{-# 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.Join
(
RoomsJoinResource
, roomsJoin
, RoomsJoin
, rjPayload
, rjRoomId
, rjLanguage
) where
import Network.Google.Games.Types
import Network.Google.Prelude
type RoomsJoinResource =
"games" :>
"v1" :>
"rooms" :>
Capture "roomId" Text :>
"join" :>
QueryParam "language" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] RoomJoinRequest :> Post '[JSON] Room
data RoomsJoin = RoomsJoin'
{ _rjPayload :: !RoomJoinRequest
, _rjRoomId :: !Text
, _rjLanguage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
roomsJoin
:: RoomJoinRequest
-> Text
-> RoomsJoin
roomsJoin pRjPayload_ pRjRoomId_ =
RoomsJoin'
{ _rjPayload = pRjPayload_
, _rjRoomId = pRjRoomId_
, _rjLanguage = Nothing
}
rjPayload :: Lens' RoomsJoin RoomJoinRequest
rjPayload
= lens _rjPayload (\ s a -> s{_rjPayload = a})
rjRoomId :: Lens' RoomsJoin Text
rjRoomId = lens _rjRoomId (\ s a -> s{_rjRoomId = a})
rjLanguage :: Lens' RoomsJoin (Maybe Text)
rjLanguage
= lens _rjLanguage (\ s a -> s{_rjLanguage = a})
instance GoogleRequest RoomsJoin where
type Rs RoomsJoin = Room
type Scopes RoomsJoin =
'["https://www.googleapis.com/auth/games"]
requestClient RoomsJoin'{..}
= go _rjRoomId _rjLanguage (Just AltJSON) _rjPayload
gamesService
where go
= buildClient (Proxy :: Proxy RoomsJoinResource)
mempty