{-# 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.Insert
(
PostsInsertResource
, postsInsert
, PostsInsert
, posFetchBody
, posIsDraft
, posFetchImages
, posBlogId
, posPayload
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsInsertResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
QueryParam "fetchBody" Bool :>
QueryParam "isDraft" Bool :>
QueryParam "fetchImages" Bool :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] Post' :> Post '[JSON] Post'
data PostsInsert = PostsInsert'
{ _posFetchBody :: !Bool
, _posIsDraft :: !(Maybe Bool)
, _posFetchImages :: !(Maybe Bool)
, _posBlogId :: !Text
, _posPayload :: !Post'
} deriving (Eq,Show,Data,Typeable,Generic)
postsInsert
:: Text
-> Post'
-> PostsInsert
postsInsert pPosBlogId_ pPosPayload_ =
PostsInsert'
{ _posFetchBody = True
, _posIsDraft = Nothing
, _posFetchImages = Nothing
, _posBlogId = pPosBlogId_
, _posPayload = pPosPayload_
}
posFetchBody :: Lens' PostsInsert Bool
posFetchBody
= lens _posFetchBody (\ s a -> s{_posFetchBody = a})
posIsDraft :: Lens' PostsInsert (Maybe Bool)
posIsDraft
= lens _posIsDraft (\ s a -> s{_posIsDraft = a})
posFetchImages :: Lens' PostsInsert (Maybe Bool)
posFetchImages
= lens _posFetchImages
(\ s a -> s{_posFetchImages = a})
posBlogId :: Lens' PostsInsert Text
posBlogId
= lens _posBlogId (\ s a -> s{_posBlogId = a})
posPayload :: Lens' PostsInsert Post'
posPayload
= lens _posPayload (\ s a -> s{_posPayload = a})
instance GoogleRequest PostsInsert where
type Rs PostsInsert = Post'
type Scopes PostsInsert =
'["https://www.googleapis.com/auth/blogger"]
requestClient PostsInsert'{..}
= go _posBlogId (Just _posFetchBody) _posIsDraft
_posFetchImages
(Just AltJSON)
_posPayload
bloggerService
where go
= buildClient (Proxy :: Proxy PostsInsertResource)
mempty