{-# 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.YouTube.LiveChatMessages.Insert
(
LiveChatMessagesInsertResource
, liveChatMessagesInsert
, LiveChatMessagesInsert
, lcmiPart
, lcmiPayload
) where
import Network.Google.Prelude
import Network.Google.YouTube.Types
type LiveChatMessagesInsertResource =
"youtube" :>
"v3" :>
"liveChat" :>
"messages" :>
QueryParam "part" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] LiveChatMessage :>
Post '[JSON] LiveChatMessage
data LiveChatMessagesInsert = LiveChatMessagesInsert'
{ _lcmiPart :: !Text
, _lcmiPayload :: !LiveChatMessage
} deriving (Eq,Show,Data,Typeable,Generic)
liveChatMessagesInsert
:: Text
-> LiveChatMessage
-> LiveChatMessagesInsert
liveChatMessagesInsert pLcmiPart_ pLcmiPayload_ =
LiveChatMessagesInsert'
{ _lcmiPart = pLcmiPart_
, _lcmiPayload = pLcmiPayload_
}
lcmiPart :: Lens' LiveChatMessagesInsert Text
lcmiPart = lens _lcmiPart (\ s a -> s{_lcmiPart = a})
lcmiPayload :: Lens' LiveChatMessagesInsert LiveChatMessage
lcmiPayload
= lens _lcmiPayload (\ s a -> s{_lcmiPayload = a})
instance GoogleRequest LiveChatMessagesInsert where
type Rs LiveChatMessagesInsert = LiveChatMessage
type Scopes LiveChatMessagesInsert =
'["https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl"]
requestClient LiveChatMessagesInsert'{..}
= go (Just _lcmiPart) (Just AltJSON) _lcmiPayload
youTubeService
where go
= buildClient
(Proxy :: Proxy LiveChatMessagesInsertResource)
mempty