{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.GameLift.Types.GameServer where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.GameServerClaimStatus
import Amazonka.GameLift.Types.GameServerUtilizationStatus
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
-- game server group.
--
-- 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@.
--
-- /See:/ 'newGameServer' smart constructor.
data GameServer = 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 -> Maybe GameServerClaimStatus
claimStatus :: Prelude.Maybe GameServerClaimStatus,
    -- | 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,
    -- | 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.
    GameServer -> Maybe Text
gameServerData :: 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,
    -- | A unique identifier for the game server group where the game server is
    -- running.
    GameServer -> Maybe Text
gameServerGroupName :: Prelude.Maybe Prelude.Text,
    -- | 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 Amazon Web Services account.
    GameServer -> Maybe Text
gameServerId :: Prelude.Maybe Prelude.Text,
    -- | 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. 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 Data.POSIX,
    -- | Timestamp that indicates the last time the game server was updated with
    -- health status. 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 Data.POSIX,
    -- | Timestamp that indicates when the game server registered. The format is
    -- a number expressed in Unix time as milliseconds (for example
    -- @\"1469498468.057\"@).
    GameServer -> Maybe POSIX
registrationTime :: Prelude.Maybe Data.POSIX,
    -- | 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
  }
  deriving (GameServer -> GameServer -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'connectionInfo', 'gameServer_connectionInfo' - The port and IP address that must be used to establish a client
-- connection to the game server.
--
-- '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.
--
-- 'gameServerGroupArn', 'gameServer_gameServerGroupArn' - The ARN identifier for the game server group where the game server is
-- located.
--
-- 'gameServerGroupName', 'gameServer_gameServerGroupName' - A unique identifier for the game server group where the game server is
-- running.
--
-- '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 Amazon Web Services account.
--
-- '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. 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.
--
-- 'lastHealthCheckTime', 'gameServer_lastHealthCheckTime' - Timestamp that indicates the last time the game server was updated with
-- health status. 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.
--
-- 'registrationTime', 'gameServer_registrationTime' - Timestamp that indicates when the game server registered. The format is
-- a number expressed in Unix time as milliseconds (for example
-- @\"1469498468.057\"@).
--
-- '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.
newGameServer ::
  GameServer
newGameServer :: GameServer
newGameServer =
  GameServer'
    { $sel:claimStatus:GameServer' :: Maybe GameServerClaimStatus
claimStatus = forall a. Maybe a
Prelude.Nothing,
      $sel:connectionInfo:GameServer' :: Maybe Text
connectionInfo = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerData:GameServer' :: Maybe Text
gameServerData = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupArn:GameServer' :: Maybe Text
gameServerGroupArn = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerGroupName:GameServer' :: Maybe Text
gameServerGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:gameServerId:GameServer' :: Maybe Text
gameServerId = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:GameServer' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
      $sel:lastClaimTime:GameServer' :: Maybe POSIX
lastClaimTime = forall a. Maybe a
Prelude.Nothing,
      $sel:lastHealthCheckTime:GameServer' :: Maybe POSIX
lastHealthCheckTime = forall a. Maybe a
Prelude.Nothing,
      $sel:registrationTime:GameServer' :: Maybe POSIX
registrationTime = forall a. Maybe a
Prelude.Nothing,
      $sel:utilizationStatus:GameServer' :: Maybe GameServerUtilizationStatus
utilizationStatus = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' GameServer (Maybe GameServerClaimStatus)
gameServer_claimStatus = 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)

-- | 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 :: Lens' GameServer (Maybe Text)
gameServer_connectionInfo = 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)

-- | 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.
gameServer_gameServerData :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerData :: Lens' GameServer (Maybe Text)
gameServer_gameServerData = 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)

-- | 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 :: Lens' GameServer (Maybe Text)
gameServer_gameServerGroupArn = 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)

-- | A unique identifier for the game server group where the game server is
-- running.
gameServer_gameServerGroupName :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerGroupName :: Lens' GameServer (Maybe Text)
gameServer_gameServerGroupName = 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 custom string that uniquely identifies the game server. Game server
-- IDs are developer-defined and are unique across all game server groups
-- in an Amazon Web Services account.
gameServer_gameServerId :: Lens.Lens' GameServer (Prelude.Maybe Prelude.Text)
gameServer_gameServerId :: Lens' GameServer (Maybe Text)
gameServer_gameServerId = 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)

-- | 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 :: Lens' GameServer (Maybe Text)
gameServer_instanceId = 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. 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 :: Lens' GameServer (Maybe UTCTime)
gameServer_lastClaimTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Timestamp that indicates the last time the game server was updated with
-- health status. 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 :: Lens' GameServer (Maybe UTCTime)
gameServer_lastHealthCheckTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Timestamp that indicates when the game server registered. 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 :: Lens' GameServer (Maybe UTCTime)
gameServer_registrationTime = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | 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 :: Lens' GameServer (Maybe GameServerUtilizationStatus)
gameServer_utilizationStatus = 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)

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

instance Prelude.Hashable GameServer where
  hashWithSalt :: Int -> GameServer -> Int
hashWithSalt Int
_salt GameServer' {Maybe Text
Maybe POSIX
Maybe GameServerClaimStatus
Maybe GameServerUtilizationStatus
utilizationStatus :: Maybe GameServerUtilizationStatus
registrationTime :: Maybe POSIX
lastHealthCheckTime :: Maybe POSIX
lastClaimTime :: Maybe POSIX
instanceId :: Maybe Text
gameServerId :: Maybe Text
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
gameServerData :: Maybe Text
connectionInfo :: Maybe Text
claimStatus :: Maybe GameServerClaimStatus
$sel:utilizationStatus:GameServer' :: GameServer -> Maybe GameServerUtilizationStatus
$sel:registrationTime:GameServer' :: GameServer -> Maybe POSIX
$sel:lastHealthCheckTime:GameServer' :: GameServer -> Maybe POSIX
$sel:lastClaimTime:GameServer' :: GameServer -> Maybe POSIX
$sel:instanceId:GameServer' :: GameServer -> Maybe Text
$sel:gameServerId:GameServer' :: GameServer -> Maybe Text
$sel:gameServerGroupName:GameServer' :: GameServer -> Maybe Text
$sel:gameServerGroupArn:GameServer' :: GameServer -> Maybe Text
$sel:gameServerData:GameServer' :: GameServer -> Maybe Text
$sel:connectionInfo:GameServer' :: GameServer -> Maybe Text
$sel:claimStatus:GameServer' :: GameServer -> Maybe GameServerClaimStatus
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameServerClaimStatus
claimStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
connectionInfo
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerData
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
gameServerId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastClaimTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastHealthCheckTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
registrationTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameServerUtilizationStatus
utilizationStatus

instance Prelude.NFData GameServer where
  rnf :: GameServer -> ()
rnf GameServer' {Maybe Text
Maybe POSIX
Maybe GameServerClaimStatus
Maybe GameServerUtilizationStatus
utilizationStatus :: Maybe GameServerUtilizationStatus
registrationTime :: Maybe POSIX
lastHealthCheckTime :: Maybe POSIX
lastClaimTime :: Maybe POSIX
instanceId :: Maybe Text
gameServerId :: Maybe Text
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
gameServerData :: Maybe Text
connectionInfo :: Maybe Text
claimStatus :: Maybe GameServerClaimStatus
$sel:utilizationStatus:GameServer' :: GameServer -> Maybe GameServerUtilizationStatus
$sel:registrationTime:GameServer' :: GameServer -> Maybe POSIX
$sel:lastHealthCheckTime:GameServer' :: GameServer -> Maybe POSIX
$sel:lastClaimTime:GameServer' :: GameServer -> Maybe POSIX
$sel:instanceId:GameServer' :: GameServer -> Maybe Text
$sel:gameServerId:GameServer' :: GameServer -> Maybe Text
$sel:gameServerGroupName:GameServer' :: GameServer -> Maybe Text
$sel:gameServerGroupArn:GameServer' :: GameServer -> Maybe Text
$sel:gameServerData:GameServer' :: GameServer -> Maybe Text
$sel:connectionInfo:GameServer' :: GameServer -> Maybe Text
$sel:claimStatus:GameServer' :: GameServer -> Maybe GameServerClaimStatus
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe GameServerClaimStatus
claimStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
connectionInfo
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
gameServerId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
instanceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastClaimTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastHealthCheckTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
registrationTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GameServerUtilizationStatus
utilizationStatus