{-# 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.Pages.Patch
(
PagesPatchResource
, pagesPatch
, PagesPatch
, ppBlogId
, ppPageId
, ppPayload
, ppRevert
, ppPublish
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PagesPatchResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"pages" :>
Capture "pageId" Text :>
QueryParam "revert" Bool :>
QueryParam "publish" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Page :> Patch '[JSON] Page
data PagesPatch = PagesPatch'
{ _ppBlogId :: !Text
, _ppPageId :: !Text
, _ppPayload :: !Page
, _ppRevert :: !(Maybe Bool)
, _ppPublish :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
pagesPatch
:: Text
-> Text
-> Page
-> PagesPatch
pagesPatch pPpBlogId_ pPpPageId_ pPpPayload_ =
PagesPatch'
{ _ppBlogId = pPpBlogId_
, _ppPageId = pPpPageId_
, _ppPayload = pPpPayload_
, _ppRevert = Nothing
, _ppPublish = Nothing
}
ppBlogId :: Lens' PagesPatch Text
ppBlogId = lens _ppBlogId (\ s a -> s{_ppBlogId = a})
ppPageId :: Lens' PagesPatch Text
ppPageId = lens _ppPageId (\ s a -> s{_ppPageId = a})
ppPayload :: Lens' PagesPatch Page
ppPayload
= lens _ppPayload (\ s a -> s{_ppPayload = a})
ppRevert :: Lens' PagesPatch (Maybe Bool)
ppRevert = lens _ppRevert (\ s a -> s{_ppRevert = a})
ppPublish :: Lens' PagesPatch (Maybe Bool)
ppPublish
= lens _ppPublish (\ s a -> s{_ppPublish = a})
instance GoogleRequest PagesPatch where
type Rs PagesPatch = Page
type Scopes PagesPatch =
'["https://www.googleapis.com/auth/blogger"]
requestClient PagesPatch'{..}
= go _ppBlogId _ppPageId _ppRevert _ppPublish
(Just AltJSON)
_ppPayload
bloggerService
where go
= buildClient (Proxy :: Proxy PagesPatchResource)
mempty