{-# 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.Blogs.Get
(
BlogsGetResource
, blogsGet
, BlogsGet
, bgBlogId
, bgMaxPosts
, bgView
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type BlogsGetResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
QueryParam "maxPosts" (Textual Word32) :>
QueryParam "view" BlogsGetView :>
QueryParam "alt" AltJSON :> Get '[JSON] Blog
data BlogsGet = BlogsGet'
{ _bgBlogId :: !Text
, _bgMaxPosts :: !(Maybe (Textual Word32))
, _bgView :: !(Maybe BlogsGetView)
} deriving (Eq,Show,Data,Typeable,Generic)
blogsGet
:: Text
-> BlogsGet
blogsGet pBgBlogId_ =
BlogsGet'
{ _bgBlogId = pBgBlogId_
, _bgMaxPosts = Nothing
, _bgView = Nothing
}
bgBlogId :: Lens' BlogsGet Text
bgBlogId = lens _bgBlogId (\ s a -> s{_bgBlogId = a})
bgMaxPosts :: Lens' BlogsGet (Maybe Word32)
bgMaxPosts
= lens _bgMaxPosts (\ s a -> s{_bgMaxPosts = a}) .
mapping _Coerce
bgView :: Lens' BlogsGet (Maybe BlogsGetView)
bgView = lens _bgView (\ s a -> s{_bgView = a})
instance GoogleRequest BlogsGet where
type Rs BlogsGet = Blog
type Scopes BlogsGet =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient BlogsGet'{..}
= go _bgBlogId _bgMaxPosts _bgView (Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy BlogsGetResource)
mempty