{-# 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.Searchanalytics.Query
(
SearchanalyticsQueryResource
, searchanalyticsQuery
, SearchanalyticsQuery
, sqSiteURL
, sqPayload
) where
import Network.Google.Prelude
import Network.Google.WebmasterTools.Types
type SearchanalyticsQueryResource =
"webmasters" :>
"v3" :>
"sites" :>
Capture "siteUrl" Text :>
"searchAnalytics" :>
"query" :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] SearchAnalyticsQueryRequest :>
Post '[JSON] SearchAnalyticsQueryResponse
data SearchanalyticsQuery = SearchanalyticsQuery'
{ _sqSiteURL :: !Text
, _sqPayload :: !SearchAnalyticsQueryRequest
} deriving (Eq,Show,Data,Typeable,Generic)
searchanalyticsQuery
:: Text
-> SearchAnalyticsQueryRequest
-> SearchanalyticsQuery
searchanalyticsQuery pSqSiteURL_ pSqPayload_ =
SearchanalyticsQuery'
{ _sqSiteURL = pSqSiteURL_
, _sqPayload = pSqPayload_
}
sqSiteURL :: Lens' SearchanalyticsQuery Text
sqSiteURL
= lens _sqSiteURL (\ s a -> s{_sqSiteURL = a})
sqPayload :: Lens' SearchanalyticsQuery SearchAnalyticsQueryRequest
sqPayload
= lens _sqPayload (\ s a -> s{_sqPayload = a})
instance GoogleRequest SearchanalyticsQuery where
type Rs SearchanalyticsQuery =
SearchAnalyticsQueryResponse
type Scopes SearchanalyticsQuery =
'["https://www.googleapis.com/auth/webmasters",
"https://www.googleapis.com/auth/webmasters.readonly"]
requestClient SearchanalyticsQuery'{..}
= go _sqSiteURL (Just AltJSON) _sqPayload
webmasterToolsService
where go
= buildClient
(Proxy :: Proxy SearchanalyticsQueryResource)
mempty