{-# 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.Insert
(
PagesInsertResource
, pagesInsert
, PagesInsert
, piIsDraft
, piBlogId
, piPayload
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PagesInsertResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"pages" :>
QueryParam "isDraft" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Page :> Post '[JSON] Page
data PagesInsert = PagesInsert'
{ _piIsDraft :: !(Maybe Bool)
, _piBlogId :: !Text
, _piPayload :: !Page
} deriving (Eq,Show,Data,Typeable,Generic)
pagesInsert
:: Text
-> Page
-> PagesInsert
pagesInsert pPiBlogId_ pPiPayload_ =
PagesInsert'
{ _piIsDraft = Nothing
, _piBlogId = pPiBlogId_
, _piPayload = pPiPayload_
}
piIsDraft :: Lens' PagesInsert (Maybe Bool)
piIsDraft
= lens _piIsDraft (\ s a -> s{_piIsDraft = a})
piBlogId :: Lens' PagesInsert Text
piBlogId = lens _piBlogId (\ s a -> s{_piBlogId = a})
piPayload :: Lens' PagesInsert Page
piPayload
= lens _piPayload (\ s a -> s{_piPayload = a})
instance GoogleRequest PagesInsert where
type Rs PagesInsert = Page
type Scopes PagesInsert =
'["https://www.googleapis.com/auth/blogger"]
requestClient PagesInsert'{..}
= go _piBlogId _piIsDraft (Just AltJSON) _piPayload
bloggerService
where go
= buildClient (Proxy :: Proxy PagesInsertResource)
mempty