{-# 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.Get
(
PostsGetResource
, postsGet
, PostsGet
, pggFetchBody
, pggFetchImages
, pggBlogId
, pggMaxComments
, pggView
, pggPostId
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsGetResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
Capture "postId" Text :>
QueryParam "fetchBody" Bool :>
QueryParam "fetchImages" Bool :>
QueryParam "maxComments" (Textual Word32) :>
QueryParam "view" PostsGetView :>
QueryParam "alt" AltJSON :> Get '[JSON] Post'
data PostsGet = PostsGet'
{ _pggFetchBody :: !Bool
, _pggFetchImages :: !(Maybe Bool)
, _pggBlogId :: !Text
, _pggMaxComments :: !(Maybe (Textual Word32))
, _pggView :: !(Maybe PostsGetView)
, _pggPostId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
postsGet
:: Text
-> Text
-> PostsGet
postsGet pPggBlogId_ pPggPostId_ =
PostsGet'
{ _pggFetchBody = True
, _pggFetchImages = Nothing
, _pggBlogId = pPggBlogId_
, _pggMaxComments = Nothing
, _pggView = Nothing
, _pggPostId = pPggPostId_
}
pggFetchBody :: Lens' PostsGet Bool
pggFetchBody
= lens _pggFetchBody (\ s a -> s{_pggFetchBody = a})
pggFetchImages :: Lens' PostsGet (Maybe Bool)
pggFetchImages
= lens _pggFetchImages
(\ s a -> s{_pggFetchImages = a})
pggBlogId :: Lens' PostsGet Text
pggBlogId
= lens _pggBlogId (\ s a -> s{_pggBlogId = a})
pggMaxComments :: Lens' PostsGet (Maybe Word32)
pggMaxComments
= lens _pggMaxComments
(\ s a -> s{_pggMaxComments = a})
. mapping _Coerce
pggView :: Lens' PostsGet (Maybe PostsGetView)
pggView = lens _pggView (\ s a -> s{_pggView = a})
pggPostId :: Lens' PostsGet Text
pggPostId
= lens _pggPostId (\ s a -> s{_pggPostId = a})
instance GoogleRequest PostsGet where
type Rs PostsGet = Post'
type Scopes PostsGet =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient PostsGet'{..}
= go _pggBlogId _pggPostId (Just _pggFetchBody)
_pggFetchImages
_pggMaxComments
_pggView
(Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy PostsGetResource)
mempty