{-# 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.ListByUser
(
BlogsListByUserResource
, blogsListByUser
, BlogsListByUser
, blbuStatus
, blbuFetchUserInfo
, blbuUserId
, blbuRole
, blbuView
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type BlogsListByUserResource =
"blogger" :>
"v3" :>
"users" :>
Capture "userId" Text :>
"blogs" :>
QueryParams "status" BlogsListByUserStatus :>
QueryParam "fetchUserInfo" Bool :>
QueryParams "role" BlogsListByUserRole :>
QueryParam "view" BlogsListByUserView :>
QueryParam "alt" AltJSON :> Get '[JSON] BlogList
data BlogsListByUser = BlogsListByUser'
{ _blbuStatus :: ![BlogsListByUserStatus]
, _blbuFetchUserInfo :: !(Maybe Bool)
, _blbuUserId :: !Text
, _blbuRole :: !(Maybe [BlogsListByUserRole])
, _blbuView :: !(Maybe BlogsListByUserView)
} deriving (Eq,Show,Data,Typeable,Generic)
blogsListByUser
:: Text
-> BlogsListByUser
blogsListByUser pBlbuUserId_ =
BlogsListByUser'
{ _blbuStatus = [BLBUSLive]
, _blbuFetchUserInfo = Nothing
, _blbuUserId = pBlbuUserId_
, _blbuRole = Nothing
, _blbuView = Nothing
}
blbuStatus :: Lens' BlogsListByUser [BlogsListByUserStatus]
blbuStatus
= lens _blbuStatus (\ s a -> s{_blbuStatus = a}) .
_Coerce
blbuFetchUserInfo :: Lens' BlogsListByUser (Maybe Bool)
blbuFetchUserInfo
= lens _blbuFetchUserInfo
(\ s a -> s{_blbuFetchUserInfo = a})
blbuUserId :: Lens' BlogsListByUser Text
blbuUserId
= lens _blbuUserId (\ s a -> s{_blbuUserId = a})
blbuRole :: Lens' BlogsListByUser [BlogsListByUserRole]
blbuRole
= lens _blbuRole (\ s a -> s{_blbuRole = a}) .
_Default
. _Coerce
blbuView :: Lens' BlogsListByUser (Maybe BlogsListByUserView)
blbuView = lens _blbuView (\ s a -> s{_blbuView = a})
instance GoogleRequest BlogsListByUser where
type Rs BlogsListByUser = BlogList
type Scopes BlogsListByUser =
'["https://www.googleapis.com/auth/blogger",
"https://www.googleapis.com/auth/blogger.readonly"]
requestClient BlogsListByUser'{..}
= go _blbuUserId _blbuStatus _blbuFetchUserInfo
(_blbuRole ^. _Default)
_blbuView
(Just AltJSON)
bloggerService
where go
= buildClient
(Proxy :: Proxy BlogsListByUserResource)
mempty