module Network.Google.YouTubeAnalytics.Types.Product where
import Network.Google.Prelude
import Network.Google.YouTubeAnalytics.Types.Sum
data GroupContentDetails = GroupContentDetails
{ _gcdItemType :: !(Maybe Text)
, _gcdItemCount :: !(Maybe (Textual Word64))
} deriving (Eq,Show,Data,Typeable,Generic)
groupContentDetails
:: GroupContentDetails
groupContentDetails =
GroupContentDetails
{ _gcdItemType = Nothing
, _gcdItemCount = Nothing
}
gcdItemType :: Lens' GroupContentDetails (Maybe Text)
gcdItemType
= lens _gcdItemType (\ s a -> s{_gcdItemType = a})
gcdItemCount :: Lens' GroupContentDetails (Maybe Word64)
gcdItemCount
= lens _gcdItemCount (\ s a -> s{_gcdItemCount = a})
. mapping _Coerce
instance FromJSON GroupContentDetails where
parseJSON
= withObject "GroupContentDetails"
(\ o ->
GroupContentDetails <$>
(o .:? "itemType") <*> (o .:? "itemCount"))
instance ToJSON GroupContentDetails where
toJSON GroupContentDetails{..}
= object
(catMaybes
[("itemType" .=) <$> _gcdItemType,
("itemCount" .=) <$> _gcdItemCount])
data Group = Group
{ _gEtag :: !(Maybe Text)
, _gSnippet :: !(Maybe GroupSnippet)
, _gKind :: !Text
, _gContentDetails :: !(Maybe GroupContentDetails)
, _gId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
group'
:: Group
group' =
Group
{ _gEtag = Nothing
, _gSnippet = Nothing
, _gKind = "youtube#group"
, _gContentDetails = Nothing
, _gId = Nothing
}
gEtag :: Lens' Group (Maybe Text)
gEtag = lens _gEtag (\ s a -> s{_gEtag = a})
gSnippet :: Lens' Group (Maybe GroupSnippet)
gSnippet = lens _gSnippet (\ s a -> s{_gSnippet = a})
gKind :: Lens' Group Text
gKind = lens _gKind (\ s a -> s{_gKind = a})
gContentDetails :: Lens' Group (Maybe GroupContentDetails)
gContentDetails
= lens _gContentDetails
(\ s a -> s{_gContentDetails = a})
gId :: Lens' Group (Maybe Text)
gId = lens _gId (\ s a -> s{_gId = a})
instance FromJSON Group where
parseJSON
= withObject "Group"
(\ o ->
Group <$>
(o .:? "etag") <*> (o .:? "snippet") <*>
(o .:? "kind" .!= "youtube#group")
<*> (o .:? "contentDetails")
<*> (o .:? "id"))
instance ToJSON Group where
toJSON Group{..}
= object
(catMaybes
[("etag" .=) <$> _gEtag,
("snippet" .=) <$> _gSnippet,
Just ("kind" .= _gKind),
("contentDetails" .=) <$> _gContentDetails,
("id" .=) <$> _gId])
data GroupItemResource = GroupItemResource
{ _girKind :: !(Maybe Text)
, _girId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
groupItemResource
:: GroupItemResource
groupItemResource =
GroupItemResource
{ _girKind = Nothing
, _girId = Nothing
}
girKind :: Lens' GroupItemResource (Maybe Text)
girKind = lens _girKind (\ s a -> s{_girKind = a})
girId :: Lens' GroupItemResource (Maybe Text)
girId = lens _girId (\ s a -> s{_girId = a})
instance FromJSON GroupItemResource where
parseJSON
= withObject "GroupItemResource"
(\ o ->
GroupItemResource <$>
(o .:? "kind") <*> (o .:? "id"))
instance ToJSON GroupItemResource where
toJSON GroupItemResource{..}
= object
(catMaybes
[("kind" .=) <$> _girKind, ("id" .=) <$> _girId])
data ResultTableColumnHeadersItem = ResultTableColumnHeadersItem
{ _rtchiColumnType :: !(Maybe Text)
, _rtchiName :: !(Maybe Text)
, _rtchiDataType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
resultTableColumnHeadersItem
:: ResultTableColumnHeadersItem
resultTableColumnHeadersItem =
ResultTableColumnHeadersItem
{ _rtchiColumnType = Nothing
, _rtchiName = Nothing
, _rtchiDataType = Nothing
}
rtchiColumnType :: Lens' ResultTableColumnHeadersItem (Maybe Text)
rtchiColumnType
= lens _rtchiColumnType
(\ s a -> s{_rtchiColumnType = a})
rtchiName :: Lens' ResultTableColumnHeadersItem (Maybe Text)
rtchiName
= lens _rtchiName (\ s a -> s{_rtchiName = a})
rtchiDataType :: Lens' ResultTableColumnHeadersItem (Maybe Text)
rtchiDataType
= lens _rtchiDataType
(\ s a -> s{_rtchiDataType = a})
instance FromJSON ResultTableColumnHeadersItem where
parseJSON
= withObject "ResultTableColumnHeadersItem"
(\ o ->
ResultTableColumnHeadersItem <$>
(o .:? "columnType") <*> (o .:? "name") <*>
(o .:? "dataType"))
instance ToJSON ResultTableColumnHeadersItem where
toJSON ResultTableColumnHeadersItem{..}
= object
(catMaybes
[("columnType" .=) <$> _rtchiColumnType,
("name" .=) <$> _rtchiName,
("dataType" .=) <$> _rtchiDataType])
data ResultTable = ResultTable
{ _rtKind :: !Text
, _rtRows :: !(Maybe [[JSONValue]])
, _rtColumnHeaders :: !(Maybe [ResultTableColumnHeadersItem])
} deriving (Eq,Show,Data,Typeable,Generic)
resultTable
:: ResultTable
resultTable =
ResultTable
{ _rtKind = "youtubeAnalytics#resultTable"
, _rtRows = Nothing
, _rtColumnHeaders = Nothing
}
rtKind :: Lens' ResultTable Text
rtKind = lens _rtKind (\ s a -> s{_rtKind = a})
rtRows :: Lens' ResultTable [[JSONValue]]
rtRows
= lens _rtRows (\ s a -> s{_rtRows = a}) . _Default .
_Coerce
rtColumnHeaders :: Lens' ResultTable [ResultTableColumnHeadersItem]
rtColumnHeaders
= lens _rtColumnHeaders
(\ s a -> s{_rtColumnHeaders = a})
. _Default
. _Coerce
instance FromJSON ResultTable where
parseJSON
= withObject "ResultTable"
(\ o ->
ResultTable <$>
(o .:? "kind" .!= "youtubeAnalytics#resultTable") <*>
(o .:? "rows" .!= mempty)
<*> (o .:? "columnHeaders" .!= mempty))
instance ToJSON ResultTable where
toJSON ResultTable{..}
= object
(catMaybes
[Just ("kind" .= _rtKind), ("rows" .=) <$> _rtRows,
("columnHeaders" .=) <$> _rtColumnHeaders])
data BatchReportDefinition = BatchReportDefinition
{ _brdStatus :: !(Maybe Text)
, _brdKind :: !Text
, _brdName :: !(Maybe Text)
, _brdId :: !(Maybe Text)
, _brdType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
batchReportDefinition
:: BatchReportDefinition
batchReportDefinition =
BatchReportDefinition
{ _brdStatus = Nothing
, _brdKind = "youtubeAnalytics#batchReportDefinition"
, _brdName = Nothing
, _brdId = Nothing
, _brdType = Nothing
}
brdStatus :: Lens' BatchReportDefinition (Maybe Text)
brdStatus
= lens _brdStatus (\ s a -> s{_brdStatus = a})
brdKind :: Lens' BatchReportDefinition Text
brdKind = lens _brdKind (\ s a -> s{_brdKind = a})
brdName :: Lens' BatchReportDefinition (Maybe Text)
brdName = lens _brdName (\ s a -> s{_brdName = a})
brdId :: Lens' BatchReportDefinition (Maybe Text)
brdId = lens _brdId (\ s a -> s{_brdId = a})
brdType :: Lens' BatchReportDefinition (Maybe Text)
brdType = lens _brdType (\ s a -> s{_brdType = a})
instance FromJSON BatchReportDefinition where
parseJSON
= withObject "BatchReportDefinition"
(\ o ->
BatchReportDefinition <$>
(o .:? "status") <*>
(o .:? "kind" .!=
"youtubeAnalytics#batchReportDefinition")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "type"))
instance ToJSON BatchReportDefinition where
toJSON BatchReportDefinition{..}
= object
(catMaybes
[("status" .=) <$> _brdStatus,
Just ("kind" .= _brdKind), ("name" .=) <$> _brdName,
("id" .=) <$> _brdId, ("type" .=) <$> _brdType])
data BatchReport = BatchReport
{ _brTimeUpdated :: !(Maybe DateTime')
, _brKind :: !Text
, _brReportId :: !(Maybe Text)
, _brTimeSpan :: !(Maybe BatchReportTimeSpan)
, _brOutputs :: !(Maybe [BatchReportOutputsItem])
, _brId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
batchReport
:: BatchReport
batchReport =
BatchReport
{ _brTimeUpdated = Nothing
, _brKind = "youtubeAnalytics#batchReport"
, _brReportId = Nothing
, _brTimeSpan = Nothing
, _brOutputs = Nothing
, _brId = Nothing
}
brTimeUpdated :: Lens' BatchReport (Maybe UTCTime)
brTimeUpdated
= lens _brTimeUpdated
(\ s a -> s{_brTimeUpdated = a})
. mapping _DateTime
brKind :: Lens' BatchReport Text
brKind = lens _brKind (\ s a -> s{_brKind = a})
brReportId :: Lens' BatchReport (Maybe Text)
brReportId
= lens _brReportId (\ s a -> s{_brReportId = a})
brTimeSpan :: Lens' BatchReport (Maybe BatchReportTimeSpan)
brTimeSpan
= lens _brTimeSpan (\ s a -> s{_brTimeSpan = a})
brOutputs :: Lens' BatchReport [BatchReportOutputsItem]
brOutputs
= lens _brOutputs (\ s a -> s{_brOutputs = a}) .
_Default
. _Coerce
brId :: Lens' BatchReport (Maybe Text)
brId = lens _brId (\ s a -> s{_brId = a})
instance FromJSON BatchReport where
parseJSON
= withObject "BatchReport"
(\ o ->
BatchReport <$>
(o .:? "timeUpdated") <*>
(o .:? "kind" .!= "youtubeAnalytics#batchReport")
<*> (o .:? "reportId")
<*> (o .:? "timeSpan")
<*> (o .:? "outputs" .!= mempty)
<*> (o .:? "id"))
instance ToJSON BatchReport where
toJSON BatchReport{..}
= object
(catMaybes
[("timeUpdated" .=) <$> _brTimeUpdated,
Just ("kind" .= _brKind),
("reportId" .=) <$> _brReportId,
("timeSpan" .=) <$> _brTimeSpan,
("outputs" .=) <$> _brOutputs, ("id" .=) <$> _brId])
data GroupSnippet = GroupSnippet
{ _gsPublishedAt :: !(Maybe DateTime')
, _gsTitle :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
groupSnippet
:: GroupSnippet
groupSnippet =
GroupSnippet
{ _gsPublishedAt = Nothing
, _gsTitle = Nothing
}
gsPublishedAt :: Lens' GroupSnippet (Maybe UTCTime)
gsPublishedAt
= lens _gsPublishedAt
(\ s a -> s{_gsPublishedAt = a})
. mapping _DateTime
gsTitle :: Lens' GroupSnippet (Maybe Text)
gsTitle = lens _gsTitle (\ s a -> s{_gsTitle = a})
instance FromJSON GroupSnippet where
parseJSON
= withObject "GroupSnippet"
(\ o ->
GroupSnippet <$>
(o .:? "publishedAt") <*> (o .:? "title"))
instance ToJSON GroupSnippet where
toJSON GroupSnippet{..}
= object
(catMaybes
[("publishedAt" .=) <$> _gsPublishedAt,
("title" .=) <$> _gsTitle])
data GroupItem = GroupItem
{ _giEtag :: !(Maybe Text)
, _giKind :: !Text
, _giResource :: !(Maybe GroupItemResource)
, _giGroupId :: !(Maybe Text)
, _giId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
groupItem
:: GroupItem
groupItem =
GroupItem
{ _giEtag = Nothing
, _giKind = "youtube#groupItem"
, _giResource = Nothing
, _giGroupId = Nothing
, _giId = Nothing
}
giEtag :: Lens' GroupItem (Maybe Text)
giEtag = lens _giEtag (\ s a -> s{_giEtag = a})
giKind :: Lens' GroupItem Text
giKind = lens _giKind (\ s a -> s{_giKind = a})
giResource :: Lens' GroupItem (Maybe GroupItemResource)
giResource
= lens _giResource (\ s a -> s{_giResource = a})
giGroupId :: Lens' GroupItem (Maybe Text)
giGroupId
= lens _giGroupId (\ s a -> s{_giGroupId = a})
giId :: Lens' GroupItem (Maybe Text)
giId = lens _giId (\ s a -> s{_giId = a})
instance FromJSON GroupItem where
parseJSON
= withObject "GroupItem"
(\ o ->
GroupItem <$>
(o .:? "etag") <*>
(o .:? "kind" .!= "youtube#groupItem")
<*> (o .:? "resource")
<*> (o .:? "groupId")
<*> (o .:? "id"))
instance ToJSON GroupItem where
toJSON GroupItem{..}
= object
(catMaybes
[("etag" .=) <$> _giEtag, Just ("kind" .= _giKind),
("resource" .=) <$> _giResource,
("groupId" .=) <$> _giGroupId, ("id" .=) <$> _giId])
data BatchReportDefinitionList = BatchReportDefinitionList
{ _brdlKind :: !Text
, _brdlItems :: !(Maybe [BatchReportDefinition])
} deriving (Eq,Show,Data,Typeable,Generic)
batchReportDefinitionList
:: BatchReportDefinitionList
batchReportDefinitionList =
BatchReportDefinitionList
{ _brdlKind = "youtubeAnalytics#batchReportDefinitionList"
, _brdlItems = Nothing
}
brdlKind :: Lens' BatchReportDefinitionList Text
brdlKind = lens _brdlKind (\ s a -> s{_brdlKind = a})
brdlItems :: Lens' BatchReportDefinitionList [BatchReportDefinition]
brdlItems
= lens _brdlItems (\ s a -> s{_brdlItems = a}) .
_Default
. _Coerce
instance FromJSON BatchReportDefinitionList where
parseJSON
= withObject "BatchReportDefinitionList"
(\ o ->
BatchReportDefinitionList <$>
(o .:? "kind" .!=
"youtubeAnalytics#batchReportDefinitionList")
<*> (o .:? "items" .!= mempty))
instance ToJSON BatchReportDefinitionList where
toJSON BatchReportDefinitionList{..}
= object
(catMaybes
[Just ("kind" .= _brdlKind),
("items" .=) <$> _brdlItems])
data BatchReportList = BatchReportList
{ _brlKind :: !Text
, _brlItems :: !(Maybe [BatchReport])
} deriving (Eq,Show,Data,Typeable,Generic)
batchReportList
:: BatchReportList
batchReportList =
BatchReportList
{ _brlKind = "youtubeAnalytics#batchReportList"
, _brlItems = Nothing
}
brlKind :: Lens' BatchReportList Text
brlKind = lens _brlKind (\ s a -> s{_brlKind = a})
brlItems :: Lens' BatchReportList [BatchReport]
brlItems
= lens _brlItems (\ s a -> s{_brlItems = a}) .
_Default
. _Coerce
instance FromJSON BatchReportList where
parseJSON
= withObject "BatchReportList"
(\ o ->
BatchReportList <$>
(o .:? "kind" .!= "youtubeAnalytics#batchReportList")
<*> (o .:? "items" .!= mempty))
instance ToJSON BatchReportList where
toJSON BatchReportList{..}
= object
(catMaybes
[Just ("kind" .= _brlKind),
("items" .=) <$> _brlItems])
data BatchReportOutputsItem = BatchReportOutputsItem
{ _broiFormat :: !(Maybe Text)
, _broiDownloadURL :: !(Maybe Text)
, _broiType :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
batchReportOutputsItem
:: BatchReportOutputsItem
batchReportOutputsItem =
BatchReportOutputsItem
{ _broiFormat = Nothing
, _broiDownloadURL = Nothing
, _broiType = "cloudStorageOutput"
}
broiFormat :: Lens' BatchReportOutputsItem (Maybe Text)
broiFormat
= lens _broiFormat (\ s a -> s{_broiFormat = a})
broiDownloadURL :: Lens' BatchReportOutputsItem (Maybe Text)
broiDownloadURL
= lens _broiDownloadURL
(\ s a -> s{_broiDownloadURL = a})
broiType :: Lens' BatchReportOutputsItem Text
broiType = lens _broiType (\ s a -> s{_broiType = a})
instance FromJSON BatchReportOutputsItem where
parseJSON
= withObject "BatchReportOutputsItem"
(\ o ->
BatchReportOutputsItem <$>
(o .:? "format") <*> (o .:? "downloadUrl") <*>
(o .:? "type" .!= "cloudStorageOutput"))
instance ToJSON BatchReportOutputsItem where
toJSON BatchReportOutputsItem{..}
= object
(catMaybes
[("format" .=) <$> _broiFormat,
("downloadUrl" .=) <$> _broiDownloadURL,
Just ("type" .= _broiType)])
data BatchReportTimeSpan = BatchReportTimeSpan
{ _brtsStartTime :: !(Maybe DateTime')
, _brtsEndTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
batchReportTimeSpan
:: BatchReportTimeSpan
batchReportTimeSpan =
BatchReportTimeSpan
{ _brtsStartTime = Nothing
, _brtsEndTime = Nothing
}
brtsStartTime :: Lens' BatchReportTimeSpan (Maybe UTCTime)
brtsStartTime
= lens _brtsStartTime
(\ s a -> s{_brtsStartTime = a})
. mapping _DateTime
brtsEndTime :: Lens' BatchReportTimeSpan (Maybe UTCTime)
brtsEndTime
= lens _brtsEndTime (\ s a -> s{_brtsEndTime = a}) .
mapping _DateTime
instance FromJSON BatchReportTimeSpan where
parseJSON
= withObject "BatchReportTimeSpan"
(\ o ->
BatchReportTimeSpan <$>
(o .:? "startTime") <*> (o .:? "endTime"))
instance ToJSON BatchReportTimeSpan where
toJSON BatchReportTimeSpan{..}
= object
(catMaybes
[("startTime" .=) <$> _brtsStartTime,
("endTime" .=) <$> _brtsEndTime])
data GroupItemListResponse = GroupItemListResponse
{ _gilrEtag :: !(Maybe Text)
, _gilrKind :: !Text
, _gilrItems :: !(Maybe [GroupItem])
} deriving (Eq,Show,Data,Typeable,Generic)
groupItemListResponse
:: GroupItemListResponse
groupItemListResponse =
GroupItemListResponse
{ _gilrEtag = Nothing
, _gilrKind = "youtube#groupItemListResponse"
, _gilrItems = Nothing
}
gilrEtag :: Lens' GroupItemListResponse (Maybe Text)
gilrEtag = lens _gilrEtag (\ s a -> s{_gilrEtag = a})
gilrKind :: Lens' GroupItemListResponse Text
gilrKind = lens _gilrKind (\ s a -> s{_gilrKind = a})
gilrItems :: Lens' GroupItemListResponse [GroupItem]
gilrItems
= lens _gilrItems (\ s a -> s{_gilrItems = a}) .
_Default
. _Coerce
instance FromJSON GroupItemListResponse where
parseJSON
= withObject "GroupItemListResponse"
(\ o ->
GroupItemListResponse <$>
(o .:? "etag") <*>
(o .:? "kind" .!= "youtube#groupItemListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON GroupItemListResponse where
toJSON GroupItemListResponse{..}
= object
(catMaybes
[("etag" .=) <$> _gilrEtag,
Just ("kind" .= _gilrKind),
("items" .=) <$> _gilrItems])
data GroupListResponse = GroupListResponse
{ _glrEtag :: !(Maybe Text)
, _glrKind :: !Text
, _glrItems :: !(Maybe [Group])
} deriving (Eq,Show,Data,Typeable,Generic)
groupListResponse
:: GroupListResponse
groupListResponse =
GroupListResponse
{ _glrEtag = Nothing
, _glrKind = "youtube#groupListResponse"
, _glrItems = Nothing
}
glrEtag :: Lens' GroupListResponse (Maybe Text)
glrEtag = lens _glrEtag (\ s a -> s{_glrEtag = a})
glrKind :: Lens' GroupListResponse Text
glrKind = lens _glrKind (\ s a -> s{_glrKind = a})
glrItems :: Lens' GroupListResponse [Group]
glrItems
= lens _glrItems (\ s a -> s{_glrItems = a}) .
_Default
. _Coerce
instance FromJSON GroupListResponse where
parseJSON
= withObject "GroupListResponse"
(\ o ->
GroupListResponse <$>
(o .:? "etag") <*>
(o .:? "kind" .!= "youtube#groupListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON GroupListResponse where
toJSON GroupListResponse{..}
= object
(catMaybes
[("etag" .=) <$> _glrEtag, Just ("kind" .= _glrKind),
("items" .=) <$> _glrItems])