{-# 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.GameSessionPlacement
-- 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.GameSessionPlacement where

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.GameProperty
import Amazonka.GameLift.Types.GameSessionPlacementState
import Amazonka.GameLift.Types.PlacedPlayerSession
import Amazonka.GameLift.Types.PlayerLatency
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Object that describes a StartGameSessionPlacement request. This object
-- includes the full details of the original request plus the current
-- status and start\/end time stamps.
--
-- Game session placement-related operations include:
--
-- -   StartGameSessionPlacement
--
-- -   DescribeGameSessionPlacement
--
-- -   StopGameSessionPlacement
--
-- /See:/ 'newGameSessionPlacement' smart constructor.
data GameSessionPlacement = GameSessionPlacement'
  { -- | Current status of the game session placement request.
    --
    -- -   __PENDING__ -- The placement request is currently in the queue
    --     waiting to be processed.
    --
    -- -   __FULFILLED__ -- A new game session and player sessions (if
    --     requested) have been successfully created. Values for
    --     /GameSessionArn/ and /GameSessionRegion/ are available.
    --
    -- -   __CANCELLED__ -- The placement request was canceled with a call to
    --     StopGameSessionPlacement.
    --
    -- -   __TIMED_OUT__ -- A new game session was not successfully created
    --     before the time limit expired. You can resubmit the placement
    --     request as needed.
    --
    -- -   __FAILED__ -- GameLift is not able to complete the process of
    --     placing the game session. Common reasons are the game session
    --     terminated before the placement process was completed, or an
    --     unexpected internal error.
    GameSessionPlacement -> Maybe GameSessionPlacementState
status :: Prelude.Maybe GameSessionPlacementState,
    -- | A unique identifier for a game session placement.
    GameSessionPlacement -> Maybe Text
placementId :: Prelude.Maybe Prelude.Text,
    -- | 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 (see
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
    GameSessionPlacement -> 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. This value is
    -- set once the new game session is placed (placement status is
    -- @FULFILLED@).
    GameSessionPlacement -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | A descriptive label that is associated with a game session. Session
    -- names do not need to be unique.
    GameSessionPlacement -> Maybe Text
gameSessionName :: Prelude.Maybe Prelude.Text,
    -- | Time stamp indicating when this request was placed in the queue. Format
    -- is a number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    GameSessionPlacement -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | A unique identifier for the game session. This value is set once the new
    -- game session is placed (placement status is @FULFILLED@).
    GameSessionPlacement -> Maybe Text
gameSessionId :: Prelude.Maybe Prelude.Text,
    -- | Name of the Region where the game session created by this placement
    -- request is running. This value is set once the new game session is
    -- placed (placement status is @FULFILLED@).
    GameSessionPlacement -> Maybe Text
gameSessionRegion :: Prelude.Maybe Prelude.Text,
    -- | Information on the matchmaking process for this game. Data is in JSON
    -- syntax, formatted as a string. It identifies the matchmaking
    -- configuration used to create the match, and 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>.
    GameSessionPlacement -> Maybe Text
matchmakerData :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of players that can be connected simultaneously to
    -- the game session.
    GameSessionPlacement -> Maybe Natural
maximumPlayerSessionCount :: Prelude.Maybe Prelude.Natural,
    -- | Time stamp indicating when this request was completed, canceled, or
    -- timed out.
    GameSessionPlacement -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | Identifier for the game session created by this placement request. This
    -- value is set once the new game session is placed (placement status is
    -- @FULFILLED@). This identifier is unique across all Regions. You can use
    -- this value as a @GameSessionId@ value as needed.
    GameSessionPlacement -> Maybe Text
gameSessionArn :: Prelude.Maybe Prelude.Text,
    -- | A set of values, expressed in milliseconds, that indicates the amount of
    -- latency that a player experiences when connected to AWS Regions.
    GameSessionPlacement -> Maybe [PlayerLatency]
playerLatencies :: Prelude.Maybe [PlayerLatency],
    -- | 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 (see
    -- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
    GameSessionPlacement -> Maybe Text
gameSessionData :: 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.
    GameSessionPlacement -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
    -- | A descriptive label that is associated with game session queue. Queue
    -- names must be unique within each Region.
    GameSessionPlacement -> Maybe Text
gameSessionQueueName :: Prelude.Maybe Prelude.Text,
    -- | A collection of information on player sessions created in response to
    -- the game session placement request. These player sessions are created
    -- only once a new game session is successfully placed (placement status is
    -- @FULFILLED@). This information includes the player ID (as provided in
    -- the placement request) and the corresponding player session ID. Retrieve
    -- full player sessions by calling DescribePlayerSessions with the player
    -- session ID.
    GameSessionPlacement -> Maybe [PlacedPlayerSession]
placedPlayerSessions :: Prelude.Maybe [PlacedPlayerSession],
    -- | The port number for the game session. To connect to a GameLift game
    -- server, an app needs both the IP address and port number. This value is
    -- set once the new game session is placed (placement status is
    -- @FULFILLED@).
    GameSessionPlacement -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural
  }
  deriving (GameSessionPlacement -> GameSessionPlacement -> Bool
(GameSessionPlacement -> GameSessionPlacement -> Bool)
-> (GameSessionPlacement -> GameSessionPlacement -> Bool)
-> Eq GameSessionPlacement
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameSessionPlacement -> GameSessionPlacement -> Bool
$c/= :: GameSessionPlacement -> GameSessionPlacement -> Bool
== :: GameSessionPlacement -> GameSessionPlacement -> Bool
$c== :: GameSessionPlacement -> GameSessionPlacement -> Bool
Prelude.Eq, ReadPrec [GameSessionPlacement]
ReadPrec GameSessionPlacement
Int -> ReadS GameSessionPlacement
ReadS [GameSessionPlacement]
(Int -> ReadS GameSessionPlacement)
-> ReadS [GameSessionPlacement]
-> ReadPrec GameSessionPlacement
-> ReadPrec [GameSessionPlacement]
-> Read GameSessionPlacement
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameSessionPlacement]
$creadListPrec :: ReadPrec [GameSessionPlacement]
readPrec :: ReadPrec GameSessionPlacement
$creadPrec :: ReadPrec GameSessionPlacement
readList :: ReadS [GameSessionPlacement]
$creadList :: ReadS [GameSessionPlacement]
readsPrec :: Int -> ReadS GameSessionPlacement
$creadsPrec :: Int -> ReadS GameSessionPlacement
Prelude.Read, Int -> GameSessionPlacement -> ShowS
[GameSessionPlacement] -> ShowS
GameSessionPlacement -> String
(Int -> GameSessionPlacement -> ShowS)
-> (GameSessionPlacement -> String)
-> ([GameSessionPlacement] -> ShowS)
-> Show GameSessionPlacement
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameSessionPlacement] -> ShowS
$cshowList :: [GameSessionPlacement] -> ShowS
show :: GameSessionPlacement -> String
$cshow :: GameSessionPlacement -> String
showsPrec :: Int -> GameSessionPlacement -> ShowS
$cshowsPrec :: Int -> GameSessionPlacement -> ShowS
Prelude.Show, (forall x. GameSessionPlacement -> Rep GameSessionPlacement x)
-> (forall x. Rep GameSessionPlacement x -> GameSessionPlacement)
-> Generic GameSessionPlacement
forall x. Rep GameSessionPlacement x -> GameSessionPlacement
forall x. GameSessionPlacement -> Rep GameSessionPlacement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameSessionPlacement x -> GameSessionPlacement
$cfrom :: forall x. GameSessionPlacement -> Rep GameSessionPlacement x
Prelude.Generic)

-- |
-- Create a value of 'GameSessionPlacement' 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:
--
-- 'status', 'gameSessionPlacement_status' - Current status of the game session placement request.
--
-- -   __PENDING__ -- The placement request is currently in the queue
--     waiting to be processed.
--
-- -   __FULFILLED__ -- A new game session and player sessions (if
--     requested) have been successfully created. Values for
--     /GameSessionArn/ and /GameSessionRegion/ are available.
--
-- -   __CANCELLED__ -- The placement request was canceled with a call to
--     StopGameSessionPlacement.
--
-- -   __TIMED_OUT__ -- A new game session was not successfully created
--     before the time limit expired. You can resubmit the placement
--     request as needed.
--
-- -   __FAILED__ -- GameLift is not able to complete the process of
--     placing the game session. Common reasons are the game session
--     terminated before the placement process was completed, or an
--     unexpected internal error.
--
-- 'placementId', 'gameSessionPlacement_placementId' - A unique identifier for a game session placement.
--
-- 'gameProperties', 'gameSessionPlacement_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 (see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
--
-- 'ipAddress', 'gameSessionPlacement_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. This value is
-- set once the new game session is placed (placement status is
-- @FULFILLED@).
--
-- 'gameSessionName', 'gameSessionPlacement_gameSessionName' - A descriptive label that is associated with a game session. Session
-- names do not need to be unique.
--
-- 'startTime', 'gameSessionPlacement_startTime' - Time stamp indicating when this request was placed in the queue. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- 'gameSessionId', 'gameSessionPlacement_gameSessionId' - A unique identifier for the game session. This value is set once the new
-- game session is placed (placement status is @FULFILLED@).
--
-- 'gameSessionRegion', 'gameSessionPlacement_gameSessionRegion' - Name of the Region where the game session created by this placement
-- request is running. This value is set once the new game session is
-- placed (placement status is @FULFILLED@).
--
-- 'matchmakerData', 'gameSessionPlacement_matchmakerData' - Information on the matchmaking process for this game. Data is in JSON
-- syntax, formatted as a string. It identifies the matchmaking
-- configuration used to create the match, and 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>.
--
-- 'maximumPlayerSessionCount', 'gameSessionPlacement_maximumPlayerSessionCount' - The maximum number of players that can be connected simultaneously to
-- the game session.
--
-- 'endTime', 'gameSessionPlacement_endTime' - Time stamp indicating when this request was completed, canceled, or
-- timed out.
--
-- 'gameSessionArn', 'gameSessionPlacement_gameSessionArn' - Identifier for the game session created by this placement request. This
-- value is set once the new game session is placed (placement status is
-- @FULFILLED@). This identifier is unique across all Regions. You can use
-- this value as a @GameSessionId@ value as needed.
--
-- 'playerLatencies', 'gameSessionPlacement_playerLatencies' - A set of values, expressed in milliseconds, that indicates the amount of
-- latency that a player experiences when connected to AWS Regions.
--
-- 'gameSessionData', 'gameSessionPlacement_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 (see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
--
-- 'dnsName', 'gameSessionPlacement_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.
--
-- 'gameSessionQueueName', 'gameSessionPlacement_gameSessionQueueName' - A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region.
--
-- 'placedPlayerSessions', 'gameSessionPlacement_placedPlayerSessions' - A collection of information on player sessions created in response to
-- the game session placement request. These player sessions are created
-- only once a new game session is successfully placed (placement status is
-- @FULFILLED@). This information includes the player ID (as provided in
-- the placement request) and the corresponding player session ID. Retrieve
-- full player sessions by calling DescribePlayerSessions with the player
-- session ID.
--
-- 'port', 'gameSessionPlacement_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. This value is
-- set once the new game session is placed (placement status is
-- @FULFILLED@).
newGameSessionPlacement ::
  GameSessionPlacement
newGameSessionPlacement :: GameSessionPlacement
newGameSessionPlacement =
  GameSessionPlacement' :: Maybe GameSessionPlacementState
-> Maybe Text
-> Maybe [GameProperty]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe [PlayerLatency]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [PlacedPlayerSession]
-> Maybe Natural
-> GameSessionPlacement
GameSessionPlacement'
    { $sel:status:GameSessionPlacement' :: Maybe GameSessionPlacementState
status = Maybe GameSessionPlacementState
forall a. Maybe a
Prelude.Nothing,
      $sel:placementId:GameSessionPlacement' :: Maybe Text
placementId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameProperties:GameSessionPlacement' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
forall a. Maybe a
Prelude.Nothing,
      $sel:ipAddress:GameSessionPlacement' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionName:GameSessionPlacement' :: Maybe Text
gameSessionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:GameSessionPlacement' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionId:GameSessionPlacement' :: Maybe Text
gameSessionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionRegion:GameSessionPlacement' :: Maybe Text
gameSessionRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:matchmakerData:GameSessionPlacement' :: Maybe Text
matchmakerData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumPlayerSessionCount:GameSessionPlacement' :: Maybe Natural
maximumPlayerSessionCount = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:GameSessionPlacement' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionArn:GameSessionPlacement' :: Maybe Text
gameSessionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:playerLatencies:GameSessionPlacement' :: Maybe [PlayerLatency]
playerLatencies = Maybe [PlayerLatency]
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionData:GameSessionPlacement' :: Maybe Text
gameSessionData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dnsName:GameSessionPlacement' :: Maybe Text
dnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameSessionQueueName:GameSessionPlacement' :: Maybe Text
gameSessionQueueName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:placedPlayerSessions:GameSessionPlacement' :: Maybe [PlacedPlayerSession]
placedPlayerSessions = Maybe [PlacedPlayerSession]
forall a. Maybe a
Prelude.Nothing,
      $sel:port:GameSessionPlacement' :: Maybe Natural
port = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Current status of the game session placement request.
--
-- -   __PENDING__ -- The placement request is currently in the queue
--     waiting to be processed.
--
-- -   __FULFILLED__ -- A new game session and player sessions (if
--     requested) have been successfully created. Values for
--     /GameSessionArn/ and /GameSessionRegion/ are available.
--
-- -   __CANCELLED__ -- The placement request was canceled with a call to
--     StopGameSessionPlacement.
--
-- -   __TIMED_OUT__ -- A new game session was not successfully created
--     before the time limit expired. You can resubmit the placement
--     request as needed.
--
-- -   __FAILED__ -- GameLift is not able to complete the process of
--     placing the game session. Common reasons are the game session
--     terminated before the placement process was completed, or an
--     unexpected internal error.
gameSessionPlacement_status :: Lens.Lens' GameSessionPlacement (Prelude.Maybe GameSessionPlacementState)
gameSessionPlacement_status :: (Maybe GameSessionPlacementState
 -> f (Maybe GameSessionPlacementState))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_status = (GameSessionPlacement -> Maybe GameSessionPlacementState)
-> (GameSessionPlacement
    -> Maybe GameSessionPlacementState -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe GameSessionPlacementState)
     (Maybe GameSessionPlacementState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe GameSessionPlacementState
status :: Maybe GameSessionPlacementState
$sel:status:GameSessionPlacement' :: GameSessionPlacement -> Maybe GameSessionPlacementState
status} -> Maybe GameSessionPlacementState
status) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe GameSessionPlacementState
a -> GameSessionPlacement
s {$sel:status:GameSessionPlacement' :: Maybe GameSessionPlacementState
status = Maybe GameSessionPlacementState
a} :: GameSessionPlacement)

-- | A unique identifier for a game session placement.
gameSessionPlacement_placementId :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_placementId :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_placementId = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
placementId :: Maybe Text
$sel:placementId:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
placementId} -> Maybe Text
placementId) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:placementId:GameSessionPlacement' :: Maybe Text
placementId = Maybe Text
a} :: GameSessionPlacement)

-- | 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 (see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
gameSessionPlacement_gameProperties :: Lens.Lens' GameSessionPlacement (Prelude.Maybe [GameProperty])
gameSessionPlacement_gameProperties :: (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameProperties = (GameSessionPlacement -> Maybe [GameProperty])
-> (GameSessionPlacement
    -> Maybe [GameProperty] -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe [GameProperty])
     (Maybe [GameProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe [GameProperty]
gameProperties :: Maybe [GameProperty]
$sel:gameProperties:GameSessionPlacement' :: GameSessionPlacement -> Maybe [GameProperty]
gameProperties} -> Maybe [GameProperty]
gameProperties) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe [GameProperty]
a -> GameSessionPlacement
s {$sel:gameProperties:GameSessionPlacement' :: Maybe [GameProperty]
gameProperties = Maybe [GameProperty]
a} :: GameSessionPlacement) ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
 -> GameSessionPlacement -> f GameSessionPlacement)
-> ((Maybe [GameProperty] -> f (Maybe [GameProperty]))
    -> Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> (Maybe [GameProperty] -> f (Maybe [GameProperty]))
-> GameSessionPlacement
-> f GameSessionPlacement
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. This value is
-- set once the new game session is placed (placement status is
-- @FULFILLED@).
gameSessionPlacement_ipAddress :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_ipAddress :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_ipAddress = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:ipAddress:GameSessionPlacement' :: Maybe Text
ipAddress = Maybe Text
a} :: GameSessionPlacement)

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

-- | Time stamp indicating when this request was placed in the queue. Format
-- is a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
gameSessionPlacement_startTime :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.UTCTime)
gameSessionPlacement_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_startTime = (GameSessionPlacement -> Maybe POSIX)
-> (GameSessionPlacement -> Maybe POSIX -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:GameSessionPlacement' :: GameSessionPlacement -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe POSIX
a -> GameSessionPlacement
s {$sel:startTime:GameSessionPlacement' :: Maybe POSIX
startTime = Maybe POSIX
a} :: GameSessionPlacement) ((Maybe POSIX -> f (Maybe POSIX))
 -> GameSessionPlacement -> f GameSessionPlacement)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSessionPlacement
-> f GameSessionPlacement
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

-- | A unique identifier for the game session. This value is set once the new
-- game session is placed (placement status is @FULFILLED@).
gameSessionPlacement_gameSessionId :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_gameSessionId :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameSessionId = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
gameSessionId :: Maybe Text
$sel:gameSessionId:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
gameSessionId} -> Maybe Text
gameSessionId) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:gameSessionId:GameSessionPlacement' :: Maybe Text
gameSessionId = Maybe Text
a} :: GameSessionPlacement)

-- | Name of the Region where the game session created by this placement
-- request is running. This value is set once the new game session is
-- placed (placement status is @FULFILLED@).
gameSessionPlacement_gameSessionRegion :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_gameSessionRegion :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameSessionRegion = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
gameSessionRegion :: Maybe Text
$sel:gameSessionRegion:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
gameSessionRegion} -> Maybe Text
gameSessionRegion) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:gameSessionRegion:GameSessionPlacement' :: Maybe Text
gameSessionRegion = Maybe Text
a} :: GameSessionPlacement)

-- | Information on the matchmaking process for this game. Data is in JSON
-- syntax, formatted as a string. It identifies the matchmaking
-- configuration used to create the match, and 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>.
gameSessionPlacement_matchmakerData :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_matchmakerData :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_matchmakerData = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
matchmakerData :: Maybe Text
$sel:matchmakerData:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
matchmakerData} -> Maybe Text
matchmakerData) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:matchmakerData:GameSessionPlacement' :: Maybe Text
matchmakerData = Maybe Text
a} :: GameSessionPlacement)

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

-- | Time stamp indicating when this request was completed, canceled, or
-- timed out.
gameSessionPlacement_endTime :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.UTCTime)
gameSessionPlacement_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_endTime = (GameSessionPlacement -> Maybe POSIX)
-> (GameSessionPlacement -> Maybe POSIX -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:GameSessionPlacement' :: GameSessionPlacement -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe POSIX
a -> GameSessionPlacement
s {$sel:endTime:GameSessionPlacement' :: Maybe POSIX
endTime = Maybe POSIX
a} :: GameSessionPlacement) ((Maybe POSIX -> f (Maybe POSIX))
 -> GameSessionPlacement -> f GameSessionPlacement)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameSessionPlacement
-> f GameSessionPlacement
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

-- | Identifier for the game session created by this placement request. This
-- value is set once the new game session is placed (placement status is
-- @FULFILLED@). This identifier is unique across all Regions. You can use
-- this value as a @GameSessionId@ value as needed.
gameSessionPlacement_gameSessionArn :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_gameSessionArn :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameSessionArn = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
gameSessionArn :: Maybe Text
$sel:gameSessionArn:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
gameSessionArn} -> Maybe Text
gameSessionArn) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:gameSessionArn:GameSessionPlacement' :: Maybe Text
gameSessionArn = Maybe Text
a} :: GameSessionPlacement)

-- | A set of values, expressed in milliseconds, that indicates the amount of
-- latency that a player experiences when connected to AWS Regions.
gameSessionPlacement_playerLatencies :: Lens.Lens' GameSessionPlacement (Prelude.Maybe [PlayerLatency])
gameSessionPlacement_playerLatencies :: (Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_playerLatencies = (GameSessionPlacement -> Maybe [PlayerLatency])
-> (GameSessionPlacement
    -> Maybe [PlayerLatency] -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe [PlayerLatency])
     (Maybe [PlayerLatency])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe [PlayerLatency]
playerLatencies :: Maybe [PlayerLatency]
$sel:playerLatencies:GameSessionPlacement' :: GameSessionPlacement -> Maybe [PlayerLatency]
playerLatencies} -> Maybe [PlayerLatency]
playerLatencies) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe [PlayerLatency]
a -> GameSessionPlacement
s {$sel:playerLatencies:GameSessionPlacement' :: Maybe [PlayerLatency]
playerLatencies = Maybe [PlayerLatency]
a} :: GameSessionPlacement) ((Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
 -> GameSessionPlacement -> f GameSessionPlacement)
-> ((Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
    -> Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> (Maybe [PlayerLatency] -> f (Maybe [PlayerLatency]))
-> GameSessionPlacement
-> f GameSessionPlacement
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlayerLatency] [PlayerLatency] [PlayerLatency] [PlayerLatency]
-> Iso
     (Maybe [PlayerLatency])
     (Maybe [PlayerLatency])
     (Maybe [PlayerLatency])
     (Maybe [PlayerLatency])
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
  [PlayerLatency] [PlayerLatency] [PlayerLatency] [PlayerLatency]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 (see
-- <https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession Start a Game Session>).
gameSessionPlacement_gameSessionData :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_gameSessionData :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameSessionData = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
gameSessionData :: Maybe Text
$sel:gameSessionData:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
gameSessionData} -> Maybe Text
gameSessionData) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:gameSessionData:GameSessionPlacement' :: Maybe Text
gameSessionData = Maybe Text
a} :: GameSessionPlacement)

-- | 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.
gameSessionPlacement_dnsName :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_dnsName :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_dnsName = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:dnsName:GameSessionPlacement' :: Maybe Text
dnsName = Maybe Text
a} :: GameSessionPlacement)

-- | A descriptive label that is associated with game session queue. Queue
-- names must be unique within each Region.
gameSessionPlacement_gameSessionQueueName :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Text)
gameSessionPlacement_gameSessionQueueName :: (Maybe Text -> f (Maybe Text))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_gameSessionQueueName = (GameSessionPlacement -> Maybe Text)
-> (GameSessionPlacement -> Maybe Text -> GameSessionPlacement)
-> Lens
     GameSessionPlacement GameSessionPlacement (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Text
gameSessionQueueName :: Maybe Text
$sel:gameSessionQueueName:GameSessionPlacement' :: GameSessionPlacement -> Maybe Text
gameSessionQueueName} -> Maybe Text
gameSessionQueueName) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Text
a -> GameSessionPlacement
s {$sel:gameSessionQueueName:GameSessionPlacement' :: Maybe Text
gameSessionQueueName = Maybe Text
a} :: GameSessionPlacement)

-- | A collection of information on player sessions created in response to
-- the game session placement request. These player sessions are created
-- only once a new game session is successfully placed (placement status is
-- @FULFILLED@). This information includes the player ID (as provided in
-- the placement request) and the corresponding player session ID. Retrieve
-- full player sessions by calling DescribePlayerSessions with the player
-- session ID.
gameSessionPlacement_placedPlayerSessions :: Lens.Lens' GameSessionPlacement (Prelude.Maybe [PlacedPlayerSession])
gameSessionPlacement_placedPlayerSessions :: (Maybe [PlacedPlayerSession] -> f (Maybe [PlacedPlayerSession]))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_placedPlayerSessions = (GameSessionPlacement -> Maybe [PlacedPlayerSession])
-> (GameSessionPlacement
    -> Maybe [PlacedPlayerSession] -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe [PlacedPlayerSession])
     (Maybe [PlacedPlayerSession])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe [PlacedPlayerSession]
placedPlayerSessions :: Maybe [PlacedPlayerSession]
$sel:placedPlayerSessions:GameSessionPlacement' :: GameSessionPlacement -> Maybe [PlacedPlayerSession]
placedPlayerSessions} -> Maybe [PlacedPlayerSession]
placedPlayerSessions) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe [PlacedPlayerSession]
a -> GameSessionPlacement
s {$sel:placedPlayerSessions:GameSessionPlacement' :: Maybe [PlacedPlayerSession]
placedPlayerSessions = Maybe [PlacedPlayerSession]
a} :: GameSessionPlacement) ((Maybe [PlacedPlayerSession] -> f (Maybe [PlacedPlayerSession]))
 -> GameSessionPlacement -> f GameSessionPlacement)
-> ((Maybe [PlacedPlayerSession]
     -> f (Maybe [PlacedPlayerSession]))
    -> Maybe [PlacedPlayerSession] -> f (Maybe [PlacedPlayerSession]))
-> (Maybe [PlacedPlayerSession] -> f (Maybe [PlacedPlayerSession]))
-> GameSessionPlacement
-> f GameSessionPlacement
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlacedPlayerSession]
  [PlacedPlayerSession]
  [PlacedPlayerSession]
  [PlacedPlayerSession]
-> Iso
     (Maybe [PlacedPlayerSession])
     (Maybe [PlacedPlayerSession])
     (Maybe [PlacedPlayerSession])
     (Maybe [PlacedPlayerSession])
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
  [PlacedPlayerSession]
  [PlacedPlayerSession]
  [PlacedPlayerSession]
  [PlacedPlayerSession]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The port number for the game session. To connect to a GameLift game
-- server, an app needs both the IP address and port number. This value is
-- set once the new game session is placed (placement status is
-- @FULFILLED@).
gameSessionPlacement_port :: Lens.Lens' GameSessionPlacement (Prelude.Maybe Prelude.Natural)
gameSessionPlacement_port :: (Maybe Natural -> f (Maybe Natural))
-> GameSessionPlacement -> f GameSessionPlacement
gameSessionPlacement_port = (GameSessionPlacement -> Maybe Natural)
-> (GameSessionPlacement -> Maybe Natural -> GameSessionPlacement)
-> Lens
     GameSessionPlacement
     GameSessionPlacement
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameSessionPlacement' {Maybe Natural
port :: Maybe Natural
$sel:port:GameSessionPlacement' :: GameSessionPlacement -> Maybe Natural
port} -> Maybe Natural
port) (\s :: GameSessionPlacement
s@GameSessionPlacement' {} Maybe Natural
a -> GameSessionPlacement
s {$sel:port:GameSessionPlacement' :: Maybe Natural
port = Maybe Natural
a} :: GameSessionPlacement)

instance Core.FromJSON GameSessionPlacement where
  parseJSON :: Value -> Parser GameSessionPlacement
parseJSON =
    String
-> (Object -> Parser GameSessionPlacement)
-> Value
-> Parser GameSessionPlacement
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GameSessionPlacement"
      ( \Object
x ->
          Maybe GameSessionPlacementState
-> Maybe Text
-> Maybe [GameProperty]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe POSIX
-> Maybe Text
-> Maybe [PlayerLatency]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [PlacedPlayerSession]
-> Maybe Natural
-> GameSessionPlacement
GameSessionPlacement'
            (Maybe GameSessionPlacementState
 -> Maybe Text
 -> Maybe [GameProperty]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe [PlayerLatency]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [PlacedPlayerSession]
 -> Maybe Natural
 -> GameSessionPlacement)
-> Parser (Maybe GameSessionPlacementState)
-> Parser
     (Maybe Text
      -> Maybe [GameProperty]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe GameSessionPlacementState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Text
   -> Maybe [GameProperty]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe [GameProperty]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"PlacementId")
            Parser
  (Maybe [GameProperty]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe [GameProperty])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"GameSessionName")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"StartTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"GameSessionRegion")
            Parser
  (Maybe Text
   -> Maybe Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 Natural
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Natural)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"EndTime")
            Parser
  (Maybe Text
   -> Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe [PlayerLatency]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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
"GameSessionArn")
            Parser
  (Maybe [PlayerLatency]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe [PlayerLatency])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlayerLatency]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlayerLatencies"
                            Parser (Maybe (Maybe [PlayerLatency]))
-> Maybe [PlayerLatency] -> Parser (Maybe [PlayerLatency])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlayerLatency]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [PlacedPlayerSession]
      -> Maybe Natural
      -> GameSessionPlacement)
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 [PlacedPlayerSession]
   -> Maybe Natural
   -> GameSessionPlacement)
-> Parser (Maybe Text)
-> Parser
     (Maybe [PlacedPlayerSession]
      -> Maybe Natural -> GameSessionPlacement)
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
"GameSessionQueueName")
            Parser
  (Maybe [PlacedPlayerSession]
   -> Maybe Natural -> GameSessionPlacement)
-> Parser (Maybe [PlacedPlayerSession])
-> Parser (Maybe Natural -> GameSessionPlacement)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PlacedPlayerSession]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PlacedPlayerSessions"
                            Parser (Maybe (Maybe [PlacedPlayerSession]))
-> Maybe [PlacedPlayerSession]
-> Parser (Maybe [PlacedPlayerSession])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PlacedPlayerSession]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Natural -> GameSessionPlacement)
-> Parser (Maybe Natural) -> Parser GameSessionPlacement
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 GameSessionPlacement

instance Prelude.NFData GameSessionPlacement