{-# 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.Update
(
PostsUpdateResource
, postsUpdate
, PostsUpdate
, puFetchBody
, puFetchImages
, puBlogId
, puPayload
, puMaxComments
, puRevert
, puPostId
, puPublish
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsUpdateResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
Capture "postId" Text :>
QueryParam "fetchBody" Bool :>
QueryParam "fetchImages" Bool :>
QueryParam "maxComments" (Textual Word32) :>
QueryParam "revert" Bool :>
QueryParam "publish" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Post' :> Put '[JSON] Post'
data PostsUpdate = PostsUpdate'
{ _puFetchBody :: !Bool
, _puFetchImages :: !(Maybe Bool)
, _puBlogId :: !Text
, _puPayload :: !Post'
, _puMaxComments :: !(Maybe (Textual Word32))
, _puRevert :: !(Maybe Bool)
, _puPostId :: !Text
, _puPublish :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
postsUpdate
:: Text
-> Post'
-> Text
-> PostsUpdate
postsUpdate pPuBlogId_ pPuPayload_ pPuPostId_ =
PostsUpdate'
{ _puFetchBody = True
, _puFetchImages = Nothing
, _puBlogId = pPuBlogId_
, _puPayload = pPuPayload_
, _puMaxComments = Nothing
, _puRevert = Nothing
, _puPostId = pPuPostId_
, _puPublish = Nothing
}
puFetchBody :: Lens' PostsUpdate Bool
puFetchBody
= lens _puFetchBody (\ s a -> s{_puFetchBody = a})
puFetchImages :: Lens' PostsUpdate (Maybe Bool)
puFetchImages
= lens _puFetchImages
(\ s a -> s{_puFetchImages = a})
puBlogId :: Lens' PostsUpdate Text
puBlogId = lens _puBlogId (\ s a -> s{_puBlogId = a})
puPayload :: Lens' PostsUpdate Post'
puPayload
= lens _puPayload (\ s a -> s{_puPayload = a})
puMaxComments :: Lens' PostsUpdate (Maybe Word32)
puMaxComments
= lens _puMaxComments
(\ s a -> s{_puMaxComments = a})
. mapping _Coerce
puRevert :: Lens' PostsUpdate (Maybe Bool)
puRevert = lens _puRevert (\ s a -> s{_puRevert = a})
puPostId :: Lens' PostsUpdate Text
puPostId = lens _puPostId (\ s a -> s{_puPostId = a})
puPublish :: Lens' PostsUpdate (Maybe Bool)
puPublish
= lens _puPublish (\ s a -> s{_puPublish = a})
instance GoogleRequest PostsUpdate where
type Rs PostsUpdate = Post'
type Scopes PostsUpdate =
'["https://www.googleapis.com/auth/blogger"]
requestClient PostsUpdate'{..}
= go _puBlogId _puPostId (Just _puFetchBody)
_puFetchImages
_puMaxComments
_puRevert
_puPublish
(Just AltJSON)
_puPayload
bloggerService
where go
= buildClient (Proxy :: Proxy PostsUpdateResource)
mempty