{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.WebmasterTools.Types.Product where
import Network.Google.Prelude
import Network.Google.WebmasterTools.Types.Sum
data WmxSitemapContent = WmxSitemapContent'
{ _wscIndexed :: !(Maybe (Textual Int64))
, _wscType :: !(Maybe Text)
, _wscSubmitted :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
wmxSitemapContent
:: WmxSitemapContent
wmxSitemapContent =
WmxSitemapContent'
{ _wscIndexed = Nothing
, _wscType = Nothing
, _wscSubmitted = Nothing
}
wscIndexed :: Lens' WmxSitemapContent (Maybe Int64)
wscIndexed
= lens _wscIndexed (\ s a -> s{_wscIndexed = a}) .
mapping _Coerce
wscType :: Lens' WmxSitemapContent (Maybe Text)
wscType = lens _wscType (\ s a -> s{_wscType = a})
wscSubmitted :: Lens' WmxSitemapContent (Maybe Int64)
wscSubmitted
= lens _wscSubmitted (\ s a -> s{_wscSubmitted = a})
. mapping _Coerce
instance FromJSON WmxSitemapContent where
parseJSON
= withObject "WmxSitemapContent"
(\ o ->
WmxSitemapContent' <$>
(o .:? "indexed") <*> (o .:? "type") <*>
(o .:? "submitted"))
instance ToJSON WmxSitemapContent where
toJSON WmxSitemapContent'{..}
= object
(catMaybes
[("indexed" .=) <$> _wscIndexed,
("type" .=) <$> _wscType,
("submitted" .=) <$> _wscSubmitted])
data APIdimensionFilterGroup = APIdimensionFilterGroup'
{ _afgFilters :: !(Maybe [APIdimensionFilter])
, _afgGroupType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
apidimensionFilterGroup
:: APIdimensionFilterGroup
apidimensionFilterGroup =
APIdimensionFilterGroup'
{ _afgFilters = Nothing
, _afgGroupType = Nothing
}
afgFilters :: Lens' APIdimensionFilterGroup [APIdimensionFilter]
afgFilters
= lens _afgFilters (\ s a -> s{_afgFilters = a}) .
_Default
. _Coerce
afgGroupType :: Lens' APIdimensionFilterGroup (Maybe Text)
afgGroupType
= lens _afgGroupType (\ s a -> s{_afgGroupType = a})
instance FromJSON APIdimensionFilterGroup where
parseJSON
= withObject "APIdimensionFilterGroup"
(\ o ->
APIdimensionFilterGroup' <$>
(o .:? "filters" .!= mempty) <*> (o .:? "groupType"))
instance ToJSON APIdimensionFilterGroup where
toJSON APIdimensionFilterGroup'{..}
= object
(catMaybes
[("filters" .=) <$> _afgFilters,
("groupType" .=) <$> _afgGroupType])
data URLSampleDetails = URLSampleDetails'
{ _usdLinkedFromURLs :: !(Maybe [Text])
, _usdContainingSitemaps :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
urlSampleDetails
:: URLSampleDetails
urlSampleDetails =
URLSampleDetails'
{ _usdLinkedFromURLs = Nothing
, _usdContainingSitemaps = Nothing
}
usdLinkedFromURLs :: Lens' URLSampleDetails [Text]
usdLinkedFromURLs
= lens _usdLinkedFromURLs
(\ s a -> s{_usdLinkedFromURLs = a})
. _Default
. _Coerce
usdContainingSitemaps :: Lens' URLSampleDetails [Text]
usdContainingSitemaps
= lens _usdContainingSitemaps
(\ s a -> s{_usdContainingSitemaps = a})
. _Default
. _Coerce
instance FromJSON URLSampleDetails where
parseJSON
= withObject "URLSampleDetails"
(\ o ->
URLSampleDetails' <$>
(o .:? "linkedFromUrls" .!= mempty) <*>
(o .:? "containingSitemaps" .!= mempty))
instance ToJSON URLSampleDetails where
toJSON URLSampleDetails'{..}
= object
(catMaybes
[("linkedFromUrls" .=) <$> _usdLinkedFromURLs,
("containingSitemaps" .=) <$>
_usdContainingSitemaps])
data URLCrawlErrorCountsPerType = URLCrawlErrorCountsPerType'
{ _ucecptPlatform :: !(Maybe Text)
, _ucecptEntries :: !(Maybe [URLCrawlErrorCount])
, _ucecptCategory :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorCountsPerType
:: URLCrawlErrorCountsPerType
urlCrawlErrorCountsPerType =
URLCrawlErrorCountsPerType'
{ _ucecptPlatform = Nothing
, _ucecptEntries = Nothing
, _ucecptCategory = Nothing
}
ucecptPlatform :: Lens' URLCrawlErrorCountsPerType (Maybe Text)
ucecptPlatform
= lens _ucecptPlatform
(\ s a -> s{_ucecptPlatform = a})
ucecptEntries :: Lens' URLCrawlErrorCountsPerType [URLCrawlErrorCount]
ucecptEntries
= lens _ucecptEntries
(\ s a -> s{_ucecptEntries = a})
. _Default
. _Coerce
ucecptCategory :: Lens' URLCrawlErrorCountsPerType (Maybe Text)
ucecptCategory
= lens _ucecptCategory
(\ s a -> s{_ucecptCategory = a})
instance FromJSON URLCrawlErrorCountsPerType where
parseJSON
= withObject "URLCrawlErrorCountsPerType"
(\ o ->
URLCrawlErrorCountsPerType' <$>
(o .:? "platform") <*> (o .:? "entries" .!= mempty)
<*> (o .:? "category"))
instance ToJSON URLCrawlErrorCountsPerType where
toJSON URLCrawlErrorCountsPerType'{..}
= object
(catMaybes
[("platform" .=) <$> _ucecptPlatform,
("entries" .=) <$> _ucecptEntries,
("category" .=) <$> _ucecptCategory])
data APIDataRow = APIDataRow'
{ _adrImpressions :: !(Maybe (Textual Double))
, _adrKeys :: !(Maybe [Text])
, _adrCtr :: !(Maybe (Textual Double))
, _adrClicks :: !(Maybe (Textual Double))
, _adrPosition :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
apiDataRow
:: APIDataRow
apiDataRow =
APIDataRow'
{ _adrImpressions = Nothing
, _adrKeys = Nothing
, _adrCtr = Nothing
, _adrClicks = Nothing
, _adrPosition = Nothing
}
adrImpressions :: Lens' APIDataRow (Maybe Double)
adrImpressions
= lens _adrImpressions
(\ s a -> s{_adrImpressions = a})
. mapping _Coerce
adrKeys :: Lens' APIDataRow [Text]
adrKeys
= lens _adrKeys (\ s a -> s{_adrKeys = a}) . _Default
. _Coerce
adrCtr :: Lens' APIDataRow (Maybe Double)
adrCtr
= lens _adrCtr (\ s a -> s{_adrCtr = a}) .
mapping _Coerce
adrClicks :: Lens' APIDataRow (Maybe Double)
adrClicks
= lens _adrClicks (\ s a -> s{_adrClicks = a}) .
mapping _Coerce
adrPosition :: Lens' APIDataRow (Maybe Double)
adrPosition
= lens _adrPosition (\ s a -> s{_adrPosition = a}) .
mapping _Coerce
instance FromJSON APIDataRow where
parseJSON
= withObject "APIDataRow"
(\ o ->
APIDataRow' <$>
(o .:? "impressions") <*> (o .:? "keys" .!= mempty)
<*> (o .:? "ctr")
<*> (o .:? "clicks")
<*> (o .:? "position"))
instance ToJSON APIDataRow where
toJSON APIDataRow'{..}
= object
(catMaybes
[("impressions" .=) <$> _adrImpressions,
("keys" .=) <$> _adrKeys, ("ctr" .=) <$> _adrCtr,
("clicks" .=) <$> _adrClicks,
("position" .=) <$> _adrPosition])
data APIdimensionFilter = APIdimensionFilter'
{ _afOperator :: !(Maybe Text)
, _afDimension :: !(Maybe Text)
, _afExpression :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
apidimensionFilter
:: APIdimensionFilter
apidimensionFilter =
APIdimensionFilter'
{ _afOperator = Nothing
, _afDimension = Nothing
, _afExpression = Nothing
}
afOperator :: Lens' APIdimensionFilter (Maybe Text)
afOperator
= lens _afOperator (\ s a -> s{_afOperator = a})
afDimension :: Lens' APIdimensionFilter (Maybe Text)
afDimension
= lens _afDimension (\ s a -> s{_afDimension = a})
afExpression :: Lens' APIdimensionFilter (Maybe Text)
afExpression
= lens _afExpression (\ s a -> s{_afExpression = a})
instance FromJSON APIdimensionFilter where
parseJSON
= withObject "APIdimensionFilter"
(\ o ->
APIdimensionFilter' <$>
(o .:? "operator") <*> (o .:? "dimension") <*>
(o .:? "expression"))
instance ToJSON APIdimensionFilter where
toJSON APIdimensionFilter'{..}
= object
(catMaybes
[("operator" .=) <$> _afOperator,
("dimension" .=) <$> _afDimension,
("expression" .=) <$> _afExpression])
data URLCrawlErrorCount = URLCrawlErrorCount'
{ _ucecCount :: !(Maybe (Textual Int64))
, _ucecTimestamp :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorCount
:: URLCrawlErrorCount
urlCrawlErrorCount =
URLCrawlErrorCount'
{ _ucecCount = Nothing
, _ucecTimestamp = Nothing
}
ucecCount :: Lens' URLCrawlErrorCount (Maybe Int64)
ucecCount
= lens _ucecCount (\ s a -> s{_ucecCount = a}) .
mapping _Coerce
ucecTimestamp :: Lens' URLCrawlErrorCount (Maybe UTCTime)
ucecTimestamp
= lens _ucecTimestamp
(\ s a -> s{_ucecTimestamp = a})
. mapping _DateTime
instance FromJSON URLCrawlErrorCount where
parseJSON
= withObject "URLCrawlErrorCount"
(\ o ->
URLCrawlErrorCount' <$>
(o .:? "count") <*> (o .:? "timestamp"))
instance ToJSON URLCrawlErrorCount where
toJSON URLCrawlErrorCount'{..}
= object
(catMaybes
[("count" .=) <$> _ucecCount,
("timestamp" .=) <$> _ucecTimestamp])
data SearchAnalyticsQueryResponse = SearchAnalyticsQueryResponse'
{ _saqrRows :: !(Maybe [APIDataRow])
, _saqrResponseAggregationType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
searchAnalyticsQueryResponse
:: SearchAnalyticsQueryResponse
searchAnalyticsQueryResponse =
SearchAnalyticsQueryResponse'
{ _saqrRows = Nothing
, _saqrResponseAggregationType = Nothing
}
saqrRows :: Lens' SearchAnalyticsQueryResponse [APIDataRow]
saqrRows
= lens _saqrRows (\ s a -> s{_saqrRows = a}) .
_Default
. _Coerce
saqrResponseAggregationType :: Lens' SearchAnalyticsQueryResponse (Maybe Text)
saqrResponseAggregationType
= lens _saqrResponseAggregationType
(\ s a -> s{_saqrResponseAggregationType = a})
instance FromJSON SearchAnalyticsQueryResponse where
parseJSON
= withObject "SearchAnalyticsQueryResponse"
(\ o ->
SearchAnalyticsQueryResponse' <$>
(o .:? "rows" .!= mempty) <*>
(o .:? "responseAggregationType"))
instance ToJSON SearchAnalyticsQueryResponse where
toJSON SearchAnalyticsQueryResponse'{..}
= object
(catMaybes
[("rows" .=) <$> _saqrRows,
("responseAggregationType" .=) <$>
_saqrResponseAggregationType])
newtype URLCrawlErrorsSamplesListResponse = URLCrawlErrorsSamplesListResponse'
{ _uceslrURLCrawlErrorSample :: Maybe [URLCrawlErrorsSample]
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorsSamplesListResponse
:: URLCrawlErrorsSamplesListResponse
urlCrawlErrorsSamplesListResponse =
URLCrawlErrorsSamplesListResponse'
{ _uceslrURLCrawlErrorSample = Nothing
}
uceslrURLCrawlErrorSample :: Lens' URLCrawlErrorsSamplesListResponse [URLCrawlErrorsSample]
uceslrURLCrawlErrorSample
= lens _uceslrURLCrawlErrorSample
(\ s a -> s{_uceslrURLCrawlErrorSample = a})
. _Default
. _Coerce
instance FromJSON URLCrawlErrorsSamplesListResponse
where
parseJSON
= withObject "URLCrawlErrorsSamplesListResponse"
(\ o ->
URLCrawlErrorsSamplesListResponse' <$>
(o .:? "urlCrawlErrorSample" .!= mempty))
instance ToJSON URLCrawlErrorsSamplesListResponse
where
toJSON URLCrawlErrorsSamplesListResponse'{..}
= object
(catMaybes
[("urlCrawlErrorSample" .=) <$>
_uceslrURLCrawlErrorSample])
newtype URLCrawlErrorsCountsQueryResponse = URLCrawlErrorsCountsQueryResponse'
{ _ucecqrCountPerTypes :: Maybe [URLCrawlErrorCountsPerType]
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorsCountsQueryResponse
:: URLCrawlErrorsCountsQueryResponse
urlCrawlErrorsCountsQueryResponse =
URLCrawlErrorsCountsQueryResponse'
{ _ucecqrCountPerTypes = Nothing
}
ucecqrCountPerTypes :: Lens' URLCrawlErrorsCountsQueryResponse [URLCrawlErrorCountsPerType]
ucecqrCountPerTypes
= lens _ucecqrCountPerTypes
(\ s a -> s{_ucecqrCountPerTypes = a})
. _Default
. _Coerce
instance FromJSON URLCrawlErrorsCountsQueryResponse
where
parseJSON
= withObject "URLCrawlErrorsCountsQueryResponse"
(\ o ->
URLCrawlErrorsCountsQueryResponse' <$>
(o .:? "countPerTypes" .!= mempty))
instance ToJSON URLCrawlErrorsCountsQueryResponse
where
toJSON URLCrawlErrorsCountsQueryResponse'{..}
= object
(catMaybes
[("countPerTypes" .=) <$> _ucecqrCountPerTypes])
data URLCrawlErrorsSample = URLCrawlErrorsSample'
{ _ucesResponseCode :: !(Maybe (Textual Int32))
, _ucesURLDetails :: !(Maybe URLSampleDetails)
, _ucesLastCrawled :: !(Maybe DateTime')
, _ucesPageURL :: !(Maybe Text)
, _ucesFirstDetected :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
urlCrawlErrorsSample
:: URLCrawlErrorsSample
urlCrawlErrorsSample =
URLCrawlErrorsSample'
{ _ucesResponseCode = Nothing
, _ucesURLDetails = Nothing
, _ucesLastCrawled = Nothing
, _ucesPageURL = Nothing
, _ucesFirstDetected = Nothing
}
ucesResponseCode :: Lens' URLCrawlErrorsSample (Maybe Int32)
ucesResponseCode
= lens _ucesResponseCode
(\ s a -> s{_ucesResponseCode = a})
. mapping _Coerce
ucesURLDetails :: Lens' URLCrawlErrorsSample (Maybe URLSampleDetails)
ucesURLDetails
= lens _ucesURLDetails
(\ s a -> s{_ucesURLDetails = a})
ucesLastCrawled :: Lens' URLCrawlErrorsSample (Maybe UTCTime)
ucesLastCrawled
= lens _ucesLastCrawled
(\ s a -> s{_ucesLastCrawled = a})
. mapping _DateTime
ucesPageURL :: Lens' URLCrawlErrorsSample (Maybe Text)
ucesPageURL
= lens _ucesPageURL (\ s a -> s{_ucesPageURL = a})
ucesFirstDetected :: Lens' URLCrawlErrorsSample (Maybe UTCTime)
ucesFirstDetected
= lens _ucesFirstDetected
(\ s a -> s{_ucesFirstDetected = a})
. mapping _DateTime
instance FromJSON URLCrawlErrorsSample where
parseJSON
= withObject "URLCrawlErrorsSample"
(\ o ->
URLCrawlErrorsSample' <$>
(o .:? "responseCode") <*> (o .:? "urlDetails") <*>
(o .:? "last_crawled")
<*> (o .:? "pageUrl")
<*> (o .:? "first_detected"))
instance ToJSON URLCrawlErrorsSample where
toJSON URLCrawlErrorsSample'{..}
= object
(catMaybes
[("responseCode" .=) <$> _ucesResponseCode,
("urlDetails" .=) <$> _ucesURLDetails,
("last_crawled" .=) <$> _ucesLastCrawled,
("pageUrl" .=) <$> _ucesPageURL,
("first_detected" .=) <$> _ucesFirstDetected])
data WmxSitemap = WmxSitemap'
{ _wsContents :: !(Maybe [WmxSitemapContent])
, _wsPath :: !(Maybe Text)
, _wsIsSitemapsIndex :: !(Maybe Bool)
, _wsLastSubmitted :: !(Maybe DateTime')
, _wsWarnings :: !(Maybe (Textual Int64))
, _wsLastDownloaded :: !(Maybe DateTime')
, _wsIsPending :: !(Maybe Bool)
, _wsType :: !(Maybe Text)
, _wsErrors :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
wmxSitemap
:: WmxSitemap
wmxSitemap =
WmxSitemap'
{ _wsContents = Nothing
, _wsPath = Nothing
, _wsIsSitemapsIndex = Nothing
, _wsLastSubmitted = Nothing
, _wsWarnings = Nothing
, _wsLastDownloaded = Nothing
, _wsIsPending = Nothing
, _wsType = Nothing
, _wsErrors = Nothing
}
wsContents :: Lens' WmxSitemap [WmxSitemapContent]
wsContents
= lens _wsContents (\ s a -> s{_wsContents = a}) .
_Default
. _Coerce
wsPath :: Lens' WmxSitemap (Maybe Text)
wsPath = lens _wsPath (\ s a -> s{_wsPath = a})
wsIsSitemapsIndex :: Lens' WmxSitemap (Maybe Bool)
wsIsSitemapsIndex
= lens _wsIsSitemapsIndex
(\ s a -> s{_wsIsSitemapsIndex = a})
wsLastSubmitted :: Lens' WmxSitemap (Maybe UTCTime)
wsLastSubmitted
= lens _wsLastSubmitted
(\ s a -> s{_wsLastSubmitted = a})
. mapping _DateTime
wsWarnings :: Lens' WmxSitemap (Maybe Int64)
wsWarnings
= lens _wsWarnings (\ s a -> s{_wsWarnings = a}) .
mapping _Coerce
wsLastDownloaded :: Lens' WmxSitemap (Maybe UTCTime)
wsLastDownloaded
= lens _wsLastDownloaded
(\ s a -> s{_wsLastDownloaded = a})
. mapping _DateTime
wsIsPending :: Lens' WmxSitemap (Maybe Bool)
wsIsPending
= lens _wsIsPending (\ s a -> s{_wsIsPending = a})
wsType :: Lens' WmxSitemap (Maybe Text)
wsType = lens _wsType (\ s a -> s{_wsType = a})
wsErrors :: Lens' WmxSitemap (Maybe Int64)
wsErrors
= lens _wsErrors (\ s a -> s{_wsErrors = a}) .
mapping _Coerce
instance FromJSON WmxSitemap where
parseJSON
= withObject "WmxSitemap"
(\ o ->
WmxSitemap' <$>
(o .:? "contents" .!= mempty) <*> (o .:? "path") <*>
(o .:? "isSitemapsIndex")
<*> (o .:? "lastSubmitted")
<*> (o .:? "warnings")
<*> (o .:? "lastDownloaded")
<*> (o .:? "isPending")
<*> (o .:? "type")
<*> (o .:? "errors"))
instance ToJSON WmxSitemap where
toJSON WmxSitemap'{..}
= object
(catMaybes
[("contents" .=) <$> _wsContents,
("path" .=) <$> _wsPath,
("isSitemapsIndex" .=) <$> _wsIsSitemapsIndex,
("lastSubmitted" .=) <$> _wsLastSubmitted,
("warnings" .=) <$> _wsWarnings,
("lastDownloaded" .=) <$> _wsLastDownloaded,
("isPending" .=) <$> _wsIsPending,
("type" .=) <$> _wsType,
("errors" .=) <$> _wsErrors])
newtype SitemapsListResponse = SitemapsListResponse'
{ _slrSitemap :: Maybe [WmxSitemap]
} deriving (Eq,Show,Data,Typeable,Generic)
sitemapsListResponse
:: SitemapsListResponse
sitemapsListResponse =
SitemapsListResponse'
{ _slrSitemap = Nothing
}
slrSitemap :: Lens' SitemapsListResponse [WmxSitemap]
slrSitemap
= lens _slrSitemap (\ s a -> s{_slrSitemap = a}) .
_Default
. _Coerce
instance FromJSON SitemapsListResponse where
parseJSON
= withObject "SitemapsListResponse"
(\ o ->
SitemapsListResponse' <$>
(o .:? "sitemap" .!= mempty))
instance ToJSON SitemapsListResponse where
toJSON SitemapsListResponse'{..}
= object (catMaybes [("sitemap" .=) <$> _slrSitemap])
data SearchAnalyticsQueryRequest = SearchAnalyticsQueryRequest'
{ _saqrAggregationType :: !(Maybe Text)
, _saqrRowLimit :: !(Maybe (Textual Int32))
, _saqrEndDate :: !(Maybe Text)
, _saqrSearchType :: !(Maybe Text)
, _saqrDimensionFilterGroups :: !(Maybe [APIdimensionFilterGroup])
, _saqrStartDate :: !(Maybe Text)
, _saqrStartRow :: !(Maybe (Textual Int32))
, _saqrDimensions :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
searchAnalyticsQueryRequest
:: SearchAnalyticsQueryRequest
searchAnalyticsQueryRequest =
SearchAnalyticsQueryRequest'
{ _saqrAggregationType = Nothing
, _saqrRowLimit = Nothing
, _saqrEndDate = Nothing
, _saqrSearchType = Nothing
, _saqrDimensionFilterGroups = Nothing
, _saqrStartDate = Nothing
, _saqrStartRow = Nothing
, _saqrDimensions = Nothing
}
saqrAggregationType :: Lens' SearchAnalyticsQueryRequest (Maybe Text)
saqrAggregationType
= lens _saqrAggregationType
(\ s a -> s{_saqrAggregationType = a})
saqrRowLimit :: Lens' SearchAnalyticsQueryRequest (Maybe Int32)
saqrRowLimit
= lens _saqrRowLimit (\ s a -> s{_saqrRowLimit = a})
. mapping _Coerce
saqrEndDate :: Lens' SearchAnalyticsQueryRequest (Maybe Text)
saqrEndDate
= lens _saqrEndDate (\ s a -> s{_saqrEndDate = a})
saqrSearchType :: Lens' SearchAnalyticsQueryRequest (Maybe Text)
saqrSearchType
= lens _saqrSearchType
(\ s a -> s{_saqrSearchType = a})
saqrDimensionFilterGroups :: Lens' SearchAnalyticsQueryRequest [APIdimensionFilterGroup]
saqrDimensionFilterGroups
= lens _saqrDimensionFilterGroups
(\ s a -> s{_saqrDimensionFilterGroups = a})
. _Default
. _Coerce
saqrStartDate :: Lens' SearchAnalyticsQueryRequest (Maybe Text)
saqrStartDate
= lens _saqrStartDate
(\ s a -> s{_saqrStartDate = a})
saqrStartRow :: Lens' SearchAnalyticsQueryRequest (Maybe Int32)
saqrStartRow
= lens _saqrStartRow (\ s a -> s{_saqrStartRow = a})
. mapping _Coerce
saqrDimensions :: Lens' SearchAnalyticsQueryRequest [Text]
saqrDimensions
= lens _saqrDimensions
(\ s a -> s{_saqrDimensions = a})
. _Default
. _Coerce
instance FromJSON SearchAnalyticsQueryRequest where
parseJSON
= withObject "SearchAnalyticsQueryRequest"
(\ o ->
SearchAnalyticsQueryRequest' <$>
(o .:? "aggregationType") <*> (o .:? "rowLimit") <*>
(o .:? "endDate")
<*> (o .:? "searchType")
<*> (o .:? "dimensionFilterGroups" .!= mempty)
<*> (o .:? "startDate")
<*> (o .:? "startRow")
<*> (o .:? "dimensions" .!= mempty))
instance ToJSON SearchAnalyticsQueryRequest where
toJSON SearchAnalyticsQueryRequest'{..}
= object
(catMaybes
[("aggregationType" .=) <$> _saqrAggregationType,
("rowLimit" .=) <$> _saqrRowLimit,
("endDate" .=) <$> _saqrEndDate,
("searchType" .=) <$> _saqrSearchType,
("dimensionFilterGroups" .=) <$>
_saqrDimensionFilterGroups,
("startDate" .=) <$> _saqrStartDate,
("startRow" .=) <$> _saqrStartRow,
("dimensions" .=) <$> _saqrDimensions])
newtype SitesListResponse = SitesListResponse'
{ _slrSiteEntry :: Maybe [WmxSite]
} deriving (Eq,Show,Data,Typeable,Generic)
sitesListResponse
:: SitesListResponse
sitesListResponse =
SitesListResponse'
{ _slrSiteEntry = Nothing
}
slrSiteEntry :: Lens' SitesListResponse [WmxSite]
slrSiteEntry
= lens _slrSiteEntry (\ s a -> s{_slrSiteEntry = a})
. _Default
. _Coerce
instance FromJSON SitesListResponse where
parseJSON
= withObject "SitesListResponse"
(\ o ->
SitesListResponse' <$>
(o .:? "siteEntry" .!= mempty))
instance ToJSON SitesListResponse where
toJSON SitesListResponse'{..}
= object
(catMaybes [("siteEntry" .=) <$> _slrSiteEntry])
data WmxSite = WmxSite'
{ _wsPermissionLevel :: !(Maybe Text)
, _wsSiteURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
wmxSite
:: WmxSite
wmxSite =
WmxSite'
{ _wsPermissionLevel = Nothing
, _wsSiteURL = Nothing
}
wsPermissionLevel :: Lens' WmxSite (Maybe Text)
wsPermissionLevel
= lens _wsPermissionLevel
(\ s a -> s{_wsPermissionLevel = a})
wsSiteURL :: Lens' WmxSite (Maybe Text)
wsSiteURL
= lens _wsSiteURL (\ s a -> s{_wsSiteURL = a})
instance FromJSON WmxSite where
parseJSON
= withObject "WmxSite"
(\ o ->
WmxSite' <$>
(o .:? "permissionLevel") <*> (o .:? "siteUrl"))
instance ToJSON WmxSite where
toJSON WmxSite'{..}
= object
(catMaybes
[("permissionLevel" .=) <$> _wsPermissionLevel,
("siteUrl" .=) <$> _wsSiteURL])