{-# 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.GamesManagement.Types.Product where
import Network.Google.GamesManagement.Types.Sum
import Network.Google.Prelude
data GamesPlayerExperienceInfoResource = GamesPlayerExperienceInfoResource'
{ _gpeirCurrentExperiencePoints :: !(Maybe (Textual Int64))
, _gpeirCurrentLevel :: !(Maybe GamesPlayerLevelResource)
, _gpeirNextLevel :: !(Maybe GamesPlayerLevelResource)
, _gpeirLastLevelUpTimestampMillis :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
gamesPlayerExperienceInfoResource
:: GamesPlayerExperienceInfoResource
gamesPlayerExperienceInfoResource =
GamesPlayerExperienceInfoResource'
{ _gpeirCurrentExperiencePoints = Nothing
, _gpeirCurrentLevel = Nothing
, _gpeirNextLevel = Nothing
, _gpeirLastLevelUpTimestampMillis = Nothing
}
gpeirCurrentExperiencePoints :: Lens' GamesPlayerExperienceInfoResource (Maybe Int64)
gpeirCurrentExperiencePoints
= lens _gpeirCurrentExperiencePoints
(\ s a -> s{_gpeirCurrentExperiencePoints = a})
. mapping _Coerce
gpeirCurrentLevel :: Lens' GamesPlayerExperienceInfoResource (Maybe GamesPlayerLevelResource)
gpeirCurrentLevel
= lens _gpeirCurrentLevel
(\ s a -> s{_gpeirCurrentLevel = a})
gpeirNextLevel :: Lens' GamesPlayerExperienceInfoResource (Maybe GamesPlayerLevelResource)
gpeirNextLevel
= lens _gpeirNextLevel
(\ s a -> s{_gpeirNextLevel = a})
gpeirLastLevelUpTimestampMillis :: Lens' GamesPlayerExperienceInfoResource (Maybe Int64)
gpeirLastLevelUpTimestampMillis
= lens _gpeirLastLevelUpTimestampMillis
(\ s a -> s{_gpeirLastLevelUpTimestampMillis = a})
. mapping _Coerce
instance FromJSON GamesPlayerExperienceInfoResource
where
parseJSON
= withObject "GamesPlayerExperienceInfoResource"
(\ o ->
GamesPlayerExperienceInfoResource' <$>
(o .:? "currentExperiencePoints") <*>
(o .:? "currentLevel")
<*> (o .:? "nextLevel")
<*> (o .:? "lastLevelUpTimestampMillis"))
instance ToJSON GamesPlayerExperienceInfoResource
where
toJSON GamesPlayerExperienceInfoResource'{..}
= object
(catMaybes
[("currentExperiencePoints" .=) <$>
_gpeirCurrentExperiencePoints,
("currentLevel" .=) <$> _gpeirCurrentLevel,
("nextLevel" .=) <$> _gpeirNextLevel,
("lastLevelUpTimestampMillis" .=) <$>
_gpeirLastLevelUpTimestampMillis])
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 PlayerScoreResetAllResponse = PlayerScoreResetAllResponse'
{ _psrarResults :: !(Maybe [PlayerScoreResetResponse])
, _psrarKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
playerScoreResetAllResponse
:: PlayerScoreResetAllResponse
playerScoreResetAllResponse =
PlayerScoreResetAllResponse'
{ _psrarResults = Nothing
, _psrarKind = "gamesManagement#playerScoreResetAllResponse"
}
psrarResults :: Lens' PlayerScoreResetAllResponse [PlayerScoreResetResponse]
psrarResults
= lens _psrarResults (\ s a -> s{_psrarResults = a})
. _Default
. _Coerce
psrarKind :: Lens' PlayerScoreResetAllResponse Text
psrarKind
= lens _psrarKind (\ s a -> s{_psrarKind = a})
instance FromJSON PlayerScoreResetAllResponse where
parseJSON
= withObject "PlayerScoreResetAllResponse"
(\ o ->
PlayerScoreResetAllResponse' <$>
(o .:? "results" .!= mempty) <*>
(o .:? "kind" .!=
"gamesManagement#playerScoreResetAllResponse"))
instance ToJSON PlayerScoreResetAllResponse where
toJSON PlayerScoreResetAllResponse'{..}
= object
(catMaybes
[("results" .=) <$> _psrarResults,
Just ("kind" .= _psrarKind)])
data GamesPlayedResource = GamesPlayedResource'
{ _gprAutoMatched :: !(Maybe Bool)
, _gprTimeMillis :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
gamesPlayedResource
:: GamesPlayedResource
gamesPlayedResource =
GamesPlayedResource'
{ _gprAutoMatched = Nothing
, _gprTimeMillis = Nothing
}
gprAutoMatched :: Lens' GamesPlayedResource (Maybe Bool)
gprAutoMatched
= lens _gprAutoMatched
(\ s a -> s{_gprAutoMatched = a})
gprTimeMillis :: Lens' GamesPlayedResource (Maybe Int64)
gprTimeMillis
= lens _gprTimeMillis
(\ s a -> s{_gprTimeMillis = a})
. mapping _Coerce
instance FromJSON GamesPlayedResource where
parseJSON
= withObject "GamesPlayedResource"
(\ o ->
GamesPlayedResource' <$>
(o .:? "autoMatched") <*> (o .:? "timeMillis"))
instance ToJSON GamesPlayedResource where
toJSON GamesPlayedResource'{..}
= object
(catMaybes
[("autoMatched" .=) <$> _gprAutoMatched,
("timeMillis" .=) <$> _gprTimeMillis])
data GamesPlayerLevelResource = GamesPlayerLevelResource'
{ _gplrMaxExperiencePoints :: !(Maybe (Textual Int64))
, _gplrMinExperiencePoints :: !(Maybe (Textual Int64))
, _gplrLevel :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
gamesPlayerLevelResource
:: GamesPlayerLevelResource
gamesPlayerLevelResource =
GamesPlayerLevelResource'
{ _gplrMaxExperiencePoints = Nothing
, _gplrMinExperiencePoints = Nothing
, _gplrLevel = Nothing
}
gplrMaxExperiencePoints :: Lens' GamesPlayerLevelResource (Maybe Int64)
gplrMaxExperiencePoints
= lens _gplrMaxExperiencePoints
(\ s a -> s{_gplrMaxExperiencePoints = a})
. mapping _Coerce
gplrMinExperiencePoints :: Lens' GamesPlayerLevelResource (Maybe Int64)
gplrMinExperiencePoints
= lens _gplrMinExperiencePoints
(\ s a -> s{_gplrMinExperiencePoints = a})
. mapping _Coerce
gplrLevel :: Lens' GamesPlayerLevelResource (Maybe Int32)
gplrLevel
= lens _gplrLevel (\ s a -> s{_gplrLevel = a}) .
mapping _Coerce
instance FromJSON GamesPlayerLevelResource where
parseJSON
= withObject "GamesPlayerLevelResource"
(\ o ->
GamesPlayerLevelResource' <$>
(o .:? "maxExperiencePoints") <*>
(o .:? "minExperiencePoints")
<*> (o .:? "level"))
instance ToJSON GamesPlayerLevelResource where
toJSON GamesPlayerLevelResource'{..}
= object
(catMaybes
[("maxExperiencePoints" .=) <$>
_gplrMaxExperiencePoints,
("minExperiencePoints" .=) <$>
_gplrMinExperiencePoints,
("level" .=) <$> _gplrLevel])
data PlayerScoreResetResponse = PlayerScoreResetResponse'
{ _psrrKind :: !Text
, _psrrResetScoreTimeSpans :: !(Maybe [Text])
, _psrrDefinitionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
playerScoreResetResponse
:: PlayerScoreResetResponse
playerScoreResetResponse =
PlayerScoreResetResponse'
{ _psrrKind = "gamesManagement#playerScoreResetResponse"
, _psrrResetScoreTimeSpans = Nothing
, _psrrDefinitionId = Nothing
}
psrrKind :: Lens' PlayerScoreResetResponse Text
psrrKind = lens _psrrKind (\ s a -> s{_psrrKind = a})
psrrResetScoreTimeSpans :: Lens' PlayerScoreResetResponse [Text]
psrrResetScoreTimeSpans
= lens _psrrResetScoreTimeSpans
(\ s a -> s{_psrrResetScoreTimeSpans = a})
. _Default
. _Coerce
psrrDefinitionId :: Lens' PlayerScoreResetResponse (Maybe Text)
psrrDefinitionId
= lens _psrrDefinitionId
(\ s a -> s{_psrrDefinitionId = a})
instance FromJSON PlayerScoreResetResponse where
parseJSON
= withObject "PlayerScoreResetResponse"
(\ o ->
PlayerScoreResetResponse' <$>
(o .:? "kind" .!=
"gamesManagement#playerScoreResetResponse")
<*> (o .:? "resetScoreTimeSpans" .!= mempty)
<*> (o .:? "definitionId"))
instance ToJSON PlayerScoreResetResponse where
toJSON PlayerScoreResetResponse'{..}
= object
(catMaybes
[Just ("kind" .= _psrrKind),
("resetScoreTimeSpans" .=) <$>
_psrrResetScoreTimeSpans,
("definitionId" .=) <$> _psrrDefinitionId])
data ScoresResetMultipleForAllRequest = ScoresResetMultipleForAllRequest'
{ _srmfarKind :: !Text
, _srmfarLeaderboardIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
scoresResetMultipleForAllRequest
:: ScoresResetMultipleForAllRequest
scoresResetMultipleForAllRequest =
ScoresResetMultipleForAllRequest'
{ _srmfarKind = "gamesManagement#scoresResetMultipleForAllRequest"
, _srmfarLeaderboardIds = Nothing
}
srmfarKind :: Lens' ScoresResetMultipleForAllRequest Text
srmfarKind
= lens _srmfarKind (\ s a -> s{_srmfarKind = a})
srmfarLeaderboardIds :: Lens' ScoresResetMultipleForAllRequest [Text]
srmfarLeaderboardIds
= lens _srmfarLeaderboardIds
(\ s a -> s{_srmfarLeaderboardIds = a})
. _Default
. _Coerce
instance FromJSON ScoresResetMultipleForAllRequest
where
parseJSON
= withObject "ScoresResetMultipleForAllRequest"
(\ o ->
ScoresResetMultipleForAllRequest' <$>
(o .:? "kind" .!=
"gamesManagement#scoresResetMultipleForAllRequest")
<*> (o .:? "leaderboard_ids" .!= mempty))
instance ToJSON ScoresResetMultipleForAllRequest
where
toJSON ScoresResetMultipleForAllRequest'{..}
= object
(catMaybes
[Just ("kind" .= _srmfarKind),
("leaderboard_ids" .=) <$> _srmfarLeaderboardIds])
data QuestsResetMultipleForAllRequest = QuestsResetMultipleForAllRequest'
{ _qrmfarKind :: !Text
, _qrmfarQuestIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
questsResetMultipleForAllRequest
:: QuestsResetMultipleForAllRequest
questsResetMultipleForAllRequest =
QuestsResetMultipleForAllRequest'
{ _qrmfarKind = "gamesManagement#questsResetMultipleForAllRequest"
, _qrmfarQuestIds = Nothing
}
qrmfarKind :: Lens' QuestsResetMultipleForAllRequest Text
qrmfarKind
= lens _qrmfarKind (\ s a -> s{_qrmfarKind = a})
qrmfarQuestIds :: Lens' QuestsResetMultipleForAllRequest [Text]
qrmfarQuestIds
= lens _qrmfarQuestIds
(\ s a -> s{_qrmfarQuestIds = a})
. _Default
. _Coerce
instance FromJSON QuestsResetMultipleForAllRequest
where
parseJSON
= withObject "QuestsResetMultipleForAllRequest"
(\ o ->
QuestsResetMultipleForAllRequest' <$>
(o .:? "kind" .!=
"gamesManagement#questsResetMultipleForAllRequest")
<*> (o .:? "quest_ids" .!= mempty))
instance ToJSON QuestsResetMultipleForAllRequest
where
toJSON QuestsResetMultipleForAllRequest'{..}
= object
(catMaybes
[Just ("kind" .= _qrmfarKind),
("quest_ids" .=) <$> _qrmfarQuestIds])
data HiddenPlayerList = HiddenPlayerList'
{ _hplNextPageToken :: !(Maybe Text)
, _hplKind :: !Text
, _hplItems :: !(Maybe [HiddenPlayer])
} deriving (Eq,Show,Data,Typeable,Generic)
hiddenPlayerList
:: HiddenPlayerList
hiddenPlayerList =
HiddenPlayerList'
{ _hplNextPageToken = Nothing
, _hplKind = "gamesManagement#hiddenPlayerList"
, _hplItems = Nothing
}
hplNextPageToken :: Lens' HiddenPlayerList (Maybe Text)
hplNextPageToken
= lens _hplNextPageToken
(\ s a -> s{_hplNextPageToken = a})
hplKind :: Lens' HiddenPlayerList Text
hplKind = lens _hplKind (\ s a -> s{_hplKind = a})
hplItems :: Lens' HiddenPlayerList [HiddenPlayer]
hplItems
= lens _hplItems (\ s a -> s{_hplItems = a}) .
_Default
. _Coerce
instance FromJSON HiddenPlayerList where
parseJSON
= withObject "HiddenPlayerList"
(\ o ->
HiddenPlayerList' <$>
(o .:? "nextPageToken") <*>
(o .:? "kind" .!= "gamesManagement#hiddenPlayerList")
<*> (o .:? "items" .!= mempty))
instance ToJSON HiddenPlayerList where
toJSON HiddenPlayerList'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _hplNextPageToken,
Just ("kind" .= _hplKind),
("items" .=) <$> _hplItems])
data EventsResetMultipleForAllRequest = EventsResetMultipleForAllRequest'
{ _ermfarKind :: !Text
, _ermfarEventIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
eventsResetMultipleForAllRequest
:: EventsResetMultipleForAllRequest
eventsResetMultipleForAllRequest =
EventsResetMultipleForAllRequest'
{ _ermfarKind = "gamesManagement#eventsResetMultipleForAllRequest"
, _ermfarEventIds = Nothing
}
ermfarKind :: Lens' EventsResetMultipleForAllRequest Text
ermfarKind
= lens _ermfarKind (\ s a -> s{_ermfarKind = a})
ermfarEventIds :: Lens' EventsResetMultipleForAllRequest [Text]
ermfarEventIds
= lens _ermfarEventIds
(\ s a -> s{_ermfarEventIds = a})
. _Default
. _Coerce
instance FromJSON EventsResetMultipleForAllRequest
where
parseJSON
= withObject "EventsResetMultipleForAllRequest"
(\ o ->
EventsResetMultipleForAllRequest' <$>
(o .:? "kind" .!=
"gamesManagement#eventsResetMultipleForAllRequest")
<*> (o .:? "event_ids" .!= mempty))
instance ToJSON EventsResetMultipleForAllRequest
where
toJSON EventsResetMultipleForAllRequest'{..}
= object
(catMaybes
[Just ("kind" .= _ermfarKind),
("event_ids" .=) <$> _ermfarEventIds])
data AchievementResetMultipleForAllRequest = AchievementResetMultipleForAllRequest'
{ _armfarKind :: !Text
, _armfarAchievementIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
achievementResetMultipleForAllRequest
:: AchievementResetMultipleForAllRequest
achievementResetMultipleForAllRequest =
AchievementResetMultipleForAllRequest'
{ _armfarKind = "gamesManagement#achievementResetMultipleForAllRequest"
, _armfarAchievementIds = Nothing
}
armfarKind :: Lens' AchievementResetMultipleForAllRequest Text
armfarKind
= lens _armfarKind (\ s a -> s{_armfarKind = a})
armfarAchievementIds :: Lens' AchievementResetMultipleForAllRequest [Text]
armfarAchievementIds
= lens _armfarAchievementIds
(\ s a -> s{_armfarAchievementIds = a})
. _Default
. _Coerce
instance FromJSON
AchievementResetMultipleForAllRequest where
parseJSON
= withObject "AchievementResetMultipleForAllRequest"
(\ o ->
AchievementResetMultipleForAllRequest' <$>
(o .:? "kind" .!=
"gamesManagement#achievementResetMultipleForAllRequest")
<*> (o .:? "achievement_ids" .!= mempty))
instance ToJSON AchievementResetMultipleForAllRequest
where
toJSON AchievementResetMultipleForAllRequest'{..}
= object
(catMaybes
[Just ("kind" .= _armfarKind),
("achievement_ids" .=) <$> _armfarAchievementIds])
data HiddenPlayer = HiddenPlayer'
{ _hpKind :: !Text
, _hpHiddenTimeMillis :: !(Maybe (Textual Int64))
, _hpPlayer :: !(Maybe Player)
} deriving (Eq,Show,Data,Typeable,Generic)
hiddenPlayer
:: HiddenPlayer
hiddenPlayer =
HiddenPlayer'
{ _hpKind = "gamesManagement#hiddenPlayer"
, _hpHiddenTimeMillis = Nothing
, _hpPlayer = Nothing
}
hpKind :: Lens' HiddenPlayer Text
hpKind = lens _hpKind (\ s a -> s{_hpKind = a})
hpHiddenTimeMillis :: Lens' HiddenPlayer (Maybe Int64)
hpHiddenTimeMillis
= lens _hpHiddenTimeMillis
(\ s a -> s{_hpHiddenTimeMillis = a})
. mapping _Coerce
hpPlayer :: Lens' HiddenPlayer (Maybe Player)
hpPlayer = lens _hpPlayer (\ s a -> s{_hpPlayer = a})
instance FromJSON HiddenPlayer where
parseJSON
= withObject "HiddenPlayer"
(\ o ->
HiddenPlayer' <$>
(o .:? "kind" .!= "gamesManagement#hiddenPlayer") <*>
(o .:? "hiddenTimeMillis")
<*> (o .:? "player"))
instance ToJSON HiddenPlayer where
toJSON HiddenPlayer'{..}
= object
(catMaybes
[Just ("kind" .= _hpKind),
("hiddenTimeMillis" .=) <$> _hpHiddenTimeMillis,
("player" .=) <$> _hpPlayer])
data AchievementResetAllResponse = AchievementResetAllResponse'
{ _ararResults :: !(Maybe [AchievementResetResponse])
, _ararKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
achievementResetAllResponse
:: AchievementResetAllResponse
achievementResetAllResponse =
AchievementResetAllResponse'
{ _ararResults = Nothing
, _ararKind = "gamesManagement#achievementResetAllResponse"
}
ararResults :: Lens' AchievementResetAllResponse [AchievementResetResponse]
ararResults
= lens _ararResults (\ s a -> s{_ararResults = a}) .
_Default
. _Coerce
ararKind :: Lens' AchievementResetAllResponse Text
ararKind = lens _ararKind (\ s a -> s{_ararKind = a})
instance FromJSON AchievementResetAllResponse where
parseJSON
= withObject "AchievementResetAllResponse"
(\ o ->
AchievementResetAllResponse' <$>
(o .:? "results" .!= mempty) <*>
(o .:? "kind" .!=
"gamesManagement#achievementResetAllResponse"))
instance ToJSON AchievementResetAllResponse where
toJSON AchievementResetAllResponse'{..}
= object
(catMaybes
[("results" .=) <$> _ararResults,
Just ("kind" .= _ararKind)])
data Player = Player'
{ _pBannerURLLandscape :: !(Maybe Text)
, _pLastPlayedWith :: !(Maybe GamesPlayedResource)
, _pAvatarImageURL :: !(Maybe Text)
, _pKind :: !Text
, _pExperienceInfo :: !(Maybe GamesPlayerExperienceInfoResource)
, _pName :: !(Maybe PlayerName)
, _pOriginalPlayerId :: !(Maybe Text)
, _pDisplayName :: !(Maybe Text)
, _pTitle :: !(Maybe Text)
, _pBannerURLPortrait :: !(Maybe Text)
, _pPlayerId :: !(Maybe Text)
, _pProFileSettings :: !(Maybe ProFileSettings)
} deriving (Eq,Show,Data,Typeable,Generic)
player
:: Player
player =
Player'
{ _pBannerURLLandscape = Nothing
, _pLastPlayedWith = Nothing
, _pAvatarImageURL = Nothing
, _pKind = "gamesManagement#player"
, _pExperienceInfo = Nothing
, _pName = Nothing
, _pOriginalPlayerId = Nothing
, _pDisplayName = Nothing
, _pTitle = Nothing
, _pBannerURLPortrait = Nothing
, _pPlayerId = Nothing
, _pProFileSettings = Nothing
}
pBannerURLLandscape :: Lens' Player (Maybe Text)
pBannerURLLandscape
= lens _pBannerURLLandscape
(\ s a -> s{_pBannerURLLandscape = a})
pLastPlayedWith :: Lens' Player (Maybe GamesPlayedResource)
pLastPlayedWith
= lens _pLastPlayedWith
(\ s a -> s{_pLastPlayedWith = a})
pAvatarImageURL :: Lens' Player (Maybe Text)
pAvatarImageURL
= lens _pAvatarImageURL
(\ s a -> s{_pAvatarImageURL = a})
pKind :: Lens' Player Text
pKind = lens _pKind (\ s a -> s{_pKind = a})
pExperienceInfo :: Lens' Player (Maybe GamesPlayerExperienceInfoResource)
pExperienceInfo
= lens _pExperienceInfo
(\ s a -> s{_pExperienceInfo = a})
pName :: Lens' Player (Maybe PlayerName)
pName = lens _pName (\ s a -> s{_pName = a})
pOriginalPlayerId :: Lens' Player (Maybe Text)
pOriginalPlayerId
= lens _pOriginalPlayerId
(\ s a -> s{_pOriginalPlayerId = a})
pDisplayName :: Lens' Player (Maybe Text)
pDisplayName
= lens _pDisplayName (\ s a -> s{_pDisplayName = a})
pTitle :: Lens' Player (Maybe Text)
pTitle = lens _pTitle (\ s a -> s{_pTitle = a})
pBannerURLPortrait :: Lens' Player (Maybe Text)
pBannerURLPortrait
= lens _pBannerURLPortrait
(\ s a -> s{_pBannerURLPortrait = a})
pPlayerId :: Lens' Player (Maybe Text)
pPlayerId
= lens _pPlayerId (\ s a -> s{_pPlayerId = a})
pProFileSettings :: Lens' Player (Maybe ProFileSettings)
pProFileSettings
= lens _pProFileSettings
(\ s a -> s{_pProFileSettings = a})
instance FromJSON Player where
parseJSON
= withObject "Player"
(\ o ->
Player' <$>
(o .:? "bannerUrlLandscape") <*>
(o .:? "lastPlayedWith")
<*> (o .:? "avatarImageUrl")
<*> (o .:? "kind" .!= "gamesManagement#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" .=) <$> _pBannerURLLandscape,
("lastPlayedWith" .=) <$> _pLastPlayedWith,
("avatarImageUrl" .=) <$> _pAvatarImageURL,
Just ("kind" .= _pKind),
("experienceInfo" .=) <$> _pExperienceInfo,
("name" .=) <$> _pName,
("originalPlayerId" .=) <$> _pOriginalPlayerId,
("displayName" .=) <$> _pDisplayName,
("title" .=) <$> _pTitle,
("bannerUrlPortrait" .=) <$> _pBannerURLPortrait,
("playerId" .=) <$> _pPlayerId,
("profileSettings" .=) <$> _pProFileSettings])
data ProFileSettings = ProFileSettings'
{ _pfsProFileVisible :: !(Maybe Bool)
, _pfsKind :: !Text
} deriving (Eq,Show,Data,Typeable,Generic)
proFileSettings
:: ProFileSettings
proFileSettings =
ProFileSettings'
{ _pfsProFileVisible = Nothing
, _pfsKind = "gamesManagement#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" .!= "gamesManagement#profileSettings"))
instance ToJSON ProFileSettings where
toJSON ProFileSettings'{..}
= object
(catMaybes
[("profileVisible" .=) <$> _pfsProFileVisible,
Just ("kind" .= _pfsKind)])
data AchievementResetResponse = AchievementResetResponse'
{ _arrUpdateOccurred :: !(Maybe Bool)
, _arrKind :: !Text
, _arrCurrentState :: !(Maybe Text)
, _arrDefinitionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
achievementResetResponse
:: AchievementResetResponse
achievementResetResponse =
AchievementResetResponse'
{ _arrUpdateOccurred = Nothing
, _arrKind = "gamesManagement#achievementResetResponse"
, _arrCurrentState = Nothing
, _arrDefinitionId = Nothing
}
arrUpdateOccurred :: Lens' AchievementResetResponse (Maybe Bool)
arrUpdateOccurred
= lens _arrUpdateOccurred
(\ s a -> s{_arrUpdateOccurred = a})
arrKind :: Lens' AchievementResetResponse Text
arrKind = lens _arrKind (\ s a -> s{_arrKind = a})
arrCurrentState :: Lens' AchievementResetResponse (Maybe Text)
arrCurrentState
= lens _arrCurrentState
(\ s a -> s{_arrCurrentState = a})
arrDefinitionId :: Lens' AchievementResetResponse (Maybe Text)
arrDefinitionId
= lens _arrDefinitionId
(\ s a -> s{_arrDefinitionId = a})
instance FromJSON AchievementResetResponse where
parseJSON
= withObject "AchievementResetResponse"
(\ o ->
AchievementResetResponse' <$>
(o .:? "updateOccurred") <*>
(o .:? "kind" .!=
"gamesManagement#achievementResetResponse")
<*> (o .:? "currentState")
<*> (o .:? "definitionId"))
instance ToJSON AchievementResetResponse where
toJSON AchievementResetResponse'{..}
= object
(catMaybes
[("updateOccurred" .=) <$> _arrUpdateOccurred,
Just ("kind" .= _arrKind),
("currentState" .=) <$> _arrCurrentState,
("definitionId" .=) <$> _arrDefinitionId])