{-# 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.PageViews.Get
(
PageViewsGetResource
, pageViewsGet
, PageViewsGet
, pvgBlogId
, pvgRange
) where
import Network.Google.Blogger.Types
import Network.Google.Prelude
type PageViewsGetResource =
"blogger" :>
"v3" :>
"blogs" :>
Capture "blogId" Text :>
"pageviews" :>
QueryParams "range" PageViewsGetRange :>
QueryParam "alt" AltJSON :> Get '[JSON] Pageviews
data PageViewsGet = PageViewsGet'
{ _pvgBlogId :: !Text
, _pvgRange :: !(Maybe [PageViewsGetRange])
} deriving (Eq,Show,Data,Typeable,Generic)
pageViewsGet
:: Text
-> PageViewsGet
pageViewsGet pPvgBlogId_ =
PageViewsGet'
{ _pvgBlogId = pPvgBlogId_
, _pvgRange = Nothing
}
pvgBlogId :: Lens' PageViewsGet Text
pvgBlogId
= lens _pvgBlogId (\ s a -> s{_pvgBlogId = a})
pvgRange :: Lens' PageViewsGet [PageViewsGetRange]
pvgRange
= lens _pvgRange (\ s a -> s{_pvgRange = a}) .
_Default
. _Coerce
instance GoogleRequest PageViewsGet where
type Rs PageViewsGet = Pageviews
type Scopes PageViewsGet =
'["https://www.googleapis.com/auth/blogger"]
requestClient PageViewsGet'{..}
= go _pvgBlogId (_pvgRange ^. _Default)
(Just AltJSON)
bloggerService
where go
= buildClient (Proxy :: Proxy PageViewsGetResource)
mempty