{-# 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.PagespeedOnline.PagespeedAPI.RunPagespeed
(
PagespeedAPIRunPagespeedResource
, pagespeedAPIRunPagespeed
, PagespeedAPIRunPagespeed
, parpUtmCampaign
, parpLocale
, parpCategory
, parpURL
, parpStrategy
, parpUtmSource
) where
import Network.Google.PageSpeed.Types
import Network.Google.Prelude
type PagespeedAPIRunPagespeedResource =
"pagespeedonline" :>
"v5" :>
"runPagespeed" :>
QueryParam "url" Text :>
QueryParam "utm_campaign" Text :>
QueryParam "locale" Text :>
QueryParams "category"
PagespeedAPIRunPagespeedCategory
:>
QueryParam "strategy"
PagespeedAPIRunPagespeedStrategy
:>
QueryParam "utm_source" Text :>
QueryParam "alt" AltJSON :>
Get '[JSON] PagespeedAPIPagespeedResponseV5
data PagespeedAPIRunPagespeed = PagespeedAPIRunPagespeed'
{ _parpUtmCampaign :: !(Maybe Text)
, _parpLocale :: !(Maybe Text)
, _parpCategory :: !(Maybe [PagespeedAPIRunPagespeedCategory])
, _parpURL :: !Text
, _parpStrategy :: !(Maybe PagespeedAPIRunPagespeedStrategy)
, _parpUtmSource :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
pagespeedAPIRunPagespeed
:: Text
-> PagespeedAPIRunPagespeed
pagespeedAPIRunPagespeed pParpURL_ =
PagespeedAPIRunPagespeed'
{ _parpUtmCampaign = Nothing
, _parpLocale = Nothing
, _parpCategory = Nothing
, _parpURL = pParpURL_
, _parpStrategy = Nothing
, _parpUtmSource = Nothing
}
parpUtmCampaign :: Lens' PagespeedAPIRunPagespeed (Maybe Text)
parpUtmCampaign
= lens _parpUtmCampaign
(\ s a -> s{_parpUtmCampaign = a})
parpLocale :: Lens' PagespeedAPIRunPagespeed (Maybe Text)
parpLocale
= lens _parpLocale (\ s a -> s{_parpLocale = a})
parpCategory :: Lens' PagespeedAPIRunPagespeed [PagespeedAPIRunPagespeedCategory]
parpCategory
= lens _parpCategory (\ s a -> s{_parpCategory = a})
. _Default
. _Coerce
parpURL :: Lens' PagespeedAPIRunPagespeed Text
parpURL = lens _parpURL (\ s a -> s{_parpURL = a})
parpStrategy :: Lens' PagespeedAPIRunPagespeed (Maybe PagespeedAPIRunPagespeedStrategy)
parpStrategy
= lens _parpStrategy (\ s a -> s{_parpStrategy = a})
parpUtmSource :: Lens' PagespeedAPIRunPagespeed (Maybe Text)
parpUtmSource
= lens _parpUtmSource
(\ s a -> s{_parpUtmSource = a})
instance GoogleRequest PagespeedAPIRunPagespeed where
type Rs PagespeedAPIRunPagespeed =
PagespeedAPIPagespeedResponseV5
type Scopes PagespeedAPIRunPagespeed = '[]
requestClient PagespeedAPIRunPagespeed'{..}
= go (Just _parpURL) _parpUtmCampaign _parpLocale
(_parpCategory ^. _Default)
_parpStrategy
_parpUtmSource
(Just AltJSON)
pageSpeedService
where go
= buildClient
(Proxy :: Proxy PagespeedAPIRunPagespeedResource)
mempty