{-# 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.Webmasters.URLCrawlErrorscounts.Query
(
URLCrawlErrorscountsQueryResource
, urlCrawlErrorscountsQuery
, URLCrawlErrorscountsQuery
, uceqPlatform
, uceqCategory
, uceqSiteURL
, uceqLatestCountsOnly
) where
import Network.Google.Prelude
import Network.Google.WebmasterTools.Types
type URLCrawlErrorscountsQueryResource =
"webmasters" :>
"v3" :>
"sites" :>
Capture "siteUrl" Text :>
"urlCrawlErrorsCounts" :>
"query" :>
QueryParam "platform"
URLCrawlErrorscountsQueryPlatform
:>
QueryParam "category"
URLCrawlErrorscountsQueryCategory
:>
QueryParam "latestCountsOnly" Bool :>
QueryParam "alt" AltJSON :>
Get '[JSON] URLCrawlErrorsCountsQueryResponse
data URLCrawlErrorscountsQuery = URLCrawlErrorscountsQuery'
{ _uceqPlatform :: !(Maybe URLCrawlErrorscountsQueryPlatform)
, _uceqCategory :: !(Maybe URLCrawlErrorscountsQueryCategory)
, _uceqSiteURL :: !Text
, _uceqLatestCountsOnly :: !Bool
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorscountsQuery
:: Text
-> URLCrawlErrorscountsQuery
urlCrawlErrorscountsQuery pUceqSiteURL_ =
URLCrawlErrorscountsQuery'
{ _uceqPlatform = Nothing
, _uceqCategory = Nothing
, _uceqSiteURL = pUceqSiteURL_
, _uceqLatestCountsOnly = True
}
uceqPlatform :: Lens' URLCrawlErrorscountsQuery (Maybe URLCrawlErrorscountsQueryPlatform)
uceqPlatform
= lens _uceqPlatform (\ s a -> s{_uceqPlatform = a})
uceqCategory :: Lens' URLCrawlErrorscountsQuery (Maybe URLCrawlErrorscountsQueryCategory)
uceqCategory
= lens _uceqCategory (\ s a -> s{_uceqCategory = a})
uceqSiteURL :: Lens' URLCrawlErrorscountsQuery Text
uceqSiteURL
= lens _uceqSiteURL (\ s a -> s{_uceqSiteURL = a})
uceqLatestCountsOnly :: Lens' URLCrawlErrorscountsQuery Bool
uceqLatestCountsOnly
= lens _uceqLatestCountsOnly
(\ s a -> s{_uceqLatestCountsOnly = a})
instance GoogleRequest URLCrawlErrorscountsQuery
where
type Rs URLCrawlErrorscountsQuery =
URLCrawlErrorsCountsQueryResponse
type Scopes URLCrawlErrorscountsQuery =
'["https://www.googleapis.com/auth/webmasters",
"https://www.googleapis.com/auth/webmasters.readonly"]
requestClient URLCrawlErrorscountsQuery'{..}
= go _uceqSiteURL _uceqPlatform _uceqCategory
(Just _uceqLatestCountsOnly)
(Just AltJSON)
webmasterToolsService
where go
= buildClient
(Proxy :: Proxy URLCrawlErrorscountsQueryResource)
mempty