{-# 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.Reports.Types.Product where
import Network.Google.Prelude
import Network.Google.Reports.Types.Sum
data UsageReportParametersItem = UsageReportParametersItem'
{ _urpiDatetimeValue :: !(Maybe DateTime')
, _urpiBoolValue :: !(Maybe Bool)
, _urpiIntValue :: !(Maybe (Textual Int64))
, _urpiStringValue :: !(Maybe Text)
, _urpiName :: !(Maybe Text)
, _urpiMsgValue :: !(Maybe [UsageReportParametersItemMsgValueItem])
} deriving (Eq,Show,Data,Typeable,Generic)
usageReportParametersItem
:: UsageReportParametersItem
usageReportParametersItem =
UsageReportParametersItem'
{ _urpiDatetimeValue = Nothing
, _urpiBoolValue = Nothing
, _urpiIntValue = Nothing
, _urpiStringValue = Nothing
, _urpiName = Nothing
, _urpiMsgValue = Nothing
}
urpiDatetimeValue :: Lens' UsageReportParametersItem (Maybe UTCTime)
urpiDatetimeValue
= lens _urpiDatetimeValue
(\ s a -> s{_urpiDatetimeValue = a})
. mapping _DateTime
urpiBoolValue :: Lens' UsageReportParametersItem (Maybe Bool)
urpiBoolValue
= lens _urpiBoolValue
(\ s a -> s{_urpiBoolValue = a})
urpiIntValue :: Lens' UsageReportParametersItem (Maybe Int64)
urpiIntValue
= lens _urpiIntValue (\ s a -> s{_urpiIntValue = a})
. mapping _Coerce
urpiStringValue :: Lens' UsageReportParametersItem (Maybe Text)
urpiStringValue
= lens _urpiStringValue
(\ s a -> s{_urpiStringValue = a})
urpiName :: Lens' UsageReportParametersItem (Maybe Text)
urpiName = lens _urpiName (\ s a -> s{_urpiName = a})
urpiMsgValue :: Lens' UsageReportParametersItem [UsageReportParametersItemMsgValueItem]
urpiMsgValue
= lens _urpiMsgValue (\ s a -> s{_urpiMsgValue = a})
. _Default
. _Coerce
instance FromJSON UsageReportParametersItem where
parseJSON
= withObject "UsageReportParametersItem"
(\ o ->
UsageReportParametersItem' <$>
(o .:? "datetimeValue") <*> (o .:? "boolValue") <*>
(o .:? "intValue")
<*> (o .:? "stringValue")
<*> (o .:? "name")
<*> (o .:? "msgValue" .!= mempty))
instance ToJSON UsageReportParametersItem where
toJSON UsageReportParametersItem'{..}
= object
(catMaybes
[("datetimeValue" .=) <$> _urpiDatetimeValue,
("boolValue" .=) <$> _urpiBoolValue,
("intValue" .=) <$> _urpiIntValue,
("stringValue" .=) <$> _urpiStringValue,
("name" .=) <$> _urpiName,
("msgValue" .=) <$> _urpiMsgValue])
data ActivityId = ActivityId'
{ _aiTime :: !(Maybe DateTime')
, _aiUniqueQualifier :: !(Maybe (Textual Int64))
, _aiCustomerId :: !(Maybe Text)
, _aiApplicationName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
activityId
:: ActivityId
activityId =
ActivityId'
{ _aiTime = Nothing
, _aiUniqueQualifier = Nothing
, _aiCustomerId = Nothing
, _aiApplicationName = Nothing
}
aiTime :: Lens' ActivityId (Maybe UTCTime)
aiTime
= lens _aiTime (\ s a -> s{_aiTime = a}) .
mapping _DateTime
aiUniqueQualifier :: Lens' ActivityId (Maybe Int64)
aiUniqueQualifier
= lens _aiUniqueQualifier
(\ s a -> s{_aiUniqueQualifier = a})
. mapping _Coerce
aiCustomerId :: Lens' ActivityId (Maybe Text)
aiCustomerId
= lens _aiCustomerId (\ s a -> s{_aiCustomerId = a})
aiApplicationName :: Lens' ActivityId (Maybe Text)
aiApplicationName
= lens _aiApplicationName
(\ s a -> s{_aiApplicationName = a})
instance FromJSON ActivityId where
parseJSON
= withObject "ActivityId"
(\ o ->
ActivityId' <$>
(o .:? "time") <*> (o .:? "uniqueQualifier") <*>
(o .:? "customerId")
<*> (o .:? "applicationName"))
instance ToJSON ActivityId where
toJSON ActivityId'{..}
= object
(catMaybes
[("time" .=) <$> _aiTime,
("uniqueQualifier" .=) <$> _aiUniqueQualifier,
("customerId" .=) <$> _aiCustomerId,
("applicationName" .=) <$> _aiApplicationName])
data UsageReports = UsageReports'
{ _urEtag :: !(Maybe Text)
, _urNextPageToken :: !(Maybe Text)
, _urUsageReports :: !(Maybe [UsageReport])
, _urKind :: !Text
, _urWarnings :: !(Maybe [UsageReportsWarningsItem])
} deriving (Eq,Show,Data,Typeable,Generic)
usageReports
:: UsageReports
usageReports =
UsageReports'
{ _urEtag = Nothing
, _urNextPageToken = Nothing
, _urUsageReports = Nothing
, _urKind = "admin#reports#usageReports"
, _urWarnings = Nothing
}
urEtag :: Lens' UsageReports (Maybe Text)
urEtag = lens _urEtag (\ s a -> s{_urEtag = a})
urNextPageToken :: Lens' UsageReports (Maybe Text)
urNextPageToken
= lens _urNextPageToken
(\ s a -> s{_urNextPageToken = a})
urUsageReports :: Lens' UsageReports [UsageReport]
urUsageReports
= lens _urUsageReports
(\ s a -> s{_urUsageReports = a})
. _Default
. _Coerce
urKind :: Lens' UsageReports Text
urKind = lens _urKind (\ s a -> s{_urKind = a})
urWarnings :: Lens' UsageReports [UsageReportsWarningsItem]
urWarnings
= lens _urWarnings (\ s a -> s{_urWarnings = a}) .
_Default
. _Coerce
instance FromJSON UsageReports where
parseJSON
= withObject "UsageReports"
(\ o ->
UsageReports' <$>
(o .:? "etag") <*> (o .:? "nextPageToken") <*>
(o .:? "usageReports" .!= mempty)
<*> (o .:? "kind" .!= "admin#reports#usageReports")
<*> (o .:? "warnings" .!= mempty))
instance ToJSON UsageReports where
toJSON UsageReports'{..}
= object
(catMaybes
[("etag" .=) <$> _urEtag,
("nextPageToken" .=) <$> _urNextPageToken,
("usageReports" .=) <$> _urUsageReports,
Just ("kind" .= _urKind),
("warnings" .=) <$> _urWarnings])
newtype UsageReportParametersItemMsgValueItem = UsageReportParametersItemMsgValueItem'
{ _urpimviAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
usageReportParametersItemMsgValueItem
:: HashMap Text JSONValue
-> UsageReportParametersItemMsgValueItem
usageReportParametersItemMsgValueItem pUrpimviAddtional_ =
UsageReportParametersItemMsgValueItem'
{ _urpimviAddtional = _Coerce # pUrpimviAddtional_
}
urpimviAddtional :: Lens' UsageReportParametersItemMsgValueItem (HashMap Text JSONValue)
urpimviAddtional
= lens _urpimviAddtional
(\ s a -> s{_urpimviAddtional = a})
. _Coerce
instance FromJSON
UsageReportParametersItemMsgValueItem where
parseJSON
= withObject "UsageReportParametersItemMsgValueItem"
(\ o ->
UsageReportParametersItemMsgValueItem' <$>
(parseJSONObject o))
instance ToJSON UsageReportParametersItemMsgValueItem
where
toJSON = toJSON . _urpimviAddtional
data Activities = Activities'
{ _aEtag :: !(Maybe Text)
, _aNextPageToken :: !(Maybe Text)
, _aKind :: !Text
, _aItems :: !(Maybe [Activity])
} deriving (Eq,Show,Data,Typeable,Generic)
activities
:: Activities
activities =
Activities'
{ _aEtag = Nothing
, _aNextPageToken = Nothing
, _aKind = "admin#reports#activities"
, _aItems = Nothing
}
aEtag :: Lens' Activities (Maybe Text)
aEtag = lens _aEtag (\ s a -> s{_aEtag = a})
aNextPageToken :: Lens' Activities (Maybe Text)
aNextPageToken
= lens _aNextPageToken
(\ s a -> s{_aNextPageToken = a})
aKind :: Lens' Activities Text
aKind = lens _aKind (\ s a -> s{_aKind = a})
aItems :: Lens' Activities [Activity]
aItems
= lens _aItems (\ s a -> s{_aItems = a}) . _Default .
_Coerce
instance FromJSON Activities where
parseJSON
= withObject "Activities"
(\ o ->
Activities' <$>
(o .:? "etag") <*> (o .:? "nextPageToken") <*>
(o .:? "kind" .!= "admin#reports#activities")
<*> (o .:? "items" .!= mempty))
instance ToJSON Activities where
toJSON Activities'{..}
= object
(catMaybes
[("etag" .=) <$> _aEtag,
("nextPageToken" .=) <$> _aNextPageToken,
Just ("kind" .= _aKind), ("items" .=) <$> _aItems])
data Channel = Channel'
{ _cResourceURI :: !(Maybe Text)
, _cResourceId :: !(Maybe Text)
, _cKind :: !Text
, _cExpiration :: !(Maybe (Textual Int64))
, _cToken :: !(Maybe Text)
, _cAddress :: !(Maybe Text)
, _cPayload :: !(Maybe Bool)
, _cParams :: !(Maybe ChannelParams)
, _cId :: !(Maybe Text)
, _cType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
channel
:: Channel
channel =
Channel'
{ _cResourceURI = Nothing
, _cResourceId = Nothing
, _cKind = "api#channel"
, _cExpiration = Nothing
, _cToken = Nothing
, _cAddress = Nothing
, _cPayload = Nothing
, _cParams = Nothing
, _cId = Nothing
, _cType = Nothing
}
cResourceURI :: Lens' Channel (Maybe Text)
cResourceURI
= lens _cResourceURI (\ s a -> s{_cResourceURI = a})
cResourceId :: Lens' Channel (Maybe Text)
cResourceId
= lens _cResourceId (\ s a -> s{_cResourceId = a})
cKind :: Lens' Channel Text
cKind = lens _cKind (\ s a -> s{_cKind = a})
cExpiration :: Lens' Channel (Maybe Int64)
cExpiration
= lens _cExpiration (\ s a -> s{_cExpiration = a}) .
mapping _Coerce
cToken :: Lens' Channel (Maybe Text)
cToken = lens _cToken (\ s a -> s{_cToken = a})
cAddress :: Lens' Channel (Maybe Text)
cAddress = lens _cAddress (\ s a -> s{_cAddress = a})
cPayload :: Lens' Channel (Maybe Bool)
cPayload = lens _cPayload (\ s a -> s{_cPayload = a})
cParams :: Lens' Channel (Maybe ChannelParams)
cParams = lens _cParams (\ s a -> s{_cParams = a})
cId :: Lens' Channel (Maybe Text)
cId = lens _cId (\ s a -> s{_cId = a})
cType :: Lens' Channel (Maybe Text)
cType = lens _cType (\ s a -> s{_cType = a})
instance FromJSON Channel where
parseJSON
= withObject "Channel"
(\ o ->
Channel' <$>
(o .:? "resourceUri") <*> (o .:? "resourceId") <*>
(o .:? "kind" .!= "api#channel")
<*> (o .:? "expiration")
<*> (o .:? "token")
<*> (o .:? "address")
<*> (o .:? "payload")
<*> (o .:? "params")
<*> (o .:? "id")
<*> (o .:? "type"))
instance ToJSON Channel where
toJSON Channel'{..}
= object
(catMaybes
[("resourceUri" .=) <$> _cResourceURI,
("resourceId" .=) <$> _cResourceId,
Just ("kind" .= _cKind),
("expiration" .=) <$> _cExpiration,
("token" .=) <$> _cToken,
("address" .=) <$> _cAddress,
("payload" .=) <$> _cPayload,
("params" .=) <$> _cParams, ("id" .=) <$> _cId,
("type" .=) <$> _cType])
data UsageReport = UsageReport'
{ _uEtag :: !(Maybe Text)
, _uKind :: !Text
, _uDate :: !(Maybe Text)
, _uParameters :: !(Maybe [UsageReportParametersItem])
, _uEntity :: !(Maybe UsageReportEntity)
} deriving (Eq,Show,Data,Typeable,Generic)
usageReport
:: UsageReport
usageReport =
UsageReport'
{ _uEtag = Nothing
, _uKind = "admin#reports#usageReport"
, _uDate = Nothing
, _uParameters = Nothing
, _uEntity = Nothing
}
uEtag :: Lens' UsageReport (Maybe Text)
uEtag = lens _uEtag (\ s a -> s{_uEtag = a})
uKind :: Lens' UsageReport Text
uKind = lens _uKind (\ s a -> s{_uKind = a})
uDate :: Lens' UsageReport (Maybe Text)
uDate = lens _uDate (\ s a -> s{_uDate = a})
uParameters :: Lens' UsageReport [UsageReportParametersItem]
uParameters
= lens _uParameters (\ s a -> s{_uParameters = a}) .
_Default
. _Coerce
uEntity :: Lens' UsageReport (Maybe UsageReportEntity)
uEntity = lens _uEntity (\ s a -> s{_uEntity = a})
instance FromJSON UsageReport where
parseJSON
= withObject "UsageReport"
(\ o ->
UsageReport' <$>
(o .:? "etag") <*>
(o .:? "kind" .!= "admin#reports#usageReport")
<*> (o .:? "date")
<*> (o .:? "parameters" .!= mempty)
<*> (o .:? "entity"))
instance ToJSON UsageReport where
toJSON UsageReport'{..}
= object
(catMaybes
[("etag" .=) <$> _uEtag, Just ("kind" .= _uKind),
("date" .=) <$> _uDate,
("parameters" .=) <$> _uParameters,
("entity" .=) <$> _uEntity])
data UsageReportsWarningsItemDataItem = UsageReportsWarningsItemDataItem'
{ _urwidiValue :: !(Maybe Text)
, _urwidiKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
usageReportsWarningsItemDataItem
:: UsageReportsWarningsItemDataItem
usageReportsWarningsItemDataItem =
UsageReportsWarningsItemDataItem'
{ _urwidiValue = Nothing
, _urwidiKey = Nothing
}
urwidiValue :: Lens' UsageReportsWarningsItemDataItem (Maybe Text)
urwidiValue
= lens _urwidiValue (\ s a -> s{_urwidiValue = a})
urwidiKey :: Lens' UsageReportsWarningsItemDataItem (Maybe Text)
urwidiKey
= lens _urwidiKey (\ s a -> s{_urwidiKey = a})
instance FromJSON UsageReportsWarningsItemDataItem
where
parseJSON
= withObject "UsageReportsWarningsItemDataItem"
(\ o ->
UsageReportsWarningsItemDataItem' <$>
(o .:? "value") <*> (o .:? "key"))
instance ToJSON UsageReportsWarningsItemDataItem
where
toJSON UsageReportsWarningsItemDataItem'{..}
= object
(catMaybes
[("value" .=) <$> _urwidiValue,
("key" .=) <$> _urwidiKey])
data UsageReportsWarningsItem = UsageReportsWarningsItem'
{ _urwiData :: !(Maybe [UsageReportsWarningsItemDataItem])
, _urwiCode :: !(Maybe Text)
, _urwiMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
usageReportsWarningsItem
:: UsageReportsWarningsItem
usageReportsWarningsItem =
UsageReportsWarningsItem'
{ _urwiData = Nothing
, _urwiCode = Nothing
, _urwiMessage = Nothing
}
urwiData :: Lens' UsageReportsWarningsItem [UsageReportsWarningsItemDataItem]
urwiData
= lens _urwiData (\ s a -> s{_urwiData = a}) .
_Default
. _Coerce
urwiCode :: Lens' UsageReportsWarningsItem (Maybe Text)
urwiCode = lens _urwiCode (\ s a -> s{_urwiCode = a})
urwiMessage :: Lens' UsageReportsWarningsItem (Maybe Text)
urwiMessage
= lens _urwiMessage (\ s a -> s{_urwiMessage = a})
instance FromJSON UsageReportsWarningsItem where
parseJSON
= withObject "UsageReportsWarningsItem"
(\ o ->
UsageReportsWarningsItem' <$>
(o .:? "data" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON UsageReportsWarningsItem where
toJSON UsageReportsWarningsItem'{..}
= object
(catMaybes
[("data" .=) <$> _urwiData,
("code" .=) <$> _urwiCode,
("message" .=) <$> _urwiMessage])
data ActivityEventsItem = ActivityEventsItem'
{ _aeiName :: !(Maybe Text)
, _aeiParameters :: !(Maybe [ActivityEventsItemParametersItem])
, _aeiType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
activityEventsItem
:: ActivityEventsItem
activityEventsItem =
ActivityEventsItem'
{ _aeiName = Nothing
, _aeiParameters = Nothing
, _aeiType = Nothing
}
aeiName :: Lens' ActivityEventsItem (Maybe Text)
aeiName = lens _aeiName (\ s a -> s{_aeiName = a})
aeiParameters :: Lens' ActivityEventsItem [ActivityEventsItemParametersItem]
aeiParameters
= lens _aeiParameters
(\ s a -> s{_aeiParameters = a})
. _Default
. _Coerce
aeiType :: Lens' ActivityEventsItem (Maybe Text)
aeiType = lens _aeiType (\ s a -> s{_aeiType = a})
instance FromJSON ActivityEventsItem where
parseJSON
= withObject "ActivityEventsItem"
(\ o ->
ActivityEventsItem' <$>
(o .:? "name") <*> (o .:? "parameters" .!= mempty)
<*> (o .:? "type"))
instance ToJSON ActivityEventsItem where
toJSON ActivityEventsItem'{..}
= object
(catMaybes
[("name" .=) <$> _aeiName,
("parameters" .=) <$> _aeiParameters,
("type" .=) <$> _aeiType])
newtype ChannelParams = ChannelParams'
{ _cpAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
channelParams
:: HashMap Text Text
-> ChannelParams
channelParams pCpAddtional_ =
ChannelParams'
{ _cpAddtional = _Coerce # pCpAddtional_
}
cpAddtional :: Lens' ChannelParams (HashMap Text Text)
cpAddtional
= lens _cpAddtional (\ s a -> s{_cpAddtional = a}) .
_Coerce
instance FromJSON ChannelParams where
parseJSON
= withObject "ChannelParams"
(\ o -> ChannelParams' <$> (parseJSONObject o))
instance ToJSON ChannelParams where
toJSON = toJSON . _cpAddtional
data Activity = Activity'
{ _actEtag :: !(Maybe Text)
, _actIPAddress :: !(Maybe Text)
, _actKind :: !Text
, _actActor :: !(Maybe ActivityActor)
, _actOwnerDomain :: !(Maybe Text)
, _actEvents :: !(Maybe [ActivityEventsItem])
, _actId :: !(Maybe ActivityId)
} deriving (Eq,Show,Data,Typeable,Generic)
activity
:: Activity
activity =
Activity'
{ _actEtag = Nothing
, _actIPAddress = Nothing
, _actKind = "admin#reports#activity"
, _actActor = Nothing
, _actOwnerDomain = Nothing
, _actEvents = Nothing
, _actId = Nothing
}
actEtag :: Lens' Activity (Maybe Text)
actEtag = lens _actEtag (\ s a -> s{_actEtag = a})
actIPAddress :: Lens' Activity (Maybe Text)
actIPAddress
= lens _actIPAddress (\ s a -> s{_actIPAddress = a})
actKind :: Lens' Activity Text
actKind = lens _actKind (\ s a -> s{_actKind = a})
actActor :: Lens' Activity (Maybe ActivityActor)
actActor = lens _actActor (\ s a -> s{_actActor = a})
actOwnerDomain :: Lens' Activity (Maybe Text)
actOwnerDomain
= lens _actOwnerDomain
(\ s a -> s{_actOwnerDomain = a})
actEvents :: Lens' Activity [ActivityEventsItem]
actEvents
= lens _actEvents (\ s a -> s{_actEvents = a}) .
_Default
. _Coerce
actId :: Lens' Activity (Maybe ActivityId)
actId = lens _actId (\ s a -> s{_actId = a})
instance FromJSON Activity where
parseJSON
= withObject "Activity"
(\ o ->
Activity' <$>
(o .:? "etag") <*> (o .:? "ipAddress") <*>
(o .:? "kind" .!= "admin#reports#activity")
<*> (o .:? "actor")
<*> (o .:? "ownerDomain")
<*> (o .:? "events" .!= mempty)
<*> (o .:? "id"))
instance ToJSON Activity where
toJSON Activity'{..}
= object
(catMaybes
[("etag" .=) <$> _actEtag,
("ipAddress" .=) <$> _actIPAddress,
Just ("kind" .= _actKind),
("actor" .=) <$> _actActor,
("ownerDomain" .=) <$> _actOwnerDomain,
("events" .=) <$> _actEvents, ("id" .=) <$> _actId])
data UsageReportEntity = UsageReportEntity'
{ _ureProFileId :: !(Maybe Text)
, _ureCustomerId :: !(Maybe Text)
, _ureUserEmail :: !(Maybe Text)
, _ureType :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
usageReportEntity
:: UsageReportEntity
usageReportEntity =
UsageReportEntity'
{ _ureProFileId = Nothing
, _ureCustomerId = Nothing
, _ureUserEmail = Nothing
, _ureType = Nothing
}
ureProFileId :: Lens' UsageReportEntity (Maybe Text)
ureProFileId
= lens _ureProFileId (\ s a -> s{_ureProFileId = a})
ureCustomerId :: Lens' UsageReportEntity (Maybe Text)
ureCustomerId
= lens _ureCustomerId
(\ s a -> s{_ureCustomerId = a})
ureUserEmail :: Lens' UsageReportEntity (Maybe Text)
ureUserEmail
= lens _ureUserEmail (\ s a -> s{_ureUserEmail = a})
ureType :: Lens' UsageReportEntity (Maybe Text)
ureType = lens _ureType (\ s a -> s{_ureType = a})
instance FromJSON UsageReportEntity where
parseJSON
= withObject "UsageReportEntity"
(\ o ->
UsageReportEntity' <$>
(o .:? "profileId") <*> (o .:? "customerId") <*>
(o .:? "userEmail")
<*> (o .:? "type"))
instance ToJSON UsageReportEntity where
toJSON UsageReportEntity'{..}
= object
(catMaybes
[("profileId" .=) <$> _ureProFileId,
("customerId" .=) <$> _ureCustomerId,
("userEmail" .=) <$> _ureUserEmail,
("type" .=) <$> _ureType])
data ActivityEventsItemParametersItem = ActivityEventsItemParametersItem'
{ _aeipiBoolValue :: !(Maybe Bool)
, _aeipiIntValue :: !(Maybe (Textual Int64))
, _aeipiValue :: !(Maybe Text)
, _aeipiMultiIntValue :: !(Maybe [Textual Int64])
, _aeipiName :: !(Maybe Text)
, _aeipiMultiValue :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
activityEventsItemParametersItem
:: ActivityEventsItemParametersItem
activityEventsItemParametersItem =
ActivityEventsItemParametersItem'
{ _aeipiBoolValue = Nothing
, _aeipiIntValue = Nothing
, _aeipiValue = Nothing
, _aeipiMultiIntValue = Nothing
, _aeipiName = Nothing
, _aeipiMultiValue = Nothing
}
aeipiBoolValue :: Lens' ActivityEventsItemParametersItem (Maybe Bool)
aeipiBoolValue
= lens _aeipiBoolValue
(\ s a -> s{_aeipiBoolValue = a})
aeipiIntValue :: Lens' ActivityEventsItemParametersItem (Maybe Int64)
aeipiIntValue
= lens _aeipiIntValue
(\ s a -> s{_aeipiIntValue = a})
. mapping _Coerce
aeipiValue :: Lens' ActivityEventsItemParametersItem (Maybe Text)
aeipiValue
= lens _aeipiValue (\ s a -> s{_aeipiValue = a})
aeipiMultiIntValue :: Lens' ActivityEventsItemParametersItem [Int64]
aeipiMultiIntValue
= lens _aeipiMultiIntValue
(\ s a -> s{_aeipiMultiIntValue = a})
. _Default
. _Coerce
aeipiName :: Lens' ActivityEventsItemParametersItem (Maybe Text)
aeipiName
= lens _aeipiName (\ s a -> s{_aeipiName = a})
aeipiMultiValue :: Lens' ActivityEventsItemParametersItem [Text]
aeipiMultiValue
= lens _aeipiMultiValue
(\ s a -> s{_aeipiMultiValue = a})
. _Default
. _Coerce
instance FromJSON ActivityEventsItemParametersItem
where
parseJSON
= withObject "ActivityEventsItemParametersItem"
(\ o ->
ActivityEventsItemParametersItem' <$>
(o .:? "boolValue") <*> (o .:? "intValue") <*>
(o .:? "value")
<*> (o .:? "multiIntValue" .!= mempty)
<*> (o .:? "name")
<*> (o .:? "multiValue" .!= mempty))
instance ToJSON ActivityEventsItemParametersItem
where
toJSON ActivityEventsItemParametersItem'{..}
= object
(catMaybes
[("boolValue" .=) <$> _aeipiBoolValue,
("intValue" .=) <$> _aeipiIntValue,
("value" .=) <$> _aeipiValue,
("multiIntValue" .=) <$> _aeipiMultiIntValue,
("name" .=) <$> _aeipiName,
("multiValue" .=) <$> _aeipiMultiValue])
data ActivityActor = ActivityActor'
{ _aaEmail :: !(Maybe Text)
, _aaCallerType :: !(Maybe Text)
, _aaProFileId :: !(Maybe Text)
, _aaKey :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
activityActor
:: ActivityActor
activityActor =
ActivityActor'
{ _aaEmail = Nothing
, _aaCallerType = Nothing
, _aaProFileId = Nothing
, _aaKey = Nothing
}
aaEmail :: Lens' ActivityActor (Maybe Text)
aaEmail = lens _aaEmail (\ s a -> s{_aaEmail = a})
aaCallerType :: Lens' ActivityActor (Maybe Text)
aaCallerType
= lens _aaCallerType (\ s a -> s{_aaCallerType = a})
aaProFileId :: Lens' ActivityActor (Maybe Text)
aaProFileId
= lens _aaProFileId (\ s a -> s{_aaProFileId = a})
aaKey :: Lens' ActivityActor (Maybe Text)
aaKey = lens _aaKey (\ s a -> s{_aaKey = a})
instance FromJSON ActivityActor where
parseJSON
= withObject "ActivityActor"
(\ o ->
ActivityActor' <$>
(o .:? "email") <*> (o .:? "callerType") <*>
(o .:? "profileId")
<*> (o .:? "key"))
instance ToJSON ActivityActor where
toJSON ActivityActor'{..}
= object
(catMaybes
[("email" .=) <$> _aaEmail,
("callerType" .=) <$> _aaCallerType,
("profileId" .=) <$> _aaProFileId,
("key" .=) <$> _aaKey])