{-# 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.Publish
(
PostsPublishResource
, postsPublish
, PostsPublish
, pppPublishDate
, pppBlogId
, pppPostId
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PostsPublishResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"posts" :>
Capture "postId" Text :>
"publish" :>
QueryParam "publishDate" DateTime' :>
QueryParam "alt" AltJSON :> Post '[JSON] Post'
data PostsPublish = PostsPublish'
{ _pppPublishDate :: !(Maybe DateTime')
, _pppBlogId :: !Text
, _pppPostId :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
postsPublish
:: Text
-> Text
-> PostsPublish
postsPublish pPppBlogId_ pPppPostId_ =
PostsPublish'
{ _pppPublishDate = Nothing
, _pppBlogId = pPppBlogId_
, _pppPostId = pPppPostId_
}
pppPublishDate :: Lens' PostsPublish (Maybe UTCTime)
pppPublishDate
= lens _pppPublishDate
(\ s a -> s{_pppPublishDate = a})
. mapping _DateTime
pppBlogId :: Lens' PostsPublish Text
pppBlogId
= lens _pppBlogId (\ s a -> s{_pppBlogId = a})
pppPostId :: Lens' PostsPublish Text
pppPostId
= lens _pppPostId (\ s a -> s{_pppPostId = a})
instance GoogleRequest PostsPublish where
type Rs PostsPublish = Post'
type Scopes PostsPublish =
'["https://www.googleapis.com/auth/blogger"]
requestClient PostsPublish'{..}
= go _pppBlogId _pppPostId _pppPublishDate
(Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy PostsPublishResource)
mempty