{-# 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.Games.Types.Product where
import Network.Google.Games.Types.Sum
import Network.Google.Prelude
data RoomJoinRequest =
RoomJoinRequest'
{ _rjrNetworkDiagnostics :: !(Maybe NetworkDiagnostics)
, _rjrKind :: !Text
, _rjrClientAddress :: !(Maybe RoomClientAddress)
, _rjrCapabilities :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
roomJoinRequest
:: RoomJoinRequest
roomJoinRequest =
RoomJoinRequest'
{ _rjrNetworkDiagnostics = Nothing
, _rjrKind = "games#roomJoinRequest"
, _rjrClientAddress = Nothing
, _rjrCapabilities = Nothing
}
rjrNetworkDiagnostics :: Lens' RoomJoinRequest (Maybe NetworkDiagnostics)
rjrNetworkDiagnostics
= lens _rjrNetworkDiagnostics
(\ s a -> s{_rjrNetworkDiagnostics = a})
rjrKind :: Lens' RoomJoinRequest Text
rjrKind = lens _rjrKind (\ s a -> s{_rjrKind = a})
rjrClientAddress :: Lens' RoomJoinRequest (Maybe RoomClientAddress)
rjrClientAddress
= lens _rjrClientAddress
(\ s a -> s{_rjrClientAddress = a})
rjrCapabilities :: Lens' RoomJoinRequest [Text]
rjrCapabilities
= lens _rjrCapabilities
(\ s a -> s{_rjrCapabilities = a})
. _Default
. _Coerce
instance FromJSON RoomJoinRequest where
parseJSON
= withObject "RoomJoinRequest"
(\ o ->
RoomJoinRequest' <$>
(o .:? "networkDiagnostics") <*>
(o .:? "kind" .!= "games#roomJoinRequest")
<*> (o .:? "clientAddress")
<*> (o .:? "capabilities" .!= mempty))
instance ToJSON RoomJoinRequest where
toJSON RoomJoinRequest'{..}
= object
(catMaybes
[("networkDiagnostics" .=) <$>
_rjrNetworkDiagnostics,
Just ("kind" .= _rjrKind),
("clientAddress" .=) <$> _rjrClientAddress,
("capabilities" .=) <$> _rjrCapabilities])
data PlayerName =
PlayerName'
{ _pnGivenName :: !(Maybe Text)
, _pnFamilyName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
playerName
:: PlayerName
playerName = PlayerName' {_pnGivenName = Nothing, _pnFamilyName = Nothing}
pnGivenName :: Lens' PlayerName (Maybe Text)
pnGivenName
= lens _pnGivenName (\ s a -> s{_pnGivenName = a})
pnFamilyName :: Lens' PlayerName (Maybe Text)
pnFamilyName
= lens _pnFamilyName (\ s a -> s{_pnFamilyName = a})
instance FromJSON PlayerName where
parseJSON
= withObject "PlayerName"
(\ o ->
PlayerName' <$>
(o .:? "givenName") <*> (o .:? "familyName"))
instance ToJSON PlayerName where
toJSON PlayerName'{..}
= object
(catMaybes
[("givenName" .=) <$> _pnGivenName,
("familyName" .=) <$> _pnFamilyName])
data Snapshot =
Snapshot'
{ _sLastModifiedMillis :: !(Maybe (Textual Int64))
, _sKind :: !Text
, _sProgressValue :: !(Maybe (Textual Int64))
, _sUniqueName :: !(Maybe Text)
, _sCoverImage :: !(Maybe SnapshotImage)
, _sId :: !(Maybe Text)
, _sDurationMillis :: !(Maybe (Textual Int64))
, _sTitle :: !(Maybe Text)
, _sType :: !(Maybe Text)
, _sDescription :: !(Maybe Text)
, _sDriveId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
snapshot
:: Snapshot
snapshot =
Snapshot'
{ _sLastModifiedMillis = Nothing
, _sKind = "games#snapshot"
, _sProgressValue = Nothing
, _sUniqueName = Nothing
, _sCoverImage = Nothing
, _sId = Nothing
, _sDurationMillis = Nothing
, _sTitle = Nothing
, _sType = Nothing
, _sDescription = Nothing
, _sDriveId = Nothing
}
sLastModifiedMillis :: Lens' Snapshot (Maybe Int64)
sLastModifiedMillis
= lens _sLastModifiedMillis
(\ s a -> s{_sLastModifiedMillis = a})
. mapping _Coerce
sKind :: Lens' Snapshot Text
sKind = lens _sKind (\ s a -> s{_sKind = a})
sProgressValue :: Lens' Snapshot (Maybe Int64)
sProgressValue
= lens _sProgressValue
(\ s a -> s{_sProgressValue = a})
. mapping _Coerce
sUniqueName :: Lens' Snapshot (Maybe Text)
sUniqueName
= lens _sUniqueName (\ s a -> s{_sUniqueName = a})
sCoverImage :: Lens' Snapshot (Maybe SnapshotImage)
sCoverImage
= lens _sCoverImage (\ s a -> s{_sCoverImage = a})
sId :: Lens' Snapshot (Maybe Text)
sId = lens _sId (\ s a -> s{_sId = a})
sDurationMillis :: Lens' Snapshot (Maybe Int64)
sDurationMillis
= lens _sDurationMillis
(\ s a -> s{_sDurationMillis = a})
. mapping _Coerce
sTitle :: Lens' Snapshot (Maybe Text)
sTitle = lens _sTitle (\ s a -> s{_sTitle = a})
sType :: Lens' Snapshot (Maybe Text)
sType = lens _sType (\ s a -> s{_sType = a})
sDescription :: Lens' Snapshot (Maybe Text)
sDescription
= lens _sDescription (\ s a -> s{_sDescription = a})
sDriveId :: Lens' Snapshot (Maybe Text)
sDriveId = lens _sDriveId (\ s a -> s{_sDriveId = a})
instance FromJSON Snapshot where
parseJSON
= withObject "Snapshot"
(\ o ->
Snapshot' <$>
(o .:? "lastModifiedMillis") <*>
(o .:? "kind" .!= "games#snapshot")
<*> (o .:? "progressValue")
<*> (o .:? "uniqueName")
<*> (o .:? "coverImage")
<*> (o .:? "id")
<*> (o .:? "durationMillis")
<*> (o .:? "title")
<*> (o .:? "type")
<*> (o .:? "description")
<*> (o .:? "driveId"))
instance ToJSON Snapshot where
toJSON Snapshot'{..}
= object
(catMaybes
[("lastModifiedMillis" .=) <$> _sLastModifiedMillis,
Just ("kind" .= _sKind),
("progressValue" .=) <$> _sProgressValue,
("uniqueName" .=) <$> _sUniqueName,
("coverImage" .=) <$> _sCoverImage,
("id" .=) <$> _sId,
("durationMillis" .=) <$> _sDurationMillis,
("title" .=) <$> _sTitle, ("type" .=) <$> _sType,
("description" .=) <$> _sDescription,
("driveId" .=) <$> _sDriveId])
data Room =
Room'
{ _rStatus :: !(Maybe Text)
, _rVariant :: !(Maybe (Textual Int32))
, _rKind :: !Text
, _rAutoMatchingStatus :: !(Maybe RoomAutoMatchStatus)
, _rCreationDetails :: !(Maybe RoomModification)
, _rInviterId :: !(Maybe Text)
, _rLastUpdateDetails :: !(Maybe RoomModification)
, _rRoomStatusVersion :: !(Maybe (Textual Int32))
, _rParticipants :: !(Maybe [RoomParticipant])
, _rApplicationId :: !(Maybe Text)
, _rAutoMatchingCriteria :: !(Maybe RoomAutoMatchingCriteria)
, _rRoomId :: !(Maybe Text)
, _rDescription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
room
:: Room
room =
Room'
{ _rStatus = Nothing
, _rVariant = Nothing
, _rKind = "games#room"
, _rAutoMatchingStatus = Nothing
, _rCreationDetails = Nothing
, _rInviterId = Nothing
, _rLastUpdateDetails = Nothing
, _rRoomStatusVersion = Nothing
, _rParticipants = Nothing
, _rApplicationId = Nothing
, _rAutoMatchingCriteria = Nothing
, _rRoomId = Nothing
, _rDescription = Nothing
}
rStatus :: Lens' Room (Maybe Text)
rStatus = lens _rStatus (\ s a -> s{_rStatus = a})
rVariant :: Lens' Room (Maybe Int32)
rVariant
= lens _rVariant (\ s a -> s{_rVariant = a}) .
mapping _Coerce
rKind :: Lens' Room Text
rKind = lens _rKind (\ s a -> s{_rKind = a})
rAutoMatchingStatus :: Lens' Room (Maybe RoomAutoMatchStatus)
rAutoMatchingStatus
= lens _rAutoMatchingStatus
(\ s a -> s{_rAutoMatchingStatus = a})
rCreationDetails :: Lens' Room (Maybe RoomModification)
rCreationDetails
= lens _rCreationDetails
(\ s a -> s{_rCreationDetails = a})
rInviterId :: Lens' Room (Maybe Text)
rInviterId
= lens _rInviterId (\ s a -> s{_rInviterId = a})
rLastUpdateDetails :: Lens' Room (Maybe RoomModification)
rLastUpdateDetails
= lens _rLastUpdateDetails
(\ s a -> s{_rLastUpdateDetails = a})
rRoomStatusVersion :: Lens' Room (Maybe Int32)
rRoomStatusVersion
= lens _rRoomStatusVersion
(\ s a -> s{_rRoomStatusVersion = a})
. mapping _Coerce
rParticipants :: Lens' Room [RoomParticipant]
rParticipants
= lens _rParticipants
(\ s a -> s{_rParticipants = a})
. _Default
. _Coerce
rApplicationId :: Lens' Room (Maybe Text)
rApplicationId
= lens _rApplicationId
(\ s a -> s{_rApplicationId = a})
rAutoMatchingCriteria :: Lens' Room (Maybe RoomAutoMatchingCriteria)
rAutoMatchingCriteria
= lens _rAutoMatchingCriteria
(\ s a -> s{_rAutoMatchingCriteria = a})
rRoomId :: Lens' Room (Maybe Text)
rRoomId = lens _rRoomId (\ s a -> s{_rRoomId = a})
rDescription :: Lens' Room (Maybe Text)
rDescription
= lens _rDescription (\ s a -> s{_rDescription = a})
instance FromJSON Room where
parseJSON
= withObject "Room"
(\ o ->
Room' <$>
(o .:? "status") <*> (o .:? "variant") <*>
(o .:? "kind" .!= "games#room")
<*> (o .:? "autoMatchingStatus")
<*> (o .:? "creationDetails")
<*> (o .:? "inviterId")
<*> (o .:? "lastUpdateDetails")
<*> (o .:? "roomStatusVersion")
<*> (o .:? "participants" .!= mempty)
<*> (o .:? "applicationId")
<*> (o .:? "autoMatchingCriteria")
<*> (o .:? "roomId")
<*> (o .:? "description"))
instance ToJSON Room where
toJSON Room'{..}
= object
(catMaybes
[("status" .=) <$> _rStatus,
("variant" .=) <$> _rVariant,
Just ("kind" .= _rKind),
("autoMatchingStatus" .=) <$> _rAutoMatchingStatus,
("creationDetails" .=) <$> _rCreationDetails,
("inviterId" .=) <$> _rInviterId,
("lastUpdateDetails" .=) <$> _rLastUpdateDetails,
("roomStatusVersion" .=) <$> _rRoomStatusVersion,
("participants" .=) <$> _rParticipants,
("applicationId" .=) <$> _rApplicationId,
("autoMatchingCriteria" .=) <$>
_rAutoMatchingCriteria,
("roomId" .=) <$> _rRoomId,
("description" .=) <$> _rDescription])
data QuestListResponse =
QuestListResponse'
{ _qlrNextPageToken :: !(Maybe Text)
, _qlrKind :: !Text
, _qlrItems :: !(Maybe [Quest])
}
deriving (Eq, Show, Data, Typeable, Generic)
questListResponse
:: QuestListResponse
questListResponse =
QuestListResponse'
{ _qlrNextPageToken = Nothing
, _qlrKind = "games#questListResponse"
, _qlrItems = Nothing
}
qlrNextPageToken :: Lens' QuestListResponse (Maybe Text)
qlrNextPageToken
= lens _qlrNextPageToken
(\ s a -> s{_qlrNextPageToken = a})
qlrKind :: Lens' QuestListResponse Text
qlrKind = lens _qlrKind (\ s a -> s{_qlrKind = a})
qlrItems :: Lens' QuestListResponse [Quest]
qlrItems
= lens _qlrItems (\ s a -> s{_qlrItems = a}) .
_Default
. _Coerce
instance FromJSON QuestListResponse where
parseJSON
= withObject "QuestListResponse"
(\ o ->
QuestListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#questListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON QuestListResponse where
toJSON QuestListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _qlrNextPageToken,
Just ("kind" .= _qlrKind),
("items" .=) <$> _qlrItems])
data TurnBasedMatch =
TurnBasedMatch'
{ _tbmStatus :: !(Maybe Text)
, _tbmVariant :: !(Maybe (Textual Int32))
, _tbmResults :: !(Maybe [ParticipantResult])
, _tbmMatchNumber :: !(Maybe (Textual Int32))
, _tbmKind :: !Text
, _tbmData :: !(Maybe TurnBasedMatchData)
, _tbmWithParticipantId :: !(Maybe Text)
, _tbmCreationDetails :: !(Maybe TurnBasedMatchModification)
, _tbmInviterId :: !(Maybe Text)
, _tbmLastUpdateDetails :: !(Maybe TurnBasedMatchModification)
, _tbmParticipants :: !(Maybe [TurnBasedMatchParticipant])
, _tbmApplicationId :: !(Maybe Text)
, _tbmAutoMatchingCriteria :: !(Maybe TurnBasedAutoMatchingCriteria)
, _tbmPreviousMatchData :: !(Maybe TurnBasedMatchData)
, _tbmPendingParticipantId :: !(Maybe Text)
, _tbmUserMatchStatus :: !(Maybe Text)
, _tbmMatchId :: !(Maybe Text)
, _tbmDescription :: !(Maybe Text)
, _tbmRematchId :: !(Maybe Text)
, _tbmMatchVersion :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatch
:: TurnBasedMatch
turnBasedMatch =
TurnBasedMatch'
{ _tbmStatus = Nothing
, _tbmVariant = Nothing
, _tbmResults = Nothing
, _tbmMatchNumber = Nothing
, _tbmKind = "games#turnBasedMatch"
, _tbmData = Nothing
, _tbmWithParticipantId = Nothing
, _tbmCreationDetails = Nothing
, _tbmInviterId = Nothing
, _tbmLastUpdateDetails = Nothing
, _tbmParticipants = Nothing
, _tbmApplicationId = Nothing
, _tbmAutoMatchingCriteria = Nothing
, _tbmPreviousMatchData = Nothing
, _tbmPendingParticipantId = Nothing
, _tbmUserMatchStatus = Nothing
, _tbmMatchId = Nothing
, _tbmDescription = Nothing
, _tbmRematchId = Nothing
, _tbmMatchVersion = Nothing
}
tbmStatus :: Lens' TurnBasedMatch (Maybe Text)
tbmStatus
= lens _tbmStatus (\ s a -> s{_tbmStatus = a})
tbmVariant :: Lens' TurnBasedMatch (Maybe Int32)
tbmVariant
= lens _tbmVariant (\ s a -> s{_tbmVariant = a}) .
mapping _Coerce
tbmResults :: Lens' TurnBasedMatch [ParticipantResult]
tbmResults
= lens _tbmResults (\ s a -> s{_tbmResults = a}) .
_Default
. _Coerce
tbmMatchNumber :: Lens' TurnBasedMatch (Maybe Int32)
tbmMatchNumber
= lens _tbmMatchNumber
(\ s a -> s{_tbmMatchNumber = a})
. mapping _Coerce
tbmKind :: Lens' TurnBasedMatch Text
tbmKind = lens _tbmKind (\ s a -> s{_tbmKind = a})
tbmData :: Lens' TurnBasedMatch (Maybe TurnBasedMatchData)
tbmData = lens _tbmData (\ s a -> s{_tbmData = a})
tbmWithParticipantId :: Lens' TurnBasedMatch (Maybe Text)
tbmWithParticipantId
= lens _tbmWithParticipantId
(\ s a -> s{_tbmWithParticipantId = a})
tbmCreationDetails :: Lens' TurnBasedMatch (Maybe TurnBasedMatchModification)
tbmCreationDetails
= lens _tbmCreationDetails
(\ s a -> s{_tbmCreationDetails = a})
tbmInviterId :: Lens' TurnBasedMatch (Maybe Text)
tbmInviterId
= lens _tbmInviterId (\ s a -> s{_tbmInviterId = a})
tbmLastUpdateDetails :: Lens' TurnBasedMatch (Maybe TurnBasedMatchModification)
tbmLastUpdateDetails
= lens _tbmLastUpdateDetails
(\ s a -> s{_tbmLastUpdateDetails = a})
tbmParticipants :: Lens' TurnBasedMatch [TurnBasedMatchParticipant]
tbmParticipants
= lens _tbmParticipants
(\ s a -> s{_tbmParticipants = a})
. _Default
. _Coerce
tbmApplicationId :: Lens' TurnBasedMatch (Maybe Text)
tbmApplicationId
= lens _tbmApplicationId
(\ s a -> s{_tbmApplicationId = a})
tbmAutoMatchingCriteria :: Lens' TurnBasedMatch (Maybe TurnBasedAutoMatchingCriteria)
tbmAutoMatchingCriteria
= lens _tbmAutoMatchingCriteria
(\ s a -> s{_tbmAutoMatchingCriteria = a})
tbmPreviousMatchData :: Lens' TurnBasedMatch (Maybe TurnBasedMatchData)
tbmPreviousMatchData
= lens _tbmPreviousMatchData
(\ s a -> s{_tbmPreviousMatchData = a})
tbmPendingParticipantId :: Lens' TurnBasedMatch (Maybe Text)
tbmPendingParticipantId
= lens _tbmPendingParticipantId
(\ s a -> s{_tbmPendingParticipantId = a})
tbmUserMatchStatus :: Lens' TurnBasedMatch (Maybe Text)
tbmUserMatchStatus
= lens _tbmUserMatchStatus
(\ s a -> s{_tbmUserMatchStatus = a})
tbmMatchId :: Lens' TurnBasedMatch (Maybe Text)
tbmMatchId
= lens _tbmMatchId (\ s a -> s{_tbmMatchId = a})
tbmDescription :: Lens' TurnBasedMatch (Maybe Text)
tbmDescription
= lens _tbmDescription
(\ s a -> s{_tbmDescription = a})
tbmRematchId :: Lens' TurnBasedMatch (Maybe Text)
tbmRematchId
= lens _tbmRematchId (\ s a -> s{_tbmRematchId = a})
tbmMatchVersion :: Lens' TurnBasedMatch (Maybe Int32)
tbmMatchVersion
= lens _tbmMatchVersion
(\ s a -> s{_tbmMatchVersion = a})
. mapping _Coerce
instance FromJSON TurnBasedMatch where
parseJSON
= withObject "TurnBasedMatch"
(\ o ->
TurnBasedMatch' <$>
(o .:? "status") <*> (o .:? "variant") <*>
(o .:? "results" .!= mempty)
<*> (o .:? "matchNumber")
<*> (o .:? "kind" .!= "games#turnBasedMatch")
<*> (o .:? "data")
<*> (o .:? "withParticipantId")
<*> (o .:? "creationDetails")
<*> (o .:? "inviterId")
<*> (o .:? "lastUpdateDetails")
<*> (o .:? "participants" .!= mempty)
<*> (o .:? "applicationId")
<*> (o .:? "autoMatchingCriteria")
<*> (o .:? "previousMatchData")
<*> (o .:? "pendingParticipantId")
<*> (o .:? "userMatchStatus")
<*> (o .:? "matchId")
<*> (o .:? "description")
<*> (o .:? "rematchId")
<*> (o .:? "matchVersion"))
instance ToJSON TurnBasedMatch where
toJSON TurnBasedMatch'{..}
= object
(catMaybes
[("status" .=) <$> _tbmStatus,
("variant" .=) <$> _tbmVariant,
("results" .=) <$> _tbmResults,
("matchNumber" .=) <$> _tbmMatchNumber,
Just ("kind" .= _tbmKind), ("data" .=) <$> _tbmData,
("withParticipantId" .=) <$> _tbmWithParticipantId,
("creationDetails" .=) <$> _tbmCreationDetails,
("inviterId" .=) <$> _tbmInviterId,
("lastUpdateDetails" .=) <$> _tbmLastUpdateDetails,
("participants" .=) <$> _tbmParticipants,
("applicationId" .=) <$> _tbmApplicationId,
("autoMatchingCriteria" .=) <$>
_tbmAutoMatchingCriteria,
("previousMatchData" .=) <$> _tbmPreviousMatchData,
("pendingParticipantId" .=) <$>
_tbmPendingParticipantId,
("userMatchStatus" .=) <$> _tbmUserMatchStatus,
("matchId" .=) <$> _tbmMatchId,
("description" .=) <$> _tbmDescription,
("rematchId" .=) <$> _tbmRematchId,
("matchVersion" .=) <$> _tbmMatchVersion])
data TurnBasedMatchData =
TurnBasedMatchData'
{ _tbmdKind :: !Text
, _tbmdData :: !(Maybe Bytes)
, _tbmdDataAvailable :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchData
:: TurnBasedMatchData
turnBasedMatchData =
TurnBasedMatchData'
{ _tbmdKind = "games#turnBasedMatchData"
, _tbmdData = Nothing
, _tbmdDataAvailable = Nothing
}
tbmdKind :: Lens' TurnBasedMatchData Text
tbmdKind = lens _tbmdKind (\ s a -> s{_tbmdKind = a})
tbmdData :: Lens' TurnBasedMatchData (Maybe ByteString)
tbmdData
= lens _tbmdData (\ s a -> s{_tbmdData = a}) .
mapping _Bytes
tbmdDataAvailable :: Lens' TurnBasedMatchData (Maybe Bool)
tbmdDataAvailable
= lens _tbmdDataAvailable
(\ s a -> s{_tbmdDataAvailable = a})
instance FromJSON TurnBasedMatchData where
parseJSON
= withObject "TurnBasedMatchData"
(\ o ->
TurnBasedMatchData' <$>
(o .:? "kind" .!= "games#turnBasedMatchData") <*>
(o .:? "data")
<*> (o .:? "dataAvailable"))
instance ToJSON TurnBasedMatchData where
toJSON TurnBasedMatchData'{..}
= object
(catMaybes
[Just ("kind" .= _tbmdKind),
("data" .=) <$> _tbmdData,
("dataAvailable" .=) <$> _tbmdDataAvailable])
data PlayerEvent =
PlayerEvent'
{ _peKind :: !Text
, _peNumEvents :: !(Maybe (Textual Int64))
, _peFormattedNumEvents :: !(Maybe Text)
, _peDefinitionId :: !(Maybe Text)
, _pePlayerId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
playerEvent
:: PlayerEvent
playerEvent =
PlayerEvent'
{ _peKind = "games#playerEvent"
, _peNumEvents = Nothing
, _peFormattedNumEvents = Nothing
, _peDefinitionId = Nothing
, _pePlayerId = Nothing
}
peKind :: Lens' PlayerEvent Text
peKind = lens _peKind (\ s a -> s{_peKind = a})
peNumEvents :: Lens' PlayerEvent (Maybe Int64)
peNumEvents
= lens _peNumEvents (\ s a -> s{_peNumEvents = a}) .
mapping _Coerce
peFormattedNumEvents :: Lens' PlayerEvent (Maybe Text)
peFormattedNumEvents
= lens _peFormattedNumEvents
(\ s a -> s{_peFormattedNumEvents = a})
peDefinitionId :: Lens' PlayerEvent (Maybe Text)
peDefinitionId
= lens _peDefinitionId
(\ s a -> s{_peDefinitionId = a})
pePlayerId :: Lens' PlayerEvent (Maybe Text)
pePlayerId
= lens _pePlayerId (\ s a -> s{_pePlayerId = a})
instance FromJSON PlayerEvent where
parseJSON
= withObject "PlayerEvent"
(\ o ->
PlayerEvent' <$>
(o .:? "kind" .!= "games#playerEvent") <*>
(o .:? "numEvents")
<*> (o .:? "formattedNumEvents")
<*> (o .:? "definitionId")
<*> (o .:? "playerId"))
instance ToJSON PlayerEvent where
toJSON PlayerEvent'{..}
= object
(catMaybes
[Just ("kind" .= _peKind),
("numEvents" .=) <$> _peNumEvents,
("formattedNumEvents" .=) <$> _peFormattedNumEvents,
("definitionId" .=) <$> _peDefinitionId,
("playerId" .=) <$> _pePlayerId])
data PlayerLeaderboardScore =
PlayerLeaderboardScore'
{ _plsScoreTag :: !(Maybe Text)
, _plsScoreString :: !(Maybe Text)
, _plsKind :: !Text
, _plsScoreValue :: !(Maybe (Textual Int64))
, _plsTimeSpan :: !(Maybe Text)
, _plsPublicRank :: !(Maybe LeaderboardScoreRank)
, _plsSocialRank :: !(Maybe LeaderboardScoreRank)
, _plsLeaderboardId :: !(Maybe Text)
, _plsWriteTimestamp :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
playerLeaderboardScore
:: PlayerLeaderboardScore
playerLeaderboardScore =
PlayerLeaderboardScore'
{ _plsScoreTag = Nothing
, _plsScoreString = Nothing
, _plsKind = "games#playerLeaderboardScore"
, _plsScoreValue = Nothing
, _plsTimeSpan = Nothing
, _plsPublicRank = Nothing
, _plsSocialRank = Nothing
, _plsLeaderboardId = Nothing
, _plsWriteTimestamp = Nothing
}
plsScoreTag :: Lens' PlayerLeaderboardScore (Maybe Text)
plsScoreTag
= lens _plsScoreTag (\ s a -> s{_plsScoreTag = a})
plsScoreString :: Lens' PlayerLeaderboardScore (Maybe Text)
plsScoreString
= lens _plsScoreString
(\ s a -> s{_plsScoreString = a})
plsKind :: Lens' PlayerLeaderboardScore Text
plsKind = lens _plsKind (\ s a -> s{_plsKind = a})
plsScoreValue :: Lens' PlayerLeaderboardScore (Maybe Int64)
plsScoreValue
= lens _plsScoreValue
(\ s a -> s{_plsScoreValue = a})
. mapping _Coerce
plsTimeSpan :: Lens' PlayerLeaderboardScore (Maybe Text)
plsTimeSpan
= lens _plsTimeSpan (\ s a -> s{_plsTimeSpan = a})
plsPublicRank :: Lens' PlayerLeaderboardScore (Maybe LeaderboardScoreRank)
plsPublicRank
= lens _plsPublicRank
(\ s a -> s{_plsPublicRank = a})
plsSocialRank :: Lens' PlayerLeaderboardScore (Maybe LeaderboardScoreRank)
plsSocialRank
= lens _plsSocialRank
(\ s a -> s{_plsSocialRank = a})
plsLeaderboardId :: Lens' PlayerLeaderboardScore (Maybe Text)
plsLeaderboardId
= lens _plsLeaderboardId
(\ s a -> s{_plsLeaderboardId = a})
plsWriteTimestamp :: Lens' PlayerLeaderboardScore (Maybe Int64)
plsWriteTimestamp
= lens _plsWriteTimestamp
(\ s a -> s{_plsWriteTimestamp = a})
. mapping _Coerce
instance FromJSON PlayerLeaderboardScore where
parseJSON
= withObject "PlayerLeaderboardScore"
(\ o ->
PlayerLeaderboardScore' <$>
(o .:? "scoreTag") <*> (o .:? "scoreString") <*>
(o .:? "kind" .!= "games#playerLeaderboardScore")
<*> (o .:? "scoreValue")
<*> (o .:? "timeSpan")
<*> (o .:? "publicRank")
<*> (o .:? "socialRank")
<*> (o .:? "leaderboard_id")
<*> (o .:? "writeTimestamp"))
instance ToJSON PlayerLeaderboardScore where
toJSON PlayerLeaderboardScore'{..}
= object
(catMaybes
[("scoreTag" .=) <$> _plsScoreTag,
("scoreString" .=) <$> _plsScoreString,
Just ("kind" .= _plsKind),
("scoreValue" .=) <$> _plsScoreValue,
("timeSpan" .=) <$> _plsTimeSpan,
("publicRank" .=) <$> _plsPublicRank,
("socialRank" .=) <$> _plsSocialRank,
("leaderboard_id" .=) <$> _plsLeaderboardId,
("writeTimestamp" .=) <$> _plsWriteTimestamp])
data Application =
Application'
{ _aThemeColor :: !(Maybe Text)
, _aLeaderboardCount :: !(Maybe (Textual Int32))
, _aKind :: !Text
, _aCategory :: !(Maybe ApplicationCategory)
, _aName :: !(Maybe Text)
, _aEnabledFeatures :: !(Maybe [Text])
, _aInstances :: !(Maybe [Instance])
, _aAuthor :: !(Maybe Text)
, _aId :: !(Maybe Text)
, _aAchievementCount :: !(Maybe (Textual Int32))
, _aAssets :: !(Maybe [ImageAsset])
, _aDescription :: !(Maybe Text)
, _aLastUpdatedTimestamp :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
application
:: Application
application =
Application'
{ _aThemeColor = Nothing
, _aLeaderboardCount = Nothing
, _aKind = "games#application"
, _aCategory = Nothing
, _aName = Nothing
, _aEnabledFeatures = Nothing
, _aInstances = Nothing
, _aAuthor = Nothing
, _aId = Nothing
, _aAchievementCount = Nothing
, _aAssets = Nothing
, _aDescription = Nothing
, _aLastUpdatedTimestamp = Nothing
}
aThemeColor :: Lens' Application (Maybe Text)
aThemeColor
= lens _aThemeColor (\ s a -> s{_aThemeColor = a})
aLeaderboardCount :: Lens' Application (Maybe Int32)
aLeaderboardCount
= lens _aLeaderboardCount
(\ s a -> s{_aLeaderboardCount = a})
. mapping _Coerce
aKind :: Lens' Application Text
aKind = lens _aKind (\ s a -> s{_aKind = a})
aCategory :: Lens' Application (Maybe ApplicationCategory)
aCategory
= lens _aCategory (\ s a -> s{_aCategory = a})
aName :: Lens' Application (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a})
aEnabledFeatures :: Lens' Application [Text]
aEnabledFeatures
= lens _aEnabledFeatures
(\ s a -> s{_aEnabledFeatures = a})
. _Default
. _Coerce
aInstances :: Lens' Application [Instance]
aInstances
= lens _aInstances (\ s a -> s{_aInstances = a}) .
_Default
. _Coerce
aAuthor :: Lens' Application (Maybe Text)
aAuthor = lens _aAuthor (\ s a -> s{_aAuthor = a})
aId :: Lens' Application (Maybe Text)
aId = lens _aId (\ s a -> s{_aId = a})
aAchievementCount :: Lens' Application (Maybe Int32)
aAchievementCount
= lens _aAchievementCount
(\ s a -> s{_aAchievementCount = a})
. mapping _Coerce
aAssets :: Lens' Application [ImageAsset]
aAssets
= lens _aAssets (\ s a -> s{_aAssets = a}) . _Default
. _Coerce
aDescription :: Lens' Application (Maybe Text)
aDescription
= lens _aDescription (\ s a -> s{_aDescription = a})
aLastUpdatedTimestamp :: Lens' Application (Maybe Int64)
aLastUpdatedTimestamp
= lens _aLastUpdatedTimestamp
(\ s a -> s{_aLastUpdatedTimestamp = a})
. mapping _Coerce
instance FromJSON Application where
parseJSON
= withObject "Application"
(\ o ->
Application' <$>
(o .:? "themeColor") <*> (o .:? "leaderboard_count")
<*> (o .:? "kind" .!= "games#application")
<*> (o .:? "category")
<*> (o .:? "name")
<*> (o .:? "enabledFeatures" .!= mempty)
<*> (o .:? "instances" .!= mempty)
<*> (o .:? "author")
<*> (o .:? "id")
<*> (o .:? "achievement_count")
<*> (o .:? "assets" .!= mempty)
<*> (o .:? "description")
<*> (o .:? "lastUpdatedTimestamp"))
instance ToJSON Application where
toJSON Application'{..}
= object
(catMaybes
[("themeColor" .=) <$> _aThemeColor,
("leaderboard_count" .=) <$> _aLeaderboardCount,
Just ("kind" .= _aKind),
("category" .=) <$> _aCategory,
("name" .=) <$> _aName,
("enabledFeatures" .=) <$> _aEnabledFeatures,
("instances" .=) <$> _aInstances,
("author" .=) <$> _aAuthor, ("id" .=) <$> _aId,
("achievement_count" .=) <$> _aAchievementCount,
("assets" .=) <$> _aAssets,
("description" .=) <$> _aDescription,
("lastUpdatedTimestamp" .=) <$>
_aLastUpdatedTimestamp])
data ApplicationCategory =
ApplicationCategory'
{ _acSecondary :: !(Maybe Text)
, _acKind :: !Text
, _acPrimary :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
applicationCategory
:: ApplicationCategory
applicationCategory =
ApplicationCategory'
{ _acSecondary = Nothing
, _acKind = "games#applicationCategory"
, _acPrimary = Nothing
}
acSecondary :: Lens' ApplicationCategory (Maybe Text)
acSecondary
= lens _acSecondary (\ s a -> s{_acSecondary = a})
acKind :: Lens' ApplicationCategory Text
acKind = lens _acKind (\ s a -> s{_acKind = a})
acPrimary :: Lens' ApplicationCategory (Maybe Text)
acPrimary
= lens _acPrimary (\ s a -> s{_acPrimary = a})
instance FromJSON ApplicationCategory where
parseJSON
= withObject "ApplicationCategory"
(\ o ->
ApplicationCategory' <$>
(o .:? "secondary") <*>
(o .:? "kind" .!= "games#applicationCategory")
<*> (o .:? "primary"))
instance ToJSON ApplicationCategory where
toJSON ApplicationCategory'{..}
= object
(catMaybes
[("secondary" .=) <$> _acSecondary,
Just ("kind" .= _acKind),
("primary" .=) <$> _acPrimary])
data PlayerScoreListResponse =
PlayerScoreListResponse'
{ _pslrSubmittedScores :: !(Maybe [PlayerScoreResponse])
, _pslrKind :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
playerScoreListResponse
:: PlayerScoreListResponse
playerScoreListResponse =
PlayerScoreListResponse'
{ _pslrSubmittedScores = Nothing
, _pslrKind = "games#playerScoreListResponse"
}
pslrSubmittedScores :: Lens' PlayerScoreListResponse [PlayerScoreResponse]
pslrSubmittedScores
= lens _pslrSubmittedScores
(\ s a -> s{_pslrSubmittedScores = a})
. _Default
. _Coerce
pslrKind :: Lens' PlayerScoreListResponse Text
pslrKind = lens _pslrKind (\ s a -> s{_pslrKind = a})
instance FromJSON PlayerScoreListResponse where
parseJSON
= withObject "PlayerScoreListResponse"
(\ o ->
PlayerScoreListResponse' <$>
(o .:? "submittedScores" .!= mempty) <*>
(o .:? "kind" .!= "games#playerScoreListResponse"))
instance ToJSON PlayerScoreListResponse where
toJSON PlayerScoreListResponse'{..}
= object
(catMaybes
[("submittedScores" .=) <$> _pslrSubmittedScores,
Just ("kind" .= _pslrKind)])
data NetworkDiagnostics =
NetworkDiagnostics'
{ _ndAndroidNetworkType :: !(Maybe (Textual Int32))
, _ndKind :: !Text
, _ndNetworkOperatorCode :: !(Maybe Text)
, _ndNetworkOperatorName :: !(Maybe Text)
, _ndRegistrationLatencyMillis :: !(Maybe (Textual Int32))
, _ndIosNetworkType :: !(Maybe (Textual Int32))
, _ndAndroidNetworkSubtype :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
networkDiagnostics
:: NetworkDiagnostics
networkDiagnostics =
NetworkDiagnostics'
{ _ndAndroidNetworkType = Nothing
, _ndKind = "games#networkDiagnostics"
, _ndNetworkOperatorCode = Nothing
, _ndNetworkOperatorName = Nothing
, _ndRegistrationLatencyMillis = Nothing
, _ndIosNetworkType = Nothing
, _ndAndroidNetworkSubtype = Nothing
}
ndAndroidNetworkType :: Lens' NetworkDiagnostics (Maybe Int32)
ndAndroidNetworkType
= lens _ndAndroidNetworkType
(\ s a -> s{_ndAndroidNetworkType = a})
. mapping _Coerce
ndKind :: Lens' NetworkDiagnostics Text
ndKind = lens _ndKind (\ s a -> s{_ndKind = a})
ndNetworkOperatorCode :: Lens' NetworkDiagnostics (Maybe Text)
ndNetworkOperatorCode
= lens _ndNetworkOperatorCode
(\ s a -> s{_ndNetworkOperatorCode = a})
ndNetworkOperatorName :: Lens' NetworkDiagnostics (Maybe Text)
ndNetworkOperatorName
= lens _ndNetworkOperatorName
(\ s a -> s{_ndNetworkOperatorName = a})
ndRegistrationLatencyMillis :: Lens' NetworkDiagnostics (Maybe Int32)
ndRegistrationLatencyMillis
= lens _ndRegistrationLatencyMillis
(\ s a -> s{_ndRegistrationLatencyMillis = a})
. mapping _Coerce
ndIosNetworkType :: Lens' NetworkDiagnostics (Maybe Int32)
ndIosNetworkType
= lens _ndIosNetworkType
(\ s a -> s{_ndIosNetworkType = a})
. mapping _Coerce
ndAndroidNetworkSubtype :: Lens' NetworkDiagnostics (Maybe Int32)
ndAndroidNetworkSubtype
= lens _ndAndroidNetworkSubtype
(\ s a -> s{_ndAndroidNetworkSubtype = a})
. mapping _Coerce
instance FromJSON NetworkDiagnostics where
parseJSON
= withObject "NetworkDiagnostics"
(\ o ->
NetworkDiagnostics' <$>
(o .:? "androidNetworkType") <*>
(o .:? "kind" .!= "games#networkDiagnostics")
<*> (o .:? "networkOperatorCode")
<*> (o .:? "networkOperatorName")
<*> (o .:? "registrationLatencyMillis")
<*> (o .:? "iosNetworkType")
<*> (o .:? "androidNetworkSubtype"))
instance ToJSON NetworkDiagnostics where
toJSON NetworkDiagnostics'{..}
= object
(catMaybes
[("androidNetworkType" .=) <$> _ndAndroidNetworkType,
Just ("kind" .= _ndKind),
("networkOperatorCode" .=) <$>
_ndNetworkOperatorCode,
("networkOperatorName" .=) <$>
_ndNetworkOperatorName,
("registrationLatencyMillis" .=) <$>
_ndRegistrationLatencyMillis,
("iosNetworkType" .=) <$> _ndIosNetworkType,
("androidNetworkSubtype" .=) <$>
_ndAndroidNetworkSubtype])
data TurnBasedMatchTurn =
TurnBasedMatchTurn'
{ _tbmtResults :: !(Maybe [ParticipantResult])
, _tbmtKind :: !Text
, _tbmtData :: !(Maybe TurnBasedMatchDataRequest)
, _tbmtPendingParticipantId :: !(Maybe Text)
, _tbmtMatchVersion :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchTurn
:: TurnBasedMatchTurn
turnBasedMatchTurn =
TurnBasedMatchTurn'
{ _tbmtResults = Nothing
, _tbmtKind = "games#turnBasedMatchTurn"
, _tbmtData = Nothing
, _tbmtPendingParticipantId = Nothing
, _tbmtMatchVersion = Nothing
}
tbmtResults :: Lens' TurnBasedMatchTurn [ParticipantResult]
tbmtResults
= lens _tbmtResults (\ s a -> s{_tbmtResults = a}) .
_Default
. _Coerce
tbmtKind :: Lens' TurnBasedMatchTurn Text
tbmtKind = lens _tbmtKind (\ s a -> s{_tbmtKind = a})
tbmtData :: Lens' TurnBasedMatchTurn (Maybe TurnBasedMatchDataRequest)
tbmtData = lens _tbmtData (\ s a -> s{_tbmtData = a})
tbmtPendingParticipantId :: Lens' TurnBasedMatchTurn (Maybe Text)
tbmtPendingParticipantId
= lens _tbmtPendingParticipantId
(\ s a -> s{_tbmtPendingParticipantId = a})
tbmtMatchVersion :: Lens' TurnBasedMatchTurn (Maybe Int32)
tbmtMatchVersion
= lens _tbmtMatchVersion
(\ s a -> s{_tbmtMatchVersion = a})
. mapping _Coerce
instance FromJSON TurnBasedMatchTurn where
parseJSON
= withObject "TurnBasedMatchTurn"
(\ o ->
TurnBasedMatchTurn' <$>
(o .:? "results" .!= mempty) <*>
(o .:? "kind" .!= "games#turnBasedMatchTurn")
<*> (o .:? "data")
<*> (o .:? "pendingParticipantId")
<*> (o .:? "matchVersion"))
instance ToJSON TurnBasedMatchTurn where
toJSON TurnBasedMatchTurn'{..}
= object
(catMaybes
[("results" .=) <$> _tbmtResults,
Just ("kind" .= _tbmtKind),
("data" .=) <$> _tbmtData,
("pendingParticipantId" .=) <$>
_tbmtPendingParticipantId,
("matchVersion" .=) <$> _tbmtMatchVersion])
data QuestCriterion =
QuestCriterion'
{ _qcCurrentContribution :: !(Maybe QuestContribution)
, _qcCompletionContribution :: !(Maybe QuestContribution)
, _qcKind :: !Text
, _qcInitialPlayerProgress :: !(Maybe QuestContribution)
, _qcEventId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
questCriterion
:: QuestCriterion
questCriterion =
QuestCriterion'
{ _qcCurrentContribution = Nothing
, _qcCompletionContribution = Nothing
, _qcKind = "games#questCriterion"
, _qcInitialPlayerProgress = Nothing
, _qcEventId = Nothing
}
qcCurrentContribution :: Lens' QuestCriterion (Maybe QuestContribution)
qcCurrentContribution
= lens _qcCurrentContribution
(\ s a -> s{_qcCurrentContribution = a})
qcCompletionContribution :: Lens' QuestCriterion (Maybe QuestContribution)
qcCompletionContribution
= lens _qcCompletionContribution
(\ s a -> s{_qcCompletionContribution = a})
qcKind :: Lens' QuestCriterion Text
qcKind = lens _qcKind (\ s a -> s{_qcKind = a})
qcInitialPlayerProgress :: Lens' QuestCriterion (Maybe QuestContribution)
qcInitialPlayerProgress
= lens _qcInitialPlayerProgress
(\ s a -> s{_qcInitialPlayerProgress = a})
qcEventId :: Lens' QuestCriterion (Maybe Text)
qcEventId
= lens _qcEventId (\ s a -> s{_qcEventId = a})
instance FromJSON QuestCriterion where
parseJSON
= withObject "QuestCriterion"
(\ o ->
QuestCriterion' <$>
(o .:? "currentContribution") <*>
(o .:? "completionContribution")
<*> (o .:? "kind" .!= "games#questCriterion")
<*> (o .:? "initialPlayerProgress")
<*> (o .:? "eventId"))
instance ToJSON QuestCriterion where
toJSON QuestCriterion'{..}
= object
(catMaybes
[("currentContribution" .=) <$>
_qcCurrentContribution,
("completionContribution" .=) <$>
_qcCompletionContribution,
Just ("kind" .= _qcKind),
("initialPlayerProgress" .=) <$>
_qcInitialPlayerProgress,
("eventId" .=) <$> _qcEventId])
data TurnBasedMatchList =
TurnBasedMatchList'
{ _tbmlNextPageToken :: !(Maybe Text)
, _tbmlKind :: !Text
, _tbmlItems :: !(Maybe [TurnBasedMatch])
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchList
:: TurnBasedMatchList
turnBasedMatchList =
TurnBasedMatchList'
{ _tbmlNextPageToken = Nothing
, _tbmlKind = "games#turnBasedMatchList"
, _tbmlItems = Nothing
}
tbmlNextPageToken :: Lens' TurnBasedMatchList (Maybe Text)
tbmlNextPageToken
= lens _tbmlNextPageToken
(\ s a -> s{_tbmlNextPageToken = a})
tbmlKind :: Lens' TurnBasedMatchList Text
tbmlKind = lens _tbmlKind (\ s a -> s{_tbmlKind = a})
tbmlItems :: Lens' TurnBasedMatchList [TurnBasedMatch]
tbmlItems
= lens _tbmlItems (\ s a -> s{_tbmlItems = a}) .
_Default
. _Coerce
instance FromJSON TurnBasedMatchList where
parseJSON
= withObject "TurnBasedMatchList"
(\ o ->
TurnBasedMatchList' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#turnBasedMatchList")
<*> (o .:? "items" .!= mempty))
instance ToJSON TurnBasedMatchList where
toJSON TurnBasedMatchList'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _tbmlNextPageToken,
Just ("kind" .= _tbmlKind),
("items" .=) <$> _tbmlItems])
data PeerChannelDiagnostics =
PeerChannelDiagnostics'
{ _pcdNumMessagesLost :: !(Maybe (Textual Int32))
, _pcdBytesSent :: !(Maybe AggregateStats)
, _pcdKind :: !Text
, _pcdRoundtripLatencyMillis :: !(Maybe AggregateStats)
, _pcdBytesReceived :: !(Maybe AggregateStats)
, _pcdNumMessagesReceived :: !(Maybe (Textual Int32))
, _pcdNumSendFailures :: !(Maybe (Textual Int32))
, _pcdNumMessagesSent :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
peerChannelDiagnostics
:: PeerChannelDiagnostics
peerChannelDiagnostics =
PeerChannelDiagnostics'
{ _pcdNumMessagesLost = Nothing
, _pcdBytesSent = Nothing
, _pcdKind = "games#peerChannelDiagnostics"
, _pcdRoundtripLatencyMillis = Nothing
, _pcdBytesReceived = Nothing
, _pcdNumMessagesReceived = Nothing
, _pcdNumSendFailures = Nothing
, _pcdNumMessagesSent = Nothing
}
pcdNumMessagesLost :: Lens' PeerChannelDiagnostics (Maybe Int32)
pcdNumMessagesLost
= lens _pcdNumMessagesLost
(\ s a -> s{_pcdNumMessagesLost = a})
. mapping _Coerce
pcdBytesSent :: Lens' PeerChannelDiagnostics (Maybe AggregateStats)
pcdBytesSent
= lens _pcdBytesSent (\ s a -> s{_pcdBytesSent = a})
pcdKind :: Lens' PeerChannelDiagnostics Text
pcdKind = lens _pcdKind (\ s a -> s{_pcdKind = a})
pcdRoundtripLatencyMillis :: Lens' PeerChannelDiagnostics (Maybe AggregateStats)
pcdRoundtripLatencyMillis
= lens _pcdRoundtripLatencyMillis
(\ s a -> s{_pcdRoundtripLatencyMillis = a})
pcdBytesReceived :: Lens' PeerChannelDiagnostics (Maybe AggregateStats)
pcdBytesReceived
= lens _pcdBytesReceived
(\ s a -> s{_pcdBytesReceived = a})
pcdNumMessagesReceived :: Lens' PeerChannelDiagnostics (Maybe Int32)
pcdNumMessagesReceived
= lens _pcdNumMessagesReceived
(\ s a -> s{_pcdNumMessagesReceived = a})
. mapping _Coerce
pcdNumSendFailures :: Lens' PeerChannelDiagnostics (Maybe Int32)
pcdNumSendFailures
= lens _pcdNumSendFailures
(\ s a -> s{_pcdNumSendFailures = a})
. mapping _Coerce
pcdNumMessagesSent :: Lens' PeerChannelDiagnostics (Maybe Int32)
pcdNumMessagesSent
= lens _pcdNumMessagesSent
(\ s a -> s{_pcdNumMessagesSent = a})
. mapping _Coerce
instance FromJSON PeerChannelDiagnostics where
parseJSON
= withObject "PeerChannelDiagnostics"
(\ o ->
PeerChannelDiagnostics' <$>
(o .:? "numMessagesLost") <*> (o .:? "bytesSent") <*>
(o .:? "kind" .!= "games#peerChannelDiagnostics")
<*> (o .:? "roundtripLatencyMillis")
<*> (o .:? "bytesReceived")
<*> (o .:? "numMessagesReceived")
<*> (o .:? "numSendFailures")
<*> (o .:? "numMessagesSent"))
instance ToJSON PeerChannelDiagnostics where
toJSON PeerChannelDiagnostics'{..}
= object
(catMaybes
[("numMessagesLost" .=) <$> _pcdNumMessagesLost,
("bytesSent" .=) <$> _pcdBytesSent,
Just ("kind" .= _pcdKind),
("roundtripLatencyMillis" .=) <$>
_pcdRoundtripLatencyMillis,
("bytesReceived" .=) <$> _pcdBytesReceived,
("numMessagesReceived" .=) <$>
_pcdNumMessagesReceived,
("numSendFailures" .=) <$> _pcdNumSendFailures,
("numMessagesSent" .=) <$> _pcdNumMessagesSent])
data RoomList =
RoomList'
{ _rlNextPageToken :: !(Maybe Text)
, _rlKind :: !Text
, _rlItems :: !(Maybe [Room])
}
deriving (Eq, Show, Data, Typeable, Generic)
roomList
:: RoomList
roomList =
RoomList'
{_rlNextPageToken = Nothing, _rlKind = "games#roomList", _rlItems = Nothing}
rlNextPageToken :: Lens' RoomList (Maybe Text)
rlNextPageToken
= lens _rlNextPageToken
(\ s a -> s{_rlNextPageToken = a})
rlKind :: Lens' RoomList Text
rlKind = lens _rlKind (\ s a -> s{_rlKind = a})
rlItems :: Lens' RoomList [Room]
rlItems
= lens _rlItems (\ s a -> s{_rlItems = a}) . _Default
. _Coerce
instance FromJSON RoomList where
parseJSON
= withObject "RoomList"
(\ o ->
RoomList' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#roomList")
<*> (o .:? "items" .!= mempty))
instance ToJSON RoomList where
toJSON RoomList'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _rlNextPageToken,
Just ("kind" .= _rlKind), ("items" .=) <$> _rlItems])
data PushToken =
PushToken'
{ _ptClientRevision :: !(Maybe Text)
, _ptKind :: !Text
, _ptLanguage :: !(Maybe Text)
, _ptId :: !(Maybe PushTokenId)
}
deriving (Eq, Show, Data, Typeable, Generic)
pushToken
:: PushToken
pushToken =
PushToken'
{ _ptClientRevision = Nothing
, _ptKind = "games#pushToken"
, _ptLanguage = Nothing
, _ptId = Nothing
}
ptClientRevision :: Lens' PushToken (Maybe Text)
ptClientRevision
= lens _ptClientRevision
(\ s a -> s{_ptClientRevision = a})
ptKind :: Lens' PushToken Text
ptKind = lens _ptKind (\ s a -> s{_ptKind = a})
ptLanguage :: Lens' PushToken (Maybe Text)
ptLanguage
= lens _ptLanguage (\ s a -> s{_ptLanguage = a})
ptId :: Lens' PushToken (Maybe PushTokenId)
ptId = lens _ptId (\ s a -> s{_ptId = a})
instance FromJSON PushToken where
parseJSON
= withObject "PushToken"
(\ o ->
PushToken' <$>
(o .:? "clientRevision") <*>
(o .:? "kind" .!= "games#pushToken")
<*> (o .:? "language")
<*> (o .:? "id"))
instance ToJSON PushToken where
toJSON PushToken'{..}
= object
(catMaybes
[("clientRevision" .=) <$> _ptClientRevision,
Just ("kind" .= _ptKind),
("language" .=) <$> _ptLanguage,
("id" .=) <$> _ptId])
data AchievementUpdateResponse =
AchievementUpdateResponse'
{ _aurUpdateOccurred :: !(Maybe Bool)
, _aurAchievementId :: !(Maybe Text)
, _aurKind :: !Text
, _aurCurrentState :: !(Maybe Text)
, _aurNewlyUnlocked :: !(Maybe Bool)
, _aurCurrentSteps :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementUpdateResponse
:: AchievementUpdateResponse
achievementUpdateResponse =
AchievementUpdateResponse'
{ _aurUpdateOccurred = Nothing
, _aurAchievementId = Nothing
, _aurKind = "games#achievementUpdateResponse"
, _aurCurrentState = Nothing
, _aurNewlyUnlocked = Nothing
, _aurCurrentSteps = Nothing
}
aurUpdateOccurred :: Lens' AchievementUpdateResponse (Maybe Bool)
aurUpdateOccurred
= lens _aurUpdateOccurred
(\ s a -> s{_aurUpdateOccurred = a})
aurAchievementId :: Lens' AchievementUpdateResponse (Maybe Text)
aurAchievementId
= lens _aurAchievementId
(\ s a -> s{_aurAchievementId = a})
aurKind :: Lens' AchievementUpdateResponse Text
aurKind = lens _aurKind (\ s a -> s{_aurKind = a})
aurCurrentState :: Lens' AchievementUpdateResponse (Maybe Text)
aurCurrentState
= lens _aurCurrentState
(\ s a -> s{_aurCurrentState = a})
aurNewlyUnlocked :: Lens' AchievementUpdateResponse (Maybe Bool)
aurNewlyUnlocked
= lens _aurNewlyUnlocked
(\ s a -> s{_aurNewlyUnlocked = a})
aurCurrentSteps :: Lens' AchievementUpdateResponse (Maybe Int32)
aurCurrentSteps
= lens _aurCurrentSteps
(\ s a -> s{_aurCurrentSteps = a})
. mapping _Coerce
instance FromJSON AchievementUpdateResponse where
parseJSON
= withObject "AchievementUpdateResponse"
(\ o ->
AchievementUpdateResponse' <$>
(o .:? "updateOccurred") <*> (o .:? "achievementId")
<*>
(o .:? "kind" .!= "games#achievementUpdateResponse")
<*> (o .:? "currentState")
<*> (o .:? "newlyUnlocked")
<*> (o .:? "currentSteps"))
instance ToJSON AchievementUpdateResponse where
toJSON AchievementUpdateResponse'{..}
= object
(catMaybes
[("updateOccurred" .=) <$> _aurUpdateOccurred,
("achievementId" .=) <$> _aurAchievementId,
Just ("kind" .= _aurKind),
("currentState" .=) <$> _aurCurrentState,
("newlyUnlocked" .=) <$> _aurNewlyUnlocked,
("currentSteps" .=) <$> _aurCurrentSteps])
data LeaderboardEntry =
LeaderboardEntry'
{ _leScoreTag :: !(Maybe Text)
, _leWriteTimestampMillis :: !(Maybe (Textual Int64))
, _leKind :: !Text
, _leScoreValue :: !(Maybe (Textual Int64))
, _leFormattedScore :: !(Maybe Text)
, _leTimeSpan :: !(Maybe Text)
, _leFormattedScoreRank :: !(Maybe Text)
, _lePlayer :: !(Maybe Player)
, _leScoreRank :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
leaderboardEntry
:: LeaderboardEntry
leaderboardEntry =
LeaderboardEntry'
{ _leScoreTag = Nothing
, _leWriteTimestampMillis = Nothing
, _leKind = "games#leaderboardEntry"
, _leScoreValue = Nothing
, _leFormattedScore = Nothing
, _leTimeSpan = Nothing
, _leFormattedScoreRank = Nothing
, _lePlayer = Nothing
, _leScoreRank = Nothing
}
leScoreTag :: Lens' LeaderboardEntry (Maybe Text)
leScoreTag
= lens _leScoreTag (\ s a -> s{_leScoreTag = a})
leWriteTimestampMillis :: Lens' LeaderboardEntry (Maybe Int64)
leWriteTimestampMillis
= lens _leWriteTimestampMillis
(\ s a -> s{_leWriteTimestampMillis = a})
. mapping _Coerce
leKind :: Lens' LeaderboardEntry Text
leKind = lens _leKind (\ s a -> s{_leKind = a})
leScoreValue :: Lens' LeaderboardEntry (Maybe Int64)
leScoreValue
= lens _leScoreValue (\ s a -> s{_leScoreValue = a})
. mapping _Coerce
leFormattedScore :: Lens' LeaderboardEntry (Maybe Text)
leFormattedScore
= lens _leFormattedScore
(\ s a -> s{_leFormattedScore = a})
leTimeSpan :: Lens' LeaderboardEntry (Maybe Text)
leTimeSpan
= lens _leTimeSpan (\ s a -> s{_leTimeSpan = a})
leFormattedScoreRank :: Lens' LeaderboardEntry (Maybe Text)
leFormattedScoreRank
= lens _leFormattedScoreRank
(\ s a -> s{_leFormattedScoreRank = a})
lePlayer :: Lens' LeaderboardEntry (Maybe Player)
lePlayer = lens _lePlayer (\ s a -> s{_lePlayer = a})
leScoreRank :: Lens' LeaderboardEntry (Maybe Int64)
leScoreRank
= lens _leScoreRank (\ s a -> s{_leScoreRank = a}) .
mapping _Coerce
instance FromJSON LeaderboardEntry where
parseJSON
= withObject "LeaderboardEntry"
(\ o ->
LeaderboardEntry' <$>
(o .:? "scoreTag") <*> (o .:? "writeTimestampMillis")
<*> (o .:? "kind" .!= "games#leaderboardEntry")
<*> (o .:? "scoreValue")
<*> (o .:? "formattedScore")
<*> (o .:? "timeSpan")
<*> (o .:? "formattedScoreRank")
<*> (o .:? "player")
<*> (o .:? "scoreRank"))
instance ToJSON LeaderboardEntry where
toJSON LeaderboardEntry'{..}
= object
(catMaybes
[("scoreTag" .=) <$> _leScoreTag,
("writeTimestampMillis" .=) <$>
_leWriteTimestampMillis,
Just ("kind" .= _leKind),
("scoreValue" .=) <$> _leScoreValue,
("formattedScore" .=) <$> _leFormattedScore,
("timeSpan" .=) <$> _leTimeSpan,
("formattedScoreRank" .=) <$> _leFormattedScoreRank,
("player" .=) <$> _lePlayer,
("scoreRank" .=) <$> _leScoreRank])
data SnapshotListResponse =
SnapshotListResponse'
{ _slrNextPageToken :: !(Maybe Text)
, _slrKind :: !Text
, _slrItems :: !(Maybe [Snapshot])
}
deriving (Eq, Show, Data, Typeable, Generic)
snapshotListResponse
:: SnapshotListResponse
snapshotListResponse =
SnapshotListResponse'
{ _slrNextPageToken = Nothing
, _slrKind = "games#snapshotListResponse"
, _slrItems = Nothing
}
slrNextPageToken :: Lens' SnapshotListResponse (Maybe Text)
slrNextPageToken
= lens _slrNextPageToken
(\ s a -> s{_slrNextPageToken = a})
slrKind :: Lens' SnapshotListResponse Text
slrKind = lens _slrKind (\ s a -> s{_slrKind = a})
slrItems :: Lens' SnapshotListResponse [Snapshot]
slrItems
= lens _slrItems (\ s a -> s{_slrItems = a}) .
_Default
. _Coerce
instance FromJSON SnapshotListResponse where
parseJSON
= withObject "SnapshotListResponse"
(\ o ->
SnapshotListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#snapshotListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON SnapshotListResponse where
toJSON SnapshotListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _slrNextPageToken,
Just ("kind" .= _slrKind),
("items" .=) <$> _slrItems])
data PlayerLevel =
PlayerLevel'
{ _plMaxExperiencePoints :: !(Maybe (Textual Int64))
, _plKind :: !Text
, _plMinExperiencePoints :: !(Maybe (Textual Int64))
, _plLevel :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
playerLevel
:: PlayerLevel
playerLevel =
PlayerLevel'
{ _plMaxExperiencePoints = Nothing
, _plKind = "games#playerLevel"
, _plMinExperiencePoints = Nothing
, _plLevel = Nothing
}
plMaxExperiencePoints :: Lens' PlayerLevel (Maybe Int64)
plMaxExperiencePoints
= lens _plMaxExperiencePoints
(\ s a -> s{_plMaxExperiencePoints = a})
. mapping _Coerce
plKind :: Lens' PlayerLevel Text
plKind = lens _plKind (\ s a -> s{_plKind = a})
plMinExperiencePoints :: Lens' PlayerLevel (Maybe Int64)
plMinExperiencePoints
= lens _plMinExperiencePoints
(\ s a -> s{_plMinExperiencePoints = a})
. mapping _Coerce
plLevel :: Lens' PlayerLevel (Maybe Int32)
plLevel
= lens _plLevel (\ s a -> s{_plLevel = a}) .
mapping _Coerce
instance FromJSON PlayerLevel where
parseJSON
= withObject "PlayerLevel"
(\ o ->
PlayerLevel' <$>
(o .:? "maxExperiencePoints") <*>
(o .:? "kind" .!= "games#playerLevel")
<*> (o .:? "minExperiencePoints")
<*> (o .:? "level"))
instance ToJSON PlayerLevel where
toJSON PlayerLevel'{..}
= object
(catMaybes
[("maxExperiencePoints" .=) <$>
_plMaxExperiencePoints,
Just ("kind" .= _plKind),
("minExperiencePoints" .=) <$>
_plMinExperiencePoints,
("level" .=) <$> _plLevel])
data AchievementUpdateMultipleResponse =
AchievementUpdateMultipleResponse'
{ _aumrKind :: !Text
, _aumrUpdatedAchievements :: !(Maybe [AchievementUpdateResponse])
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementUpdateMultipleResponse
:: AchievementUpdateMultipleResponse
achievementUpdateMultipleResponse =
AchievementUpdateMultipleResponse'
{ _aumrKind = "games#achievementUpdateMultipleResponse"
, _aumrUpdatedAchievements = Nothing
}
aumrKind :: Lens' AchievementUpdateMultipleResponse Text
aumrKind = lens _aumrKind (\ s a -> s{_aumrKind = a})
aumrUpdatedAchievements :: Lens' AchievementUpdateMultipleResponse [AchievementUpdateResponse]
aumrUpdatedAchievements
= lens _aumrUpdatedAchievements
(\ s a -> s{_aumrUpdatedAchievements = a})
. _Default
. _Coerce
instance FromJSON AchievementUpdateMultipleResponse
where
parseJSON
= withObject "AchievementUpdateMultipleResponse"
(\ o ->
AchievementUpdateMultipleResponse' <$>
(o .:? "kind" .!=
"games#achievementUpdateMultipleResponse")
<*> (o .:? "updatedAchievements" .!= mempty))
instance ToJSON AchievementUpdateMultipleResponse
where
toJSON AchievementUpdateMultipleResponse'{..}
= object
(catMaybes
[Just ("kind" .= _aumrKind),
("updatedAchievements" .=) <$>
_aumrUpdatedAchievements])
data RoomParticipant =
RoomParticipant'
{ _rpStatus :: !(Maybe Text)
, _rpConnected :: !(Maybe Bool)
, _rpLeaveReason :: !(Maybe Text)
, _rpKind :: !Text
, _rpClientAddress :: !(Maybe RoomClientAddress)
, _rpId :: !(Maybe Text)
, _rpAutoMatched :: !(Maybe Bool)
, _rpPlayer :: !(Maybe Player)
, _rpCapabilities :: !(Maybe [Text])
, _rpAutoMatchedPlayer :: !(Maybe AnonymousPlayer)
}
deriving (Eq, Show, Data, Typeable, Generic)
roomParticipant
:: RoomParticipant
roomParticipant =
RoomParticipant'
{ _rpStatus = Nothing
, _rpConnected = Nothing
, _rpLeaveReason = Nothing
, _rpKind = "games#roomParticipant"
, _rpClientAddress = Nothing
, _rpId = Nothing
, _rpAutoMatched = Nothing
, _rpPlayer = Nothing
, _rpCapabilities = Nothing
, _rpAutoMatchedPlayer = Nothing
}
rpStatus :: Lens' RoomParticipant (Maybe Text)
rpStatus = lens _rpStatus (\ s a -> s{_rpStatus = a})
rpConnected :: Lens' RoomParticipant (Maybe Bool)
rpConnected
= lens _rpConnected (\ s a -> s{_rpConnected = a})
rpLeaveReason :: Lens' RoomParticipant (Maybe Text)
rpLeaveReason
= lens _rpLeaveReason
(\ s a -> s{_rpLeaveReason = a})
rpKind :: Lens' RoomParticipant Text
rpKind = lens _rpKind (\ s a -> s{_rpKind = a})
rpClientAddress :: Lens' RoomParticipant (Maybe RoomClientAddress)
rpClientAddress
= lens _rpClientAddress
(\ s a -> s{_rpClientAddress = a})
rpId :: Lens' RoomParticipant (Maybe Text)
rpId = lens _rpId (\ s a -> s{_rpId = a})
rpAutoMatched :: Lens' RoomParticipant (Maybe Bool)
rpAutoMatched
= lens _rpAutoMatched
(\ s a -> s{_rpAutoMatched = a})
rpPlayer :: Lens' RoomParticipant (Maybe Player)
rpPlayer = lens _rpPlayer (\ s a -> s{_rpPlayer = a})
rpCapabilities :: Lens' RoomParticipant [Text]
rpCapabilities
= lens _rpCapabilities
(\ s a -> s{_rpCapabilities = a})
. _Default
. _Coerce
rpAutoMatchedPlayer :: Lens' RoomParticipant (Maybe AnonymousPlayer)
rpAutoMatchedPlayer
= lens _rpAutoMatchedPlayer
(\ s a -> s{_rpAutoMatchedPlayer = a})
instance FromJSON RoomParticipant where
parseJSON
= withObject "RoomParticipant"
(\ o ->
RoomParticipant' <$>
(o .:? "status") <*> (o .:? "connected") <*>
(o .:? "leaveReason")
<*> (o .:? "kind" .!= "games#roomParticipant")
<*> (o .:? "clientAddress")
<*> (o .:? "id")
<*> (o .:? "autoMatched")
<*> (o .:? "player")
<*> (o .:? "capabilities" .!= mempty)
<*> (o .:? "autoMatchedPlayer"))
instance ToJSON RoomParticipant where
toJSON RoomParticipant'{..}
= object
(catMaybes
[("status" .=) <$> _rpStatus,
("connected" .=) <$> _rpConnected,
("leaveReason" .=) <$> _rpLeaveReason,
Just ("kind" .= _rpKind),
("clientAddress" .=) <$> _rpClientAddress,
("id" .=) <$> _rpId,
("autoMatched" .=) <$> _rpAutoMatched,
("player" .=) <$> _rpPlayer,
("capabilities" .=) <$> _rpCapabilities,
("autoMatchedPlayer" .=) <$> _rpAutoMatchedPlayer])
data EventDefinitionListResponse =
EventDefinitionListResponse'
{ _edlrNextPageToken :: !(Maybe Text)
, _edlrKind :: !Text
, _edlrItems :: !(Maybe [EventDefinition])
}
deriving (Eq, Show, Data, Typeable, Generic)
eventDefinitionListResponse
:: EventDefinitionListResponse
eventDefinitionListResponse =
EventDefinitionListResponse'
{ _edlrNextPageToken = Nothing
, _edlrKind = "games#eventDefinitionListResponse"
, _edlrItems = Nothing
}
edlrNextPageToken :: Lens' EventDefinitionListResponse (Maybe Text)
edlrNextPageToken
= lens _edlrNextPageToken
(\ s a -> s{_edlrNextPageToken = a})
edlrKind :: Lens' EventDefinitionListResponse Text
edlrKind = lens _edlrKind (\ s a -> s{_edlrKind = a})
edlrItems :: Lens' EventDefinitionListResponse [EventDefinition]
edlrItems
= lens _edlrItems (\ s a -> s{_edlrItems = a}) .
_Default
. _Coerce
instance FromJSON EventDefinitionListResponse where
parseJSON
= withObject "EventDefinitionListResponse"
(\ o ->
EventDefinitionListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"games#eventDefinitionListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON EventDefinitionListResponse where
toJSON EventDefinitionListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _edlrNextPageToken,
Just ("kind" .= _edlrKind),
("items" .=) <$> _edlrItems])
data Category =
Category'
{ _cKind :: !Text
, _cCategory :: !(Maybe Text)
, _cExperiencePoints :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
category
:: Category
category =
Category'
{ _cKind = "games#category"
, _cCategory = Nothing
, _cExperiencePoints = Nothing
}
cKind :: Lens' Category Text
cKind = lens _cKind (\ s a -> s{_cKind = a})
cCategory :: Lens' Category (Maybe Text)
cCategory
= lens _cCategory (\ s a -> s{_cCategory = a})
cExperiencePoints :: Lens' Category (Maybe Int64)
cExperiencePoints
= lens _cExperiencePoints
(\ s a -> s{_cExperiencePoints = a})
. mapping _Coerce
instance FromJSON Category where
parseJSON
= withObject "Category"
(\ o ->
Category' <$>
(o .:? "kind" .!= "games#category") <*>
(o .:? "category")
<*> (o .:? "experiencePoints"))
instance ToJSON Category where
toJSON Category'{..}
= object
(catMaybes
[Just ("kind" .= _cKind),
("category" .=) <$> _cCategory,
("experiencePoints" .=) <$> _cExperiencePoints])
data InstanceAndroidDetails =
InstanceAndroidDetails'
{ _iadPackageName :: !(Maybe Text)
, _iadPreferred :: !(Maybe Bool)
, _iadKind :: !Text
, _iadEnablePiracyCheck :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
instanceAndroidDetails
:: InstanceAndroidDetails
instanceAndroidDetails =
InstanceAndroidDetails'
{ _iadPackageName = Nothing
, _iadPreferred = Nothing
, _iadKind = "games#instanceAndroidDetails"
, _iadEnablePiracyCheck = Nothing
}
iadPackageName :: Lens' InstanceAndroidDetails (Maybe Text)
iadPackageName
= lens _iadPackageName
(\ s a -> s{_iadPackageName = a})
iadPreferred :: Lens' InstanceAndroidDetails (Maybe Bool)
iadPreferred
= lens _iadPreferred (\ s a -> s{_iadPreferred = a})
iadKind :: Lens' InstanceAndroidDetails Text
iadKind = lens _iadKind (\ s a -> s{_iadKind = a})
iadEnablePiracyCheck :: Lens' InstanceAndroidDetails (Maybe Bool)
iadEnablePiracyCheck
= lens _iadEnablePiracyCheck
(\ s a -> s{_iadEnablePiracyCheck = a})
instance FromJSON InstanceAndroidDetails where
parseJSON
= withObject "InstanceAndroidDetails"
(\ o ->
InstanceAndroidDetails' <$>
(o .:? "packageName") <*> (o .:? "preferred") <*>
(o .:? "kind" .!= "games#instanceAndroidDetails")
<*> (o .:? "enablePiracyCheck"))
instance ToJSON InstanceAndroidDetails where
toJSON InstanceAndroidDetails'{..}
= object
(catMaybes
[("packageName" .=) <$> _iadPackageName,
("preferred" .=) <$> _iadPreferred,
Just ("kind" .= _iadKind),
("enablePiracyCheck" .=) <$> _iadEnablePiracyCheck])
data TurnBasedMatchParticipant =
TurnBasedMatchParticipant'
{ _tbmpStatus :: !(Maybe Text)
, _tbmpKind :: !Text
, _tbmpId :: !(Maybe Text)
, _tbmpAutoMatched :: !(Maybe Bool)
, _tbmpPlayer :: !(Maybe Player)
, _tbmpAutoMatchedPlayer :: !(Maybe AnonymousPlayer)
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchParticipant
:: TurnBasedMatchParticipant
turnBasedMatchParticipant =
TurnBasedMatchParticipant'
{ _tbmpStatus = Nothing
, _tbmpKind = "games#turnBasedMatchParticipant"
, _tbmpId = Nothing
, _tbmpAutoMatched = Nothing
, _tbmpPlayer = Nothing
, _tbmpAutoMatchedPlayer = Nothing
}
tbmpStatus :: Lens' TurnBasedMatchParticipant (Maybe Text)
tbmpStatus
= lens _tbmpStatus (\ s a -> s{_tbmpStatus = a})
tbmpKind :: Lens' TurnBasedMatchParticipant Text
tbmpKind = lens _tbmpKind (\ s a -> s{_tbmpKind = a})
tbmpId :: Lens' TurnBasedMatchParticipant (Maybe Text)
tbmpId = lens _tbmpId (\ s a -> s{_tbmpId = a})
tbmpAutoMatched :: Lens' TurnBasedMatchParticipant (Maybe Bool)
tbmpAutoMatched
= lens _tbmpAutoMatched
(\ s a -> s{_tbmpAutoMatched = a})
tbmpPlayer :: Lens' TurnBasedMatchParticipant (Maybe Player)
tbmpPlayer
= lens _tbmpPlayer (\ s a -> s{_tbmpPlayer = a})
tbmpAutoMatchedPlayer :: Lens' TurnBasedMatchParticipant (Maybe AnonymousPlayer)
tbmpAutoMatchedPlayer
= lens _tbmpAutoMatchedPlayer
(\ s a -> s{_tbmpAutoMatchedPlayer = a})
instance FromJSON TurnBasedMatchParticipant where
parseJSON
= withObject "TurnBasedMatchParticipant"
(\ o ->
TurnBasedMatchParticipant' <$>
(o .:? "status") <*>
(o .:? "kind" .!= "games#turnBasedMatchParticipant")
<*> (o .:? "id")
<*> (o .:? "autoMatched")
<*> (o .:? "player")
<*> (o .:? "autoMatchedPlayer"))
instance ToJSON TurnBasedMatchParticipant where
toJSON TurnBasedMatchParticipant'{..}
= object
(catMaybes
[("status" .=) <$> _tbmpStatus,
Just ("kind" .= _tbmpKind), ("id" .=) <$> _tbmpId,
("autoMatched" .=) <$> _tbmpAutoMatched,
("player" .=) <$> _tbmpPlayer,
("autoMatchedPlayer" .=) <$> _tbmpAutoMatchedPlayer])
data AchievementDefinitionsListResponse =
AchievementDefinitionsListResponse'
{ _adlrNextPageToken :: !(Maybe Text)
, _adlrKind :: !Text
, _adlrItems :: !(Maybe [AchievementDefinition])
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementDefinitionsListResponse
:: AchievementDefinitionsListResponse
achievementDefinitionsListResponse =
AchievementDefinitionsListResponse'
{ _adlrNextPageToken = Nothing
, _adlrKind = "games#achievementDefinitionsListResponse"
, _adlrItems = Nothing
}
adlrNextPageToken :: Lens' AchievementDefinitionsListResponse (Maybe Text)
adlrNextPageToken
= lens _adlrNextPageToken
(\ s a -> s{_adlrNextPageToken = a})
adlrKind :: Lens' AchievementDefinitionsListResponse Text
adlrKind = lens _adlrKind (\ s a -> s{_adlrKind = a})
adlrItems :: Lens' AchievementDefinitionsListResponse [AchievementDefinition]
adlrItems
= lens _adlrItems (\ s a -> s{_adlrItems = a}) .
_Default
. _Coerce
instance FromJSON AchievementDefinitionsListResponse
where
parseJSON
= withObject "AchievementDefinitionsListResponse"
(\ o ->
AchievementDefinitionsListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"games#achievementDefinitionsListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON AchievementDefinitionsListResponse
where
toJSON AchievementDefinitionsListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _adlrNextPageToken,
Just ("kind" .= _adlrKind),
("items" .=) <$> _adlrItems])
data PlayerScoreResponse =
PlayerScoreResponse'
{ _psrScoreTag :: !(Maybe Text)
, _psrKind :: !Text
, _psrFormattedScore :: !(Maybe Text)
, _psrLeaderboardId :: !(Maybe Text)
, _psrBeatenScoreTimeSpans :: !(Maybe [Text])
, _psrUnbeatenScores :: !(Maybe [PlayerScore])
}
deriving (Eq, Show, Data, Typeable, Generic)
playerScoreResponse
:: PlayerScoreResponse
playerScoreResponse =
PlayerScoreResponse'
{ _psrScoreTag = Nothing
, _psrKind = "games#playerScoreResponse"
, _psrFormattedScore = Nothing
, _psrLeaderboardId = Nothing
, _psrBeatenScoreTimeSpans = Nothing
, _psrUnbeatenScores = Nothing
}
psrScoreTag :: Lens' PlayerScoreResponse (Maybe Text)
psrScoreTag
= lens _psrScoreTag (\ s a -> s{_psrScoreTag = a})
psrKind :: Lens' PlayerScoreResponse Text
psrKind = lens _psrKind (\ s a -> s{_psrKind = a})
psrFormattedScore :: Lens' PlayerScoreResponse (Maybe Text)
psrFormattedScore
= lens _psrFormattedScore
(\ s a -> s{_psrFormattedScore = a})
psrLeaderboardId :: Lens' PlayerScoreResponse (Maybe Text)
psrLeaderboardId
= lens _psrLeaderboardId
(\ s a -> s{_psrLeaderboardId = a})
psrBeatenScoreTimeSpans :: Lens' PlayerScoreResponse [Text]
psrBeatenScoreTimeSpans
= lens _psrBeatenScoreTimeSpans
(\ s a -> s{_psrBeatenScoreTimeSpans = a})
. _Default
. _Coerce
psrUnbeatenScores :: Lens' PlayerScoreResponse [PlayerScore]
psrUnbeatenScores
= lens _psrUnbeatenScores
(\ s a -> s{_psrUnbeatenScores = a})
. _Default
. _Coerce
instance FromJSON PlayerScoreResponse where
parseJSON
= withObject "PlayerScoreResponse"
(\ o ->
PlayerScoreResponse' <$>
(o .:? "scoreTag") <*>
(o .:? "kind" .!= "games#playerScoreResponse")
<*> (o .:? "formattedScore")
<*> (o .:? "leaderboardId")
<*> (o .:? "beatenScoreTimeSpans" .!= mempty)
<*> (o .:? "unbeatenScores" .!= mempty))
instance ToJSON PlayerScoreResponse where
toJSON PlayerScoreResponse'{..}
= object
(catMaybes
[("scoreTag" .=) <$> _psrScoreTag,
Just ("kind" .= _psrKind),
("formattedScore" .=) <$> _psrFormattedScore,
("leaderboardId" .=) <$> _psrLeaderboardId,
("beatenScoreTimeSpans" .=) <$>
_psrBeatenScoreTimeSpans,
("unbeatenScores" .=) <$> _psrUnbeatenScores])
data AnonymousPlayer =
AnonymousPlayer'
{ _apAvatarImageURL :: !(Maybe Text)
, _apKind :: !Text
, _apDisplayName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
anonymousPlayer
:: AnonymousPlayer
anonymousPlayer =
AnonymousPlayer'
{ _apAvatarImageURL = Nothing
, _apKind = "games#anonymousPlayer"
, _apDisplayName = Nothing
}
apAvatarImageURL :: Lens' AnonymousPlayer (Maybe Text)
apAvatarImageURL
= lens _apAvatarImageURL
(\ s a -> s{_apAvatarImageURL = a})
apKind :: Lens' AnonymousPlayer Text
apKind = lens _apKind (\ s a -> s{_apKind = a})
apDisplayName :: Lens' AnonymousPlayer (Maybe Text)
apDisplayName
= lens _apDisplayName
(\ s a -> s{_apDisplayName = a})
instance FromJSON AnonymousPlayer where
parseJSON
= withObject "AnonymousPlayer"
(\ o ->
AnonymousPlayer' <$>
(o .:? "avatarImageUrl") <*>
(o .:? "kind" .!= "games#anonymousPlayer")
<*> (o .:? "displayName"))
instance ToJSON AnonymousPlayer where
toJSON AnonymousPlayer'{..}
= object
(catMaybes
[("avatarImageUrl" .=) <$> _apAvatarImageURL,
Just ("kind" .= _apKind),
("displayName" .=) <$> _apDisplayName])
data QuestContribution =
QuestContribution'
{ _qKind :: !Text
, _qValue :: !(Maybe (Textual Int64))
, _qFormattedValue :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
questContribution
:: QuestContribution
questContribution =
QuestContribution'
{ _qKind = "games#questContribution"
, _qValue = Nothing
, _qFormattedValue = Nothing
}
qKind :: Lens' QuestContribution Text
qKind = lens _qKind (\ s a -> s{_qKind = a})
qValue :: Lens' QuestContribution (Maybe Int64)
qValue
= lens _qValue (\ s a -> s{_qValue = a}) .
mapping _Coerce
qFormattedValue :: Lens' QuestContribution (Maybe Text)
qFormattedValue
= lens _qFormattedValue
(\ s a -> s{_qFormattedValue = a})
instance FromJSON QuestContribution where
parseJSON
= withObject "QuestContribution"
(\ o ->
QuestContribution' <$>
(o .:? "kind" .!= "games#questContribution") <*>
(o .:? "value")
<*> (o .:? "formattedValue"))
instance ToJSON QuestContribution where
toJSON QuestContribution'{..}
= object
(catMaybes
[Just ("kind" .= _qKind), ("value" .=) <$> _qValue,
("formattedValue" .=) <$> _qFormattedValue])
data RoomClientAddress =
RoomClientAddress'
{ _rcaKind :: !Text
, _rcaXmppAddress :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
roomClientAddress
:: RoomClientAddress
roomClientAddress =
RoomClientAddress'
{_rcaKind = "games#roomClientAddress", _rcaXmppAddress = Nothing}
rcaKind :: Lens' RoomClientAddress Text
rcaKind = lens _rcaKind (\ s a -> s{_rcaKind = a})
rcaXmppAddress :: Lens' RoomClientAddress (Maybe Text)
rcaXmppAddress
= lens _rcaXmppAddress
(\ s a -> s{_rcaXmppAddress = a})
instance FromJSON RoomClientAddress where
parseJSON
= withObject "RoomClientAddress"
(\ o ->
RoomClientAddress' <$>
(o .:? "kind" .!= "games#roomClientAddress") <*>
(o .:? "xmppAddress"))
instance ToJSON RoomClientAddress where
toJSON RoomClientAddress'{..}
= object
(catMaybes
[Just ("kind" .= _rcaKind),
("xmppAddress" .=) <$> _rcaXmppAddress])
data LeaderboardListResponse =
LeaderboardListResponse'
{ _llrNextPageToken :: !(Maybe Text)
, _llrKind :: !Text
, _llrItems :: !(Maybe [Leaderboard])
}
deriving (Eq, Show, Data, Typeable, Generic)
leaderboardListResponse
:: LeaderboardListResponse
leaderboardListResponse =
LeaderboardListResponse'
{ _llrNextPageToken = Nothing
, _llrKind = "games#leaderboardListResponse"
, _llrItems = Nothing
}
llrNextPageToken :: Lens' LeaderboardListResponse (Maybe Text)
llrNextPageToken
= lens _llrNextPageToken
(\ s a -> s{_llrNextPageToken = a})
llrKind :: Lens' LeaderboardListResponse Text
llrKind = lens _llrKind (\ s a -> s{_llrKind = a})
llrItems :: Lens' LeaderboardListResponse [Leaderboard]
llrItems
= lens _llrItems (\ s a -> s{_llrItems = a}) .
_Default
. _Coerce
instance FromJSON LeaderboardListResponse where
parseJSON
= withObject "LeaderboardListResponse"
(\ o ->
LeaderboardListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#leaderboardListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON LeaderboardListResponse where
toJSON LeaderboardListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _llrNextPageToken,
Just ("kind" .= _llrKind),
("items" .=) <$> _llrItems])
data PlayerScore =
PlayerScore'
{ _psScoreTag :: !(Maybe Text)
, _psScore :: !(Maybe (Textual Int64))
, _psKind :: !Text
, _psFormattedScore :: !(Maybe Text)
, _psTimeSpan :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
playerScore
:: PlayerScore
playerScore =
PlayerScore'
{ _psScoreTag = Nothing
, _psScore = Nothing
, _psKind = "games#playerScore"
, _psFormattedScore = Nothing
, _psTimeSpan = Nothing
}
psScoreTag :: Lens' PlayerScore (Maybe Text)
psScoreTag
= lens _psScoreTag (\ s a -> s{_psScoreTag = a})
psScore :: Lens' PlayerScore (Maybe Int64)
psScore
= lens _psScore (\ s a -> s{_psScore = a}) .
mapping _Coerce
psKind :: Lens' PlayerScore Text
psKind = lens _psKind (\ s a -> s{_psKind = a})
psFormattedScore :: Lens' PlayerScore (Maybe Text)
psFormattedScore
= lens _psFormattedScore
(\ s a -> s{_psFormattedScore = a})
psTimeSpan :: Lens' PlayerScore (Maybe Text)
psTimeSpan
= lens _psTimeSpan (\ s a -> s{_psTimeSpan = a})
instance FromJSON PlayerScore where
parseJSON
= withObject "PlayerScore"
(\ o ->
PlayerScore' <$>
(o .:? "scoreTag") <*> (o .:? "score") <*>
(o .:? "kind" .!= "games#playerScore")
<*> (o .:? "formattedScore")
<*> (o .:? "timeSpan"))
instance ToJSON PlayerScore where
toJSON PlayerScore'{..}
= object
(catMaybes
[("scoreTag" .=) <$> _psScoreTag,
("score" .=) <$> _psScore, Just ("kind" .= _psKind),
("formattedScore" .=) <$> _psFormattedScore,
("timeSpan" .=) <$> _psTimeSpan])
data TurnBasedAutoMatchingCriteria =
TurnBasedAutoMatchingCriteria'
{ _tbamcKind :: !Text
, _tbamcExclusiveBitmask :: !(Maybe (Textual Int64))
, _tbamcMaxAutoMatchingPlayers :: !(Maybe (Textual Int32))
, _tbamcMinAutoMatchingPlayers :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedAutoMatchingCriteria
:: TurnBasedAutoMatchingCriteria
turnBasedAutoMatchingCriteria =
TurnBasedAutoMatchingCriteria'
{ _tbamcKind = "games#turnBasedAutoMatchingCriteria"
, _tbamcExclusiveBitmask = Nothing
, _tbamcMaxAutoMatchingPlayers = Nothing
, _tbamcMinAutoMatchingPlayers = Nothing
}
tbamcKind :: Lens' TurnBasedAutoMatchingCriteria Text
tbamcKind
= lens _tbamcKind (\ s a -> s{_tbamcKind = a})
tbamcExclusiveBitmask :: Lens' TurnBasedAutoMatchingCriteria (Maybe Int64)
tbamcExclusiveBitmask
= lens _tbamcExclusiveBitmask
(\ s a -> s{_tbamcExclusiveBitmask = a})
. mapping _Coerce
tbamcMaxAutoMatchingPlayers :: Lens' TurnBasedAutoMatchingCriteria (Maybe Int32)
tbamcMaxAutoMatchingPlayers
= lens _tbamcMaxAutoMatchingPlayers
(\ s a -> s{_tbamcMaxAutoMatchingPlayers = a})
. mapping _Coerce
tbamcMinAutoMatchingPlayers :: Lens' TurnBasedAutoMatchingCriteria (Maybe Int32)
tbamcMinAutoMatchingPlayers
= lens _tbamcMinAutoMatchingPlayers
(\ s a -> s{_tbamcMinAutoMatchingPlayers = a})
. mapping _Coerce
instance FromJSON TurnBasedAutoMatchingCriteria where
parseJSON
= withObject "TurnBasedAutoMatchingCriteria"
(\ o ->
TurnBasedAutoMatchingCriteria' <$>
(o .:? "kind" .!=
"games#turnBasedAutoMatchingCriteria")
<*> (o .:? "exclusiveBitmask")
<*> (o .:? "maxAutoMatchingPlayers")
<*> (o .:? "minAutoMatchingPlayers"))
instance ToJSON TurnBasedAutoMatchingCriteria where
toJSON TurnBasedAutoMatchingCriteria'{..}
= object
(catMaybes
[Just ("kind" .= _tbamcKind),
("exclusiveBitmask" .=) <$> _tbamcExclusiveBitmask,
("maxAutoMatchingPlayers" .=) <$>
_tbamcMaxAutoMatchingPlayers,
("minAutoMatchingPlayers" .=) <$>
_tbamcMinAutoMatchingPlayers])
data SnapshotImage =
SnapshotImage'
{ _siHeight :: !(Maybe (Textual Int32))
, _siKind :: !Text
, _siURL :: !(Maybe Text)
, _siMimeType :: !(Maybe Text)
, _siWidth :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
snapshotImage
:: SnapshotImage
snapshotImage =
SnapshotImage'
{ _siHeight = Nothing
, _siKind = "games#snapshotImage"
, _siURL = Nothing
, _siMimeType = Nothing
, _siWidth = Nothing
}
siHeight :: Lens' SnapshotImage (Maybe Int32)
siHeight
= lens _siHeight (\ s a -> s{_siHeight = a}) .
mapping _Coerce
siKind :: Lens' SnapshotImage Text
siKind = lens _siKind (\ s a -> s{_siKind = a})
siURL :: Lens' SnapshotImage (Maybe Text)
siURL = lens _siURL (\ s a -> s{_siURL = a})
siMimeType :: Lens' SnapshotImage (Maybe Text)
siMimeType
= lens _siMimeType (\ s a -> s{_siMimeType = a})
siWidth :: Lens' SnapshotImage (Maybe Int32)
siWidth
= lens _siWidth (\ s a -> s{_siWidth = a}) .
mapping _Coerce
instance FromJSON SnapshotImage where
parseJSON
= withObject "SnapshotImage"
(\ o ->
SnapshotImage' <$>
(o .:? "height") <*>
(o .:? "kind" .!= "games#snapshotImage")
<*> (o .:? "url")
<*> (o .:? "mime_type")
<*> (o .:? "width"))
instance ToJSON SnapshotImage where
toJSON SnapshotImage'{..}
= object
(catMaybes
[("height" .=) <$> _siHeight,
Just ("kind" .= _siKind), ("url" .=) <$> _siURL,
("mime_type" .=) <$> _siMimeType,
("width" .=) <$> _siWidth])
data RoomStatus =
RoomStatus'
{ _rsStatus :: !(Maybe Text)
, _rsKind :: !Text
, _rsAutoMatchingStatus :: !(Maybe RoomAutoMatchStatus)
, _rsStatusVersion :: !(Maybe (Textual Int32))
, _rsParticipants :: !(Maybe [RoomParticipant])
, _rsRoomId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
roomStatus
:: RoomStatus
roomStatus =
RoomStatus'
{ _rsStatus = Nothing
, _rsKind = "games#roomStatus"
, _rsAutoMatchingStatus = Nothing
, _rsStatusVersion = Nothing
, _rsParticipants = Nothing
, _rsRoomId = Nothing
}
rsStatus :: Lens' RoomStatus (Maybe Text)
rsStatus = lens _rsStatus (\ s a -> s{_rsStatus = a})
rsKind :: Lens' RoomStatus Text
rsKind = lens _rsKind (\ s a -> s{_rsKind = a})
rsAutoMatchingStatus :: Lens' RoomStatus (Maybe RoomAutoMatchStatus)
rsAutoMatchingStatus
= lens _rsAutoMatchingStatus
(\ s a -> s{_rsAutoMatchingStatus = a})
rsStatusVersion :: Lens' RoomStatus (Maybe Int32)
rsStatusVersion
= lens _rsStatusVersion
(\ s a -> s{_rsStatusVersion = a})
. mapping _Coerce
rsParticipants :: Lens' RoomStatus [RoomParticipant]
rsParticipants
= lens _rsParticipants
(\ s a -> s{_rsParticipants = a})
. _Default
. _Coerce
rsRoomId :: Lens' RoomStatus (Maybe Text)
rsRoomId = lens _rsRoomId (\ s a -> s{_rsRoomId = a})
instance FromJSON RoomStatus where
parseJSON
= withObject "RoomStatus"
(\ o ->
RoomStatus' <$>
(o .:? "status") <*>
(o .:? "kind" .!= "games#roomStatus")
<*> (o .:? "autoMatchingStatus")
<*> (o .:? "statusVersion")
<*> (o .:? "participants" .!= mempty)
<*> (o .:? "roomId"))
instance ToJSON RoomStatus where
toJSON RoomStatus'{..}
= object
(catMaybes
[("status" .=) <$> _rsStatus,
Just ("kind" .= _rsKind),
("autoMatchingStatus" .=) <$> _rsAutoMatchingStatus,
("statusVersion" .=) <$> _rsStatusVersion,
("participants" .=) <$> _rsParticipants,
("roomId" .=) <$> _rsRoomId])
data PlayerLeaderboardScoreListResponse =
PlayerLeaderboardScoreListResponse'
{ _plslrNextPageToken :: !(Maybe Text)
, _plslrKind :: !Text
, _plslrItems :: !(Maybe [PlayerLeaderboardScore])
, _plslrPlayer :: !(Maybe Player)
}
deriving (Eq, Show, Data, Typeable, Generic)
playerLeaderboardScoreListResponse
:: PlayerLeaderboardScoreListResponse
playerLeaderboardScoreListResponse =
PlayerLeaderboardScoreListResponse'
{ _plslrNextPageToken = Nothing
, _plslrKind = "games#playerLeaderboardScoreListResponse"
, _plslrItems = Nothing
, _plslrPlayer = Nothing
}
plslrNextPageToken :: Lens' PlayerLeaderboardScoreListResponse (Maybe Text)
plslrNextPageToken
= lens _plslrNextPageToken
(\ s a -> s{_plslrNextPageToken = a})
plslrKind :: Lens' PlayerLeaderboardScoreListResponse Text
plslrKind
= lens _plslrKind (\ s a -> s{_plslrKind = a})
plslrItems :: Lens' PlayerLeaderboardScoreListResponse [PlayerLeaderboardScore]
plslrItems
= lens _plslrItems (\ s a -> s{_plslrItems = a}) .
_Default
. _Coerce
plslrPlayer :: Lens' PlayerLeaderboardScoreListResponse (Maybe Player)
plslrPlayer
= lens _plslrPlayer (\ s a -> s{_plslrPlayer = a})
instance FromJSON PlayerLeaderboardScoreListResponse
where
parseJSON
= withObject "PlayerLeaderboardScoreListResponse"
(\ o ->
PlayerLeaderboardScoreListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"games#playerLeaderboardScoreListResponse")
<*> (o .:? "items" .!= mempty)
<*> (o .:? "player"))
instance ToJSON PlayerLeaderboardScoreListResponse
where
toJSON PlayerLeaderboardScoreListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _plslrNextPageToken,
Just ("kind" .= _plslrKind),
("items" .=) <$> _plslrItems,
("player" .=) <$> _plslrPlayer])
data InstanceIosDetails =
InstanceIosDetails'
{ _iidItunesAppId :: !(Maybe Text)
, _iidPreferredForIPad :: !(Maybe Bool)
, _iidSupportIPhone :: !(Maybe Bool)
, _iidKind :: !Text
, _iidSupportIPad :: !(Maybe Bool)
, _iidPreferredForIPhone :: !(Maybe Bool)
, _iidBundleIdentifier :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
instanceIosDetails
:: InstanceIosDetails
instanceIosDetails =
InstanceIosDetails'
{ _iidItunesAppId = Nothing
, _iidPreferredForIPad = Nothing
, _iidSupportIPhone = Nothing
, _iidKind = "games#instanceIosDetails"
, _iidSupportIPad = Nothing
, _iidPreferredForIPhone = Nothing
, _iidBundleIdentifier = Nothing
}
iidItunesAppId :: Lens' InstanceIosDetails (Maybe Text)
iidItunesAppId
= lens _iidItunesAppId
(\ s a -> s{_iidItunesAppId = a})
iidPreferredForIPad :: Lens' InstanceIosDetails (Maybe Bool)
iidPreferredForIPad
= lens _iidPreferredForIPad
(\ s a -> s{_iidPreferredForIPad = a})
iidSupportIPhone :: Lens' InstanceIosDetails (Maybe Bool)
iidSupportIPhone
= lens _iidSupportIPhone
(\ s a -> s{_iidSupportIPhone = a})
iidKind :: Lens' InstanceIosDetails Text
iidKind = lens _iidKind (\ s a -> s{_iidKind = a})
iidSupportIPad :: Lens' InstanceIosDetails (Maybe Bool)
iidSupportIPad
= lens _iidSupportIPad
(\ s a -> s{_iidSupportIPad = a})
iidPreferredForIPhone :: Lens' InstanceIosDetails (Maybe Bool)
iidPreferredForIPhone
= lens _iidPreferredForIPhone
(\ s a -> s{_iidPreferredForIPhone = a})
iidBundleIdentifier :: Lens' InstanceIosDetails (Maybe Text)
iidBundleIdentifier
= lens _iidBundleIdentifier
(\ s a -> s{_iidBundleIdentifier = a})
instance FromJSON InstanceIosDetails where
parseJSON
= withObject "InstanceIosDetails"
(\ o ->
InstanceIosDetails' <$>
(o .:? "itunesAppId") <*> (o .:? "preferredForIpad")
<*> (o .:? "supportIphone")
<*> (o .:? "kind" .!= "games#instanceIosDetails")
<*> (o .:? "supportIpad")
<*> (o .:? "preferredForIphone")
<*> (o .:? "bundleIdentifier"))
instance ToJSON InstanceIosDetails where
toJSON InstanceIosDetails'{..}
= object
(catMaybes
[("itunesAppId" .=) <$> _iidItunesAppId,
("preferredForIpad" .=) <$> _iidPreferredForIPad,
("supportIphone" .=) <$> _iidSupportIPhone,
Just ("kind" .= _iidKind),
("supportIpad" .=) <$> _iidSupportIPad,
("preferredForIphone" .=) <$> _iidPreferredForIPhone,
("bundleIdentifier" .=) <$> _iidBundleIdentifier])
data EventUpdateResponse =
EventUpdateResponse'
{ _eurPlayerEvents :: !(Maybe [PlayerEvent])
, _eurBatchFailures :: !(Maybe [EventBatchRecordFailure])
, _eurEventFailures :: !(Maybe [EventRecordFailure])
, _eurKind :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
eventUpdateResponse
:: EventUpdateResponse
eventUpdateResponse =
EventUpdateResponse'
{ _eurPlayerEvents = Nothing
, _eurBatchFailures = Nothing
, _eurEventFailures = Nothing
, _eurKind = "games#eventUpdateResponse"
}
eurPlayerEvents :: Lens' EventUpdateResponse [PlayerEvent]
eurPlayerEvents
= lens _eurPlayerEvents
(\ s a -> s{_eurPlayerEvents = a})
. _Default
. _Coerce
eurBatchFailures :: Lens' EventUpdateResponse [EventBatchRecordFailure]
eurBatchFailures
= lens _eurBatchFailures
(\ s a -> s{_eurBatchFailures = a})
. _Default
. _Coerce
eurEventFailures :: Lens' EventUpdateResponse [EventRecordFailure]
eurEventFailures
= lens _eurEventFailures
(\ s a -> s{_eurEventFailures = a})
. _Default
. _Coerce
eurKind :: Lens' EventUpdateResponse Text
eurKind = lens _eurKind (\ s a -> s{_eurKind = a})
instance FromJSON EventUpdateResponse where
parseJSON
= withObject "EventUpdateResponse"
(\ o ->
EventUpdateResponse' <$>
(o .:? "playerEvents" .!= mempty) <*>
(o .:? "batchFailures" .!= mempty)
<*> (o .:? "eventFailures" .!= mempty)
<*> (o .:? "kind" .!= "games#eventUpdateResponse"))
instance ToJSON EventUpdateResponse where
toJSON EventUpdateResponse'{..}
= object
(catMaybes
[("playerEvents" .=) <$> _eurPlayerEvents,
("batchFailures" .=) <$> _eurBatchFailures,
("eventFailures" .=) <$> _eurEventFailures,
Just ("kind" .= _eurKind)])
data RevisionCheckResponse =
RevisionCheckResponse'
{ _rcrAPIVersion :: !(Maybe Text)
, _rcrKind :: !Text
, _rcrRevisionStatus :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
revisionCheckResponse
:: RevisionCheckResponse
revisionCheckResponse =
RevisionCheckResponse'
{ _rcrAPIVersion = Nothing
, _rcrKind = "games#revisionCheckResponse"
, _rcrRevisionStatus = Nothing
}
rcrAPIVersion :: Lens' RevisionCheckResponse (Maybe Text)
rcrAPIVersion
= lens _rcrAPIVersion
(\ s a -> s{_rcrAPIVersion = a})
rcrKind :: Lens' RevisionCheckResponse Text
rcrKind = lens _rcrKind (\ s a -> s{_rcrKind = a})
rcrRevisionStatus :: Lens' RevisionCheckResponse (Maybe Text)
rcrRevisionStatus
= lens _rcrRevisionStatus
(\ s a -> s{_rcrRevisionStatus = a})
instance FromJSON RevisionCheckResponse where
parseJSON
= withObject "RevisionCheckResponse"
(\ o ->
RevisionCheckResponse' <$>
(o .:? "apiVersion") <*>
(o .:? "kind" .!= "games#revisionCheckResponse")
<*> (o .:? "revisionStatus"))
instance ToJSON RevisionCheckResponse where
toJSON RevisionCheckResponse'{..}
= object
(catMaybes
[("apiVersion" .=) <$> _rcrAPIVersion,
Just ("kind" .= _rcrKind),
("revisionStatus" .=) <$> _rcrRevisionStatus])
data ParticipantResult =
ParticipantResult'
{ _prParticipantId :: !(Maybe Text)
, _prKind :: !Text
, _prResult :: !(Maybe Text)
, _prPlacing :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
participantResult
:: ParticipantResult
participantResult =
ParticipantResult'
{ _prParticipantId = Nothing
, _prKind = "games#participantResult"
, _prResult = Nothing
, _prPlacing = Nothing
}
prParticipantId :: Lens' ParticipantResult (Maybe Text)
prParticipantId
= lens _prParticipantId
(\ s a -> s{_prParticipantId = a})
prKind :: Lens' ParticipantResult Text
prKind = lens _prKind (\ s a -> s{_prKind = a})
prResult :: Lens' ParticipantResult (Maybe Text)
prResult = lens _prResult (\ s a -> s{_prResult = a})
prPlacing :: Lens' ParticipantResult (Maybe Int32)
prPlacing
= lens _prPlacing (\ s a -> s{_prPlacing = a}) .
mapping _Coerce
instance FromJSON ParticipantResult where
parseJSON
= withObject "ParticipantResult"
(\ o ->
ParticipantResult' <$>
(o .:? "participantId") <*>
(o .:? "kind" .!= "games#participantResult")
<*> (o .:? "result")
<*> (o .:? "placing"))
instance ToJSON ParticipantResult where
toJSON ParticipantResult'{..}
= object
(catMaybes
[("participantId" .=) <$> _prParticipantId,
Just ("kind" .= _prKind),
("result" .=) <$> _prResult,
("placing" .=) <$> _prPlacing])
data Leaderboard =
Leaderboard'
{ _lKind :: !Text
, _lIsIconURLDefault :: !(Maybe Bool)
, _lName :: !(Maybe Text)
, _lId :: !(Maybe Text)
, _lIconURL :: !(Maybe Text)
, _lOrder :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
leaderboard
:: Leaderboard
leaderboard =
Leaderboard'
{ _lKind = "games#leaderboard"
, _lIsIconURLDefault = Nothing
, _lName = Nothing
, _lId = Nothing
, _lIconURL = Nothing
, _lOrder = Nothing
}
lKind :: Lens' Leaderboard Text
lKind = lens _lKind (\ s a -> s{_lKind = a})
lIsIconURLDefault :: Lens' Leaderboard (Maybe Bool)
lIsIconURLDefault
= lens _lIsIconURLDefault
(\ s a -> s{_lIsIconURLDefault = a})
lName :: Lens' Leaderboard (Maybe Text)
lName = lens _lName (\ s a -> s{_lName = a})
lId :: Lens' Leaderboard (Maybe Text)
lId = lens _lId (\ s a -> s{_lId = a})
lIconURL :: Lens' Leaderboard (Maybe Text)
lIconURL = lens _lIconURL (\ s a -> s{_lIconURL = a})
lOrder :: Lens' Leaderboard (Maybe Text)
lOrder = lens _lOrder (\ s a -> s{_lOrder = a})
instance FromJSON Leaderboard where
parseJSON
= withObject "Leaderboard"
(\ o ->
Leaderboard' <$>
(o .:? "kind" .!= "games#leaderboard") <*>
(o .:? "isIconUrlDefault")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "iconUrl")
<*> (o .:? "order"))
instance ToJSON Leaderboard where
toJSON Leaderboard'{..}
= object
(catMaybes
[Just ("kind" .= _lKind),
("isIconUrlDefault" .=) <$> _lIsIconURLDefault,
("name" .=) <$> _lName, ("id" .=) <$> _lId,
("iconUrl" .=) <$> _lIconURL,
("order" .=) <$> _lOrder])
data MetagameConfig =
MetagameConfig'
{ _mcKind :: !Text
, _mcCurrentVersion :: !(Maybe (Textual Int32))
, _mcPlayerLevels :: !(Maybe [PlayerLevel])
}
deriving (Eq, Show, Data, Typeable, Generic)
metagameConfig
:: MetagameConfig
metagameConfig =
MetagameConfig'
{ _mcKind = "games#metagameConfig"
, _mcCurrentVersion = Nothing
, _mcPlayerLevels = Nothing
}
mcKind :: Lens' MetagameConfig Text
mcKind = lens _mcKind (\ s a -> s{_mcKind = a})
mcCurrentVersion :: Lens' MetagameConfig (Maybe Int32)
mcCurrentVersion
= lens _mcCurrentVersion
(\ s a -> s{_mcCurrentVersion = a})
. mapping _Coerce
mcPlayerLevels :: Lens' MetagameConfig [PlayerLevel]
mcPlayerLevels
= lens _mcPlayerLevels
(\ s a -> s{_mcPlayerLevels = a})
. _Default
. _Coerce
instance FromJSON MetagameConfig where
parseJSON
= withObject "MetagameConfig"
(\ o ->
MetagameConfig' <$>
(o .:? "kind" .!= "games#metagameConfig") <*>
(o .:? "currentVersion")
<*> (o .:? "playerLevels" .!= mempty))
instance ToJSON MetagameConfig where
toJSON MetagameConfig'{..}
= object
(catMaybes
[Just ("kind" .= _mcKind),
("currentVersion" .=) <$> _mcCurrentVersion,
("playerLevels" .=) <$> _mcPlayerLevels])
data CategoryListResponse =
CategoryListResponse'
{ _clrNextPageToken :: !(Maybe Text)
, _clrKind :: !Text
, _clrItems :: !(Maybe [Category])
}
deriving (Eq, Show, Data, Typeable, Generic)
categoryListResponse
:: CategoryListResponse
categoryListResponse =
CategoryListResponse'
{ _clrNextPageToken = Nothing
, _clrKind = "games#categoryListResponse"
, _clrItems = Nothing
}
clrNextPageToken :: Lens' CategoryListResponse (Maybe Text)
clrNextPageToken
= lens _clrNextPageToken
(\ s a -> s{_clrNextPageToken = a})
clrKind :: Lens' CategoryListResponse Text
clrKind = lens _clrKind (\ s a -> s{_clrKind = a})
clrItems :: Lens' CategoryListResponse [Category]
clrItems
= lens _clrItems (\ s a -> s{_clrItems = a}) .
_Default
. _Coerce
instance FromJSON CategoryListResponse where
parseJSON
= withObject "CategoryListResponse"
(\ o ->
CategoryListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#categoryListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON CategoryListResponse where
toJSON CategoryListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _clrNextPageToken,
Just ("kind" .= _clrKind),
("items" .=) <$> _clrItems])
data RoomP2PStatus =
RoomP2PStatus'
{ _rppsStatus :: !(Maybe Text)
, _rppsParticipantId :: !(Maybe Text)
, _rppsKind :: !Text
, _rppsError :: !(Maybe Text)
, _rppsErrorReason :: !(Maybe Text)
, _rppsConnectionSetupLatencyMillis :: !(Maybe (Textual Int32))
, _rppsUnreliableRoundtripLatencyMillis :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
roomP2PStatus
:: RoomP2PStatus
roomP2PStatus =
RoomP2PStatus'
{ _rppsStatus = Nothing
, _rppsParticipantId = Nothing
, _rppsKind = "games#roomP2PStatus"
, _rppsError = Nothing
, _rppsErrorReason = Nothing
, _rppsConnectionSetupLatencyMillis = Nothing
, _rppsUnreliableRoundtripLatencyMillis = Nothing
}
rppsStatus :: Lens' RoomP2PStatus (Maybe Text)
rppsStatus
= lens _rppsStatus (\ s a -> s{_rppsStatus = a})
rppsParticipantId :: Lens' RoomP2PStatus (Maybe Text)
rppsParticipantId
= lens _rppsParticipantId
(\ s a -> s{_rppsParticipantId = a})
rppsKind :: Lens' RoomP2PStatus Text
rppsKind = lens _rppsKind (\ s a -> s{_rppsKind = a})
rppsError :: Lens' RoomP2PStatus (Maybe Text)
rppsError
= lens _rppsError (\ s a -> s{_rppsError = a})
rppsErrorReason :: Lens' RoomP2PStatus (Maybe Text)
rppsErrorReason
= lens _rppsErrorReason
(\ s a -> s{_rppsErrorReason = a})
rppsConnectionSetupLatencyMillis :: Lens' RoomP2PStatus (Maybe Int32)
rppsConnectionSetupLatencyMillis
= lens _rppsConnectionSetupLatencyMillis
(\ s a -> s{_rppsConnectionSetupLatencyMillis = a})
. mapping _Coerce
rppsUnreliableRoundtripLatencyMillis :: Lens' RoomP2PStatus (Maybe Int32)
rppsUnreliableRoundtripLatencyMillis
= lens _rppsUnreliableRoundtripLatencyMillis
(\ s a ->
s{_rppsUnreliableRoundtripLatencyMillis = a})
. mapping _Coerce
instance FromJSON RoomP2PStatus where
parseJSON
= withObject "RoomP2PStatus"
(\ o ->
RoomP2PStatus' <$>
(o .:? "status") <*> (o .:? "participantId") <*>
(o .:? "kind" .!= "games#roomP2PStatus")
<*> (o .:? "error")
<*> (o .:? "error_reason")
<*> (o .:? "connectionSetupLatencyMillis")
<*> (o .:? "unreliableRoundtripLatencyMillis"))
instance ToJSON RoomP2PStatus where
toJSON RoomP2PStatus'{..}
= object
(catMaybes
[("status" .=) <$> _rppsStatus,
("participantId" .=) <$> _rppsParticipantId,
Just ("kind" .= _rppsKind),
("error" .=) <$> _rppsError,
("error_reason" .=) <$> _rppsErrorReason,
("connectionSetupLatencyMillis" .=) <$>
_rppsConnectionSetupLatencyMillis,
("unreliableRoundtripLatencyMillis" .=) <$>
_rppsUnreliableRoundtripLatencyMillis])
data TurnBasedMatchModification =
TurnBasedMatchModification'
{ _tbmmParticipantId :: !(Maybe Text)
, _tbmmKind :: !Text
, _tbmmModifiedTimestampMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchModification
:: TurnBasedMatchModification
turnBasedMatchModification =
TurnBasedMatchModification'
{ _tbmmParticipantId = Nothing
, _tbmmKind = "games#turnBasedMatchModification"
, _tbmmModifiedTimestampMillis = Nothing
}
tbmmParticipantId :: Lens' TurnBasedMatchModification (Maybe Text)
tbmmParticipantId
= lens _tbmmParticipantId
(\ s a -> s{_tbmmParticipantId = a})
tbmmKind :: Lens' TurnBasedMatchModification Text
tbmmKind = lens _tbmmKind (\ s a -> s{_tbmmKind = a})
tbmmModifiedTimestampMillis :: Lens' TurnBasedMatchModification (Maybe Int64)
tbmmModifiedTimestampMillis
= lens _tbmmModifiedTimestampMillis
(\ s a -> s{_tbmmModifiedTimestampMillis = a})
. mapping _Coerce
instance FromJSON TurnBasedMatchModification where
parseJSON
= withObject "TurnBasedMatchModification"
(\ o ->
TurnBasedMatchModification' <$>
(o .:? "participantId") <*>
(o .:? "kind" .!= "games#turnBasedMatchModification")
<*> (o .:? "modifiedTimestampMillis"))
instance ToJSON TurnBasedMatchModification where
toJSON TurnBasedMatchModification'{..}
= object
(catMaybes
[("participantId" .=) <$> _tbmmParticipantId,
Just ("kind" .= _tbmmKind),
("modifiedTimestampMillis" .=) <$>
_tbmmModifiedTimestampMillis])
data EventDefinition =
EventDefinition'
{ _edIsDefaultImageURL :: !(Maybe Bool)
, _edKind :: !Text
, _edVisibility :: !(Maybe Text)
, _edImageURL :: !(Maybe Text)
, _edDisplayName :: !(Maybe Text)
, _edId :: !(Maybe Text)
, _edChildEvents :: !(Maybe [EventChild])
, _edDescription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
eventDefinition
:: EventDefinition
eventDefinition =
EventDefinition'
{ _edIsDefaultImageURL = Nothing
, _edKind = "games#eventDefinition"
, _edVisibility = Nothing
, _edImageURL = Nothing
, _edDisplayName = Nothing
, _edId = Nothing
, _edChildEvents = Nothing
, _edDescription = Nothing
}
edIsDefaultImageURL :: Lens' EventDefinition (Maybe Bool)
edIsDefaultImageURL
= lens _edIsDefaultImageURL
(\ s a -> s{_edIsDefaultImageURL = a})
edKind :: Lens' EventDefinition Text
edKind = lens _edKind (\ s a -> s{_edKind = a})
edVisibility :: Lens' EventDefinition (Maybe Text)
edVisibility
= lens _edVisibility (\ s a -> s{_edVisibility = a})
edImageURL :: Lens' EventDefinition (Maybe Text)
edImageURL
= lens _edImageURL (\ s a -> s{_edImageURL = a})
edDisplayName :: Lens' EventDefinition (Maybe Text)
edDisplayName
= lens _edDisplayName
(\ s a -> s{_edDisplayName = a})
edId :: Lens' EventDefinition (Maybe Text)
edId = lens _edId (\ s a -> s{_edId = a})
edChildEvents :: Lens' EventDefinition [EventChild]
edChildEvents
= lens _edChildEvents
(\ s a -> s{_edChildEvents = a})
. _Default
. _Coerce
edDescription :: Lens' EventDefinition (Maybe Text)
edDescription
= lens _edDescription
(\ s a -> s{_edDescription = a})
instance FromJSON EventDefinition where
parseJSON
= withObject "EventDefinition"
(\ o ->
EventDefinition' <$>
(o .:? "isDefaultImageUrl") <*>
(o .:? "kind" .!= "games#eventDefinition")
<*> (o .:? "visibility")
<*> (o .:? "imageUrl")
<*> (o .:? "displayName")
<*> (o .:? "id")
<*> (o .:? "childEvents" .!= mempty)
<*> (o .:? "description"))
instance ToJSON EventDefinition where
toJSON EventDefinition'{..}
= object
(catMaybes
[("isDefaultImageUrl" .=) <$> _edIsDefaultImageURL,
Just ("kind" .= _edKind),
("visibility" .=) <$> _edVisibility,
("imageUrl" .=) <$> _edImageURL,
("displayName" .=) <$> _edDisplayName,
("id" .=) <$> _edId,
("childEvents" .=) <$> _edChildEvents,
("description" .=) <$> _edDescription])
data RoomModification =
RoomModification'
{ _rmParticipantId :: !(Maybe Text)
, _rmKind :: !Text
, _rmModifiedTimestampMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
roomModification
:: RoomModification
roomModification =
RoomModification'
{ _rmParticipantId = Nothing
, _rmKind = "games#roomModification"
, _rmModifiedTimestampMillis = Nothing
}
rmParticipantId :: Lens' RoomModification (Maybe Text)
rmParticipantId
= lens _rmParticipantId
(\ s a -> s{_rmParticipantId = a})
rmKind :: Lens' RoomModification Text
rmKind = lens _rmKind (\ s a -> s{_rmKind = a})
rmModifiedTimestampMillis :: Lens' RoomModification (Maybe Int64)
rmModifiedTimestampMillis
= lens _rmModifiedTimestampMillis
(\ s a -> s{_rmModifiedTimestampMillis = a})
. mapping _Coerce
instance FromJSON RoomModification where
parseJSON
= withObject "RoomModification"
(\ o ->
RoomModification' <$>
(o .:? "participantId") <*>
(o .:? "kind" .!= "games#roomModification")
<*> (o .:? "modifiedTimestampMillis"))
instance ToJSON RoomModification where
toJSON RoomModification'{..}
= object
(catMaybes
[("participantId" .=) <$> _rmParticipantId,
Just ("kind" .= _rmKind),
("modifiedTimestampMillis" .=) <$>
_rmModifiedTimestampMillis])
data EventUpdateRequest =
EventUpdateRequest'
{ _eUpdateCount :: !(Maybe (Textual Int64))
, _eKind :: !Text
, _eDefinitionId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
eventUpdateRequest
:: EventUpdateRequest
eventUpdateRequest =
EventUpdateRequest'
{ _eUpdateCount = Nothing
, _eKind = "games#eventUpdateRequest"
, _eDefinitionId = Nothing
}
eUpdateCount :: Lens' EventUpdateRequest (Maybe Int64)
eUpdateCount
= lens _eUpdateCount (\ s a -> s{_eUpdateCount = a})
. mapping _Coerce
eKind :: Lens' EventUpdateRequest Text
eKind = lens _eKind (\ s a -> s{_eKind = a})
eDefinitionId :: Lens' EventUpdateRequest (Maybe Text)
eDefinitionId
= lens _eDefinitionId
(\ s a -> s{_eDefinitionId = a})
instance FromJSON EventUpdateRequest where
parseJSON
= withObject "EventUpdateRequest"
(\ o ->
EventUpdateRequest' <$>
(o .:? "updateCount") <*>
(o .:? "kind" .!= "games#eventUpdateRequest")
<*> (o .:? "definitionId"))
instance ToJSON EventUpdateRequest where
toJSON EventUpdateRequest'{..}
= object
(catMaybes
[("updateCount" .=) <$> _eUpdateCount,
Just ("kind" .= _eKind),
("definitionId" .=) <$> _eDefinitionId])
data AchievementUnlockResponse =
AchievementUnlockResponse'
{ _achKind :: !Text
, _achNewlyUnlocked :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementUnlockResponse
:: AchievementUnlockResponse
achievementUnlockResponse =
AchievementUnlockResponse'
{_achKind = "games#achievementUnlockResponse", _achNewlyUnlocked = Nothing}
achKind :: Lens' AchievementUnlockResponse Text
achKind = lens _achKind (\ s a -> s{_achKind = a})
achNewlyUnlocked :: Lens' AchievementUnlockResponse (Maybe Bool)
achNewlyUnlocked
= lens _achNewlyUnlocked
(\ s a -> s{_achNewlyUnlocked = a})
instance FromJSON AchievementUnlockResponse where
parseJSON
= withObject "AchievementUnlockResponse"
(\ o ->
AchievementUnlockResponse' <$>
(o .:? "kind" .!= "games#achievementUnlockResponse")
<*> (o .:? "newlyUnlocked"))
instance ToJSON AchievementUnlockResponse where
toJSON AchievementUnlockResponse'{..}
= object
(catMaybes
[Just ("kind" .= _achKind),
("newlyUnlocked" .=) <$> _achNewlyUnlocked])
data PlayerAchievement =
PlayerAchievement'
{ _paKind :: !Text
, _paAchievementState :: !(Maybe Text)
, _paFormattedCurrentStepsString :: !(Maybe Text)
, _paExperiencePoints :: !(Maybe (Textual Int64))
, _paId :: !(Maybe Text)
, _paCurrentSteps :: !(Maybe (Textual Int32))
, _paLastUpdatedTimestamp :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
playerAchievement
:: PlayerAchievement
playerAchievement =
PlayerAchievement'
{ _paKind = "games#playerAchievement"
, _paAchievementState = Nothing
, _paFormattedCurrentStepsString = Nothing
, _paExperiencePoints = Nothing
, _paId = Nothing
, _paCurrentSteps = Nothing
, _paLastUpdatedTimestamp = Nothing
}
paKind :: Lens' PlayerAchievement Text
paKind = lens _paKind (\ s a -> s{_paKind = a})
paAchievementState :: Lens' PlayerAchievement (Maybe Text)
paAchievementState
= lens _paAchievementState
(\ s a -> s{_paAchievementState = a})
paFormattedCurrentStepsString :: Lens' PlayerAchievement (Maybe Text)
paFormattedCurrentStepsString
= lens _paFormattedCurrentStepsString
(\ s a -> s{_paFormattedCurrentStepsString = a})
paExperiencePoints :: Lens' PlayerAchievement (Maybe Int64)
paExperiencePoints
= lens _paExperiencePoints
(\ s a -> s{_paExperiencePoints = a})
. mapping _Coerce
paId :: Lens' PlayerAchievement (Maybe Text)
paId = lens _paId (\ s a -> s{_paId = a})
paCurrentSteps :: Lens' PlayerAchievement (Maybe Int32)
paCurrentSteps
= lens _paCurrentSteps
(\ s a -> s{_paCurrentSteps = a})
. mapping _Coerce
paLastUpdatedTimestamp :: Lens' PlayerAchievement (Maybe Int64)
paLastUpdatedTimestamp
= lens _paLastUpdatedTimestamp
(\ s a -> s{_paLastUpdatedTimestamp = a})
. mapping _Coerce
instance FromJSON PlayerAchievement where
parseJSON
= withObject "PlayerAchievement"
(\ o ->
PlayerAchievement' <$>
(o .:? "kind" .!= "games#playerAchievement") <*>
(o .:? "achievementState")
<*> (o .:? "formattedCurrentStepsString")
<*> (o .:? "experiencePoints")
<*> (o .:? "id")
<*> (o .:? "currentSteps")
<*> (o .:? "lastUpdatedTimestamp"))
instance ToJSON PlayerAchievement where
toJSON PlayerAchievement'{..}
= object
(catMaybes
[Just ("kind" .= _paKind),
("achievementState" .=) <$> _paAchievementState,
("formattedCurrentStepsString" .=) <$>
_paFormattedCurrentStepsString,
("experiencePoints" .=) <$> _paExperiencePoints,
("id" .=) <$> _paId,
("currentSteps" .=) <$> _paCurrentSteps,
("lastUpdatedTimestamp" .=) <$>
_paLastUpdatedTimestamp])
data RoomP2PStatuses =
RoomP2PStatuses'
{ _rppssKind :: !Text
, _rppssUpdates :: !(Maybe [RoomP2PStatus])
}
deriving (Eq, Show, Data, Typeable, Generic)
roomP2PStatuses
:: RoomP2PStatuses
roomP2PStatuses =
RoomP2PStatuses'
{_rppssKind = "games#roomP2PStatuses", _rppssUpdates = Nothing}
rppssKind :: Lens' RoomP2PStatuses Text
rppssKind
= lens _rppssKind (\ s a -> s{_rppssKind = a})
rppssUpdates :: Lens' RoomP2PStatuses [RoomP2PStatus]
rppssUpdates
= lens _rppssUpdates (\ s a -> s{_rppssUpdates = a})
. _Default
. _Coerce
instance FromJSON RoomP2PStatuses where
parseJSON
= withObject "RoomP2PStatuses"
(\ o ->
RoomP2PStatuses' <$>
(o .:? "kind" .!= "games#roomP2PStatuses") <*>
(o .:? "updates" .!= mempty))
instance ToJSON RoomP2PStatuses where
toJSON RoomP2PStatuses'{..}
= object
(catMaybes
[Just ("kind" .= _rppssKind),
("updates" .=) <$> _rppssUpdates])
data ImageAsset =
ImageAsset'
{ _iaHeight :: !(Maybe (Textual Int32))
, _iaKind :: !Text
, _iaURL :: !(Maybe Text)
, _iaWidth :: !(Maybe (Textual Int32))
, _iaName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
imageAsset
:: ImageAsset
imageAsset =
ImageAsset'
{ _iaHeight = Nothing
, _iaKind = "games#imageAsset"
, _iaURL = Nothing
, _iaWidth = Nothing
, _iaName = Nothing
}
iaHeight :: Lens' ImageAsset (Maybe Int32)
iaHeight
= lens _iaHeight (\ s a -> s{_iaHeight = a}) .
mapping _Coerce
iaKind :: Lens' ImageAsset Text
iaKind = lens _iaKind (\ s a -> s{_iaKind = a})
iaURL :: Lens' ImageAsset (Maybe Text)
iaURL = lens _iaURL (\ s a -> s{_iaURL = a})
iaWidth :: Lens' ImageAsset (Maybe Int32)
iaWidth
= lens _iaWidth (\ s a -> s{_iaWidth = a}) .
mapping _Coerce
iaName :: Lens' ImageAsset (Maybe Text)
iaName = lens _iaName (\ s a -> s{_iaName = a})
instance FromJSON ImageAsset where
parseJSON
= withObject "ImageAsset"
(\ o ->
ImageAsset' <$>
(o .:? "height") <*>
(o .:? "kind" .!= "games#imageAsset")
<*> (o .:? "url")
<*> (o .:? "width")
<*> (o .:? "name"))
instance ToJSON ImageAsset where
toJSON ImageAsset'{..}
= object
(catMaybes
[("height" .=) <$> _iaHeight,
Just ("kind" .= _iaKind), ("url" .=) <$> _iaURL,
("width" .=) <$> _iaWidth, ("name" .=) <$> _iaName])
data AchievementUpdateMultipleRequest =
AchievementUpdateMultipleRequest'
{ _aumruKind :: !Text
, _aumruUpdates :: !(Maybe [AchievementUpdateRequest])
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementUpdateMultipleRequest
:: AchievementUpdateMultipleRequest
achievementUpdateMultipleRequest =
AchievementUpdateMultipleRequest'
{ _aumruKind = "games#achievementUpdateMultipleRequest"
, _aumruUpdates = Nothing
}
aumruKind :: Lens' AchievementUpdateMultipleRequest Text
aumruKind
= lens _aumruKind (\ s a -> s{_aumruKind = a})
aumruUpdates :: Lens' AchievementUpdateMultipleRequest [AchievementUpdateRequest]
aumruUpdates
= lens _aumruUpdates (\ s a -> s{_aumruUpdates = a})
. _Default
. _Coerce
instance FromJSON AchievementUpdateMultipleRequest
where
parseJSON
= withObject "AchievementUpdateMultipleRequest"
(\ o ->
AchievementUpdateMultipleRequest' <$>
(o .:? "kind" .!=
"games#achievementUpdateMultipleRequest")
<*> (o .:? "updates" .!= mempty))
instance ToJSON AchievementUpdateMultipleRequest
where
toJSON AchievementUpdateMultipleRequest'{..}
= object
(catMaybes
[Just ("kind" .= _aumruKind),
("updates" .=) <$> _aumruUpdates])
data RoomAutoMatchStatus =
RoomAutoMatchStatus'
{ _ramsKind :: !Text
, _ramsWaitEstimateSeconds :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
roomAutoMatchStatus
:: RoomAutoMatchStatus
roomAutoMatchStatus =
RoomAutoMatchStatus'
{ _ramsKind = "games#roomAutoMatchStatus"
, _ramsWaitEstimateSeconds = Nothing
}
ramsKind :: Lens' RoomAutoMatchStatus Text
ramsKind = lens _ramsKind (\ s a -> s{_ramsKind = a})
ramsWaitEstimateSeconds :: Lens' RoomAutoMatchStatus (Maybe Int32)
ramsWaitEstimateSeconds
= lens _ramsWaitEstimateSeconds
(\ s a -> s{_ramsWaitEstimateSeconds = a})
. mapping _Coerce
instance FromJSON RoomAutoMatchStatus where
parseJSON
= withObject "RoomAutoMatchStatus"
(\ o ->
RoomAutoMatchStatus' <$>
(o .:? "kind" .!= "games#roomAutoMatchStatus") <*>
(o .:? "waitEstimateSeconds"))
instance ToJSON RoomAutoMatchStatus where
toJSON RoomAutoMatchStatus'{..}
= object
(catMaybes
[Just ("kind" .= _ramsKind),
("waitEstimateSeconds" .=) <$>
_ramsWaitEstimateSeconds])
data AchievementUpdateRequest =
AchievementUpdateRequest'
{ _auruAchievementId :: !(Maybe Text)
, _auruKind :: !Text
, _auruUpdateType :: !(Maybe Text)
, _auruSetStepsAtLeastPayload :: !(Maybe GamesAchievementSetStepsAtLeast)
, _auruIncrementPayload :: !(Maybe GamesAchievementIncrement)
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementUpdateRequest
:: AchievementUpdateRequest
achievementUpdateRequest =
AchievementUpdateRequest'
{ _auruAchievementId = Nothing
, _auruKind = "games#achievementUpdateRequest"
, _auruUpdateType = Nothing
, _auruSetStepsAtLeastPayload = Nothing
, _auruIncrementPayload = Nothing
}
auruAchievementId :: Lens' AchievementUpdateRequest (Maybe Text)
auruAchievementId
= lens _auruAchievementId
(\ s a -> s{_auruAchievementId = a})
auruKind :: Lens' AchievementUpdateRequest Text
auruKind = lens _auruKind (\ s a -> s{_auruKind = a})
auruUpdateType :: Lens' AchievementUpdateRequest (Maybe Text)
auruUpdateType
= lens _auruUpdateType
(\ s a -> s{_auruUpdateType = a})
auruSetStepsAtLeastPayload :: Lens' AchievementUpdateRequest (Maybe GamesAchievementSetStepsAtLeast)
auruSetStepsAtLeastPayload
= lens _auruSetStepsAtLeastPayload
(\ s a -> s{_auruSetStepsAtLeastPayload = a})
auruIncrementPayload :: Lens' AchievementUpdateRequest (Maybe GamesAchievementIncrement)
auruIncrementPayload
= lens _auruIncrementPayload
(\ s a -> s{_auruIncrementPayload = a})
instance FromJSON AchievementUpdateRequest where
parseJSON
= withObject "AchievementUpdateRequest"
(\ o ->
AchievementUpdateRequest' <$>
(o .:? "achievementId") <*>
(o .:? "kind" .!= "games#achievementUpdateRequest")
<*> (o .:? "updateType")
<*> (o .:? "setStepsAtLeastPayload")
<*> (o .:? "incrementPayload"))
instance ToJSON AchievementUpdateRequest where
toJSON AchievementUpdateRequest'{..}
= object
(catMaybes
[("achievementId" .=) <$> _auruAchievementId,
Just ("kind" .= _auruKind),
("updateType" .=) <$> _auruUpdateType,
("setStepsAtLeastPayload" .=) <$>
_auruSetStepsAtLeastPayload,
("incrementPayload" .=) <$> _auruIncrementPayload])
data LeaderboardScoreRank =
LeaderboardScoreRank'
{ _lsrNumScores :: !(Maybe (Textual Int64))
, _lsrKind :: !Text
, _lsrFormattedRank :: !(Maybe Text)
, _lsrFormattedNumScores :: !(Maybe Text)
, _lsrRank :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
leaderboardScoreRank
:: LeaderboardScoreRank
leaderboardScoreRank =
LeaderboardScoreRank'
{ _lsrNumScores = Nothing
, _lsrKind = "games#leaderboardScoreRank"
, _lsrFormattedRank = Nothing
, _lsrFormattedNumScores = Nothing
, _lsrRank = Nothing
}
lsrNumScores :: Lens' LeaderboardScoreRank (Maybe Int64)
lsrNumScores
= lens _lsrNumScores (\ s a -> s{_lsrNumScores = a})
. mapping _Coerce
lsrKind :: Lens' LeaderboardScoreRank Text
lsrKind = lens _lsrKind (\ s a -> s{_lsrKind = a})
lsrFormattedRank :: Lens' LeaderboardScoreRank (Maybe Text)
lsrFormattedRank
= lens _lsrFormattedRank
(\ s a -> s{_lsrFormattedRank = a})
lsrFormattedNumScores :: Lens' LeaderboardScoreRank (Maybe Text)
lsrFormattedNumScores
= lens _lsrFormattedNumScores
(\ s a -> s{_lsrFormattedNumScores = a})
lsrRank :: Lens' LeaderboardScoreRank (Maybe Int64)
lsrRank
= lens _lsrRank (\ s a -> s{_lsrRank = a}) .
mapping _Coerce
instance FromJSON LeaderboardScoreRank where
parseJSON
= withObject "LeaderboardScoreRank"
(\ o ->
LeaderboardScoreRank' <$>
(o .:? "numScores") <*>
(o .:? "kind" .!= "games#leaderboardScoreRank")
<*> (o .:? "formattedRank")
<*> (o .:? "formattedNumScores")
<*> (o .:? "rank"))
instance ToJSON LeaderboardScoreRank where
toJSON LeaderboardScoreRank'{..}
= object
(catMaybes
[("numScores" .=) <$> _lsrNumScores,
Just ("kind" .= _lsrKind),
("formattedRank" .=) <$> _lsrFormattedRank,
("formattedNumScores" .=) <$> _lsrFormattedNumScores,
("rank" .=) <$> _lsrRank])
data RoomCreateRequest =
RoomCreateRequest'
{ _rooRequestId :: !(Maybe (Textual Int64))
, _rooVariant :: !(Maybe (Textual Int32))
, _rooNetworkDiagnostics :: !(Maybe NetworkDiagnostics)
, _rooKind :: !Text
, _rooInvitedPlayerIds :: !(Maybe [Text])
, _rooClientAddress :: !(Maybe RoomClientAddress)
, _rooAutoMatchingCriteria :: !(Maybe RoomAutoMatchingCriteria)
, _rooCapabilities :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
roomCreateRequest
:: RoomCreateRequest
roomCreateRequest =
RoomCreateRequest'
{ _rooRequestId = Nothing
, _rooVariant = Nothing
, _rooNetworkDiagnostics = Nothing
, _rooKind = "games#roomCreateRequest"
, _rooInvitedPlayerIds = Nothing
, _rooClientAddress = Nothing
, _rooAutoMatchingCriteria = Nothing
, _rooCapabilities = Nothing
}
rooRequestId :: Lens' RoomCreateRequest (Maybe Int64)
rooRequestId
= lens _rooRequestId (\ s a -> s{_rooRequestId = a})
. mapping _Coerce
rooVariant :: Lens' RoomCreateRequest (Maybe Int32)
rooVariant
= lens _rooVariant (\ s a -> s{_rooVariant = a}) .
mapping _Coerce
rooNetworkDiagnostics :: Lens' RoomCreateRequest (Maybe NetworkDiagnostics)
rooNetworkDiagnostics
= lens _rooNetworkDiagnostics
(\ s a -> s{_rooNetworkDiagnostics = a})
rooKind :: Lens' RoomCreateRequest Text
rooKind = lens _rooKind (\ s a -> s{_rooKind = a})
rooInvitedPlayerIds :: Lens' RoomCreateRequest [Text]
rooInvitedPlayerIds
= lens _rooInvitedPlayerIds
(\ s a -> s{_rooInvitedPlayerIds = a})
. _Default
. _Coerce
rooClientAddress :: Lens' RoomCreateRequest (Maybe RoomClientAddress)
rooClientAddress
= lens _rooClientAddress
(\ s a -> s{_rooClientAddress = a})
rooAutoMatchingCriteria :: Lens' RoomCreateRequest (Maybe RoomAutoMatchingCriteria)
rooAutoMatchingCriteria
= lens _rooAutoMatchingCriteria
(\ s a -> s{_rooAutoMatchingCriteria = a})
rooCapabilities :: Lens' RoomCreateRequest [Text]
rooCapabilities
= lens _rooCapabilities
(\ s a -> s{_rooCapabilities = a})
. _Default
. _Coerce
instance FromJSON RoomCreateRequest where
parseJSON
= withObject "RoomCreateRequest"
(\ o ->
RoomCreateRequest' <$>
(o .:? "requestId") <*> (o .:? "variant") <*>
(o .:? "networkDiagnostics")
<*> (o .:? "kind" .!= "games#roomCreateRequest")
<*> (o .:? "invitedPlayerIds" .!= mempty)
<*> (o .:? "clientAddress")
<*> (o .:? "autoMatchingCriteria")
<*> (o .:? "capabilities" .!= mempty))
instance ToJSON RoomCreateRequest where
toJSON RoomCreateRequest'{..}
= object
(catMaybes
[("requestId" .=) <$> _rooRequestId,
("variant" .=) <$> _rooVariant,
("networkDiagnostics" .=) <$> _rooNetworkDiagnostics,
Just ("kind" .= _rooKind),
("invitedPlayerIds" .=) <$> _rooInvitedPlayerIds,
("clientAddress" .=) <$> _rooClientAddress,
("autoMatchingCriteria" .=) <$>
_rooAutoMatchingCriteria,
("capabilities" .=) <$> _rooCapabilities])
data PlayerListResponse =
PlayerListResponse'
{ _plrNextPageToken :: !(Maybe Text)
, _plrKind :: !Text
, _plrItems :: !(Maybe [Player])
}
deriving (Eq, Show, Data, Typeable, Generic)
playerListResponse
:: PlayerListResponse
playerListResponse =
PlayerListResponse'
{ _plrNextPageToken = Nothing
, _plrKind = "games#playerListResponse"
, _plrItems = Nothing
}
plrNextPageToken :: Lens' PlayerListResponse (Maybe Text)
plrNextPageToken
= lens _plrNextPageToken
(\ s a -> s{_plrNextPageToken = a})
plrKind :: Lens' PlayerListResponse Text
plrKind = lens _plrKind (\ s a -> s{_plrKind = a})
plrItems :: Lens' PlayerListResponse [Player]
plrItems
= lens _plrItems (\ s a -> s{_plrItems = a}) .
_Default
. _Coerce
instance FromJSON PlayerListResponse where
parseJSON
= withObject "PlayerListResponse"
(\ o ->
PlayerListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#playerListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON PlayerListResponse where
toJSON PlayerListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _plrNextPageToken,
Just ("kind" .= _plrKind),
("items" .=) <$> _plrItems])
data LeaderboardScores =
LeaderboardScores'
{ _lsNextPageToken :: !(Maybe Text)
, _lsNumScores :: !(Maybe (Textual Int64))
, _lsKind :: !Text
, _lsPlayerScore :: !(Maybe LeaderboardEntry)
, _lsItems :: !(Maybe [LeaderboardEntry])
, _lsPrevPageToken :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
leaderboardScores
:: LeaderboardScores
leaderboardScores =
LeaderboardScores'
{ _lsNextPageToken = Nothing
, _lsNumScores = Nothing
, _lsKind = "games#leaderboardScores"
, _lsPlayerScore = Nothing
, _lsItems = Nothing
, _lsPrevPageToken = Nothing
}
lsNextPageToken :: Lens' LeaderboardScores (Maybe Text)
lsNextPageToken
= lens _lsNextPageToken
(\ s a -> s{_lsNextPageToken = a})
lsNumScores :: Lens' LeaderboardScores (Maybe Int64)
lsNumScores
= lens _lsNumScores (\ s a -> s{_lsNumScores = a}) .
mapping _Coerce
lsKind :: Lens' LeaderboardScores Text
lsKind = lens _lsKind (\ s a -> s{_lsKind = a})
lsPlayerScore :: Lens' LeaderboardScores (Maybe LeaderboardEntry)
lsPlayerScore
= lens _lsPlayerScore
(\ s a -> s{_lsPlayerScore = a})
lsItems :: Lens' LeaderboardScores [LeaderboardEntry]
lsItems
= lens _lsItems (\ s a -> s{_lsItems = a}) . _Default
. _Coerce
lsPrevPageToken :: Lens' LeaderboardScores (Maybe Text)
lsPrevPageToken
= lens _lsPrevPageToken
(\ s a -> s{_lsPrevPageToken = a})
instance FromJSON LeaderboardScores where
parseJSON
= withObject "LeaderboardScores"
(\ o ->
LeaderboardScores' <$>
(o .:? "nextPageToken") <*> (o .:? "numScores") <*>
(o .:? "kind" .!= "games#leaderboardScores")
<*> (o .:? "playerScore")
<*> (o .:? "items" .!= mempty)
<*> (o .:? "prevPageToken"))
instance ToJSON LeaderboardScores where
toJSON LeaderboardScores'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsNextPageToken,
("numScores" .=) <$> _lsNumScores,
Just ("kind" .= _lsKind),
("playerScore" .=) <$> _lsPlayerScore,
("items" .=) <$> _lsItems,
("prevPageToken" .=) <$> _lsPrevPageToken])
data AchievementDefinition =
AchievementDefinition'
{ _adAchievementType :: !(Maybe Text)
, _adFormattedTotalSteps :: !(Maybe Text)
, _adRevealedIconURL :: !(Maybe Text)
, _adKind :: !Text
, _adExperiencePoints :: !(Maybe (Textual Int64))
, _adInitialState :: !(Maybe Text)
, _adName :: !(Maybe Text)
, _adId :: !(Maybe Text)
, _adIsUnlockedIconURLDefault :: !(Maybe Bool)
, _adTotalSteps :: !(Maybe (Textual Int32))
, _adDescription :: !(Maybe Text)
, _adIsRevealedIconURLDefault :: !(Maybe Bool)
, _adUnlockedIconURL :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementDefinition
:: AchievementDefinition
achievementDefinition =
AchievementDefinition'
{ _adAchievementType = Nothing
, _adFormattedTotalSteps = Nothing
, _adRevealedIconURL = Nothing
, _adKind = "games#achievementDefinition"
, _adExperiencePoints = Nothing
, _adInitialState = Nothing
, _adName = Nothing
, _adId = Nothing
, _adIsUnlockedIconURLDefault = Nothing
, _adTotalSteps = Nothing
, _adDescription = Nothing
, _adIsRevealedIconURLDefault = Nothing
, _adUnlockedIconURL = Nothing
}
adAchievementType :: Lens' AchievementDefinition (Maybe Text)
adAchievementType
= lens _adAchievementType
(\ s a -> s{_adAchievementType = a})
adFormattedTotalSteps :: Lens' AchievementDefinition (Maybe Text)
adFormattedTotalSteps
= lens _adFormattedTotalSteps
(\ s a -> s{_adFormattedTotalSteps = a})
adRevealedIconURL :: Lens' AchievementDefinition (Maybe Text)
adRevealedIconURL
= lens _adRevealedIconURL
(\ s a -> s{_adRevealedIconURL = a})
adKind :: Lens' AchievementDefinition Text
adKind = lens _adKind (\ s a -> s{_adKind = a})
adExperiencePoints :: Lens' AchievementDefinition (Maybe Int64)
adExperiencePoints
= lens _adExperiencePoints
(\ s a -> s{_adExperiencePoints = a})
. mapping _Coerce
adInitialState :: Lens' AchievementDefinition (Maybe Text)
adInitialState
= lens _adInitialState
(\ s a -> s{_adInitialState = a})
adName :: Lens' AchievementDefinition (Maybe Text)
adName = lens _adName (\ s a -> s{_adName = a})
adId :: Lens' AchievementDefinition (Maybe Text)
adId = lens _adId (\ s a -> s{_adId = a})
adIsUnlockedIconURLDefault :: Lens' AchievementDefinition (Maybe Bool)
adIsUnlockedIconURLDefault
= lens _adIsUnlockedIconURLDefault
(\ s a -> s{_adIsUnlockedIconURLDefault = a})
adTotalSteps :: Lens' AchievementDefinition (Maybe Int32)
adTotalSteps
= lens _adTotalSteps (\ s a -> s{_adTotalSteps = a})
. mapping _Coerce
adDescription :: Lens' AchievementDefinition (Maybe Text)
adDescription
= lens _adDescription
(\ s a -> s{_adDescription = a})
adIsRevealedIconURLDefault :: Lens' AchievementDefinition (Maybe Bool)
adIsRevealedIconURLDefault
= lens _adIsRevealedIconURLDefault
(\ s a -> s{_adIsRevealedIconURLDefault = a})
adUnlockedIconURL :: Lens' AchievementDefinition (Maybe Text)
adUnlockedIconURL
= lens _adUnlockedIconURL
(\ s a -> s{_adUnlockedIconURL = a})
instance FromJSON AchievementDefinition where
parseJSON
= withObject "AchievementDefinition"
(\ o ->
AchievementDefinition' <$>
(o .:? "achievementType") <*>
(o .:? "formattedTotalSteps")
<*> (o .:? "revealedIconUrl")
<*> (o .:? "kind" .!= "games#achievementDefinition")
<*> (o .:? "experiencePoints")
<*> (o .:? "initialState")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "isUnlockedIconUrlDefault")
<*> (o .:? "totalSteps")
<*> (o .:? "description")
<*> (o .:? "isRevealedIconUrlDefault")
<*> (o .:? "unlockedIconUrl"))
instance ToJSON AchievementDefinition where
toJSON AchievementDefinition'{..}
= object
(catMaybes
[("achievementType" .=) <$> _adAchievementType,
("formattedTotalSteps" .=) <$>
_adFormattedTotalSteps,
("revealedIconUrl" .=) <$> _adRevealedIconURL,
Just ("kind" .= _adKind),
("experiencePoints" .=) <$> _adExperiencePoints,
("initialState" .=) <$> _adInitialState,
("name" .=) <$> _adName, ("id" .=) <$> _adId,
("isUnlockedIconUrlDefault" .=) <$>
_adIsUnlockedIconURLDefault,
("totalSteps" .=) <$> _adTotalSteps,
("description" .=) <$> _adDescription,
("isRevealedIconUrlDefault" .=) <$>
_adIsRevealedIconURLDefault,
("unlockedIconUrl" .=) <$> _adUnlockedIconURL])
data TurnBasedMatchCreateRequest =
TurnBasedMatchCreateRequest'
{ _tbmcrRequestId :: !(Maybe (Textual Int64))
, _tbmcrVariant :: !(Maybe (Textual Int32))
, _tbmcrKind :: !Text
, _tbmcrInvitedPlayerIds :: !(Maybe [Text])
, _tbmcrAutoMatchingCriteria :: !(Maybe TurnBasedAutoMatchingCriteria)
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchCreateRequest
:: TurnBasedMatchCreateRequest
turnBasedMatchCreateRequest =
TurnBasedMatchCreateRequest'
{ _tbmcrRequestId = Nothing
, _tbmcrVariant = Nothing
, _tbmcrKind = "games#turnBasedMatchCreateRequest"
, _tbmcrInvitedPlayerIds = Nothing
, _tbmcrAutoMatchingCriteria = Nothing
}
tbmcrRequestId :: Lens' TurnBasedMatchCreateRequest (Maybe Int64)
tbmcrRequestId
= lens _tbmcrRequestId
(\ s a -> s{_tbmcrRequestId = a})
. mapping _Coerce
tbmcrVariant :: Lens' TurnBasedMatchCreateRequest (Maybe Int32)
tbmcrVariant
= lens _tbmcrVariant (\ s a -> s{_tbmcrVariant = a})
. mapping _Coerce
tbmcrKind :: Lens' TurnBasedMatchCreateRequest Text
tbmcrKind
= lens _tbmcrKind (\ s a -> s{_tbmcrKind = a})
tbmcrInvitedPlayerIds :: Lens' TurnBasedMatchCreateRequest [Text]
tbmcrInvitedPlayerIds
= lens _tbmcrInvitedPlayerIds
(\ s a -> s{_tbmcrInvitedPlayerIds = a})
. _Default
. _Coerce
tbmcrAutoMatchingCriteria :: Lens' TurnBasedMatchCreateRequest (Maybe TurnBasedAutoMatchingCriteria)
tbmcrAutoMatchingCriteria
= lens _tbmcrAutoMatchingCriteria
(\ s a -> s{_tbmcrAutoMatchingCriteria = a})
instance FromJSON TurnBasedMatchCreateRequest where
parseJSON
= withObject "TurnBasedMatchCreateRequest"
(\ o ->
TurnBasedMatchCreateRequest' <$>
(o .:? "requestId") <*> (o .:? "variant") <*>
(o .:? "kind" .!=
"games#turnBasedMatchCreateRequest")
<*> (o .:? "invitedPlayerIds" .!= mempty)
<*> (o .:? "autoMatchingCriteria"))
instance ToJSON TurnBasedMatchCreateRequest where
toJSON TurnBasedMatchCreateRequest'{..}
= object
(catMaybes
[("requestId" .=) <$> _tbmcrRequestId,
("variant" .=) <$> _tbmcrVariant,
Just ("kind" .= _tbmcrKind),
("invitedPlayerIds" .=) <$> _tbmcrInvitedPlayerIds,
("autoMatchingCriteria" .=) <$>
_tbmcrAutoMatchingCriteria])
data EventBatchRecordFailure =
EventBatchRecordFailure'
{ _ebrfKind :: !Text
, _ebrfRange :: !(Maybe EventPeriodRange)
, _ebrfFailureCause :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
eventBatchRecordFailure
:: EventBatchRecordFailure
eventBatchRecordFailure =
EventBatchRecordFailure'
{ _ebrfKind = "games#eventBatchRecordFailure"
, _ebrfRange = Nothing
, _ebrfFailureCause = Nothing
}
ebrfKind :: Lens' EventBatchRecordFailure Text
ebrfKind = lens _ebrfKind (\ s a -> s{_ebrfKind = a})
ebrfRange :: Lens' EventBatchRecordFailure (Maybe EventPeriodRange)
ebrfRange
= lens _ebrfRange (\ s a -> s{_ebrfRange = a})
ebrfFailureCause :: Lens' EventBatchRecordFailure (Maybe Text)
ebrfFailureCause
= lens _ebrfFailureCause
(\ s a -> s{_ebrfFailureCause = a})
instance FromJSON EventBatchRecordFailure where
parseJSON
= withObject "EventBatchRecordFailure"
(\ o ->
EventBatchRecordFailure' <$>
(o .:? "kind" .!= "games#eventBatchRecordFailure")
<*> (o .:? "range")
<*> (o .:? "failureCause"))
instance ToJSON EventBatchRecordFailure where
toJSON EventBatchRecordFailure'{..}
= object
(catMaybes
[Just ("kind" .= _ebrfKind),
("range" .=) <$> _ebrfRange,
("failureCause" .=) <$> _ebrfFailureCause])
data TurnBasedMatchResults =
TurnBasedMatchResults'
{ _tbmrResults :: !(Maybe [ParticipantResult])
, _tbmrKind :: !Text
, _tbmrData :: !(Maybe TurnBasedMatchDataRequest)
, _tbmrMatchVersion :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchResults
:: TurnBasedMatchResults
turnBasedMatchResults =
TurnBasedMatchResults'
{ _tbmrResults = Nothing
, _tbmrKind = "games#turnBasedMatchResults"
, _tbmrData = Nothing
, _tbmrMatchVersion = Nothing
}
tbmrResults :: Lens' TurnBasedMatchResults [ParticipantResult]
tbmrResults
= lens _tbmrResults (\ s a -> s{_tbmrResults = a}) .
_Default
. _Coerce
tbmrKind :: Lens' TurnBasedMatchResults Text
tbmrKind = lens _tbmrKind (\ s a -> s{_tbmrKind = a})
tbmrData :: Lens' TurnBasedMatchResults (Maybe TurnBasedMatchDataRequest)
tbmrData = lens _tbmrData (\ s a -> s{_tbmrData = a})
tbmrMatchVersion :: Lens' TurnBasedMatchResults (Maybe Int32)
tbmrMatchVersion
= lens _tbmrMatchVersion
(\ s a -> s{_tbmrMatchVersion = a})
. mapping _Coerce
instance FromJSON TurnBasedMatchResults where
parseJSON
= withObject "TurnBasedMatchResults"
(\ o ->
TurnBasedMatchResults' <$>
(o .:? "results" .!= mempty) <*>
(o .:? "kind" .!= "games#turnBasedMatchResults")
<*> (o .:? "data")
<*> (o .:? "matchVersion"))
instance ToJSON TurnBasedMatchResults where
toJSON TurnBasedMatchResults'{..}
= object
(catMaybes
[("results" .=) <$> _tbmrResults,
Just ("kind" .= _tbmrKind),
("data" .=) <$> _tbmrData,
("matchVersion" .=) <$> _tbmrMatchVersion])
data PushTokenIdIos =
PushTokenIdIos'
{ _ptiiAPNSDeviceToken :: !(Maybe Bytes)
, _ptiiAPNSEnvironment :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
pushTokenIdIos
:: PushTokenIdIos
pushTokenIdIos =
PushTokenIdIos'
{_ptiiAPNSDeviceToken = Nothing, _ptiiAPNSEnvironment = Nothing}
ptiiAPNSDeviceToken :: Lens' PushTokenIdIos (Maybe ByteString)
ptiiAPNSDeviceToken
= lens _ptiiAPNSDeviceToken
(\ s a -> s{_ptiiAPNSDeviceToken = a})
. mapping _Bytes
ptiiAPNSEnvironment :: Lens' PushTokenIdIos (Maybe Text)
ptiiAPNSEnvironment
= lens _ptiiAPNSEnvironment
(\ s a -> s{_ptiiAPNSEnvironment = a})
instance FromJSON PushTokenIdIos where
parseJSON
= withObject "PushTokenIdIos"
(\ o ->
PushTokenIdIos' <$>
(o .:? "apns_device_token") <*>
(o .:? "apns_environment"))
instance ToJSON PushTokenIdIos where
toJSON PushTokenIdIos'{..}
= object
(catMaybes
[("apns_device_token" .=) <$> _ptiiAPNSDeviceToken,
("apns_environment" .=) <$> _ptiiAPNSEnvironment])
data RoomLeaveRequest =
RoomLeaveRequest'
{ _rlrKind :: !Text
, _rlrReason :: !(Maybe Text)
, _rlrLeaveDiagnostics :: !(Maybe RoomLeaveDiagnostics)
}
deriving (Eq, Show, Data, Typeable, Generic)
roomLeaveRequest
:: RoomLeaveRequest
roomLeaveRequest =
RoomLeaveRequest'
{ _rlrKind = "games#roomLeaveRequest"
, _rlrReason = Nothing
, _rlrLeaveDiagnostics = Nothing
}
rlrKind :: Lens' RoomLeaveRequest Text
rlrKind = lens _rlrKind (\ s a -> s{_rlrKind = a})
rlrReason :: Lens' RoomLeaveRequest (Maybe Text)
rlrReason
= lens _rlrReason (\ s a -> s{_rlrReason = a})
rlrLeaveDiagnostics :: Lens' RoomLeaveRequest (Maybe RoomLeaveDiagnostics)
rlrLeaveDiagnostics
= lens _rlrLeaveDiagnostics
(\ s a -> s{_rlrLeaveDiagnostics = a})
instance FromJSON RoomLeaveRequest where
parseJSON
= withObject "RoomLeaveRequest"
(\ o ->
RoomLeaveRequest' <$>
(o .:? "kind" .!= "games#roomLeaveRequest") <*>
(o .:? "reason")
<*> (o .:? "leaveDiagnostics"))
instance ToJSON RoomLeaveRequest where
toJSON RoomLeaveRequest'{..}
= object
(catMaybes
[Just ("kind" .= _rlrKind),
("reason" .=) <$> _rlrReason,
("leaveDiagnostics" .=) <$> _rlrLeaveDiagnostics])
data Played =
Played'
{ _pKind :: !Text
, _pAutoMatched :: !(Maybe Bool)
, _pTimeMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
played
:: Played
played =
Played'
{_pKind = "games#played", _pAutoMatched = Nothing, _pTimeMillis = Nothing}
pKind :: Lens' Played Text
pKind = lens _pKind (\ s a -> s{_pKind = a})
pAutoMatched :: Lens' Played (Maybe Bool)
pAutoMatched
= lens _pAutoMatched (\ s a -> s{_pAutoMatched = a})
pTimeMillis :: Lens' Played (Maybe Int64)
pTimeMillis
= lens _pTimeMillis (\ s a -> s{_pTimeMillis = a}) .
mapping _Coerce
instance FromJSON Played where
parseJSON
= withObject "Played"
(\ o ->
Played' <$>
(o .:? "kind" .!= "games#played") <*>
(o .:? "autoMatched")
<*> (o .:? "timeMillis"))
instance ToJSON Played where
toJSON Played'{..}
= object
(catMaybes
[Just ("kind" .= _pKind),
("autoMatched" .=) <$> _pAutoMatched,
("timeMillis" .=) <$> _pTimeMillis])
data AchievementIncrementResponse =
AchievementIncrementResponse'
{ _airKind :: !Text
, _airNewlyUnlocked :: !(Maybe Bool)
, _airCurrentSteps :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementIncrementResponse
:: AchievementIncrementResponse
achievementIncrementResponse =
AchievementIncrementResponse'
{ _airKind = "games#achievementIncrementResponse"
, _airNewlyUnlocked = Nothing
, _airCurrentSteps = Nothing
}
airKind :: Lens' AchievementIncrementResponse Text
airKind = lens _airKind (\ s a -> s{_airKind = a})
airNewlyUnlocked :: Lens' AchievementIncrementResponse (Maybe Bool)
airNewlyUnlocked
= lens _airNewlyUnlocked
(\ s a -> s{_airNewlyUnlocked = a})
airCurrentSteps :: Lens' AchievementIncrementResponse (Maybe Int32)
airCurrentSteps
= lens _airCurrentSteps
(\ s a -> s{_airCurrentSteps = a})
. mapping _Coerce
instance FromJSON AchievementIncrementResponse where
parseJSON
= withObject "AchievementIncrementResponse"
(\ o ->
AchievementIncrementResponse' <$>
(o .:? "kind" .!=
"games#achievementIncrementResponse")
<*> (o .:? "newlyUnlocked")
<*> (o .:? "currentSteps"))
instance ToJSON AchievementIncrementResponse where
toJSON AchievementIncrementResponse'{..}
= object
(catMaybes
[Just ("kind" .= _airKind),
("newlyUnlocked" .=) <$> _airNewlyUnlocked,
("currentSteps" .=) <$> _airCurrentSteps])
data AchievementRevealResponse =
AchievementRevealResponse'
{ _arrKind :: !Text
, _arrCurrentState :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementRevealResponse
:: AchievementRevealResponse
achievementRevealResponse =
AchievementRevealResponse'
{_arrKind = "games#achievementRevealResponse", _arrCurrentState = Nothing}
arrKind :: Lens' AchievementRevealResponse Text
arrKind = lens _arrKind (\ s a -> s{_arrKind = a})
arrCurrentState :: Lens' AchievementRevealResponse (Maybe Text)
arrCurrentState
= lens _arrCurrentState
(\ s a -> s{_arrCurrentState = a})
instance FromJSON AchievementRevealResponse where
parseJSON
= withObject "AchievementRevealResponse"
(\ o ->
AchievementRevealResponse' <$>
(o .:? "kind" .!= "games#achievementRevealResponse")
<*> (o .:? "currentState"))
instance ToJSON AchievementRevealResponse where
toJSON AchievementRevealResponse'{..}
= object
(catMaybes
[Just ("kind" .= _arrKind),
("currentState" .=) <$> _arrCurrentState])
data AchievementSetStepsAtLeastResponse =
AchievementSetStepsAtLeastResponse'
{ _assalrKind :: !Text
, _assalrNewlyUnlocked :: !(Maybe Bool)
, _assalrCurrentSteps :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
achievementSetStepsAtLeastResponse
:: AchievementSetStepsAtLeastResponse
achievementSetStepsAtLeastResponse =
AchievementSetStepsAtLeastResponse'
{ _assalrKind = "games#achievementSetStepsAtLeastResponse"
, _assalrNewlyUnlocked = Nothing
, _assalrCurrentSteps = Nothing
}
assalrKind :: Lens' AchievementSetStepsAtLeastResponse Text
assalrKind
= lens _assalrKind (\ s a -> s{_assalrKind = a})
assalrNewlyUnlocked :: Lens' AchievementSetStepsAtLeastResponse (Maybe Bool)
assalrNewlyUnlocked
= lens _assalrNewlyUnlocked
(\ s a -> s{_assalrNewlyUnlocked = a})
assalrCurrentSteps :: Lens' AchievementSetStepsAtLeastResponse (Maybe Int32)
assalrCurrentSteps
= lens _assalrCurrentSteps
(\ s a -> s{_assalrCurrentSteps = a})
. mapping _Coerce
instance FromJSON AchievementSetStepsAtLeastResponse
where
parseJSON
= withObject "AchievementSetStepsAtLeastResponse"
(\ o ->
AchievementSetStepsAtLeastResponse' <$>
(o .:? "kind" .!=
"games#achievementSetStepsAtLeastResponse")
<*> (o .:? "newlyUnlocked")
<*> (o .:? "currentSteps"))
instance ToJSON AchievementSetStepsAtLeastResponse
where
toJSON AchievementSetStepsAtLeastResponse'{..}
= object
(catMaybes
[Just ("kind" .= _assalrKind),
("newlyUnlocked" .=) <$> _assalrNewlyUnlocked,
("currentSteps" .=) <$> _assalrCurrentSteps])
data PlayerAchievementListResponse =
PlayerAchievementListResponse'
{ _palrNextPageToken :: !(Maybe Text)
, _palrKind :: !Text
, _palrItems :: !(Maybe [PlayerAchievement])
}
deriving (Eq, Show, Data, Typeable, Generic)
playerAchievementListResponse
:: PlayerAchievementListResponse
playerAchievementListResponse =
PlayerAchievementListResponse'
{ _palrNextPageToken = Nothing
, _palrKind = "games#playerAchievementListResponse"
, _palrItems = Nothing
}
palrNextPageToken :: Lens' PlayerAchievementListResponse (Maybe Text)
palrNextPageToken
= lens _palrNextPageToken
(\ s a -> s{_palrNextPageToken = a})
palrKind :: Lens' PlayerAchievementListResponse Text
palrKind = lens _palrKind (\ s a -> s{_palrKind = a})
palrItems :: Lens' PlayerAchievementListResponse [PlayerAchievement]
palrItems
= lens _palrItems (\ s a -> s{_palrItems = a}) .
_Default
. _Coerce
instance FromJSON PlayerAchievementListResponse where
parseJSON
= withObject "PlayerAchievementListResponse"
(\ o ->
PlayerAchievementListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!=
"games#playerAchievementListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON PlayerAchievementListResponse where
toJSON PlayerAchievementListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _palrNextPageToken,
Just ("kind" .= _palrKind),
("items" .=) <$> _palrItems])
data EventRecordRequest =
EventRecordRequest'
{ _errRequestId :: !(Maybe (Textual Int64))
, _errKind :: !Text
, _errCurrentTimeMillis :: !(Maybe (Textual Int64))
, _errTimePeriods :: !(Maybe [EventPeriodUpdate])
}
deriving (Eq, Show, Data, Typeable, Generic)
eventRecordRequest
:: EventRecordRequest
eventRecordRequest =
EventRecordRequest'
{ _errRequestId = Nothing
, _errKind = "games#eventRecordRequest"
, _errCurrentTimeMillis = Nothing
, _errTimePeriods = Nothing
}
errRequestId :: Lens' EventRecordRequest (Maybe Int64)
errRequestId
= lens _errRequestId (\ s a -> s{_errRequestId = a})
. mapping _Coerce
errKind :: Lens' EventRecordRequest Text
errKind = lens _errKind (\ s a -> s{_errKind = a})
errCurrentTimeMillis :: Lens' EventRecordRequest (Maybe Int64)
errCurrentTimeMillis
= lens _errCurrentTimeMillis
(\ s a -> s{_errCurrentTimeMillis = a})
. mapping _Coerce
errTimePeriods :: Lens' EventRecordRequest [EventPeriodUpdate]
errTimePeriods
= lens _errTimePeriods
(\ s a -> s{_errTimePeriods = a})
. _Default
. _Coerce
instance FromJSON EventRecordRequest where
parseJSON
= withObject "EventRecordRequest"
(\ o ->
EventRecordRequest' <$>
(o .:? "requestId") <*>
(o .:? "kind" .!= "games#eventRecordRequest")
<*> (o .:? "currentTimeMillis")
<*> (o .:? "timePeriods" .!= mempty))
instance ToJSON EventRecordRequest where
toJSON EventRecordRequest'{..}
= object
(catMaybes
[("requestId" .=) <$> _errRequestId,
Just ("kind" .= _errKind),
("currentTimeMillis" .=) <$> _errCurrentTimeMillis,
("timePeriods" .=) <$> _errTimePeriods])
data RoomAutoMatchingCriteria =
RoomAutoMatchingCriteria'
{ _ramcKind :: !Text
, _ramcExclusiveBitmask :: !(Maybe (Textual Int64))
, _ramcMaxAutoMatchingPlayers :: !(Maybe (Textual Int32))
, _ramcMinAutoMatchingPlayers :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
roomAutoMatchingCriteria
:: RoomAutoMatchingCriteria
roomAutoMatchingCriteria =
RoomAutoMatchingCriteria'
{ _ramcKind = "games#roomAutoMatchingCriteria"
, _ramcExclusiveBitmask = Nothing
, _ramcMaxAutoMatchingPlayers = Nothing
, _ramcMinAutoMatchingPlayers = Nothing
}
ramcKind :: Lens' RoomAutoMatchingCriteria Text
ramcKind = lens _ramcKind (\ s a -> s{_ramcKind = a})
ramcExclusiveBitmask :: Lens' RoomAutoMatchingCriteria (Maybe Int64)
ramcExclusiveBitmask
= lens _ramcExclusiveBitmask
(\ s a -> s{_ramcExclusiveBitmask = a})
. mapping _Coerce
ramcMaxAutoMatchingPlayers :: Lens' RoomAutoMatchingCriteria (Maybe Int32)
ramcMaxAutoMatchingPlayers
= lens _ramcMaxAutoMatchingPlayers
(\ s a -> s{_ramcMaxAutoMatchingPlayers = a})
. mapping _Coerce
ramcMinAutoMatchingPlayers :: Lens' RoomAutoMatchingCriteria (Maybe Int32)
ramcMinAutoMatchingPlayers
= lens _ramcMinAutoMatchingPlayers
(\ s a -> s{_ramcMinAutoMatchingPlayers = a})
. mapping _Coerce
instance FromJSON RoomAutoMatchingCriteria where
parseJSON
= withObject "RoomAutoMatchingCriteria"
(\ o ->
RoomAutoMatchingCriteria' <$>
(o .:? "kind" .!= "games#roomAutoMatchingCriteria")
<*> (o .:? "exclusiveBitmask")
<*> (o .:? "maxAutoMatchingPlayers")
<*> (o .:? "minAutoMatchingPlayers"))
instance ToJSON RoomAutoMatchingCriteria where
toJSON RoomAutoMatchingCriteria'{..}
= object
(catMaybes
[Just ("kind" .= _ramcKind),
("exclusiveBitmask" .=) <$> _ramcExclusiveBitmask,
("maxAutoMatchingPlayers" .=) <$>
_ramcMaxAutoMatchingPlayers,
("minAutoMatchingPlayers" .=) <$>
_ramcMinAutoMatchingPlayers])
data QuestMilestone =
QuestMilestone'
{ _qmState :: !(Maybe Text)
, _qmKind :: !Text
, _qmId :: !(Maybe Text)
, _qmCompletionRewardData :: !(Maybe Bytes)
, _qmCriteria :: !(Maybe [QuestCriterion])
}
deriving (Eq, Show, Data, Typeable, Generic)
questMilestone
:: QuestMilestone
questMilestone =
QuestMilestone'
{ _qmState = Nothing
, _qmKind = "games#questMilestone"
, _qmId = Nothing
, _qmCompletionRewardData = Nothing
, _qmCriteria = Nothing
}
qmState :: Lens' QuestMilestone (Maybe Text)
qmState = lens _qmState (\ s a -> s{_qmState = a})
qmKind :: Lens' QuestMilestone Text
qmKind = lens _qmKind (\ s a -> s{_qmKind = a})
qmId :: Lens' QuestMilestone (Maybe Text)
qmId = lens _qmId (\ s a -> s{_qmId = a})
qmCompletionRewardData :: Lens' QuestMilestone (Maybe ByteString)
qmCompletionRewardData
= lens _qmCompletionRewardData
(\ s a -> s{_qmCompletionRewardData = a})
. mapping _Bytes
qmCriteria :: Lens' QuestMilestone [QuestCriterion]
qmCriteria
= lens _qmCriteria (\ s a -> s{_qmCriteria = a}) .
_Default
. _Coerce
instance FromJSON QuestMilestone where
parseJSON
= withObject "QuestMilestone"
(\ o ->
QuestMilestone' <$>
(o .:? "state") <*>
(o .:? "kind" .!= "games#questMilestone")
<*> (o .:? "id")
<*> (o .:? "completionRewardData")
<*> (o .:? "criteria" .!= mempty))
instance ToJSON QuestMilestone where
toJSON QuestMilestone'{..}
= object
(catMaybes
[("state" .=) <$> _qmState, Just ("kind" .= _qmKind),
("id" .=) <$> _qmId,
("completionRewardData" .=) <$>
_qmCompletionRewardData,
("criteria" .=) <$> _qmCriteria])
data PeerSessionDiagnostics =
PeerSessionDiagnostics'
{ _psdConnectedTimestampMillis :: !(Maybe (Textual Int64))
, _psdParticipantId :: !(Maybe Text)
, _psdKind :: !Text
, _psdUnreliableChannel :: !(Maybe PeerChannelDiagnostics)
, _psdReliableChannel :: !(Maybe PeerChannelDiagnostics)
}
deriving (Eq, Show, Data, Typeable, Generic)
peerSessionDiagnostics
:: PeerSessionDiagnostics
peerSessionDiagnostics =
PeerSessionDiagnostics'
{ _psdConnectedTimestampMillis = Nothing
, _psdParticipantId = Nothing
, _psdKind = "games#peerSessionDiagnostics"
, _psdUnreliableChannel = Nothing
, _psdReliableChannel = Nothing
}
psdConnectedTimestampMillis :: Lens' PeerSessionDiagnostics (Maybe Int64)
psdConnectedTimestampMillis
= lens _psdConnectedTimestampMillis
(\ s a -> s{_psdConnectedTimestampMillis = a})
. mapping _Coerce
psdParticipantId :: Lens' PeerSessionDiagnostics (Maybe Text)
psdParticipantId
= lens _psdParticipantId
(\ s a -> s{_psdParticipantId = a})
psdKind :: Lens' PeerSessionDiagnostics Text
psdKind = lens _psdKind (\ s a -> s{_psdKind = a})
psdUnreliableChannel :: Lens' PeerSessionDiagnostics (Maybe PeerChannelDiagnostics)
psdUnreliableChannel
= lens _psdUnreliableChannel
(\ s a -> s{_psdUnreliableChannel = a})
psdReliableChannel :: Lens' PeerSessionDiagnostics (Maybe PeerChannelDiagnostics)
psdReliableChannel
= lens _psdReliableChannel
(\ s a -> s{_psdReliableChannel = a})
instance FromJSON PeerSessionDiagnostics where
parseJSON
= withObject "PeerSessionDiagnostics"
(\ o ->
PeerSessionDiagnostics' <$>
(o .:? "connectedTimestampMillis") <*>
(o .:? "participantId")
<*> (o .:? "kind" .!= "games#peerSessionDiagnostics")
<*> (o .:? "unreliableChannel")
<*> (o .:? "reliableChannel"))
instance ToJSON PeerSessionDiagnostics where
toJSON PeerSessionDiagnostics'{..}
= object
(catMaybes
[("connectedTimestampMillis" .=) <$>
_psdConnectedTimestampMillis,
("participantId" .=) <$> _psdParticipantId,
Just ("kind" .= _psdKind),
("unreliableChannel" .=) <$> _psdUnreliableChannel,
("reliableChannel" .=) <$> _psdReliableChannel])
data PushTokenId =
PushTokenId'
{ _ptiIos :: !(Maybe PushTokenIdIos)
, _ptiKind :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
pushTokenId
:: PushTokenId
pushTokenId = PushTokenId' {_ptiIos = Nothing, _ptiKind = "games#pushTokenId"}
ptiIos :: Lens' PushTokenId (Maybe PushTokenIdIos)
ptiIos = lens _ptiIos (\ s a -> s{_ptiIos = a})
ptiKind :: Lens' PushTokenId Text
ptiKind = lens _ptiKind (\ s a -> s{_ptiKind = a})
instance FromJSON PushTokenId where
parseJSON
= withObject "PushTokenId"
(\ o ->
PushTokenId' <$>
(o .:? "ios") <*>
(o .:? "kind" .!= "games#pushTokenId"))
instance ToJSON PushTokenId where
toJSON PushTokenId'{..}
= object
(catMaybes
[("ios" .=) <$> _ptiIos, Just ("kind" .= _ptiKind)])
data EventPeriodUpdate =
EventPeriodUpdate'
{ _epuKind :: !Text
, _epuTimePeriod :: !(Maybe EventPeriodRange)
, _epuUpdates :: !(Maybe [EventUpdateRequest])
}
deriving (Eq, Show, Data, Typeable, Generic)
eventPeriodUpdate
:: EventPeriodUpdate
eventPeriodUpdate =
EventPeriodUpdate'
{ _epuKind = "games#eventPeriodUpdate"
, _epuTimePeriod = Nothing
, _epuUpdates = Nothing
}
epuKind :: Lens' EventPeriodUpdate Text
epuKind = lens _epuKind (\ s a -> s{_epuKind = a})
epuTimePeriod :: Lens' EventPeriodUpdate (Maybe EventPeriodRange)
epuTimePeriod
= lens _epuTimePeriod
(\ s a -> s{_epuTimePeriod = a})
epuUpdates :: Lens' EventPeriodUpdate [EventUpdateRequest]
epuUpdates
= lens _epuUpdates (\ s a -> s{_epuUpdates = a}) .
_Default
. _Coerce
instance FromJSON EventPeriodUpdate where
parseJSON
= withObject "EventPeriodUpdate"
(\ o ->
EventPeriodUpdate' <$>
(o .:? "kind" .!= "games#eventPeriodUpdate") <*>
(o .:? "timePeriod")
<*> (o .:? "updates" .!= mempty))
instance ToJSON EventPeriodUpdate where
toJSON EventPeriodUpdate'{..}
= object
(catMaybes
[Just ("kind" .= _epuKind),
("timePeriod" .=) <$> _epuTimePeriod,
("updates" .=) <$> _epuUpdates])
data TurnBasedMatchSync =
TurnBasedMatchSync'
{ _tbmsMoreAvailable :: !(Maybe Bool)
, _tbmsNextPageToken :: !(Maybe Text)
, _tbmsKind :: !Text
, _tbmsItems :: !(Maybe [TurnBasedMatch])
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchSync
:: TurnBasedMatchSync
turnBasedMatchSync =
TurnBasedMatchSync'
{ _tbmsMoreAvailable = Nothing
, _tbmsNextPageToken = Nothing
, _tbmsKind = "games#turnBasedMatchSync"
, _tbmsItems = Nothing
}
tbmsMoreAvailable :: Lens' TurnBasedMatchSync (Maybe Bool)
tbmsMoreAvailable
= lens _tbmsMoreAvailable
(\ s a -> s{_tbmsMoreAvailable = a})
tbmsNextPageToken :: Lens' TurnBasedMatchSync (Maybe Text)
tbmsNextPageToken
= lens _tbmsNextPageToken
(\ s a -> s{_tbmsNextPageToken = a})
tbmsKind :: Lens' TurnBasedMatchSync Text
tbmsKind = lens _tbmsKind (\ s a -> s{_tbmsKind = a})
tbmsItems :: Lens' TurnBasedMatchSync [TurnBasedMatch]
tbmsItems
= lens _tbmsItems (\ s a -> s{_tbmsItems = a}) .
_Default
. _Coerce
instance FromJSON TurnBasedMatchSync where
parseJSON
= withObject "TurnBasedMatchSync"
(\ o ->
TurnBasedMatchSync' <$>
(o .:? "moreAvailable") <*> (o .:? "nextPageToken")
<*> (o .:? "kind" .!= "games#turnBasedMatchSync")
<*> (o .:? "items" .!= mempty))
instance ToJSON TurnBasedMatchSync where
toJSON TurnBasedMatchSync'{..}
= object
(catMaybes
[("moreAvailable" .=) <$> _tbmsMoreAvailable,
("nextPageToken" .=) <$> _tbmsNextPageToken,
Just ("kind" .= _tbmsKind),
("items" .=) <$> _tbmsItems])
data ScoreSubmission =
ScoreSubmission'
{ _scoSignature :: !(Maybe Text)
, _scoScoreTag :: !(Maybe Text)
, _scoScore :: !(Maybe (Textual Int64))
, _scoKind :: !Text
, _scoLeaderboardId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
scoreSubmission
:: ScoreSubmission
scoreSubmission =
ScoreSubmission'
{ _scoSignature = Nothing
, _scoScoreTag = Nothing
, _scoScore = Nothing
, _scoKind = "games#scoreSubmission"
, _scoLeaderboardId = Nothing
}
scoSignature :: Lens' ScoreSubmission (Maybe Text)
scoSignature
= lens _scoSignature (\ s a -> s{_scoSignature = a})
scoScoreTag :: Lens' ScoreSubmission (Maybe Text)
scoScoreTag
= lens _scoScoreTag (\ s a -> s{_scoScoreTag = a})
scoScore :: Lens' ScoreSubmission (Maybe Int64)
scoScore
= lens _scoScore (\ s a -> s{_scoScore = a}) .
mapping _Coerce
scoKind :: Lens' ScoreSubmission Text
scoKind = lens _scoKind (\ s a -> s{_scoKind = a})
scoLeaderboardId :: Lens' ScoreSubmission (Maybe Text)
scoLeaderboardId
= lens _scoLeaderboardId
(\ s a -> s{_scoLeaderboardId = a})
instance FromJSON ScoreSubmission where
parseJSON
= withObject "ScoreSubmission"
(\ o ->
ScoreSubmission' <$>
(o .:? "signature") <*> (o .:? "scoreTag") <*>
(o .:? "score")
<*> (o .:? "kind" .!= "games#scoreSubmission")
<*> (o .:? "leaderboardId"))
instance ToJSON ScoreSubmission where
toJSON ScoreSubmission'{..}
= object
(catMaybes
[("signature" .=) <$> _scoSignature,
("scoreTag" .=) <$> _scoScoreTag,
("score" .=) <$> _scoScore,
Just ("kind" .= _scoKind),
("leaderboardId" .=) <$> _scoLeaderboardId])
data RoomLeaveDiagnostics =
RoomLeaveDiagnostics'
{ _rldPeerSession :: !(Maybe [PeerSessionDiagnostics])
, _rldAndroidNetworkType :: !(Maybe (Textual Int32))
, _rldKind :: !Text
, _rldNetworkOperatorCode :: !(Maybe Text)
, _rldNetworkOperatorName :: !(Maybe Text)
, _rldSocketsUsed :: !(Maybe Bool)
, _rldIosNetworkType :: !(Maybe (Textual Int32))
, _rldAndroidNetworkSubtype :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
roomLeaveDiagnostics
:: RoomLeaveDiagnostics
roomLeaveDiagnostics =
RoomLeaveDiagnostics'
{ _rldPeerSession = Nothing
, _rldAndroidNetworkType = Nothing
, _rldKind = "games#roomLeaveDiagnostics"
, _rldNetworkOperatorCode = Nothing
, _rldNetworkOperatorName = Nothing
, _rldSocketsUsed = Nothing
, _rldIosNetworkType = Nothing
, _rldAndroidNetworkSubtype = Nothing
}
rldPeerSession :: Lens' RoomLeaveDiagnostics [PeerSessionDiagnostics]
rldPeerSession
= lens _rldPeerSession
(\ s a -> s{_rldPeerSession = a})
. _Default
. _Coerce
rldAndroidNetworkType :: Lens' RoomLeaveDiagnostics (Maybe Int32)
rldAndroidNetworkType
= lens _rldAndroidNetworkType
(\ s a -> s{_rldAndroidNetworkType = a})
. mapping _Coerce
rldKind :: Lens' RoomLeaveDiagnostics Text
rldKind = lens _rldKind (\ s a -> s{_rldKind = a})
rldNetworkOperatorCode :: Lens' RoomLeaveDiagnostics (Maybe Text)
rldNetworkOperatorCode
= lens _rldNetworkOperatorCode
(\ s a -> s{_rldNetworkOperatorCode = a})
rldNetworkOperatorName :: Lens' RoomLeaveDiagnostics (Maybe Text)
rldNetworkOperatorName
= lens _rldNetworkOperatorName
(\ s a -> s{_rldNetworkOperatorName = a})
rldSocketsUsed :: Lens' RoomLeaveDiagnostics (Maybe Bool)
rldSocketsUsed
= lens _rldSocketsUsed
(\ s a -> s{_rldSocketsUsed = a})
rldIosNetworkType :: Lens' RoomLeaveDiagnostics (Maybe Int32)
rldIosNetworkType
= lens _rldIosNetworkType
(\ s a -> s{_rldIosNetworkType = a})
. mapping _Coerce
rldAndroidNetworkSubtype :: Lens' RoomLeaveDiagnostics (Maybe Int32)
rldAndroidNetworkSubtype
= lens _rldAndroidNetworkSubtype
(\ s a -> s{_rldAndroidNetworkSubtype = a})
. mapping _Coerce
instance FromJSON RoomLeaveDiagnostics where
parseJSON
= withObject "RoomLeaveDiagnostics"
(\ o ->
RoomLeaveDiagnostics' <$>
(o .:? "peerSession" .!= mempty) <*>
(o .:? "androidNetworkType")
<*> (o .:? "kind" .!= "games#roomLeaveDiagnostics")
<*> (o .:? "networkOperatorCode")
<*> (o .:? "networkOperatorName")
<*> (o .:? "socketsUsed")
<*> (o .:? "iosNetworkType")
<*> (o .:? "androidNetworkSubtype"))
instance ToJSON RoomLeaveDiagnostics where
toJSON RoomLeaveDiagnostics'{..}
= object
(catMaybes
[("peerSession" .=) <$> _rldPeerSession,
("androidNetworkType" .=) <$> _rldAndroidNetworkType,
Just ("kind" .= _rldKind),
("networkOperatorCode" .=) <$>
_rldNetworkOperatorCode,
("networkOperatorName" .=) <$>
_rldNetworkOperatorName,
("socketsUsed" .=) <$> _rldSocketsUsed,
("iosNetworkType" .=) <$> _rldIosNetworkType,
("androidNetworkSubtype" .=) <$>
_rldAndroidNetworkSubtype])
data AggregateStats =
AggregateStats'
{ _asMax :: !(Maybe (Textual Int64))
, _asKind :: !Text
, _asCount :: !(Maybe (Textual Int64))
, _asMin :: !(Maybe (Textual Int64))
, _asSum :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
aggregateStats
:: AggregateStats
aggregateStats =
AggregateStats'
{ _asMax = Nothing
, _asKind = "games#aggregateStats"
, _asCount = Nothing
, _asMin = Nothing
, _asSum = Nothing
}
asMax :: Lens' AggregateStats (Maybe Int64)
asMax
= lens _asMax (\ s a -> s{_asMax = a}) .
mapping _Coerce
asKind :: Lens' AggregateStats Text
asKind = lens _asKind (\ s a -> s{_asKind = a})
asCount :: Lens' AggregateStats (Maybe Int64)
asCount
= lens _asCount (\ s a -> s{_asCount = a}) .
mapping _Coerce
asMin :: Lens' AggregateStats (Maybe Int64)
asMin
= lens _asMin (\ s a -> s{_asMin = a}) .
mapping _Coerce
asSum :: Lens' AggregateStats (Maybe Int64)
asSum
= lens _asSum (\ s a -> s{_asSum = a}) .
mapping _Coerce
instance FromJSON AggregateStats where
parseJSON
= withObject "AggregateStats"
(\ o ->
AggregateStats' <$>
(o .:? "max") <*>
(o .:? "kind" .!= "games#aggregateStats")
<*> (o .:? "count")
<*> (o .:? "min")
<*> (o .:? "sum"))
instance ToJSON AggregateStats where
toJSON AggregateStats'{..}
= object
(catMaybes
[("max" .=) <$> _asMax, Just ("kind" .= _asKind),
("count" .=) <$> _asCount, ("min" .=) <$> _asMin,
("sum" .=) <$> _asSum])
data InstanceWebDetails =
InstanceWebDetails'
{ _iwdPreferred :: !(Maybe Bool)
, _iwdKind :: !Text
, _iwdLaunchURL :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
instanceWebDetails
:: InstanceWebDetails
instanceWebDetails =
InstanceWebDetails'
{ _iwdPreferred = Nothing
, _iwdKind = "games#instanceWebDetails"
, _iwdLaunchURL = Nothing
}
iwdPreferred :: Lens' InstanceWebDetails (Maybe Bool)
iwdPreferred
= lens _iwdPreferred (\ s a -> s{_iwdPreferred = a})
iwdKind :: Lens' InstanceWebDetails Text
iwdKind = lens _iwdKind (\ s a -> s{_iwdKind = a})
iwdLaunchURL :: Lens' InstanceWebDetails (Maybe Text)
iwdLaunchURL
= lens _iwdLaunchURL (\ s a -> s{_iwdLaunchURL = a})
instance FromJSON InstanceWebDetails where
parseJSON
= withObject "InstanceWebDetails"
(\ o ->
InstanceWebDetails' <$>
(o .:? "preferred") <*>
(o .:? "kind" .!= "games#instanceWebDetails")
<*> (o .:? "launchUrl"))
instance ToJSON InstanceWebDetails where
toJSON InstanceWebDetails'{..}
= object
(catMaybes
[("preferred" .=) <$> _iwdPreferred,
Just ("kind" .= _iwdKind),
("launchUrl" .=) <$> _iwdLaunchURL])
data TurnBasedMatchRematch =
TurnBasedMatchRematch'
{ _tRematch :: !(Maybe TurnBasedMatch)
, _tKind :: !Text
, _tPreviousMatch :: !(Maybe TurnBasedMatch)
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchRematch
:: TurnBasedMatchRematch
turnBasedMatchRematch =
TurnBasedMatchRematch'
{ _tRematch = Nothing
, _tKind = "games#turnBasedMatchRematch"
, _tPreviousMatch = Nothing
}
tRematch :: Lens' TurnBasedMatchRematch (Maybe TurnBasedMatch)
tRematch = lens _tRematch (\ s a -> s{_tRematch = a})
tKind :: Lens' TurnBasedMatchRematch Text
tKind = lens _tKind (\ s a -> s{_tKind = a})
tPreviousMatch :: Lens' TurnBasedMatchRematch (Maybe TurnBasedMatch)
tPreviousMatch
= lens _tPreviousMatch
(\ s a -> s{_tPreviousMatch = a})
instance FromJSON TurnBasedMatchRematch where
parseJSON
= withObject "TurnBasedMatchRematch"
(\ o ->
TurnBasedMatchRematch' <$>
(o .:? "rematch") <*>
(o .:? "kind" .!= "games#turnBasedMatchRematch")
<*> (o .:? "previousMatch"))
instance ToJSON TurnBasedMatchRematch where
toJSON TurnBasedMatchRematch'{..}
= object
(catMaybes
[("rematch" .=) <$> _tRematch,
Just ("kind" .= _tKind),
("previousMatch" .=) <$> _tPreviousMatch])
data PlayerExperienceInfo =
PlayerExperienceInfo'
{ _peiKind :: !Text
, _peiCurrentExperiencePoints :: !(Maybe (Textual Int64))
, _peiCurrentLevel :: !(Maybe PlayerLevel)
, _peiNextLevel :: !(Maybe PlayerLevel)
, _peiLastLevelUpTimestampMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
playerExperienceInfo
:: PlayerExperienceInfo
playerExperienceInfo =
PlayerExperienceInfo'
{ _peiKind = "games#playerExperienceInfo"
, _peiCurrentExperiencePoints = Nothing
, _peiCurrentLevel = Nothing
, _peiNextLevel = Nothing
, _peiLastLevelUpTimestampMillis = Nothing
}
peiKind :: Lens' PlayerExperienceInfo Text
peiKind = lens _peiKind (\ s a -> s{_peiKind = a})
peiCurrentExperiencePoints :: Lens' PlayerExperienceInfo (Maybe Int64)
peiCurrentExperiencePoints
= lens _peiCurrentExperiencePoints
(\ s a -> s{_peiCurrentExperiencePoints = a})
. mapping _Coerce
peiCurrentLevel :: Lens' PlayerExperienceInfo (Maybe PlayerLevel)
peiCurrentLevel
= lens _peiCurrentLevel
(\ s a -> s{_peiCurrentLevel = a})
peiNextLevel :: Lens' PlayerExperienceInfo (Maybe PlayerLevel)
peiNextLevel
= lens _peiNextLevel (\ s a -> s{_peiNextLevel = a})
peiLastLevelUpTimestampMillis :: Lens' PlayerExperienceInfo (Maybe Int64)
peiLastLevelUpTimestampMillis
= lens _peiLastLevelUpTimestampMillis
(\ s a -> s{_peiLastLevelUpTimestampMillis = a})
. mapping _Coerce
instance FromJSON PlayerExperienceInfo where
parseJSON
= withObject "PlayerExperienceInfo"
(\ o ->
PlayerExperienceInfo' <$>
(o .:? "kind" .!= "games#playerExperienceInfo") <*>
(o .:? "currentExperiencePoints")
<*> (o .:? "currentLevel")
<*> (o .:? "nextLevel")
<*> (o .:? "lastLevelUpTimestampMillis"))
instance ToJSON PlayerExperienceInfo where
toJSON PlayerExperienceInfo'{..}
= object
(catMaybes
[Just ("kind" .= _peiKind),
("currentExperiencePoints" .=) <$>
_peiCurrentExperiencePoints,
("currentLevel" .=) <$> _peiCurrentLevel,
("nextLevel" .=) <$> _peiNextLevel,
("lastLevelUpTimestampMillis" .=) <$>
_peiLastLevelUpTimestampMillis])
data GamesAchievementSetStepsAtLeast =
GamesAchievementSetStepsAtLeast'
{ _gassalKind :: !Text
, _gassalSteps :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
gamesAchievementSetStepsAtLeast
:: GamesAchievementSetStepsAtLeast
gamesAchievementSetStepsAtLeast =
GamesAchievementSetStepsAtLeast'
{ _gassalKind = "games#GamesAchievementSetStepsAtLeast"
, _gassalSteps = Nothing
}
gassalKind :: Lens' GamesAchievementSetStepsAtLeast Text
gassalKind
= lens _gassalKind (\ s a -> s{_gassalKind = a})
gassalSteps :: Lens' GamesAchievementSetStepsAtLeast (Maybe Int32)
gassalSteps
= lens _gassalSteps (\ s a -> s{_gassalSteps = a}) .
mapping _Coerce
instance FromJSON GamesAchievementSetStepsAtLeast
where
parseJSON
= withObject "GamesAchievementSetStepsAtLeast"
(\ o ->
GamesAchievementSetStepsAtLeast' <$>
(o .:? "kind" .!=
"games#GamesAchievementSetStepsAtLeast")
<*> (o .:? "steps"))
instance ToJSON GamesAchievementSetStepsAtLeast where
toJSON GamesAchievementSetStepsAtLeast'{..}
= object
(catMaybes
[Just ("kind" .= _gassalKind),
("steps" .=) <$> _gassalSteps])
data Player =
Player'
{ _plaBannerURLLandscape :: !(Maybe Text)
, _plaLastPlayedWith :: !(Maybe Played)
, _plaAvatarImageURL :: !(Maybe Text)
, _plaKind :: !Text
, _plaExperienceInfo :: !(Maybe PlayerExperienceInfo)
, _plaName :: !(Maybe PlayerName)
, _plaOriginalPlayerId :: !(Maybe Text)
, _plaDisplayName :: !(Maybe Text)
, _plaTitle :: !(Maybe Text)
, _plaBannerURLPortrait :: !(Maybe Text)
, _plaPlayerId :: !(Maybe Text)
, _plaProFileSettings :: !(Maybe ProFileSettings)
}
deriving (Eq, Show, Data, Typeable, Generic)
player
:: Player
player =
Player'
{ _plaBannerURLLandscape = Nothing
, _plaLastPlayedWith = Nothing
, _plaAvatarImageURL = Nothing
, _plaKind = "games#player"
, _plaExperienceInfo = Nothing
, _plaName = Nothing
, _plaOriginalPlayerId = Nothing
, _plaDisplayName = Nothing
, _plaTitle = Nothing
, _plaBannerURLPortrait = Nothing
, _plaPlayerId = Nothing
, _plaProFileSettings = Nothing
}
plaBannerURLLandscape :: Lens' Player (Maybe Text)
plaBannerURLLandscape
= lens _plaBannerURLLandscape
(\ s a -> s{_plaBannerURLLandscape = a})
plaLastPlayedWith :: Lens' Player (Maybe Played)
plaLastPlayedWith
= lens _plaLastPlayedWith
(\ s a -> s{_plaLastPlayedWith = a})
plaAvatarImageURL :: Lens' Player (Maybe Text)
plaAvatarImageURL
= lens _plaAvatarImageURL
(\ s a -> s{_plaAvatarImageURL = a})
plaKind :: Lens' Player Text
plaKind = lens _plaKind (\ s a -> s{_plaKind = a})
plaExperienceInfo :: Lens' Player (Maybe PlayerExperienceInfo)
plaExperienceInfo
= lens _plaExperienceInfo
(\ s a -> s{_plaExperienceInfo = a})
plaName :: Lens' Player (Maybe PlayerName)
plaName = lens _plaName (\ s a -> s{_plaName = a})
plaOriginalPlayerId :: Lens' Player (Maybe Text)
plaOriginalPlayerId
= lens _plaOriginalPlayerId
(\ s a -> s{_plaOriginalPlayerId = a})
plaDisplayName :: Lens' Player (Maybe Text)
plaDisplayName
= lens _plaDisplayName
(\ s a -> s{_plaDisplayName = a})
plaTitle :: Lens' Player (Maybe Text)
plaTitle = lens _plaTitle (\ s a -> s{_plaTitle = a})
plaBannerURLPortrait :: Lens' Player (Maybe Text)
plaBannerURLPortrait
= lens _plaBannerURLPortrait
(\ s a -> s{_plaBannerURLPortrait = a})
plaPlayerId :: Lens' Player (Maybe Text)
plaPlayerId
= lens _plaPlayerId (\ s a -> s{_plaPlayerId = a})
plaProFileSettings :: Lens' Player (Maybe ProFileSettings)
plaProFileSettings
= lens _plaProFileSettings
(\ s a -> s{_plaProFileSettings = a})
instance FromJSON Player where
parseJSON
= withObject "Player"
(\ o ->
Player' <$>
(o .:? "bannerUrlLandscape") <*>
(o .:? "lastPlayedWith")
<*> (o .:? "avatarImageUrl")
<*> (o .:? "kind" .!= "games#player")
<*> (o .:? "experienceInfo")
<*> (o .:? "name")
<*> (o .:? "originalPlayerId")
<*> (o .:? "displayName")
<*> (o .:? "title")
<*> (o .:? "bannerUrlPortrait")
<*> (o .:? "playerId")
<*> (o .:? "profileSettings"))
instance ToJSON Player where
toJSON Player'{..}
= object
(catMaybes
[("bannerUrlLandscape" .=) <$>
_plaBannerURLLandscape,
("lastPlayedWith" .=) <$> _plaLastPlayedWith,
("avatarImageUrl" .=) <$> _plaAvatarImageURL,
Just ("kind" .= _plaKind),
("experienceInfo" .=) <$> _plaExperienceInfo,
("name" .=) <$> _plaName,
("originalPlayerId" .=) <$> _plaOriginalPlayerId,
("displayName" .=) <$> _plaDisplayName,
("title" .=) <$> _plaTitle,
("bannerUrlPortrait" .=) <$> _plaBannerURLPortrait,
("playerId" .=) <$> _plaPlayerId,
("profileSettings" .=) <$> _plaProFileSettings])
data GamesAchievementIncrement =
GamesAchievementIncrement'
{ _gaiRequestId :: !(Maybe (Textual Int64))
, _gaiKind :: !Text
, _gaiSteps :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
gamesAchievementIncrement
:: GamesAchievementIncrement
gamesAchievementIncrement =
GamesAchievementIncrement'
{ _gaiRequestId = Nothing
, _gaiKind = "games#GamesAchievementIncrement"
, _gaiSteps = Nothing
}
gaiRequestId :: Lens' GamesAchievementIncrement (Maybe Int64)
gaiRequestId
= lens _gaiRequestId (\ s a -> s{_gaiRequestId = a})
. mapping _Coerce
gaiKind :: Lens' GamesAchievementIncrement Text
gaiKind = lens _gaiKind (\ s a -> s{_gaiKind = a})
gaiSteps :: Lens' GamesAchievementIncrement (Maybe Int32)
gaiSteps
= lens _gaiSteps (\ s a -> s{_gaiSteps = a}) .
mapping _Coerce
instance FromJSON GamesAchievementIncrement where
parseJSON
= withObject "GamesAchievementIncrement"
(\ o ->
GamesAchievementIncrement' <$>
(o .:? "requestId") <*>
(o .:? "kind" .!= "games#GamesAchievementIncrement")
<*> (o .:? "steps"))
instance ToJSON GamesAchievementIncrement where
toJSON GamesAchievementIncrement'{..}
= object
(catMaybes
[("requestId" .=) <$> _gaiRequestId,
Just ("kind" .= _gaiKind),
("steps" .=) <$> _gaiSteps])
data Quest =
Quest'
{ _queLastUpdatedTimestampMillis :: !(Maybe (Textual Int64))
, _queBannerURL :: !(Maybe Text)
, _queState :: !(Maybe Text)
, _queMilestones :: !(Maybe [QuestMilestone])
, _queKind :: !Text
, _queApplicationId :: !(Maybe Text)
, _queEndTimestampMillis :: !(Maybe (Textual Int64))
, _queName :: !(Maybe Text)
, _queId :: !(Maybe Text)
, _queIconURL :: !(Maybe Text)
, _queStartTimestampMillis :: !(Maybe (Textual Int64))
, _queNotifyTimestampMillis :: !(Maybe (Textual Int64))
, _queDescription :: !(Maybe Text)
, _queIsDefaultBannerURL :: !(Maybe Bool)
, _queIsDefaultIconURL :: !(Maybe Bool)
, _queAcceptedTimestampMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
quest
:: Quest
quest =
Quest'
{ _queLastUpdatedTimestampMillis = Nothing
, _queBannerURL = Nothing
, _queState = Nothing
, _queMilestones = Nothing
, _queKind = "games#quest"
, _queApplicationId = Nothing
, _queEndTimestampMillis = Nothing
, _queName = Nothing
, _queId = Nothing
, _queIconURL = Nothing
, _queStartTimestampMillis = Nothing
, _queNotifyTimestampMillis = Nothing
, _queDescription = Nothing
, _queIsDefaultBannerURL = Nothing
, _queIsDefaultIconURL = Nothing
, _queAcceptedTimestampMillis = Nothing
}
queLastUpdatedTimestampMillis :: Lens' Quest (Maybe Int64)
queLastUpdatedTimestampMillis
= lens _queLastUpdatedTimestampMillis
(\ s a -> s{_queLastUpdatedTimestampMillis = a})
. mapping _Coerce
queBannerURL :: Lens' Quest (Maybe Text)
queBannerURL
= lens _queBannerURL (\ s a -> s{_queBannerURL = a})
queState :: Lens' Quest (Maybe Text)
queState = lens _queState (\ s a -> s{_queState = a})
queMilestones :: Lens' Quest [QuestMilestone]
queMilestones
= lens _queMilestones
(\ s a -> s{_queMilestones = a})
. _Default
. _Coerce
queKind :: Lens' Quest Text
queKind = lens _queKind (\ s a -> s{_queKind = a})
queApplicationId :: Lens' Quest (Maybe Text)
queApplicationId
= lens _queApplicationId
(\ s a -> s{_queApplicationId = a})
queEndTimestampMillis :: Lens' Quest (Maybe Int64)
queEndTimestampMillis
= lens _queEndTimestampMillis
(\ s a -> s{_queEndTimestampMillis = a})
. mapping _Coerce
queName :: Lens' Quest (Maybe Text)
queName = lens _queName (\ s a -> s{_queName = a})
queId :: Lens' Quest (Maybe Text)
queId = lens _queId (\ s a -> s{_queId = a})
queIconURL :: Lens' Quest (Maybe Text)
queIconURL
= lens _queIconURL (\ s a -> s{_queIconURL = a})
queStartTimestampMillis :: Lens' Quest (Maybe Int64)
queStartTimestampMillis
= lens _queStartTimestampMillis
(\ s a -> s{_queStartTimestampMillis = a})
. mapping _Coerce
queNotifyTimestampMillis :: Lens' Quest (Maybe Int64)
queNotifyTimestampMillis
= lens _queNotifyTimestampMillis
(\ s a -> s{_queNotifyTimestampMillis = a})
. mapping _Coerce
queDescription :: Lens' Quest (Maybe Text)
queDescription
= lens _queDescription
(\ s a -> s{_queDescription = a})
queIsDefaultBannerURL :: Lens' Quest (Maybe Bool)
queIsDefaultBannerURL
= lens _queIsDefaultBannerURL
(\ s a -> s{_queIsDefaultBannerURL = a})
queIsDefaultIconURL :: Lens' Quest (Maybe Bool)
queIsDefaultIconURL
= lens _queIsDefaultIconURL
(\ s a -> s{_queIsDefaultIconURL = a})
queAcceptedTimestampMillis :: Lens' Quest (Maybe Int64)
queAcceptedTimestampMillis
= lens _queAcceptedTimestampMillis
(\ s a -> s{_queAcceptedTimestampMillis = a})
. mapping _Coerce
instance FromJSON Quest where
parseJSON
= withObject "Quest"
(\ o ->
Quest' <$>
(o .:? "lastUpdatedTimestampMillis") <*>
(o .:? "bannerUrl")
<*> (o .:? "state")
<*> (o .:? "milestones" .!= mempty)
<*> (o .:? "kind" .!= "games#quest")
<*> (o .:? "applicationId")
<*> (o .:? "endTimestampMillis")
<*> (o .:? "name")
<*> (o .:? "id")
<*> (o .:? "iconUrl")
<*> (o .:? "startTimestampMillis")
<*> (o .:? "notifyTimestampMillis")
<*> (o .:? "description")
<*> (o .:? "isDefaultBannerUrl")
<*> (o .:? "isDefaultIconUrl")
<*> (o .:? "acceptedTimestampMillis"))
instance ToJSON Quest where
toJSON Quest'{..}
= object
(catMaybes
[("lastUpdatedTimestampMillis" .=) <$>
_queLastUpdatedTimestampMillis,
("bannerUrl" .=) <$> _queBannerURL,
("state" .=) <$> _queState,
("milestones" .=) <$> _queMilestones,
Just ("kind" .= _queKind),
("applicationId" .=) <$> _queApplicationId,
("endTimestampMillis" .=) <$> _queEndTimestampMillis,
("name" .=) <$> _queName, ("id" .=) <$> _queId,
("iconUrl" .=) <$> _queIconURL,
("startTimestampMillis" .=) <$>
_queStartTimestampMillis,
("notifyTimestampMillis" .=) <$>
_queNotifyTimestampMillis,
("description" .=) <$> _queDescription,
("isDefaultBannerUrl" .=) <$> _queIsDefaultBannerURL,
("isDefaultIconUrl" .=) <$> _queIsDefaultIconURL,
("acceptedTimestampMillis" .=) <$>
_queAcceptedTimestampMillis])
data EventChild =
EventChild'
{ _ecKind :: !Text
, _ecChildId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
eventChild
:: EventChild
eventChild = EventChild' {_ecKind = "games#eventChild", _ecChildId = Nothing}
ecKind :: Lens' EventChild Text
ecKind = lens _ecKind (\ s a -> s{_ecKind = a})
ecChildId :: Lens' EventChild (Maybe Text)
ecChildId
= lens _ecChildId (\ s a -> s{_ecChildId = a})
instance FromJSON EventChild where
parseJSON
= withObject "EventChild"
(\ o ->
EventChild' <$>
(o .:? "kind" .!= "games#eventChild") <*>
(o .:? "childId"))
instance ToJSON EventChild where
toJSON EventChild'{..}
= object
(catMaybes
[Just ("kind" .= _ecKind),
("childId" .=) <$> _ecChildId])
data ApplicationVerifyResponse =
ApplicationVerifyResponse'
{ _avrKind :: !Text
, _avrAlternatePlayerId :: !(Maybe Text)
, _avrPlayerId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
applicationVerifyResponse
:: ApplicationVerifyResponse
applicationVerifyResponse =
ApplicationVerifyResponse'
{ _avrKind = "games#applicationVerifyResponse"
, _avrAlternatePlayerId = Nothing
, _avrPlayerId = Nothing
}
avrKind :: Lens' ApplicationVerifyResponse Text
avrKind = lens _avrKind (\ s a -> s{_avrKind = a})
avrAlternatePlayerId :: Lens' ApplicationVerifyResponse (Maybe Text)
avrAlternatePlayerId
= lens _avrAlternatePlayerId
(\ s a -> s{_avrAlternatePlayerId = a})
avrPlayerId :: Lens' ApplicationVerifyResponse (Maybe Text)
avrPlayerId
= lens _avrPlayerId (\ s a -> s{_avrPlayerId = a})
instance FromJSON ApplicationVerifyResponse where
parseJSON
= withObject "ApplicationVerifyResponse"
(\ o ->
ApplicationVerifyResponse' <$>
(o .:? "kind" .!= "games#applicationVerifyResponse")
<*> (o .:? "alternate_player_id")
<*> (o .:? "player_id"))
instance ToJSON ApplicationVerifyResponse where
toJSON ApplicationVerifyResponse'{..}
= object
(catMaybes
[Just ("kind" .= _avrKind),
("alternate_player_id" .=) <$> _avrAlternatePlayerId,
("player_id" .=) <$> _avrPlayerId])
data PlayerEventListResponse =
PlayerEventListResponse'
{ _pelrNextPageToken :: !(Maybe Text)
, _pelrKind :: !Text
, _pelrItems :: !(Maybe [PlayerEvent])
}
deriving (Eq, Show, Data, Typeable, Generic)
playerEventListResponse
:: PlayerEventListResponse
playerEventListResponse =
PlayerEventListResponse'
{ _pelrNextPageToken = Nothing
, _pelrKind = "games#playerEventListResponse"
, _pelrItems = Nothing
}
pelrNextPageToken :: Lens' PlayerEventListResponse (Maybe Text)
pelrNextPageToken
= lens _pelrNextPageToken
(\ s a -> s{_pelrNextPageToken = a})
pelrKind :: Lens' PlayerEventListResponse Text
pelrKind = lens _pelrKind (\ s a -> s{_pelrKind = a})
pelrItems :: Lens' PlayerEventListResponse [PlayerEvent]
pelrItems
= lens _pelrItems (\ s a -> s{_pelrItems = a}) .
_Default
. _Coerce
instance FromJSON PlayerEventListResponse where
parseJSON
= withObject "PlayerEventListResponse"
(\ o ->
PlayerEventListResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "games#playerEventListResponse")
<*> (o .:? "items" .!= mempty))
instance ToJSON PlayerEventListResponse where
toJSON PlayerEventListResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _pelrNextPageToken,
Just ("kind" .= _pelrKind),
("items" .=) <$> _pelrItems])
data TurnBasedMatchDataRequest =
TurnBasedMatchDataRequest'
{ _tbmdrKind :: !Text
, _tbmdrData :: !(Maybe Bytes)
}
deriving (Eq, Show, Data, Typeable, Generic)
turnBasedMatchDataRequest
:: TurnBasedMatchDataRequest
turnBasedMatchDataRequest =
TurnBasedMatchDataRequest'
{_tbmdrKind = "games#turnBasedMatchDataRequest", _tbmdrData = Nothing}
tbmdrKind :: Lens' TurnBasedMatchDataRequest Text
tbmdrKind
= lens _tbmdrKind (\ s a -> s{_tbmdrKind = a})
tbmdrData :: Lens' TurnBasedMatchDataRequest (Maybe ByteString)
tbmdrData
= lens _tbmdrData (\ s a -> s{_tbmdrData = a}) .
mapping _Bytes
instance FromJSON TurnBasedMatchDataRequest where
parseJSON
= withObject "TurnBasedMatchDataRequest"
(\ o ->
TurnBasedMatchDataRequest' <$>
(o .:? "kind" .!= "games#turnBasedMatchDataRequest")
<*> (o .:? "data"))
instance ToJSON TurnBasedMatchDataRequest where
toJSON TurnBasedMatchDataRequest'{..}
= object
(catMaybes
[Just ("kind" .= _tbmdrKind),
("data" .=) <$> _tbmdrData])
data ProFileSettings =
ProFileSettings'
{ _pfsProFileVisible :: !(Maybe Bool)
, _pfsKind :: !Text
}
deriving (Eq, Show, Data, Typeable, Generic)
proFileSettings
:: ProFileSettings
proFileSettings =
ProFileSettings'
{_pfsProFileVisible = Nothing, _pfsKind = "games#profileSettings"}
pfsProFileVisible :: Lens' ProFileSettings (Maybe Bool)
pfsProFileVisible
= lens _pfsProFileVisible
(\ s a -> s{_pfsProFileVisible = a})
pfsKind :: Lens' ProFileSettings Text
pfsKind = lens _pfsKind (\ s a -> s{_pfsKind = a})
instance FromJSON ProFileSettings where
parseJSON
= withObject "ProFileSettings"
(\ o ->
ProFileSettings' <$>
(o .:? "profileVisible") <*>
(o .:? "kind" .!= "games#profileSettings"))
instance ToJSON ProFileSettings where
toJSON ProFileSettings'{..}
= object
(catMaybes
[("profileVisible" .=) <$> _pfsProFileVisible,
Just ("kind" .= _pfsKind)])
data EventPeriodRange =
EventPeriodRange'
{ _eprKind :: !Text
, _eprPeriodStartMillis :: !(Maybe (Textual Int64))
, _eprPeriodEndMillis :: !(Maybe (Textual Int64))
}
deriving (Eq, Show, Data, Typeable, Generic)
eventPeriodRange
:: EventPeriodRange
eventPeriodRange =
EventPeriodRange'
{ _eprKind = "games#eventPeriodRange"
, _eprPeriodStartMillis = Nothing
, _eprPeriodEndMillis = Nothing
}
eprKind :: Lens' EventPeriodRange Text
eprKind = lens _eprKind (\ s a -> s{_eprKind = a})
eprPeriodStartMillis :: Lens' EventPeriodRange (Maybe Int64)
eprPeriodStartMillis
= lens _eprPeriodStartMillis
(\ s a -> s{_eprPeriodStartMillis = a})
. mapping _Coerce
eprPeriodEndMillis :: Lens' EventPeriodRange (Maybe Int64)
eprPeriodEndMillis
= lens _eprPeriodEndMillis
(\ s a -> s{_eprPeriodEndMillis = a})
. mapping _Coerce
instance FromJSON EventPeriodRange where
parseJSON
= withObject "EventPeriodRange"
(\ o ->
EventPeriodRange' <$>
(o .:? "kind" .!= "games#eventPeriodRange") <*>
(o .:? "periodStartMillis")
<*> (o .:? "periodEndMillis"))
instance ToJSON EventPeriodRange where
toJSON EventPeriodRange'{..}
= object
(catMaybes
[Just ("kind" .= _eprKind),
("periodStartMillis" .=) <$> _eprPeriodStartMillis,
("periodEndMillis" .=) <$> _eprPeriodEndMillis])
data EventRecordFailure =
EventRecordFailure'
{ _erfKind :: !Text
, _erfFailureCause :: !(Maybe Text)
, _erfEventId :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
eventRecordFailure
:: EventRecordFailure
eventRecordFailure =
EventRecordFailure'
{ _erfKind = "games#eventRecordFailure"
, _erfFailureCause = Nothing
, _erfEventId = Nothing
}
erfKind :: Lens' EventRecordFailure Text
erfKind = lens _erfKind (\ s a -> s{_erfKind = a})
erfFailureCause :: Lens' EventRecordFailure (Maybe Text)
erfFailureCause
= lens _erfFailureCause
(\ s a -> s{_erfFailureCause = a})
erfEventId :: Lens' EventRecordFailure (Maybe Text)
erfEventId
= lens _erfEventId (\ s a -> s{_erfEventId = a})
instance FromJSON EventRecordFailure where
parseJSON
= withObject "EventRecordFailure"
(\ o ->
EventRecordFailure' <$>
(o .:? "kind" .!= "games#eventRecordFailure") <*>
(o .:? "failureCause")
<*> (o .:? "eventId"))
instance ToJSON EventRecordFailure where
toJSON EventRecordFailure'{..}
= object
(catMaybes
[Just ("kind" .= _erfKind),
("failureCause" .=) <$> _erfFailureCause,
("eventId" .=) <$> _erfEventId])
data PlayerScoreSubmissionList =
PlayerScoreSubmissionList'
{ _psslKind :: !Text
, _psslScores :: !(Maybe [ScoreSubmission])
}
deriving (Eq, Show, Data, Typeable, Generic)
playerScoreSubmissionList
:: PlayerScoreSubmissionList
playerScoreSubmissionList =
PlayerScoreSubmissionList'
{_psslKind = "games#playerScoreSubmissionList", _psslScores = Nothing}
psslKind :: Lens' PlayerScoreSubmissionList Text
psslKind = lens _psslKind (\ s a -> s{_psslKind = a})
psslScores :: Lens' PlayerScoreSubmissionList [ScoreSubmission]
psslScores
= lens _psslScores (\ s a -> s{_psslScores = a}) .
_Default
. _Coerce
instance FromJSON PlayerScoreSubmissionList where
parseJSON
= withObject "PlayerScoreSubmissionList"
(\ o ->
PlayerScoreSubmissionList' <$>
(o .:? "kind" .!= "games#playerScoreSubmissionList")
<*> (o .:? "scores" .!= mempty))
instance ToJSON PlayerScoreSubmissionList where
toJSON PlayerScoreSubmissionList'{..}
= object
(catMaybes
[Just ("kind" .= _psslKind),
("scores" .=) <$> _psslScores])
data Instance =
Instance'
{ _iAndroidInstance :: !(Maybe InstanceAndroidDetails)
, _iKind :: !Text
, _iWebInstance :: !(Maybe InstanceWebDetails)
, _iIosInstance :: !(Maybe InstanceIosDetails)
, _iName :: !(Maybe Text)
, _iAcquisitionURI :: !(Maybe Text)
, _iPlatformType :: !(Maybe Text)
, _iTurnBasedPlay :: !(Maybe Bool)
, _iRealtimePlay :: !(Maybe Bool)
}
deriving (Eq, Show, Data, Typeable, Generic)
instance'
:: Instance
instance' =
Instance'
{ _iAndroidInstance = Nothing
, _iKind = "games#instance"
, _iWebInstance = Nothing
, _iIosInstance = Nothing
, _iName = Nothing
, _iAcquisitionURI = Nothing
, _iPlatformType = Nothing
, _iTurnBasedPlay = Nothing
, _iRealtimePlay = Nothing
}
iAndroidInstance :: Lens' Instance (Maybe InstanceAndroidDetails)
iAndroidInstance
= lens _iAndroidInstance
(\ s a -> s{_iAndroidInstance = a})
iKind :: Lens' Instance Text
iKind = lens _iKind (\ s a -> s{_iKind = a})
iWebInstance :: Lens' Instance (Maybe InstanceWebDetails)
iWebInstance
= lens _iWebInstance (\ s a -> s{_iWebInstance = a})
iIosInstance :: Lens' Instance (Maybe InstanceIosDetails)
iIosInstance
= lens _iIosInstance (\ s a -> s{_iIosInstance = a})
iName :: Lens' Instance (Maybe Text)
iName = lens _iName (\ s a -> s{_iName = a})
iAcquisitionURI :: Lens' Instance (Maybe Text)
iAcquisitionURI
= lens _iAcquisitionURI
(\ s a -> s{_iAcquisitionURI = a})
iPlatformType :: Lens' Instance (Maybe Text)
iPlatformType
= lens _iPlatformType
(\ s a -> s{_iPlatformType = a})
iTurnBasedPlay :: Lens' Instance (Maybe Bool)
iTurnBasedPlay
= lens _iTurnBasedPlay
(\ s a -> s{_iTurnBasedPlay = a})
iRealtimePlay :: Lens' Instance (Maybe Bool)
iRealtimePlay
= lens _iRealtimePlay
(\ s a -> s{_iRealtimePlay = a})
instance FromJSON Instance where
parseJSON
= withObject "Instance"
(\ o ->
Instance' <$>
(o .:? "androidInstance") <*>
(o .:? "kind" .!= "games#instance")
<*> (o .:? "webInstance")
<*> (o .:? "iosInstance")
<*> (o .:? "name")
<*> (o .:? "acquisitionUri")
<*> (o .:? "platformType")
<*> (o .:? "turnBasedPlay")
<*> (o .:? "realtimePlay"))
instance ToJSON Instance where
toJSON Instance'{..}
= object
(catMaybes
[("androidInstance" .=) <$> _iAndroidInstance,
Just ("kind" .= _iKind),
("webInstance" .=) <$> _iWebInstance,
("iosInstance" .=) <$> _iIosInstance,
("name" .=) <$> _iName,
("acquisitionUri" .=) <$> _iAcquisitionURI,
("platformType" .=) <$> _iPlatformType,
("turnBasedPlay" .=) <$> _iTurnBasedPlay,
("realtimePlay" .=) <$> _iRealtimePlay])