{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.GameLift.Types.GameSession
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.GameSession where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.GameProperty
import Amazonka.GameLift.Types.GameSessionStatus
import Amazonka.GameLift.Types.GameSessionStatusReason
import Amazonka.GameLift.Types.PlayerSessionCreationPolicy
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Properties describing a game session.
--
-- A game session in ACTIVE status can host players. When a game session
-- ends, its status is set to @TERMINATED@.
--
-- Once the session ends, the game session object is retained for 30 days.
-- This means you can reuse idempotency token values after this time. Game
-- session logs are retained for 14 days.
--
-- __Related actions__
--
-- CreateGameSession | DescribeGameSessions | DescribeGameSessionDetails |
-- SearchGameSessions | UpdateGameSession | GetGameSessionLogUrl |
-- StartGameSessionPlacement | DescribeGameSessionPlacement |
-- StopGameSessionPlacement |
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets All APIs by task>
--
-- /See:/ 'newGameSession' smart constructor.
data GameSession = GameSession'
  { -- | A time stamp indicating when this data object was created. Format is a
    -- number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    GameSession -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | Current status of the game session. A game session must have an @ACTIVE@
    -- status to have player sessions.
    GameSession -> Maybe GameSessionStatus
status :: Prelude.Maybe GameSessionStatus,
    -- | A set of custom properties for a game session, formatted as key:value
    -- pairs. These properties are passed to a game server process in the
    -- GameSession object with a request to start a new game session. You can
    -- search for active game sessions based on this custom data with
    -- SearchGameSessions.
    GameSession -> Maybe [GameProperty]
gameProperties :: Prelude.Maybe [GameProperty],
    -- | The IP address of the game session. To connect to a GameLift game
    -- server, an app needs both the IP address and port number.
    GameSession -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | The fleet location where the game session is running. This value might
    -- specify the fleet\'s home Region or a remote location. Location is
    -- expressed as an AWS Region code such as @us-west-2@.
    GameSession -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the game session. A game session ARN has the
    -- following format:
    -- @arn:aws:gamelift:\<region>::gamesession\/\<fleet ID>\/\<custom ID string or idempotency token>@.
    GameSession -> Maybe Text
gameSessionId :: Prelude.Maybe Prelude.Text,
    -- | Information about the matchmaking process that was used to create the
    -- game session. It is in JSON syntax, formatted as a string. In addition
    -- the matchmaking configuration used, it contains data on all players
    -- assigned to the match, including player attributes and team assignments.
    -- For more details on matchmaker data, see
    -- <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data Match Data>.
    -- Matchmaker data is useful when requesting match backfills, and is
    -- updated whenever new players are added during a successful backfill (see
    -- StartMatchBackfill).
    GameSession -> Maybe Text
matchmakerData :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name
    -- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
    -- associated with the GameLift fleet that this game session is running on.
    GameSession -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of players that can be connected simultaneously to
    -- the game session.
    GameSession -> Maybe Natural
maximumPlayerSessionCount :: Prelude.Maybe Prelude.Natural,
    -- | A time stamp indicating when this data object was terminated. Format is
    -- a number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    GameSession -> Maybe POSIX
terminationTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates whether or not the game session is accepting new players.
    GameSession -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy :: Prelude.Maybe PlayerSessionCreationPolicy,
    -- | A descriptive label that is associated with a game session. Session
    -- names do not need to be unique.
    GameSession -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Number of players currently in the game session.
    GameSession -> Maybe Natural
currentPlayerSessionCount :: Prelude.Maybe Prelude.Natural,
    -- | Provides additional information about game session status. @INTERRUPTED@
    -- indicates that the game session was hosted on a spot instance that was
    -- reclaimed, causing the active game session to be terminated.
    GameSession -> Maybe GameSessionStatusReason
statusReason :: Prelude.Maybe GameSessionStatusReason,
    -- | A set of custom game session properties, formatted as a single string
    -- value. This data is passed to a game server process in the GameSession
    -- object with a request to start a new game session.
    GameSession -> Maybe Text
gameSessionData :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for the fleet that the game session is running on.
    GameSession -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
    -- | The DNS identifier assigned to the instance that is running the game
    -- session. Values have the following format:
    --
    -- -   TLS-enabled fleets:
    --     @\<unique identifier>.\<region identifier>.amazongamelift.com@.
    --
    -- -   Non-TLS-enabled fleets:
    --     @ec2-\<unique identifier>.compute.amazonaws.com@. (See
    --     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses Amazon EC2 Instance IP Addressing>.)
    --
    -- When connecting to a game session that is running on a TLS-enabled
    -- fleet, you must use the DNS name, not the IP address.
    GameSession -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
    -- | A unique identifier for a player. This ID is used to enforce a resource
    -- protection policy (if one exists), that limits the number of game
    -- sessions a player can create.
    GameSession -> Maybe Text
creatorId :: Prelude.Maybe Prelude.Text,
    -- | The port number for the game session. To connect to a GameLift game
    -- server, an app needs both the IP address and port number.
    GameSession -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
  }
  deriving (GameSession -> GameSession -> Bool
(GameSession -> GameSession -> Bool)
-> (GameSession -> GameSession -> Bool) -> Eq GameSession
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameSession -> GameSession -> Bool
$c/= :: GameSession -> GameSession -> Bool
== :: GameSession -> GameSession -> Bool
$c== :: GameSession -> GameSession -> Bool
Prelude.Eq, ReadPrec [GameSession]
ReadPrec GameSession
Int -> ReadS GameSession
ReadS [GameSession]
(Int -> ReadS GameSession)
-> ReadS [GameSession]
-> ReadPrec GameSession
-> ReadPrec [GameSession]
-> Read GameSession
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameSession]
$creadListPrec :: ReadPrec [GameSession]
readPrec :: ReadPrec GameSession
$creadPrec :: ReadPrec GameSession
readList :: ReadS [GameSession]
$creadList :: ReadS [GameSession]
readsPrec :: Int -> ReadS GameSession
$creadsPrec :: Int -> ReadS GameSession
Prelude.Read, Int -> GameSession -> ShowS
[GameSession] -> ShowS
GameSession -> String
(Int -> GameSession -> ShowS)
-> (GameSession -> String)
-> ([GameSession] -> ShowS)
-> Show GameSession
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameSession] -> ShowS
$cshowList :: [GameSession] -> ShowS
show :: GameSession -> String
$cshow :: GameSession -> String
showsPrec :: Int -> GameSession -> ShowS
$cshowsPrec :: Int -> GameSession -> ShowS
Prelude.Show, (forall x. GameSession -> Rep GameSession x)
-> (forall x. Rep GameSession x -> GameSession)
-> Generic GameSession
forall x. Rep GameSession x -> GameSession
forall x. GameSession -> Rep GameSession x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameSession x -> GameSession
$cfrom :: forall x. GameSession -> Rep GameSession x
Prelude.Generic)

-- |
-- Create a value of 'GameSession' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'creationTime', 'gameSession_creationTime' - A time stamp indicating when this data object was created. Format is a
-- number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'status', 'gameSession_status' - Current status of the game session. A game session must have an @ACTIVE@
-- status to have player sessions.
--
-- 'gameProperties', 'gameSession_gameProperties' - A set of custom properties for a game session, formatted as key:value
-- pairs. These properties are passed to a game server process in the
-- GameSession object with a request to start a new game session. You can
-- search for active game sessions based on this custom data with
-- SearchGameSessions.
--
-- 'ipAddress', 'gameSession_ipAddress' - The IP address of the game session. To connect to a GameLift game
-- server, an app needs both the IP address and port number.
--
-- 'location', 'gameSession_location' - The fleet location where the game session is running. This value might
-- specify the fleet\'s home Region or a remote location. Location is
-- expressed as an AWS Region code such as @us-west-2@.
--
-- 'gameSessionId', 'gameSession_gameSessionId' - A unique identifier for the game session. A game session ARN has the
-- following format:
-- @arn:aws:gamelift:\<region>::gamesession\/\<fleet ID>\/\<custom ID string or idempotency token>@.
--
-- 'matchmakerData', 'gameSession_matchmakerData' - Information about the matchmaking process that was used to create the
-- game session. It is in JSON syntax, formatted as a string. In addition
-- the matchmaking configuration used, it contains data on all players
-- assigned to the match, including player attributes and team assignments.
-- For more details on matchmaker data, see
-- <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data Match Data>.
-- Matchmaker data is useful when requesting match backfills, and is
-- updated whenever new players are added during a successful backfill (see
-- StartMatchBackfill).
--
-- 'fleetArn', 'gameSession_fleetArn' - The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- associated with the GameLift fleet that this game session is running on.
--
-- 'maximumPlayerSessionCount', 'gameSession_maximumPlayerSessionCount' - The maximum number of players that can be connected simultaneously to
-- the game session.
--
-- 'terminationTime', 'gameSession_terminationTime' - A time stamp indicating when this data object was terminated. Format is
-- a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'playerSessionCreationPolicy', 'gameSession_playerSessionCreationPolicy' - Indicates whether or not the game session is accepting new players.
--
-- 'name', 'gameSession_name' - A descriptive label that is associated with a game session. Session
-- names do not need to be unique.
--
-- 'currentPlayerSessionCount', 'gameSession_currentPlayerSessionCount' - Number of players currently in the game session.
--
-- 'statusReason', 'gameSession_statusReason' - Provides additional information about game session status. @INTERRUPTED@
-- indicates that the game session was hosted on a spot instance that was
-- reclaimed, causing the active game session to be terminated.
--
-- 'gameSessionData', 'gameSession_gameSessionData' - A set of custom game session properties, formatted as a single string
-- value. This data is passed to a game server process in the GameSession
-- object with a request to start a new game session.
--
-- 'fleetId', 'gameSession_fleetId' - A unique identifier for the fleet that the game session is running on.
--
-- 'dnsName', 'gameSession_dnsName' - The DNS identifier assigned to the instance that is running the game
-- session. Values have the following format:
--
-- -   TLS-enabled fleets:
--     @\<unique identifier>.\<region identifier>.amazongamelift.com@.
--
-- -   Non-TLS-enabled fleets:
--     @ec2-\<unique identifier>.compute.amazonaws.com@. (See
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses Amazon EC2 Instance IP Addressing>.)
--
-- When connecting to a game session that is running on a TLS-enabled
-- fleet, you must use the DNS name, not the IP address.
--
-- 'creatorId', 'gameSession_creatorId' - A unique identifier for a player. This ID is used to enforce a resource
-- protection policy (if one exists), that limits the number of game
-- sessions a player can create.
--
-- 'port', 'gameSession_port' - The port number for the game session. To connect to a GameLift game
-- server, an app needs both the IP address and port number.
newGameSession ::
  GameSession
newGameSession :: GameSession
newGameSession =
  GameSession' :: Maybe POSIX
-> Maybe GameSessionStatus
-> Maybe [GameProperty]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe PlayerSessionCreationPolicy
-> Maybe Text
-> Maybe Natural
-> Maybe GameSessionStatusReason
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSession
GameSession'
    { $sel:creationTime:GameSession' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:GameSession' :: Maybe GameSessionStatus
status = Maybe GameSessionStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:gameProperties:GameSession' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:GameSession' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:GameSession' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionId:GameSession' :: Maybe Text
gameSessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:matchmakerData:GameSession' :: Maybe Text
matchmakerData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetArn:GameSession' :: Maybe Text
fleetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumPlayerSessionCount:GameSession' :: Maybe Natural
maximumPlayerSessionCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:terminationTime:GameSession' :: Maybe POSIX
terminationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:playerSessionCreationPolicy:GameSession' :: Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy = Maybe PlayerSessionCreationPolicy
forall a. Maybe a
Prelude.Nothing,
      $sel:name:GameSession' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currentPlayerSessionCount:GameSession' :: Maybe Natural
currentPlayerSessionCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:statusReason:GameSession' :: Maybe GameSessionStatusReason
statusReason = Maybe GameSessionStatusReason
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionData:GameSession' :: Maybe Text
gameSessionData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:fleetId:GameSession' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dnsName:GameSession' :: Maybe Text
dnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorId:GameSession' :: Maybe Text
creatorId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:port:GameSession' :: Maybe Natural
port = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | A time stamp indicating when this data object was created. Format is a
-- number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
gameSession_creationTime :: Lens.Lens' GameSession (Prelude.Maybe Prelude.UTCTime)
gameSession_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSession -> f GameSession
gameSession_creationTime = (GameSession -> Maybe POSIX)
-> (GameSession -> Maybe POSIX -> GameSession)
-> Lens GameSession GameSession (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:GameSession' :: GameSession -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: GameSession
s@GameSession' {} Maybe POSIX
a -> GameSession
s {$sel:creationTime:GameSession' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: GameSession) ((Maybe POSIX -> f (Maybe POSIX)) -> GameSession -> f GameSession)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSession
-> f GameSession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Current status of the game session. A game session must have an @ACTIVE@
-- status to have player sessions.
gameSession_status :: Lens.Lens' GameSession (Prelude.Maybe GameSessionStatus)
gameSession_status :: (Maybe GameSessionStatus -> f (Maybe GameSessionStatus))
-> GameSession -> f GameSession
gameSession_status = (GameSession -> Maybe GameSessionStatus)
-> (GameSession -> Maybe GameSessionStatus -> GameSession)
-> Lens
     GameSession
     GameSession
     (Maybe GameSessionStatus)
     (Maybe GameSessionStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe GameSessionStatus
status :: Maybe GameSessionStatus
$sel:status:GameSession' :: GameSession -> Maybe GameSessionStatus
status} -> Maybe GameSessionStatus
status) (\s :: GameSession
s@GameSession' {} Maybe GameSessionStatus
a -> GameSession
s {$sel:status:GameSession' :: Maybe GameSessionStatus
status = Maybe GameSessionStatus
a} :: GameSession)

-- | A set of custom properties for a game session, formatted as key:value
-- pairs. These properties are passed to a game server process in the
-- GameSession object with a request to start a new game session. You can
-- search for active game sessions based on this custom data with
-- SearchGameSessions.
gameSession_gameProperties :: Lens.Lens' GameSession (Prelude.Maybe [GameProperty])
gameSession_gameProperties :: (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> GameSession -> f GameSession
gameSession_gameProperties = (GameSession -> Maybe [GameProperty])
-> (GameSession -> Maybe [GameProperty] -> GameSession)
-> Lens
     GameSession
     GameSession
     (Maybe [GameProperty])
     (Maybe [GameProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe [GameProperty]
gameProperties :: Maybe [GameProperty]
$sel:gameProperties:GameSession' :: GameSession -> Maybe [GameProperty]
gameProperties} -> Maybe [GameProperty]
gameProperties) (\s :: GameSession
s@GameSession' {} Maybe [GameProperty]
a -> GameSession
s {$sel:gameProperties:GameSession' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
a} :: GameSession) ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
 -> GameSession -> f GameSession)
-> ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
    -> Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> GameSession
-> f GameSession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [GameProperty] [GameProperty] [GameProperty] [GameProperty]
-> Iso
     (Maybe [GameProperty])
     (Maybe [GameProperty])
     (Maybe [GameProperty])
     (Maybe [GameProperty])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [GameProperty] [GameProperty] [GameProperty] [GameProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The IP address of the game session. To connect to a GameLift game
-- server, an app needs both the IP address and port number.
gameSession_ipAddress :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_ipAddress :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_ipAddress = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:GameSession' :: GameSession -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:ipAddress:GameSession' :: Maybe Text
ipAddress = Maybe Text
a} :: GameSession)

-- | The fleet location where the game session is running. This value might
-- specify the fleet\'s home Region or a remote location. Location is
-- expressed as an AWS Region code such as @us-west-2@.
gameSession_location :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_location :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_location = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
location :: Maybe Text
$sel:location:GameSession' :: GameSession -> Maybe Text
location} -> Maybe Text
location) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:location:GameSession' :: Maybe Text
location = Maybe Text
a} :: GameSession)

-- | A unique identifier for the game session. A game session ARN has the
-- following format:
-- @arn:aws:gamelift:\<region>::gamesession\/\<fleet ID>\/\<custom ID string or idempotency token>@.
gameSession_gameSessionId :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_gameSessionId :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_gameSessionId = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
gameSessionId :: Maybe Text
$sel:gameSessionId:GameSession' :: GameSession -> Maybe Text
gameSessionId} -> Maybe Text
gameSessionId) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:gameSessionId:GameSession' :: Maybe Text
gameSessionId = Maybe Text
a} :: GameSession)

-- | Information about the matchmaking process that was used to create the
-- game session. It is in JSON syntax, formatted as a string. In addition
-- the matchmaking configuration used, it contains data on all players
-- assigned to the match, including player attributes and team assignments.
-- For more details on matchmaker data, see
-- <https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-server.html#match-server-data Match Data>.
-- Matchmaker data is useful when requesting match backfills, and is
-- updated whenever new players are added during a successful backfill (see
-- StartMatchBackfill).
gameSession_matchmakerData :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_matchmakerData :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_matchmakerData = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
matchmakerData :: Maybe Text
$sel:matchmakerData:GameSession' :: GameSession -> Maybe Text
matchmakerData} -> Maybe Text
matchmakerData) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:matchmakerData:GameSession' :: Maybe Text
matchmakerData = Maybe Text
a} :: GameSession)

-- | The Amazon Resource Name
-- (<https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html ARN>)
-- associated with the GameLift fleet that this game session is running on.
gameSession_fleetArn :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_fleetArn :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_fleetArn = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:GameSession' :: GameSession -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:fleetArn:GameSession' :: Maybe Text
fleetArn = Maybe Text
a} :: GameSession)

-- | The maximum number of players that can be connected simultaneously to
-- the game session.
gameSession_maximumPlayerSessionCount :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Natural)
gameSession_maximumPlayerSessionCount :: (Maybe Natural -> f (Maybe Natural))
-> GameSession -> f GameSession
gameSession_maximumPlayerSessionCount = (GameSession -> Maybe Natural)
-> (GameSession -> Maybe Natural -> GameSession)
-> Lens GameSession GameSession (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Natural
maximumPlayerSessionCount :: Maybe Natural
$sel:maximumPlayerSessionCount:GameSession' :: GameSession -> Maybe Natural
maximumPlayerSessionCount} -> Maybe Natural
maximumPlayerSessionCount) (\s :: GameSession
s@GameSession' {} Maybe Natural
a -> GameSession
s {$sel:maximumPlayerSessionCount:GameSession' :: Maybe Natural
maximumPlayerSessionCount = Maybe Natural
a} :: GameSession)

-- | A time stamp indicating when this data object was terminated. Format is
-- a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
gameSession_terminationTime :: Lens.Lens' GameSession (Prelude.Maybe Prelude.UTCTime)
gameSession_terminationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSession -> f GameSession
gameSession_terminationTime = (GameSession -> Maybe POSIX)
-> (GameSession -> Maybe POSIX -> GameSession)
-> Lens GameSession GameSession (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe POSIX
terminationTime :: Maybe POSIX
$sel:terminationTime:GameSession' :: GameSession -> Maybe POSIX
terminationTime} -> Maybe POSIX
terminationTime) (\s :: GameSession
s@GameSession' {} Maybe POSIX
a -> GameSession
s {$sel:terminationTime:GameSession' :: Maybe POSIX
terminationTime = Maybe POSIX
a} :: GameSession) ((Maybe POSIX -> f (Maybe POSIX)) -> GameSession -> f GameSession)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSession
-> f GameSession
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Indicates whether or not the game session is accepting new players.
gameSession_playerSessionCreationPolicy :: Lens.Lens' GameSession (Prelude.Maybe PlayerSessionCreationPolicy)
gameSession_playerSessionCreationPolicy :: (Maybe PlayerSessionCreationPolicy
 -> f (Maybe PlayerSessionCreationPolicy))
-> GameSession -> f GameSession
gameSession_playerSessionCreationPolicy = (GameSession -> Maybe PlayerSessionCreationPolicy)
-> (GameSession
    -> Maybe PlayerSessionCreationPolicy -> GameSession)
-> Lens
     GameSession
     GameSession
     (Maybe PlayerSessionCreationPolicy)
     (Maybe PlayerSessionCreationPolicy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy :: Maybe PlayerSessionCreationPolicy
$sel:playerSessionCreationPolicy:GameSession' :: GameSession -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy} -> Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy) (\s :: GameSession
s@GameSession' {} Maybe PlayerSessionCreationPolicy
a -> GameSession
s {$sel:playerSessionCreationPolicy:GameSession' :: Maybe PlayerSessionCreationPolicy
playerSessionCreationPolicy = Maybe PlayerSessionCreationPolicy
a} :: GameSession)

-- | A descriptive label that is associated with a game session. Session
-- names do not need to be unique.
gameSession_name :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_name :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_name = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
name :: Maybe Text
$sel:name:GameSession' :: GameSession -> Maybe Text
name} -> Maybe Text
name) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:name:GameSession' :: Maybe Text
name = Maybe Text
a} :: GameSession)

-- | Number of players currently in the game session.
gameSession_currentPlayerSessionCount :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Natural)
gameSession_currentPlayerSessionCount :: (Maybe Natural -> f (Maybe Natural))
-> GameSession -> f GameSession
gameSession_currentPlayerSessionCount = (GameSession -> Maybe Natural)
-> (GameSession -> Maybe Natural -> GameSession)
-> Lens GameSession GameSession (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Natural
currentPlayerSessionCount :: Maybe Natural
$sel:currentPlayerSessionCount:GameSession' :: GameSession -> Maybe Natural
currentPlayerSessionCount} -> Maybe Natural
currentPlayerSessionCount) (\s :: GameSession
s@GameSession' {} Maybe Natural
a -> GameSession
s {$sel:currentPlayerSessionCount:GameSession' :: Maybe Natural
currentPlayerSessionCount = Maybe Natural
a} :: GameSession)

-- | Provides additional information about game session status. @INTERRUPTED@
-- indicates that the game session was hosted on a spot instance that was
-- reclaimed, causing the active game session to be terminated.
gameSession_statusReason :: Lens.Lens' GameSession (Prelude.Maybe GameSessionStatusReason)
gameSession_statusReason :: (Maybe GameSessionStatusReason
 -> f (Maybe GameSessionStatusReason))
-> GameSession -> f GameSession
gameSession_statusReason = (GameSession -> Maybe GameSessionStatusReason)
-> (GameSession -> Maybe GameSessionStatusReason -> GameSession)
-> Lens
     GameSession
     GameSession
     (Maybe GameSessionStatusReason)
     (Maybe GameSessionStatusReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe GameSessionStatusReason
statusReason :: Maybe GameSessionStatusReason
$sel:statusReason:GameSession' :: GameSession -> Maybe GameSessionStatusReason
statusReason} -> Maybe GameSessionStatusReason
statusReason) (\s :: GameSession
s@GameSession' {} Maybe GameSessionStatusReason
a -> GameSession
s {$sel:statusReason:GameSession' :: Maybe GameSessionStatusReason
statusReason = Maybe GameSessionStatusReason
a} :: GameSession)

-- | A set of custom game session properties, formatted as a single string
-- value. This data is passed to a game server process in the GameSession
-- object with a request to start a new game session.
gameSession_gameSessionData :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_gameSessionData :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_gameSessionData = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
gameSessionData :: Maybe Text
$sel:gameSessionData:GameSession' :: GameSession -> Maybe Text
gameSessionData} -> Maybe Text
gameSessionData) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:gameSessionData:GameSession' :: Maybe Text
gameSessionData = Maybe Text
a} :: GameSession)

-- | A unique identifier for the fleet that the game session is running on.
gameSession_fleetId :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_fleetId :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_fleetId = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:GameSession' :: GameSession -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:fleetId:GameSession' :: Maybe Text
fleetId = Maybe Text
a} :: GameSession)

-- | The DNS identifier assigned to the instance that is running the game
-- session. Values have the following format:
--
-- -   TLS-enabled fleets:
--     @\<unique identifier>.\<region identifier>.amazongamelift.com@.
--
-- -   Non-TLS-enabled fleets:
--     @ec2-\<unique identifier>.compute.amazonaws.com@. (See
--     <https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses Amazon EC2 Instance IP Addressing>.)
--
-- When connecting to a game session that is running on a TLS-enabled
-- fleet, you must use the DNS name, not the IP address.
gameSession_dnsName :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_dnsName :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_dnsName = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:GameSession' :: GameSession -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:dnsName:GameSession' :: Maybe Text
dnsName = Maybe Text
a} :: GameSession)

-- | A unique identifier for a player. This ID is used to enforce a resource
-- protection policy (if one exists), that limits the number of game
-- sessions a player can create.
gameSession_creatorId :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Text)
gameSession_creatorId :: (Maybe Text -> f (Maybe Text)) -> GameSession -> f GameSession
gameSession_creatorId = (GameSession -> Maybe Text)
-> (GameSession -> Maybe Text -> GameSession)
-> Lens GameSession GameSession (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Text
creatorId :: Maybe Text
$sel:creatorId:GameSession' :: GameSession -> Maybe Text
creatorId} -> Maybe Text
creatorId) (\s :: GameSession
s@GameSession' {} Maybe Text
a -> GameSession
s {$sel:creatorId:GameSession' :: Maybe Text
creatorId = Maybe Text
a} :: GameSession)

-- | The port number for the game session. To connect to a GameLift game
-- server, an app needs both the IP address and port number.
gameSession_port :: Lens.Lens' GameSession (Prelude.Maybe Prelude.Natural)
gameSession_port :: (Maybe Natural -> f (Maybe Natural))
-> GameSession -> f GameSession
gameSession_port = (GameSession -> Maybe Natural)
-> (GameSession -> Maybe Natural -> GameSession)
-> Lens GameSession GameSession (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSession' {Maybe Natural
port :: Maybe Natural
$sel:port:GameSession' :: GameSession -> Maybe Natural
port} -> Maybe Natural
port) (\s :: GameSession
s@GameSession' {} Maybe Natural
a -> GameSession
s {$sel:port:GameSession' :: Maybe Natural
port = Maybe Natural
a} :: GameSession)

instance Core.FromJSON GameSession where
  parseJSON :: Value -> Parser GameSession
parseJSON =
    String
-> (Object -> Parser GameSession) -> Value -> Parser GameSession
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GameSession"
      ( \Object
x ->
          Maybe POSIX
-> Maybe GameSessionStatus
-> Maybe [GameProperty]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe PlayerSessionCreationPolicy
-> Maybe Text
-> Maybe Natural
-> Maybe GameSessionStatusReason
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> GameSession
GameSession'
            (Maybe POSIX
 -> Maybe GameSessionStatus
 -> Maybe [GameProperty]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe POSIX
 -> Maybe PlayerSessionCreationPolicy
 -> Maybe Text
 -> Maybe Natural
 -> Maybe GameSessionStatusReason
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> GameSession)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe GameSessionStatus
      -> Maybe [GameProperty]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationTime")
            Parser
  (Maybe GameSessionStatus
   -> Maybe [GameProperty]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe GameSessionStatus)
-> Parser
     (Maybe [GameProperty]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GameSessionStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe [GameProperty]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe [GameProperty])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [GameProperty]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameProperties" Parser (Maybe (Maybe [GameProperty]))
-> Maybe [GameProperty] -> Parser (Maybe [GameProperty])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [GameProperty]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IpAddress")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Location")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameSessionId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MatchmakerData")
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FleetArn")
            Parser
  (Maybe Natural
   -> Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Natural)
-> Parser
     (Maybe POSIX
      -> Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaximumPlayerSessionCount")
            Parser
  (Maybe POSIX
   -> Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe PlayerSessionCreationPolicy
      -> Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TerminationTime")
            Parser
  (Maybe PlayerSessionCreationPolicy
   -> Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe PlayerSessionCreationPolicy)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PlayerSessionCreationPolicy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayerSessionCreationPolicy")
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser
  (Maybe Natural
   -> Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Natural)
-> Parser
     (Maybe GameSessionStatusReason
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentPlayerSessionCount")
            Parser
  (Maybe GameSessionStatusReason
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe GameSessionStatusReason)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GameSessionStatusReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StatusReason")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> Maybe Natural -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"GameSessionData")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> Maybe Natural -> GameSession)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Natural -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FleetId")
            Parser (Maybe Text -> Maybe Text -> Maybe Natural -> GameSession)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Natural -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DnsName")
            Parser (Maybe Text -> Maybe Natural -> GameSession)
-> Parser (Maybe Text) -> Parser (Maybe Natural -> GameSession)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreatorId")
            Parser (Maybe Natural -> GameSession)
-> Parser (Maybe Natural) -> Parser GameSession
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
      )

instance Prelude.Hashable GameSession

instance Prelude.NFData GameSession