{-# 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.DoubleClickBids.Types.Product where
import Network.Google.DoubleClickBids.Types.Sum
import Network.Google.Prelude
data ListReportsResponse = ListReportsResponse'
{ _lrrReports :: !(Maybe [Report])
, _lrrKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
listReportsResponse
:: ListReportsResponse
listReportsResponse =
ListReportsResponse'
{ _lrrReports = Nothing
, _lrrKind = "doubleclickbidmanager#listReportsResponse"
}
lrrReports :: Lens' ListReportsResponse [Report]
lrrReports
= lens _lrrReports (\ s a -> s{_lrrReports = a}) .
_Default
. _Coerce
lrrKind :: Lens' ListReportsResponse Text
lrrKind = lens _lrrKind (\ s a -> s{_lrrKind = a})
instance FromJSON ListReportsResponse where
parseJSON
= withObject "ListReportsResponse"
(\ o ->
ListReportsResponse' <$>
(o .:? "reports" .!= mempty) <*>
(o .:? "kind" .!=
"doubleclickbidmanager#listReportsResponse"))
instance ToJSON ListReportsResponse where
toJSON ListReportsResponse'{..}
= object
(catMaybes
[("reports" .=) <$> _lrrReports,
Just ("kind" .= _lrrKind)])
data QueryMetadata = QueryMetadata'
{ _qmGoogleCloudStoragePathForLatestReport :: !(Maybe Text)
, _qmLocale :: !(Maybe Text)
, _qmFormat :: !(Maybe QueryMetadataFormat)
, _qmGoogleDrivePathForLatestReport :: !(Maybe Text)
, _qmShareEmailAddress :: !(Maybe [Text])
, _qmRunning :: !(Maybe Bool)
, _qmDataRange :: !(Maybe QueryMetadataDataRange)
, _qmLatestReportRunTimeMs :: !(Maybe (Textual Int64))
, _qmReportCount :: !(Maybe (Textual Int32))
, _qmTitle :: !(Maybe Text)
, _qmSendNotification :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
queryMetadata
:: QueryMetadata
queryMetadata =
QueryMetadata'
{ _qmGoogleCloudStoragePathForLatestReport = Nothing
, _qmLocale = Nothing
, _qmFormat = Nothing
, _qmGoogleDrivePathForLatestReport = Nothing
, _qmShareEmailAddress = Nothing
, _qmRunning = Nothing
, _qmDataRange = Nothing
, _qmLatestReportRunTimeMs = Nothing
, _qmReportCount = Nothing
, _qmTitle = Nothing
, _qmSendNotification = Nothing
}
qmGoogleCloudStoragePathForLatestReport :: Lens' QueryMetadata (Maybe Text)
qmGoogleCloudStoragePathForLatestReport
= lens _qmGoogleCloudStoragePathForLatestReport
(\ s a ->
s{_qmGoogleCloudStoragePathForLatestReport = a})
qmLocale :: Lens' QueryMetadata (Maybe Text)
qmLocale = lens _qmLocale (\ s a -> s{_qmLocale = a})
qmFormat :: Lens' QueryMetadata (Maybe QueryMetadataFormat)
qmFormat = lens _qmFormat (\ s a -> s{_qmFormat = a})
qmGoogleDrivePathForLatestReport :: Lens' QueryMetadata (Maybe Text)
qmGoogleDrivePathForLatestReport
= lens _qmGoogleDrivePathForLatestReport
(\ s a -> s{_qmGoogleDrivePathForLatestReport = a})
qmShareEmailAddress :: Lens' QueryMetadata [Text]
qmShareEmailAddress
= lens _qmShareEmailAddress
(\ s a -> s{_qmShareEmailAddress = a})
. _Default
. _Coerce
qmRunning :: Lens' QueryMetadata (Maybe Bool)
qmRunning
= lens _qmRunning (\ s a -> s{_qmRunning = a})
qmDataRange :: Lens' QueryMetadata (Maybe QueryMetadataDataRange)
qmDataRange
= lens _qmDataRange (\ s a -> s{_qmDataRange = a})
qmLatestReportRunTimeMs :: Lens' QueryMetadata (Maybe Int64)
qmLatestReportRunTimeMs
= lens _qmLatestReportRunTimeMs
(\ s a -> s{_qmLatestReportRunTimeMs = a})
. mapping _Coerce
qmReportCount :: Lens' QueryMetadata (Maybe Int32)
qmReportCount
= lens _qmReportCount
(\ s a -> s{_qmReportCount = a})
. mapping _Coerce
qmTitle :: Lens' QueryMetadata (Maybe Text)
qmTitle = lens _qmTitle (\ s a -> s{_qmTitle = a})
qmSendNotification :: Lens' QueryMetadata (Maybe Bool)
qmSendNotification
= lens _qmSendNotification
(\ s a -> s{_qmSendNotification = a})
instance FromJSON QueryMetadata where
parseJSON
= withObject "QueryMetadata"
(\ o ->
QueryMetadata' <$>
(o .:? "googleCloudStoragePathForLatestReport") <*>
(o .:? "locale")
<*> (o .:? "format")
<*> (o .:? "googleDrivePathForLatestReport")
<*> (o .:? "shareEmailAddress" .!= mempty)
<*> (o .:? "running")
<*> (o .:? "dataRange")
<*> (o .:? "latestReportRunTimeMs")
<*> (o .:? "reportCount")
<*> (o .:? "title")
<*> (o .:? "sendNotification"))
instance ToJSON QueryMetadata where
toJSON QueryMetadata'{..}
= object
(catMaybes
[("googleCloudStoragePathForLatestReport" .=) <$>
_qmGoogleCloudStoragePathForLatestReport,
("locale" .=) <$> _qmLocale,
("format" .=) <$> _qmFormat,
("googleDrivePathForLatestReport" .=) <$>
_qmGoogleDrivePathForLatestReport,
("shareEmailAddress" .=) <$> _qmShareEmailAddress,
("running" .=) <$> _qmRunning,
("dataRange" .=) <$> _qmDataRange,
("latestReportRunTimeMs" .=) <$>
_qmLatestReportRunTimeMs,
("reportCount" .=) <$> _qmReportCount,
("title" .=) <$> _qmTitle,
("sendNotification" .=) <$> _qmSendNotification])
data RunQueryRequest = RunQueryRequest'
{ _rqrReportDataEndTimeMs :: !(Maybe (Textual Int64))
, _rqrDataRange :: !(Maybe RunQueryRequestDataRange)
, _rqrReportDataStartTimeMs :: !(Maybe (Textual Int64))
, _rqrTimezoneCode :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
runQueryRequest
:: RunQueryRequest
runQueryRequest =
RunQueryRequest'
{ _rqrReportDataEndTimeMs = Nothing
, _rqrDataRange = Nothing
, _rqrReportDataStartTimeMs = Nothing
, _rqrTimezoneCode = Nothing
}
rqrReportDataEndTimeMs :: Lens' RunQueryRequest (Maybe Int64)
rqrReportDataEndTimeMs
= lens _rqrReportDataEndTimeMs
(\ s a -> s{_rqrReportDataEndTimeMs = a})
. mapping _Coerce
rqrDataRange :: Lens' RunQueryRequest (Maybe RunQueryRequestDataRange)
rqrDataRange
= lens _rqrDataRange (\ s a -> s{_rqrDataRange = a})
rqrReportDataStartTimeMs :: Lens' RunQueryRequest (Maybe Int64)
rqrReportDataStartTimeMs
= lens _rqrReportDataStartTimeMs
(\ s a -> s{_rqrReportDataStartTimeMs = a})
. mapping _Coerce
rqrTimezoneCode :: Lens' RunQueryRequest (Maybe Text)
rqrTimezoneCode
= lens _rqrTimezoneCode
(\ s a -> s{_rqrTimezoneCode = a})
instance FromJSON RunQueryRequest where
parseJSON
= withObject "RunQueryRequest"
(\ o ->
RunQueryRequest' <$>
(o .:? "reportDataEndTimeMs") <*> (o .:? "dataRange")
<*> (o .:? "reportDataStartTimeMs")
<*> (o .:? "timezoneCode"))
instance ToJSON RunQueryRequest where
toJSON RunQueryRequest'{..}
= object
(catMaybes
[("reportDataEndTimeMs" .=) <$>
_rqrReportDataEndTimeMs,
("dataRange" .=) <$> _rqrDataRange,
("reportDataStartTimeMs" .=) <$>
_rqrReportDataStartTimeMs,
("timezoneCode" .=) <$> _rqrTimezoneCode])
data FilterPair = FilterPair'
{ _fpValue :: !(Maybe Text)
, _fpType :: !(Maybe FilterPairType)
} deriving (Eq,Show,Data,Typeable,Generic)
filterPair
:: FilterPair
filterPair =
FilterPair'
{ _fpValue = Nothing
, _fpType = Nothing
}
fpValue :: Lens' FilterPair (Maybe Text)
fpValue = lens _fpValue (\ s a -> s{_fpValue = a})
fpType :: Lens' FilterPair (Maybe FilterPairType)
fpType = lens _fpType (\ s a -> s{_fpType = a})
instance FromJSON FilterPair where
parseJSON
= withObject "FilterPair"
(\ o ->
FilterPair' <$> (o .:? "value") <*> (o .:? "type"))
instance ToJSON FilterPair where
toJSON FilterPair'{..}
= object
(catMaybes
[("value" .=) <$> _fpValue, ("type" .=) <$> _fpType])
data UploadLineItemsRequest = UploadLineItemsRequest'
{ _ulirLineItems :: !(Maybe Text)
, _ulirFormat :: !(Maybe UploadLineItemsRequestFormat)
, _ulirDryRun :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
uploadLineItemsRequest
:: UploadLineItemsRequest
uploadLineItemsRequest =
UploadLineItemsRequest'
{ _ulirLineItems = Nothing
, _ulirFormat = Nothing
, _ulirDryRun = Nothing
}
ulirLineItems :: Lens' UploadLineItemsRequest (Maybe Text)
ulirLineItems
= lens _ulirLineItems
(\ s a -> s{_ulirLineItems = a})
ulirFormat :: Lens' UploadLineItemsRequest (Maybe UploadLineItemsRequestFormat)
ulirFormat
= lens _ulirFormat (\ s a -> s{_ulirFormat = a})
ulirDryRun :: Lens' UploadLineItemsRequest (Maybe Bool)
ulirDryRun
= lens _ulirDryRun (\ s a -> s{_ulirDryRun = a})
instance FromJSON UploadLineItemsRequest where
parseJSON
= withObject "UploadLineItemsRequest"
(\ o ->
UploadLineItemsRequest' <$>
(o .:? "lineItems") <*> (o .:? "format") <*>
(o .:? "dryRun"))
instance ToJSON UploadLineItemsRequest where
toJSON UploadLineItemsRequest'{..}
= object
(catMaybes
[("lineItems" .=) <$> _ulirLineItems,
("format" .=) <$> _ulirFormat,
("dryRun" .=) <$> _ulirDryRun])
data DownloadLineItemsRequest = DownloadLineItemsRequest'
{ _dlirFilterType :: !(Maybe DownloadLineItemsRequestFilterType)
, _dlirFormat :: !(Maybe DownloadLineItemsRequestFormat)
, _dlirFileSpec :: !(Maybe DownloadLineItemsRequestFileSpec)
, _dlirFilterIds :: !(Maybe [Textual Int64])
} deriving (Eq,Show,Data,Typeable,Generic)
downloadLineItemsRequest
:: DownloadLineItemsRequest
downloadLineItemsRequest =
DownloadLineItemsRequest'
{ _dlirFilterType = Nothing
, _dlirFormat = Nothing
, _dlirFileSpec = Nothing
, _dlirFilterIds = Nothing
}
dlirFilterType :: Lens' DownloadLineItemsRequest (Maybe DownloadLineItemsRequestFilterType)
dlirFilterType
= lens _dlirFilterType
(\ s a -> s{_dlirFilterType = a})
dlirFormat :: Lens' DownloadLineItemsRequest (Maybe DownloadLineItemsRequestFormat)
dlirFormat
= lens _dlirFormat (\ s a -> s{_dlirFormat = a})
dlirFileSpec :: Lens' DownloadLineItemsRequest (Maybe DownloadLineItemsRequestFileSpec)
dlirFileSpec
= lens _dlirFileSpec (\ s a -> s{_dlirFileSpec = a})
dlirFilterIds :: Lens' DownloadLineItemsRequest [Int64]
dlirFilterIds
= lens _dlirFilterIds
(\ s a -> s{_dlirFilterIds = a})
. _Default
. _Coerce
instance FromJSON DownloadLineItemsRequest where
parseJSON
= withObject "DownloadLineItemsRequest"
(\ o ->
DownloadLineItemsRequest' <$>
(o .:? "filterType") <*> (o .:? "format") <*>
(o .:? "fileSpec")
<*> (o .:? "filterIds" .!= mempty))
instance ToJSON DownloadLineItemsRequest where
toJSON DownloadLineItemsRequest'{..}
= object
(catMaybes
[("filterType" .=) <$> _dlirFilterType,
("format" .=) <$> _dlirFormat,
("fileSpec" .=) <$> _dlirFileSpec,
("filterIds" .=) <$> _dlirFilterIds])
data DownloadRequest = DownloadRequest'
{ _drFileTypes :: !(Maybe [DownloadRequestFileTypesItem])
, _drFilterType :: !(Maybe DownloadRequestFilterType)
, _drVersion :: !(Maybe Text)
, _drFilterIds :: !(Maybe [Textual Int64])
} deriving (Eq,Show,Data,Typeable,Generic)
downloadRequest
:: DownloadRequest
downloadRequest =
DownloadRequest'
{ _drFileTypes = Nothing
, _drFilterType = Nothing
, _drVersion = Nothing
, _drFilterIds = Nothing
}
drFileTypes :: Lens' DownloadRequest [DownloadRequestFileTypesItem]
drFileTypes
= lens _drFileTypes (\ s a -> s{_drFileTypes = a}) .
_Default
. _Coerce
drFilterType :: Lens' DownloadRequest (Maybe DownloadRequestFilterType)
drFilterType
= lens _drFilterType (\ s a -> s{_drFilterType = a})
drVersion :: Lens' DownloadRequest (Maybe Text)
drVersion
= lens _drVersion (\ s a -> s{_drVersion = a})
drFilterIds :: Lens' DownloadRequest [Int64]
drFilterIds
= lens _drFilterIds (\ s a -> s{_drFilterIds = a}) .
_Default
. _Coerce
instance FromJSON DownloadRequest where
parseJSON
= withObject "DownloadRequest"
(\ o ->
DownloadRequest' <$>
(o .:? "fileTypes" .!= mempty) <*>
(o .:? "filterType")
<*> (o .:? "version")
<*> (o .:? "filterIds" .!= mempty))
instance ToJSON DownloadRequest where
toJSON DownloadRequest'{..}
= object
(catMaybes
[("fileTypes" .=) <$> _drFileTypes,
("filterType" .=) <$> _drFilterType,
("version" .=) <$> _drVersion,
("filterIds" .=) <$> _drFilterIds])
data ListQueriesResponse = ListQueriesResponse'
{ _lqrQueries :: !(Maybe [Query])
, _lqrKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
listQueriesResponse
:: ListQueriesResponse
listQueriesResponse =
ListQueriesResponse'
{ _lqrQueries = Nothing
, _lqrKind = "doubleclickbidmanager#listQueriesResponse"
}
lqrQueries :: Lens' ListQueriesResponse [Query]
lqrQueries
= lens _lqrQueries (\ s a -> s{_lqrQueries = a}) .
_Default
. _Coerce
lqrKind :: Lens' ListQueriesResponse Text
lqrKind = lens _lqrKind (\ s a -> s{_lqrKind = a})
instance FromJSON ListQueriesResponse where
parseJSON
= withObject "ListQueriesResponse"
(\ o ->
ListQueriesResponse' <$>
(o .:? "queries" .!= mempty) <*>
(o .:? "kind" .!=
"doubleclickbidmanager#listQueriesResponse"))
instance ToJSON ListQueriesResponse where
toJSON ListQueriesResponse'{..}
= object
(catMaybes
[("queries" .=) <$> _lqrQueries,
Just ("kind" .= _lqrKind)])
newtype UploadLineItemsResponse = UploadLineItemsResponse'
{ _ulirUploadStatus :: Maybe UploadStatus
} deriving (Eq,Show,Data,Typeable,Generic)
uploadLineItemsResponse
:: UploadLineItemsResponse
uploadLineItemsResponse =
UploadLineItemsResponse'
{ _ulirUploadStatus = Nothing
}
ulirUploadStatus :: Lens' UploadLineItemsResponse (Maybe UploadStatus)
ulirUploadStatus
= lens _ulirUploadStatus
(\ s a -> s{_ulirUploadStatus = a})
instance FromJSON UploadLineItemsResponse where
parseJSON
= withObject "UploadLineItemsResponse"
(\ o ->
UploadLineItemsResponse' <$> (o .:? "uploadStatus"))
instance ToJSON UploadLineItemsResponse where
toJSON UploadLineItemsResponse'{..}
= object
(catMaybes
[("uploadStatus" .=) <$> _ulirUploadStatus])
data ReportMetadata = ReportMetadata'
{ _rmStatus :: !(Maybe ReportStatus)
, _rmReportDataEndTimeMs :: !(Maybe (Textual Int64))
, _rmGoogleCloudStoragePath :: !(Maybe Text)
, _rmReportDataStartTimeMs :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
reportMetadata
:: ReportMetadata
reportMetadata =
ReportMetadata'
{ _rmStatus = Nothing
, _rmReportDataEndTimeMs = Nothing
, _rmGoogleCloudStoragePath = Nothing
, _rmReportDataStartTimeMs = Nothing
}
rmStatus :: Lens' ReportMetadata (Maybe ReportStatus)
rmStatus = lens _rmStatus (\ s a -> s{_rmStatus = a})
rmReportDataEndTimeMs :: Lens' ReportMetadata (Maybe Int64)
rmReportDataEndTimeMs
= lens _rmReportDataEndTimeMs
(\ s a -> s{_rmReportDataEndTimeMs = a})
. mapping _Coerce
rmGoogleCloudStoragePath :: Lens' ReportMetadata (Maybe Text)
rmGoogleCloudStoragePath
= lens _rmGoogleCloudStoragePath
(\ s a -> s{_rmGoogleCloudStoragePath = a})
rmReportDataStartTimeMs :: Lens' ReportMetadata (Maybe Int64)
rmReportDataStartTimeMs
= lens _rmReportDataStartTimeMs
(\ s a -> s{_rmReportDataStartTimeMs = a})
. mapping _Coerce
instance FromJSON ReportMetadata where
parseJSON
= withObject "ReportMetadata"
(\ o ->
ReportMetadata' <$>
(o .:? "status") <*> (o .:? "reportDataEndTimeMs")
<*> (o .:? "googleCloudStoragePath")
<*> (o .:? "reportDataStartTimeMs"))
instance ToJSON ReportMetadata where
toJSON ReportMetadata'{..}
= object
(catMaybes
[("status" .=) <$> _rmStatus,
("reportDataEndTimeMs" .=) <$>
_rmReportDataEndTimeMs,
("googleCloudStoragePath" .=) <$>
_rmGoogleCloudStoragePath,
("reportDataStartTimeMs" .=) <$>
_rmReportDataStartTimeMs])
data Report = Report'
{ _rParams :: !(Maybe Parameters)
, _rKey :: !(Maybe ReportKey)
, _rMetadata :: !(Maybe ReportMetadata)
} deriving (Eq,Show,Data,Typeable,Generic)
report
:: Report
report =
Report'
{ _rParams = Nothing
, _rKey = Nothing
, _rMetadata = Nothing
}
rParams :: Lens' Report (Maybe Parameters)
rParams = lens _rParams (\ s a -> s{_rParams = a})
rKey :: Lens' Report (Maybe ReportKey)
rKey = lens _rKey (\ s a -> s{_rKey = a})
rMetadata :: Lens' Report (Maybe ReportMetadata)
rMetadata
= lens _rMetadata (\ s a -> s{_rMetadata = a})
instance FromJSON Report where
parseJSON
= withObject "Report"
(\ o ->
Report' <$>
(o .:? "params") <*> (o .:? "key") <*>
(o .:? "metadata"))
instance ToJSON Report where
toJSON Report'{..}
= object
(catMaybes
[("params" .=) <$> _rParams, ("key" .=) <$> _rKey,
("metadata" .=) <$> _rMetadata])
data RowStatus = RowStatus'
{ _rsEntityName :: !(Maybe Text)
, _rsChanged :: !(Maybe Bool)
, _rsPersisted :: !(Maybe Bool)
, _rsRowNumber :: !(Maybe (Textual Int32))
, _rsErrors :: !(Maybe [Text])
, _rsEntityId :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
rowStatus
:: RowStatus
rowStatus =
RowStatus'
{ _rsEntityName = Nothing
, _rsChanged = Nothing
, _rsPersisted = Nothing
, _rsRowNumber = Nothing
, _rsErrors = Nothing
, _rsEntityId = Nothing
}
rsEntityName :: Lens' RowStatus (Maybe Text)
rsEntityName
= lens _rsEntityName (\ s a -> s{_rsEntityName = a})
rsChanged :: Lens' RowStatus (Maybe Bool)
rsChanged
= lens _rsChanged (\ s a -> s{_rsChanged = a})
rsPersisted :: Lens' RowStatus (Maybe Bool)
rsPersisted
= lens _rsPersisted (\ s a -> s{_rsPersisted = a})
rsRowNumber :: Lens' RowStatus (Maybe Int32)
rsRowNumber
= lens _rsRowNumber (\ s a -> s{_rsRowNumber = a}) .
mapping _Coerce
rsErrors :: Lens' RowStatus [Text]
rsErrors
= lens _rsErrors (\ s a -> s{_rsErrors = a}) .
_Default
. _Coerce
rsEntityId :: Lens' RowStatus (Maybe Int64)
rsEntityId
= lens _rsEntityId (\ s a -> s{_rsEntityId = a}) .
mapping _Coerce
instance FromJSON RowStatus where
parseJSON
= withObject "RowStatus"
(\ o ->
RowStatus' <$>
(o .:? "entityName") <*> (o .:? "changed") <*>
(o .:? "persisted")
<*> (o .:? "rowNumber")
<*> (o .:? "errors" .!= mempty)
<*> (o .:? "entityId"))
instance ToJSON RowStatus where
toJSON RowStatus'{..}
= object
(catMaybes
[("entityName" .=) <$> _rsEntityName,
("changed" .=) <$> _rsChanged,
("persisted" .=) <$> _rsPersisted,
("rowNumber" .=) <$> _rsRowNumber,
("errors" .=) <$> _rsErrors,
("entityId" .=) <$> _rsEntityId])
data ReportKey = ReportKey'
{ _rkQueryId :: !(Maybe (Textual Int64))
, _rkReportId :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
reportKey
:: ReportKey
reportKey =
ReportKey'
{ _rkQueryId = Nothing
, _rkReportId = Nothing
}
rkQueryId :: Lens' ReportKey (Maybe Int64)
rkQueryId
= lens _rkQueryId (\ s a -> s{_rkQueryId = a}) .
mapping _Coerce
rkReportId :: Lens' ReportKey (Maybe Int64)
rkReportId
= lens _rkReportId (\ s a -> s{_rkReportId = a}) .
mapping _Coerce
instance FromJSON ReportKey where
parseJSON
= withObject "ReportKey"
(\ o ->
ReportKey' <$>
(o .:? "queryId") <*> (o .:? "reportId"))
instance ToJSON ReportKey where
toJSON ReportKey'{..}
= object
(catMaybes
[("queryId" .=) <$> _rkQueryId,
("reportId" .=) <$> _rkReportId])
data UploadStatus = UploadStatus'
{ _usRowStatus :: !(Maybe [RowStatus])
, _usErrors :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
uploadStatus
:: UploadStatus
uploadStatus =
UploadStatus'
{ _usRowStatus = Nothing
, _usErrors = Nothing
}
usRowStatus :: Lens' UploadStatus [RowStatus]
usRowStatus
= lens _usRowStatus (\ s a -> s{_usRowStatus = a}) .
_Default
. _Coerce
usErrors :: Lens' UploadStatus [Text]
usErrors
= lens _usErrors (\ s a -> s{_usErrors = a}) .
_Default
. _Coerce
instance FromJSON UploadStatus where
parseJSON
= withObject "UploadStatus"
(\ o ->
UploadStatus' <$>
(o .:? "rowStatus" .!= mempty) <*>
(o .:? "errors" .!= mempty))
instance ToJSON UploadStatus where
toJSON UploadStatus'{..}
= object
(catMaybes
[("rowStatus" .=) <$> _usRowStatus,
("errors" .=) <$> _usErrors])
data QuerySchedule = QuerySchedule'
{ _qsFrequency :: !(Maybe QueryScheduleFrequency)
, _qsEndTimeMs :: !(Maybe (Textual Int64))
, _qsNextRunMinuteOfDay :: !(Maybe (Textual Int32))
, _qsNextRunTimezoneCode :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
querySchedule
:: QuerySchedule
querySchedule =
QuerySchedule'
{ _qsFrequency = Nothing
, _qsEndTimeMs = Nothing
, _qsNextRunMinuteOfDay = Nothing
, _qsNextRunTimezoneCode = Nothing
}
qsFrequency :: Lens' QuerySchedule (Maybe QueryScheduleFrequency)
qsFrequency
= lens _qsFrequency (\ s a -> s{_qsFrequency = a})
qsEndTimeMs :: Lens' QuerySchedule (Maybe Int64)
qsEndTimeMs
= lens _qsEndTimeMs (\ s a -> s{_qsEndTimeMs = a}) .
mapping _Coerce
qsNextRunMinuteOfDay :: Lens' QuerySchedule (Maybe Int32)
qsNextRunMinuteOfDay
= lens _qsNextRunMinuteOfDay
(\ s a -> s{_qsNextRunMinuteOfDay = a})
. mapping _Coerce
qsNextRunTimezoneCode :: Lens' QuerySchedule (Maybe Text)
qsNextRunTimezoneCode
= lens _qsNextRunTimezoneCode
(\ s a -> s{_qsNextRunTimezoneCode = a})
instance FromJSON QuerySchedule where
parseJSON
= withObject "QuerySchedule"
(\ o ->
QuerySchedule' <$>
(o .:? "frequency") <*> (o .:? "endTimeMs") <*>
(o .:? "nextRunMinuteOfDay")
<*> (o .:? "nextRunTimezoneCode"))
instance ToJSON QuerySchedule where
toJSON QuerySchedule'{..}
= object
(catMaybes
[("frequency" .=) <$> _qsFrequency,
("endTimeMs" .=) <$> _qsEndTimeMs,
("nextRunMinuteOfDay" .=) <$> _qsNextRunMinuteOfDay,
("nextRunTimezoneCode" .=) <$>
_qsNextRunTimezoneCode])
newtype DownloadLineItemsResponse = DownloadLineItemsResponse'
{ _dlirLineItems :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
downloadLineItemsResponse
:: DownloadLineItemsResponse
downloadLineItemsResponse =
DownloadLineItemsResponse'
{ _dlirLineItems = Nothing
}
dlirLineItems :: Lens' DownloadLineItemsResponse (Maybe Text)
dlirLineItems
= lens _dlirLineItems
(\ s a -> s{_dlirLineItems = a})
instance FromJSON DownloadLineItemsResponse where
parseJSON
= withObject "DownloadLineItemsResponse"
(\ o ->
DownloadLineItemsResponse' <$> (o .:? "lineItems"))
instance ToJSON DownloadLineItemsResponse where
toJSON DownloadLineItemsResponse'{..}
= object
(catMaybes [("lineItems" .=) <$> _dlirLineItems])
data DownloadResponse = DownloadResponse'
{ _drInsertionOrders :: !(Maybe Text)
, _drCampaigns :: !(Maybe Text)
, _drLineItems :: !(Maybe Text)
, _drAdGroups :: !(Maybe Text)
, _drAds :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
downloadResponse
:: DownloadResponse
downloadResponse =
DownloadResponse'
{ _drInsertionOrders = Nothing
, _drCampaigns = Nothing
, _drLineItems = Nothing
, _drAdGroups = Nothing
, _drAds = Nothing
}
drInsertionOrders :: Lens' DownloadResponse (Maybe Text)
drInsertionOrders
= lens _drInsertionOrders
(\ s a -> s{_drInsertionOrders = a})
drCampaigns :: Lens' DownloadResponse (Maybe Text)
drCampaigns
= lens _drCampaigns (\ s a -> s{_drCampaigns = a})
drLineItems :: Lens' DownloadResponse (Maybe Text)
drLineItems
= lens _drLineItems (\ s a -> s{_drLineItems = a})
drAdGroups :: Lens' DownloadResponse (Maybe Text)
drAdGroups
= lens _drAdGroups (\ s a -> s{_drAdGroups = a})
drAds :: Lens' DownloadResponse (Maybe Text)
drAds = lens _drAds (\ s a -> s{_drAds = a})
instance FromJSON DownloadResponse where
parseJSON
= withObject "DownloadResponse"
(\ o ->
DownloadResponse' <$>
(o .:? "insertionOrders") <*> (o .:? "campaigns") <*>
(o .:? "lineItems")
<*> (o .:? "adGroups")
<*> (o .:? "ads"))
instance ToJSON DownloadResponse where
toJSON DownloadResponse'{..}
= object
(catMaybes
[("insertionOrders" .=) <$> _drInsertionOrders,
("campaigns" .=) <$> _drCampaigns,
("lineItems" .=) <$> _drLineItems,
("adGroups" .=) <$> _drAdGroups,
("ads" .=) <$> _drAds])
data ReportStatus = ReportStatus'
{ _rsState :: !(Maybe ReportStatusState)
, _rsFinishTimeMs :: !(Maybe (Textual Int64))
, _rsFormat :: !(Maybe ReportStatusFormat)
, _rsFailure :: !(Maybe ReportFailure)
} deriving (Eq,Show,Data,Typeable,Generic)
reportStatus
:: ReportStatus
reportStatus =
ReportStatus'
{ _rsState = Nothing
, _rsFinishTimeMs = Nothing
, _rsFormat = Nothing
, _rsFailure = Nothing
}
rsState :: Lens' ReportStatus (Maybe ReportStatusState)
rsState = lens _rsState (\ s a -> s{_rsState = a})
rsFinishTimeMs :: Lens' ReportStatus (Maybe Int64)
rsFinishTimeMs
= lens _rsFinishTimeMs
(\ s a -> s{_rsFinishTimeMs = a})
. mapping _Coerce
rsFormat :: Lens' ReportStatus (Maybe ReportStatusFormat)
rsFormat = lens _rsFormat (\ s a -> s{_rsFormat = a})
rsFailure :: Lens' ReportStatus (Maybe ReportFailure)
rsFailure
= lens _rsFailure (\ s a -> s{_rsFailure = a})
instance FromJSON ReportStatus where
parseJSON
= withObject "ReportStatus"
(\ o ->
ReportStatus' <$>
(o .:? "state") <*> (o .:? "finishTimeMs") <*>
(o .:? "format")
<*> (o .:? "failure"))
instance ToJSON ReportStatus where
toJSON ReportStatus'{..}
= object
(catMaybes
[("state" .=) <$> _rsState,
("finishTimeMs" .=) <$> _rsFinishTimeMs,
("format" .=) <$> _rsFormat,
("failure" .=) <$> _rsFailure])
data Query = Query'
{ _qQueryId :: !(Maybe (Textual Int64))
, _qReportDataEndTimeMs :: !(Maybe (Textual Int64))
, _qSchedule :: !(Maybe QuerySchedule)
, _qKind :: !Text
, _qParams :: !(Maybe Parameters)
, _qMetadata :: !(Maybe QueryMetadata)
, _qReportDataStartTimeMs :: !(Maybe (Textual Int64))
, _qTimezoneCode :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
query
:: Query
query =
Query'
{ _qQueryId = Nothing
, _qReportDataEndTimeMs = Nothing
, _qSchedule = Nothing
, _qKind = "doubleclickbidmanager#query"
, _qParams = Nothing
, _qMetadata = Nothing
, _qReportDataStartTimeMs = Nothing
, _qTimezoneCode = Nothing
}
qQueryId :: Lens' Query (Maybe Int64)
qQueryId
= lens _qQueryId (\ s a -> s{_qQueryId = a}) .
mapping _Coerce
qReportDataEndTimeMs :: Lens' Query (Maybe Int64)
qReportDataEndTimeMs
= lens _qReportDataEndTimeMs
(\ s a -> s{_qReportDataEndTimeMs = a})
. mapping _Coerce
qSchedule :: Lens' Query (Maybe QuerySchedule)
qSchedule
= lens _qSchedule (\ s a -> s{_qSchedule = a})
qKind :: Lens' Query Text
qKind = lens _qKind (\ s a -> s{_qKind = a})
qParams :: Lens' Query (Maybe Parameters)
qParams = lens _qParams (\ s a -> s{_qParams = a})
qMetadata :: Lens' Query (Maybe QueryMetadata)
qMetadata
= lens _qMetadata (\ s a -> s{_qMetadata = a})
qReportDataStartTimeMs :: Lens' Query (Maybe Int64)
qReportDataStartTimeMs
= lens _qReportDataStartTimeMs
(\ s a -> s{_qReportDataStartTimeMs = a})
. mapping _Coerce
qTimezoneCode :: Lens' Query (Maybe Text)
qTimezoneCode
= lens _qTimezoneCode
(\ s a -> s{_qTimezoneCode = a})
instance FromJSON Query where
parseJSON
= withObject "Query"
(\ o ->
Query' <$>
(o .:? "queryId") <*> (o .:? "reportDataEndTimeMs")
<*> (o .:? "schedule")
<*> (o .:? "kind" .!= "doubleclickbidmanager#query")
<*> (o .:? "params")
<*> (o .:? "metadata")
<*> (o .:? "reportDataStartTimeMs")
<*> (o .:? "timezoneCode"))
instance ToJSON Query where
toJSON Query'{..}
= object
(catMaybes
[("queryId" .=) <$> _qQueryId,
("reportDataEndTimeMs" .=) <$> _qReportDataEndTimeMs,
("schedule" .=) <$> _qSchedule,
Just ("kind" .= _qKind), ("params" .=) <$> _qParams,
("metadata" .=) <$> _qMetadata,
("reportDataStartTimeMs" .=) <$>
_qReportDataStartTimeMs,
("timezoneCode" .=) <$> _qTimezoneCode])
data Parameters = Parameters'
{ _pMetrics :: !(Maybe [ParametersMetricsItem])
, _pIncludeInviteData :: !(Maybe Bool)
, _pFilters :: !(Maybe [FilterPair])
, _pGroupBys :: !(Maybe [ParametersGroupBysItem])
, _pType :: !(Maybe ParametersType)
} deriving (Eq,Show,Data,Typeable,Generic)
parameters
:: Parameters
parameters =
Parameters'
{ _pMetrics = Nothing
, _pIncludeInviteData = Nothing
, _pFilters = Nothing
, _pGroupBys = Nothing
, _pType = Nothing
}
pMetrics :: Lens' Parameters [ParametersMetricsItem]
pMetrics
= lens _pMetrics (\ s a -> s{_pMetrics = a}) .
_Default
. _Coerce
pIncludeInviteData :: Lens' Parameters (Maybe Bool)
pIncludeInviteData
= lens _pIncludeInviteData
(\ s a -> s{_pIncludeInviteData = a})
pFilters :: Lens' Parameters [FilterPair]
pFilters
= lens _pFilters (\ s a -> s{_pFilters = a}) .
_Default
. _Coerce
pGroupBys :: Lens' Parameters [ParametersGroupBysItem]
pGroupBys
= lens _pGroupBys (\ s a -> s{_pGroupBys = a}) .
_Default
. _Coerce
pType :: Lens' Parameters (Maybe ParametersType)
pType = lens _pType (\ s a -> s{_pType = a})
instance FromJSON Parameters where
parseJSON
= withObject "Parameters"
(\ o ->
Parameters' <$>
(o .:? "metrics" .!= mempty) <*>
(o .:? "includeInviteData")
<*> (o .:? "filters" .!= mempty)
<*> (o .:? "groupBys" .!= mempty)
<*> (o .:? "type"))
instance ToJSON Parameters where
toJSON Parameters'{..}
= object
(catMaybes
[("metrics" .=) <$> _pMetrics,
("includeInviteData" .=) <$> _pIncludeInviteData,
("filters" .=) <$> _pFilters,
("groupBys" .=) <$> _pGroupBys,
("type" .=) <$> _pType])
newtype ReportFailure = ReportFailure'
{ _rfErrorCode :: Maybe ReportFailureErrorCode
} deriving (Eq,Show,Data,Typeable,Generic)
reportFailure
:: ReportFailure
reportFailure =
ReportFailure'
{ _rfErrorCode = Nothing
}
rfErrorCode :: Lens' ReportFailure (Maybe ReportFailureErrorCode)
rfErrorCode
= lens _rfErrorCode (\ s a -> s{_rfErrorCode = a})
instance FromJSON ReportFailure where
parseJSON
= withObject "ReportFailure"
(\ o -> ReportFailure' <$> (o .:? "errorCode"))
instance ToJSON ReportFailure where
toJSON ReportFailure'{..}
= object
(catMaybes [("errorCode" .=) <$> _rfErrorCode])