{-# 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.GetByPath
(
PostsGetByPathResource
, postsGetByPath
, PostsGetByPath
, pgbpPath
, pgbpBlogId
, pgbpMaxComments
, pgbpView
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsGetByPathResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
"bypath" :>
QueryParam "path" Text :>
QueryParam "maxComments" (Textual Word32) :>
QueryParam "view" PostsGetByPathView :>
QueryParam "alt" AltJSON :> Get '[JSON] Post'
data PostsGetByPath = PostsGetByPath'
{ _pgbpPath :: !Text
, _pgbpBlogId :: !Text
, _pgbpMaxComments :: !(Maybe (Textual Word32))
, _pgbpView :: !(Maybe PostsGetByPathView)
} deriving (Eq,Show,Data,Typeable,Generic)
postsGetByPath
:: Text
-> Text
-> PostsGetByPath
postsGetByPath pPgbpPath_ pPgbpBlogId_ =
PostsGetByPath'
{ _pgbpPath = pPgbpPath_
, _pgbpBlogId = pPgbpBlogId_
, _pgbpMaxComments = Nothing
, _pgbpView = Nothing
}
pgbpPath :: Lens' PostsGetByPath Text
pgbpPath = lens _pgbpPath (\ s a -> s{_pgbpPath = a})
pgbpBlogId :: Lens' PostsGetByPath Text
pgbpBlogId
= lens _pgbpBlogId (\ s a -> s{_pgbpBlogId = a})
pgbpMaxComments :: Lens' PostsGetByPath (Maybe Word32)
pgbpMaxComments
= lens _pgbpMaxComments
(\ s a -> s{_pgbpMaxComments = a})
. mapping _Coerce
pgbpView :: Lens' PostsGetByPath (Maybe PostsGetByPathView)
pgbpView = lens _pgbpView (\ s a -> s{_pgbpView = a})
instance GoogleRequest PostsGetByPath where
type Rs PostsGetByPath = Post'
type Scopes PostsGetByPath =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient PostsGetByPath'{..}
= go _pgbpBlogId (Just _pgbpPath) _pgbpMaxComments
_pgbpView
(Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy PostsGetByPathResource)
mempty