{-# 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.Posts.List
(
PostsListResource
, postsList
, PostsList
, pllStatus
, pllOrderBy
, pllFetchImages
, pllEndDate
, pllBlogId
, pllStartDate
, pllFetchBodies
, pllView
, pllLabels
, pllPageToken
, pllMaxResults
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsListResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
QueryParams "status" PostsListStatus :>
QueryParam "orderBy" PostsListOrderBy :>
QueryParam "fetchImages" Bool :>
QueryParam "endDate" DateTime' :>
QueryParam "startDate" DateTime' :>
QueryParam "fetchBodies" Bool :>
QueryParam "view" PostsListView :>
QueryParam "labels" Text :>
QueryParam "pageToken" Text :>
QueryParam "maxResults" (Textual Word32) :>
QueryParam "alt" AltJSON :>
Get '[JSON] PostList
data PostsList = PostsList'
{ _pllStatus :: !(Maybe [PostsListStatus])
, _pllOrderBy :: !PostsListOrderBy
, _pllFetchImages :: !(Maybe Bool)
, _pllEndDate :: !(Maybe DateTime')
, _pllBlogId :: !Text
, _pllStartDate :: !(Maybe DateTime')
, _pllFetchBodies :: !Bool
, _pllView :: !(Maybe PostsListView)
, _pllLabels :: !(Maybe Text)
, _pllPageToken :: !(Maybe Text)
, _pllMaxResults :: !(Maybe (Textual Word32))
} deriving (Eq,Show,Data,Typeable,Generic)
postsList
:: Text
-> PostsList
postsList pPllBlogId_ =
PostsList'
{ _pllStatus = Nothing
, _pllOrderBy = Published
, _pllFetchImages = Nothing
, _pllEndDate = Nothing
, _pllBlogId = pPllBlogId_
, _pllStartDate = Nothing
, _pllFetchBodies = True
, _pllView = Nothing
, _pllLabels = Nothing
, _pllPageToken = Nothing
, _pllMaxResults = Nothing
}
pllStatus :: Lens' PostsList [PostsListStatus]
pllStatus
= lens _pllStatus (\ s a -> s{_pllStatus = a}) .
_Default
. _Coerce
pllOrderBy :: Lens' PostsList PostsListOrderBy
pllOrderBy
= lens _pllOrderBy (\ s a -> s{_pllOrderBy = a})
pllFetchImages :: Lens' PostsList (Maybe Bool)
pllFetchImages
= lens _pllFetchImages
(\ s a -> s{_pllFetchImages = a})
pllEndDate :: Lens' PostsList (Maybe UTCTime)
pllEndDate
= lens _pllEndDate (\ s a -> s{_pllEndDate = a}) .
mapping _DateTime
pllBlogId :: Lens' PostsList Text
pllBlogId
= lens _pllBlogId (\ s a -> s{_pllBlogId = a})
pllStartDate :: Lens' PostsList (Maybe UTCTime)
pllStartDate
= lens _pllStartDate (\ s a -> s{_pllStartDate = a})
. mapping _DateTime
pllFetchBodies :: Lens' PostsList Bool
pllFetchBodies
= lens _pllFetchBodies
(\ s a -> s{_pllFetchBodies = a})
pllView :: Lens' PostsList (Maybe PostsListView)
pllView = lens _pllView (\ s a -> s{_pllView = a})
pllLabels :: Lens' PostsList (Maybe Text)
pllLabels
= lens _pllLabels (\ s a -> s{_pllLabels = a})
pllPageToken :: Lens' PostsList (Maybe Text)
pllPageToken
= lens _pllPageToken (\ s a -> s{_pllPageToken = a})
pllMaxResults :: Lens' PostsList (Maybe Word32)
pllMaxResults
= lens _pllMaxResults
(\ s a -> s{_pllMaxResults = a})
. mapping _Coerce
instance GoogleRequest PostsList where
type Rs PostsList = PostList
type Scopes PostsList =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient PostsList'{..}
= go _pllBlogId (_pllStatus ^. _Default)
(Just _pllOrderBy)
_pllFetchImages
_pllEndDate
_pllStartDate
(Just _pllFetchBodies)
_pllView
_pllLabels
_pllPageToken
_pllMaxResults
(Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy PostsListResource)
mempty