{-# 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.Update
(
PagesUpdateResource
, pagesUpdate
, PagesUpdate
, puuBlogId
, puuPageId
, puuPayload
, puuRevert
, puuPublish
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PagesUpdateResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"pages" :>
Capture "pageId" Text :>
QueryParam "revert" Bool :>
QueryParam "publish" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Page :> Put '[JSON] Page
data PagesUpdate = PagesUpdate'
{ _puuBlogId :: !Text
, _puuPageId :: !Text
, _puuPayload :: !Page
, _puuRevert :: !(Maybe Bool)
, _puuPublish :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
pagesUpdate
:: Text
-> Text
-> Page
-> PagesUpdate
pagesUpdate pPuuBlogId_ pPuuPageId_ pPuuPayload_ =
PagesUpdate'
{ _puuBlogId = pPuuBlogId_
, _puuPageId = pPuuPageId_
, _puuPayload = pPuuPayload_
, _puuRevert = Nothing
, _puuPublish = Nothing
}
puuBlogId :: Lens' PagesUpdate Text
puuBlogId
= lens _puuBlogId (\ s a -> s{_puuBlogId = a})
puuPageId :: Lens' PagesUpdate Text
puuPageId
= lens _puuPageId (\ s a -> s{_puuPageId = a})
puuPayload :: Lens' PagesUpdate Page
puuPayload
= lens _puuPayload (\ s a -> s{_puuPayload = a})
puuRevert :: Lens' PagesUpdate (Maybe Bool)
puuRevert
= lens _puuRevert (\ s a -> s{_puuRevert = a})
puuPublish :: Lens' PagesUpdate (Maybe Bool)
puuPublish
= lens _puuPublish (\ s a -> s{_puuPublish = a})
instance GoogleRequest PagesUpdate where
type Rs PagesUpdate = Page
type Scopes PagesUpdate =
'["https://www.googleapis.com/auth/blogger"]
requestClient PagesUpdate'{..}
= go _puuBlogId _puuPageId _puuRevert _puuPublish
(Just AltJSON)
_puuPayload
bloggerService
where go
= buildClient (Proxy :: Proxy PagesUpdateResource)
mempty