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

import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.GameServerClaimStatus
import Amazonka.GameLift.Types.GameServerUtilizationStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | __This data type is used with the GameLift FleetIQ and game server
-- groups.__
--
-- Properties describing a game server that is running on an instance in a
-- GameServerGroup.
--
-- A game server is created by a successful call to @RegisterGameServer@
-- and deleted by calling @DeregisterGameServer@. A game server is claimed
-- to host a game session by calling @ClaimGameServer@.
--
-- __Related actions__
--
-- RegisterGameServer | ListGameServers | ClaimGameServer |
-- DescribeGameServer | UpdateGameServer | DeregisterGameServer |
-- <https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/reference-awssdk-fleetiq.html All APIs by task>
--
-- /See:/ 'newGameServer' smart constructor.
data GameServer = GameServer'
  { -- | The unique identifier for the instance where the game server is running.
    -- This ID is available in the instance metadata. EC2 instance IDs use a
    -- 17-character format, for example: @i-1234567890abcdef0@.
    GameServer -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
    -- | Timestamp that indicates the last time the game server was claimed with
    -- a ClaimGameServer request. The format is a number expressed in Unix time
    -- as milliseconds (for example @\"1469498468.057\"@). This value is used
    -- to calculate when a claimed game server\'s status should revert to null.
    GameServer -> Maybe POSIX
lastClaimTime :: Prelude.Maybe Core.POSIX,
    -- | A unique identifier for the game server group where the game server is
    -- running. Use either the GameServerGroup name or ARN value.
    GameServer -> Maybe Text
gameServerGroupName :: Prelude.Maybe Prelude.Text,
    -- | A set of custom game server properties, formatted as a single string
    -- value. This data is passed to a game client or service when it requests
    -- information on game servers using ListGameServers or ClaimGameServer.
    GameServer -> Maybe Text
gameServerData :: Prelude.Maybe Prelude.Text,
    -- | Indicates when an available game server has been reserved for gameplay
    -- but has not yet started hosting a game. Once it is claimed, the game
    -- server remains in @CLAIMED@ status for a maximum of one minute. During
    -- this time, game clients connect to the game server to start the game and
    -- trigger the game server to update its utilization status. After one
    -- minute, the game server claim status reverts to null.
    GameServer -> Maybe GameServerClaimStatus
claimStatus :: Prelude.Maybe GameServerClaimStatus,
    -- | A custom string that uniquely identifies the game server. Game server
    -- IDs are developer-defined and are unique across all game server groups
    -- in an AWS account.
    GameServer -> Maybe Text
gameServerId :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the game server is currently available for new games
    -- or is busy. Possible statuses include:
    --
    -- -   @AVAILABLE@ - The game server is available to be claimed. A game
    --     server that has been claimed remains in this status until it reports
    --     game hosting activity.
    --
    -- -   @UTILIZED@ - The game server is currently hosting a game session
    --     with players.
    GameServer -> Maybe GameServerUtilizationStatus
utilizationStatus :: Prelude.Maybe GameServerUtilizationStatus,
    -- | Timestamp that indicates when the game server was created with a
    -- RegisterGameServer request. The format is a number expressed in Unix
    -- time as milliseconds (for example @\"1469498468.057\"@).
    GameServer -> Maybe POSIX
registrationTime :: Prelude.Maybe Core.POSIX,
    -- | Timestamp that indicates the last time the game server was updated with
    -- health status using an UpdateGameServer request. The format is a number
    -- expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@). After game server registration, this property is
    -- only changed when a game server update specifies a health check value.
    GameServer -> Maybe POSIX
lastHealthCheckTime :: Prelude.Maybe Core.POSIX,
    -- | The port and IP address that must be used to establish a client
    -- connection to the game server.
    GameServer -> Maybe Text
connectionInfo :: Prelude.Maybe Prelude.Text,
    -- | The ARN identifier for the game server group where the game server is
    -- located.
    GameServer -> Maybe Text
gameServerGroupArn :: Prelude.Maybe Prelude.Text
  }
  deriving (GameServer -> GameServer -> Bool
(GameServer -> GameServer -> Bool)
-> (GameServer -> GameServer -> Bool) -> Eq GameServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameServer -> GameServer -> Bool
$c/= :: GameServer -> GameServer -> Bool
== :: GameServer -> GameServer -> Bool
$c== :: GameServer -> GameServer -> Bool
Prelude.Eq, ReadPrec [GameServer]
ReadPrec GameServer
Int -> ReadS GameServer
ReadS [GameServer]
(Int -> ReadS GameServer)
-> ReadS [GameServer]
-> ReadPrec GameServer
-> ReadPrec [GameServer]
-> Read GameServer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameServer]
$creadListPrec :: ReadPrec [GameServer]
readPrec :: ReadPrec GameServer
$creadPrec :: ReadPrec GameServer
readList :: ReadS [GameServer]
$creadList :: ReadS [GameServer]
readsPrec :: Int -> ReadS GameServer
$creadsPrec :: Int -> ReadS GameServer
Prelude.Read, Int -> GameServer -> ShowS
[GameServer] -> ShowS
GameServer -> String
(Int -> GameServer -> ShowS)
-> (GameServer -> String)
-> ([GameServer] -> ShowS)
-> Show GameServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameServer] -> ShowS
$cshowList :: [GameServer] -> ShowS
show :: GameServer -> String
$cshow :: GameServer -> String
showsPrec :: Int -> GameServer -> ShowS
$cshowsPrec :: Int -> GameServer -> ShowS
Prelude.Show, (forall x. GameServer -> Rep GameServer x)
-> (forall x. Rep GameServer x -> GameServer) -> Generic GameServer
forall x. Rep GameServer x -> GameServer
forall x. GameServer -> Rep GameServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameServer x -> GameServer
$cfrom :: forall x. GameServer -> Rep GameServer x
Prelude.Generic)

-- |
-- Create a value of 'GameServer' 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:
--
-- 'instanceId', 'gameServer_instanceId' - The unique identifier for the instance where the game server is running.
-- This ID is available in the instance metadata. EC2 instance IDs use a
-- 17-character format, for example: @i-1234567890abcdef0@.
--
-- 'lastClaimTime', 'gameServer_lastClaimTime' - Timestamp that indicates the last time the game server was claimed with
-- a ClaimGameServer request. The format is a number expressed in Unix time
-- as milliseconds (for example @\"1469498468.057\"@). This value is used
-- to calculate when a claimed game server\'s status should revert to null.
--
-- 'gameServerGroupName', 'gameServer_gameServerGroupName' - A unique identifier for the game server group where the game server is
-- running. Use either the GameServerGroup name or ARN value.
--
-- 'gameServerData', 'gameServer_gameServerData' - A set of custom game server properties, formatted as a single string
-- value. This data is passed to a game client or service when it requests
-- information on game servers using ListGameServers or ClaimGameServer.
--
-- 'claimStatus', 'gameServer_claimStatus' - Indicates when an available game server has been reserved for gameplay
-- but has not yet started hosting a game. Once it is claimed, the game
-- server remains in @CLAIMED@ status for a maximum of one minute. During
-- this time, game clients connect to the game server to start the game and
-- trigger the game server to update its utilization status. After one
-- minute, the game server claim status reverts to null.
--
-- 'gameServerId', 'gameServer_gameServerId' - A custom string that uniquely identifies the game server. Game server
-- IDs are developer-defined and are unique across all game server groups
-- in an AWS account.
--
-- 'utilizationStatus', 'gameServer_utilizationStatus' - Indicates whether the game server is currently available for new games
-- or is busy. Possible statuses include:
--
-- -   @AVAILABLE@ - The game server is available to be claimed. A game
--     server that has been claimed remains in this status until it reports
--     game hosting activity.
--
-- -   @UTILIZED@ - The game server is currently hosting a game session
--     with players.
--
-- 'registrationTime', 'gameServer_registrationTime' - Timestamp that indicates when the game server was created with a
-- RegisterGameServer request. The format is a number expressed in Unix
-- time as milliseconds (for example @\"1469498468.057\"@).
--
-- 'lastHealthCheckTime', 'gameServer_lastHealthCheckTime' - Timestamp that indicates the last time the game server was updated with
-- health status using an UpdateGameServer request. The format is a number
-- expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@). After game server registration, this property is
-- only changed when a game server update specifies a health check value.
--
-- 'connectionInfo', 'gameServer_connectionInfo' - The port and IP address that must be used to establish a client
-- connection to the game server.
--
-- 'gameServerGroupArn', 'gameServer_gameServerGroupArn' - The ARN identifier for the game server group where the game server is
-- located.
newGameServer ::
  GameServer
newGameServer :: GameServer
newGameServer =
  GameServer' :: Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe GameServerClaimStatus
-> Maybe Text
-> Maybe GameServerUtilizationStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> GameServer
GameServer'
    { $sel:instanceId:GameServer' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastClaimTime:GameServer' :: Maybe POSIX
lastClaimTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupName:GameServer' :: Maybe Text
gameServerGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerData:GameServer' :: Maybe Text
gameServerData = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:claimStatus:GameServer' :: Maybe GameServerClaimStatus
claimStatus = Maybe GameServerClaimStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerId:GameServer' :: Maybe Text
gameServerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:utilizationStatus:GameServer' :: Maybe GameServerUtilizationStatus
utilizationStatus = Maybe GameServerUtilizationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:registrationTime:GameServer' :: Maybe POSIX
registrationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:lastHealthCheckTime:GameServer' :: Maybe POSIX
lastHealthCheckTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionInfo:GameServer' :: Maybe Text
connectionInfo = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupArn:GameServer' :: Maybe Text
gameServerGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the instance where the game server is running.
-- This ID is available in the instance metadata. EC2 instance IDs use a
-- 17-character format, for example: @i-1234567890abcdef0@.
gameServer_instanceId :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_instanceId :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_instanceId = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:GameServer' :: GameServer -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:instanceId:GameServer' :: Maybe Text
instanceId = Maybe Text
a} :: GameServer)

-- | Timestamp that indicates the last time the game server was claimed with
-- a ClaimGameServer request. The format is a number expressed in Unix time
-- as milliseconds (for example @\"1469498468.057\"@). This value is used
-- to calculate when a claimed game server\'s status should revert to null.
gameServer_lastClaimTime :: Lens.Lens' GameServer (Prelude.Maybe Prelude.UTCTime)
gameServer_lastClaimTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GameServer -> f GameServer
gameServer_lastClaimTime = (GameServer -> Maybe POSIX)
-> (GameServer -> Maybe POSIX -> GameServer)
-> Lens GameServer GameServer (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe POSIX
lastClaimTime :: Maybe POSIX
$sel:lastClaimTime:GameServer' :: GameServer -> Maybe POSIX
lastClaimTime} -> Maybe POSIX
lastClaimTime) (\s :: GameServer
s@GameServer' {} Maybe POSIX
a -> GameServer
s {$sel:lastClaimTime:GameServer' :: Maybe POSIX
lastClaimTime = Maybe POSIX
a} :: GameServer) ((Maybe POSIX -> f (Maybe POSIX)) -> GameServer -> f GameServer)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameServer
-> f GameServer
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 server group where the game server is
-- running. Use either the GameServerGroup name or ARN value.
gameServer_gameServerGroupName :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerGroupName :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_gameServerGroupName = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
gameServerGroupName :: Maybe Text
$sel:gameServerGroupName:GameServer' :: GameServer -> Maybe Text
gameServerGroupName} -> Maybe Text
gameServerGroupName) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:gameServerGroupName:GameServer' :: Maybe Text
gameServerGroupName = Maybe Text
a} :: GameServer)

-- | A set of custom game server properties, formatted as a single string
-- value. This data is passed to a game client or service when it requests
-- information on game servers using ListGameServers or ClaimGameServer.
gameServer_gameServerData :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerData :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_gameServerData = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
gameServerData :: Maybe Text
$sel:gameServerData:GameServer' :: GameServer -> Maybe Text
gameServerData} -> Maybe Text
gameServerData) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:gameServerData:GameServer' :: Maybe Text
gameServerData = Maybe Text
a} :: GameServer)

-- | Indicates when an available game server has been reserved for gameplay
-- but has not yet started hosting a game. Once it is claimed, the game
-- server remains in @CLAIMED@ status for a maximum of one minute. During
-- this time, game clients connect to the game server to start the game and
-- trigger the game server to update its utilization status. After one
-- minute, the game server claim status reverts to null.
gameServer_claimStatus :: Lens.Lens' GameServer (Prelude.Maybe GameServerClaimStatus)
gameServer_claimStatus :: (Maybe GameServerClaimStatus -> f (Maybe GameServerClaimStatus))
-> GameServer -> f GameServer
gameServer_claimStatus = (GameServer -> Maybe GameServerClaimStatus)
-> (GameServer -> Maybe GameServerClaimStatus -> GameServer)
-> Lens
     GameServer
     GameServer
     (Maybe GameServerClaimStatus)
     (Maybe GameServerClaimStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe GameServerClaimStatus
claimStatus :: Maybe GameServerClaimStatus
$sel:claimStatus:GameServer' :: GameServer -> Maybe GameServerClaimStatus
claimStatus} -> Maybe GameServerClaimStatus
claimStatus) (\s :: GameServer
s@GameServer' {} Maybe GameServerClaimStatus
a -> GameServer
s {$sel:claimStatus:GameServer' :: Maybe GameServerClaimStatus
claimStatus = Maybe GameServerClaimStatus
a} :: GameServer)

-- | A custom string that uniquely identifies the game server. Game server
-- IDs are developer-defined and are unique across all game server groups
-- in an AWS account.
gameServer_gameServerId :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerId :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_gameServerId = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
gameServerId :: Maybe Text
$sel:gameServerId:GameServer' :: GameServer -> Maybe Text
gameServerId} -> Maybe Text
gameServerId) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:gameServerId:GameServer' :: Maybe Text
gameServerId = Maybe Text
a} :: GameServer)

-- | Indicates whether the game server is currently available for new games
-- or is busy. Possible statuses include:
--
-- -   @AVAILABLE@ - The game server is available to be claimed. A game
--     server that has been claimed remains in this status until it reports
--     game hosting activity.
--
-- -   @UTILIZED@ - The game server is currently hosting a game session
--     with players.
gameServer_utilizationStatus :: Lens.Lens' GameServer (Prelude.Maybe GameServerUtilizationStatus)
gameServer_utilizationStatus :: (Maybe GameServerUtilizationStatus
 -> f (Maybe GameServerUtilizationStatus))
-> GameServer -> f GameServer
gameServer_utilizationStatus = (GameServer -> Maybe GameServerUtilizationStatus)
-> (GameServer -> Maybe GameServerUtilizationStatus -> GameServer)
-> Lens
     GameServer
     GameServer
     (Maybe GameServerUtilizationStatus)
     (Maybe GameServerUtilizationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe GameServerUtilizationStatus
utilizationStatus :: Maybe GameServerUtilizationStatus
$sel:utilizationStatus:GameServer' :: GameServer -> Maybe GameServerUtilizationStatus
utilizationStatus} -> Maybe GameServerUtilizationStatus
utilizationStatus) (\s :: GameServer
s@GameServer' {} Maybe GameServerUtilizationStatus
a -> GameServer
s {$sel:utilizationStatus:GameServer' :: Maybe GameServerUtilizationStatus
utilizationStatus = Maybe GameServerUtilizationStatus
a} :: GameServer)

-- | Timestamp that indicates when the game server was created with a
-- RegisterGameServer request. The format is a number expressed in Unix
-- time as milliseconds (for example @\"1469498468.057\"@).
gameServer_registrationTime :: Lens.Lens' GameServer (Prelude.Maybe Prelude.UTCTime)
gameServer_registrationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GameServer -> f GameServer
gameServer_registrationTime = (GameServer -> Maybe POSIX)
-> (GameServer -> Maybe POSIX -> GameServer)
-> Lens GameServer GameServer (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe POSIX
registrationTime :: Maybe POSIX
$sel:registrationTime:GameServer' :: GameServer -> Maybe POSIX
registrationTime} -> Maybe POSIX
registrationTime) (\s :: GameServer
s@GameServer' {} Maybe POSIX
a -> GameServer
s {$sel:registrationTime:GameServer' :: Maybe POSIX
registrationTime = Maybe POSIX
a} :: GameServer) ((Maybe POSIX -> f (Maybe POSIX)) -> GameServer -> f GameServer)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameServer
-> f GameServer
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

-- | Timestamp that indicates the last time the game server was updated with
-- health status using an UpdateGameServer request. The format is a number
-- expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@). After game server registration, this property is
-- only changed when a game server update specifies a health check value.
gameServer_lastHealthCheckTime :: Lens.Lens' GameServer (Prelude.Maybe Prelude.UTCTime)
gameServer_lastHealthCheckTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> GameServer -> f GameServer
gameServer_lastHealthCheckTime = (GameServer -> Maybe POSIX)
-> (GameServer -> Maybe POSIX -> GameServer)
-> Lens GameServer GameServer (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe POSIX
lastHealthCheckTime :: Maybe POSIX
$sel:lastHealthCheckTime:GameServer' :: GameServer -> Maybe POSIX
lastHealthCheckTime} -> Maybe POSIX
lastHealthCheckTime) (\s :: GameServer
s@GameServer' {} Maybe POSIX
a -> GameServer
s {$sel:lastHealthCheckTime:GameServer' :: Maybe POSIX
lastHealthCheckTime = Maybe POSIX
a} :: GameServer) ((Maybe POSIX -> f (Maybe POSIX)) -> GameServer -> f GameServer)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GameServer
-> f GameServer
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

-- | The port and IP address that must be used to establish a client
-- connection to the game server.
gameServer_connectionInfo :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_connectionInfo :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_connectionInfo = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
connectionInfo :: Maybe Text
$sel:connectionInfo:GameServer' :: GameServer -> Maybe Text
connectionInfo} -> Maybe Text
connectionInfo) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:connectionInfo:GameServer' :: Maybe Text
connectionInfo = Maybe Text
a} :: GameServer)

-- | The ARN identifier for the game server group where the game server is
-- located.
gameServer_gameServerGroupArn :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerGroupArn :: (Maybe Text -> f (Maybe Text)) -> GameServer -> f GameServer
gameServer_gameServerGroupArn = (GameServer -> Maybe Text)
-> (GameServer -> Maybe Text -> GameServer)
-> Lens GameServer GameServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServer' {Maybe Text
gameServerGroupArn :: Maybe Text
$sel:gameServerGroupArn:GameServer' :: GameServer -> Maybe Text
gameServerGroupArn} -> Maybe Text
gameServerGroupArn) (\s :: GameServer
s@GameServer' {} Maybe Text
a -> GameServer
s {$sel:gameServerGroupArn:GameServer' :: Maybe Text
gameServerGroupArn = Maybe Text
a} :: GameServer)

instance Core.FromJSON GameServer where
  parseJSON :: Value -> Parser GameServer
parseJSON =
    String
-> (Object -> Parser GameServer) -> Value -> Parser GameServer
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"GameServer"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe GameServerClaimStatus
-> Maybe Text
-> Maybe GameServerUtilizationStatus
-> Maybe POSIX
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> GameServer
GameServer'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe GameServerClaimStatus
 -> Maybe Text
 -> Maybe GameServerUtilizationStatus
 -> Maybe POSIX
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> GameServer)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe GameServerClaimStatus
      -> Maybe Text
      -> Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
forall (f :: * -> *) a b. Functor 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
"InstanceId")
            Parser
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe GameServerClaimStatus
   -> Maybe Text
   -> Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe GameServerClaimStatus
      -> Maybe Text
      -> Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
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
"LastClaimTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe GameServerClaimStatus
   -> Maybe Text
   -> Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe GameServerClaimStatus
      -> Maybe Text
      -> Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
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
"GameServerGroupName")
            Parser
  (Maybe Text
   -> Maybe GameServerClaimStatus
   -> Maybe Text
   -> Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe Text)
-> Parser
     (Maybe GameServerClaimStatus
      -> Maybe Text
      -> Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
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
"GameServerData")
            Parser
  (Maybe GameServerClaimStatus
   -> Maybe Text
   -> Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe GameServerClaimStatus)
-> Parser
     (Maybe Text
      -> Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GameServerClaimStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClaimStatus")
            Parser
  (Maybe Text
   -> Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe Text)
-> Parser
     (Maybe GameServerUtilizationStatus
      -> Maybe POSIX
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> GameServer)
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
"GameServerId")
            Parser
  (Maybe GameServerUtilizationStatus
   -> Maybe POSIX
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> GameServer)
-> Parser (Maybe GameServerUtilizationStatus)
-> Parser
     (Maybe POSIX
      -> Maybe POSIX -> Maybe Text -> Maybe Text -> GameServer)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GameServerUtilizationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UtilizationStatus")
            Parser
  (Maybe POSIX
   -> Maybe POSIX -> Maybe Text -> Maybe Text -> GameServer)
-> Parser (Maybe POSIX)
-> Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> GameServer)
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
"RegistrationTime")
            Parser (Maybe POSIX -> Maybe Text -> Maybe Text -> GameServer)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> Maybe Text -> GameServer)
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
"LastHealthCheckTime")
            Parser (Maybe Text -> Maybe Text -> GameServer)
-> Parser (Maybe Text) -> Parser (Maybe Text -> GameServer)
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
"ConnectionInfo")
            Parser (Maybe Text -> GameServer)
-> Parser (Maybe Text) -> Parser GameServer
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
"GameServerGroupArn")
      )

instance Prelude.Hashable GameServer

instance Prelude.NFData GameServer