{-# 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.PlusDomains.Comments.Insert
(
CommentsInsertResource
, commentsInsert
, CommentsInsert
, cActivityId
, cPayload
) where
import Network.Google.PlusDomains.Types
import Network.Google.Prelude
type CommentsInsertResource =
"plusDomains" :>
"v1" :>
"activities" :>
Capture "activityId" Text :>
"comments" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Comment :> Post '[JSON] Comment
-- | Create a new comment in reply to an activity.
--
-- /See:/ 'commentsInsert' smart constructor.
data CommentsInsert = CommentsInsert'
{ _cActivityId :: !Text
, _cPayload :: !Comment
} deriving (Eq,Show,Data,Typeable,Generic)
-- | Creates a value of 'CommentsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cActivityId'
--
-- * 'cPayload'
commentsInsert
:: Text -- ^ 'cActivityId'
-> Comment -- ^ 'cPayload'
-> CommentsInsert
commentsInsert pCActivityId_ pCPayload_ =
CommentsInsert'
{ _cActivityId = pCActivityId_
, _cPayload = pCPayload_
}
-- | The ID of the activity to reply to.
cActivityId :: Lens' CommentsInsert Text
cActivityId
= lens _cActivityId (\ s a -> s{_cActivityId = a})
-- | Multipart request metadata.
cPayload :: Lens' CommentsInsert Comment
cPayload = lens _cPayload (\ s a -> s{_cPayload = a})
instance GoogleRequest CommentsInsert where
type Rs CommentsInsert = Comment
type Scopes CommentsInsert =
'["https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.stream.write"]
requestClient CommentsInsert'{..}
= go _cActivityId (Just AltJSON) _cPayload
plusDomainsService
where go
= buildClient (Proxy :: Proxy CommentsInsertResource)
mempty