{-# 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.Plus.Comments.List
(
CommentsListResource
, commentsList
, CommentsList
, clActivityId
, clSortOrder
, clPageToken
, clMaxResults
) where
import Network.Google.Plus.Types
import Network.Google.Prelude
type CommentsListResource =
"plus" :>
"v1" :>
"activities" :>
Capture "activityId" Text :>
"comments" :>
QueryParam "sortOrder" CommentsListSortOrder :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] CommentFeed
data CommentsList = CommentsList'
{ _clActivityId :: !Text
, _clSortOrder :: !CommentsListSortOrder
, _clPageToken :: !(Maybe Text)
, _clMaxResults :: !(Textual Word32)
} deriving (Eq,Show,Data,Typeable,Generic)
commentsList
:: Text
-> CommentsList
commentsList pClActivityId_ =
CommentsList'
{ _clActivityId = pClActivityId_
, _clSortOrder = Ascending
, _clPageToken = Nothing
, _clMaxResults = 20
}
clActivityId :: Lens' CommentsList Text
clActivityId
= lens _clActivityId (\ s a -> s{_clActivityId = a})
clSortOrder :: Lens' CommentsList CommentsListSortOrder
clSortOrder
= lens _clSortOrder (\ s a -> s{_clSortOrder = a})
clPageToken :: Lens' CommentsList (Maybe Text)
clPageToken
= lens _clPageToken (\ s a -> s{_clPageToken = a})
clMaxResults :: Lens' CommentsList Word32
clMaxResults
= lens _clMaxResults (\ s a -> s{_clMaxResults = a})
. _Coerce
instance GoogleRequest CommentsList where
type Rs CommentsList = CommentFeed
type Scopes CommentsList =
'["https://www.googleapis.com/auth/plus.login",
"https://www.googleapis.com/auth/plus.me"]
requestClient CommentsList'{..}
= go _clActivityId (Just _clSortOrder) _clPageToken
(Just _clMaxResults)
(Just AltJSON)
plusService
where go
= buildClient (Proxy :: Proxy CommentsListResource)
mempty