{-# 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.Blogger.Comments.ListByBlog
(
CommentsListByBlogResource
, commentsListByBlog
, CommentsListByBlog
, clbbStatus
, clbbEndDate
, clbbBlogId
, clbbStartDate
, clbbFetchBodies
, clbbPageToken
, clbbMaxResults
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type CommentsListByBlogResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"comments" :>
QueryParams "status" CommentsListByBlogStatus :>
QueryParam "endDate" DateTime' :>
QueryParam "startDate" DateTime' :>
QueryParam "fetchBodies" Bool :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :> Get '[JSON] CommentList
data CommentsListByBlog = CommentsListByBlog'
{ _clbbStatus :: !(Maybe [CommentsListByBlogStatus])
, _clbbEndDate :: !(Maybe DateTime')
, _clbbBlogId :: !Text
, _clbbStartDate :: !(Maybe DateTime')
, _clbbFetchBodies :: !(Maybe Bool)
, _clbbPageToken :: !(Maybe Text)
, _clbbMaxResults :: !(Maybe (Textual Word32))
} deriving (Eq,Show,Data,Typeable,Generic)
commentsListByBlog
:: Text
-> CommentsListByBlog
commentsListByBlog pClbbBlogId_ =
CommentsListByBlog'
{ _clbbStatus = Nothing
, _clbbEndDate = Nothing
, _clbbBlogId = pClbbBlogId_
, _clbbStartDate = Nothing
, _clbbFetchBodies = Nothing
, _clbbPageToken = Nothing
, _clbbMaxResults = Nothing
}
clbbStatus :: Lens' CommentsListByBlog [CommentsListByBlogStatus]
clbbStatus
= lens _clbbStatus (\ s a -> s{_clbbStatus = a}) .
_Default
. _Coerce
clbbEndDate :: Lens' CommentsListByBlog (Maybe UTCTime)
clbbEndDate
= lens _clbbEndDate (\ s a -> s{_clbbEndDate = a}) .
mapping _DateTime
clbbBlogId :: Lens' CommentsListByBlog Text
clbbBlogId
= lens _clbbBlogId (\ s a -> s{_clbbBlogId = a})
clbbStartDate :: Lens' CommentsListByBlog (Maybe UTCTime)
clbbStartDate
= lens _clbbStartDate
(\ s a -> s{_clbbStartDate = a})
. mapping _DateTime
clbbFetchBodies :: Lens' CommentsListByBlog (Maybe Bool)
clbbFetchBodies
= lens _clbbFetchBodies
(\ s a -> s{_clbbFetchBodies = a})
clbbPageToken :: Lens' CommentsListByBlog (Maybe Text)
clbbPageToken
= lens _clbbPageToken
(\ s a -> s{_clbbPageToken = a})
clbbMaxResults :: Lens' CommentsListByBlog (Maybe Word32)
clbbMaxResults
= lens _clbbMaxResults
(\ s a -> s{_clbbMaxResults = a})
. mapping _Coerce
instance GoogleRequest CommentsListByBlog where
type Rs CommentsListByBlog = CommentList
type Scopes CommentsListByBlog =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient CommentsListByBlog'{..}
= go _clbbBlogId (_clbbStatus ^. _Default)
_clbbEndDate
_clbbStartDate
_clbbFetchBodies
_clbbPageToken
_clbbMaxResults
(Just AltJSON)
bloggerService
where go
= buildClient
(Proxy :: Proxy CommentsListByBlogResource)
mempty