{-# 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 #-}
module Amazonka.GameLift.Types.GameServerInstance 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.GameServerInstanceStatus
import qualified Amazonka.Prelude as Prelude
data GameServerInstance = GameServerInstance'
{
GameServerInstance -> Maybe Text
gameServerGroupArn :: Prelude.Maybe Prelude.Text,
GameServerInstance -> Maybe Text
gameServerGroupName :: Prelude.Maybe Prelude.Text,
GameServerInstance -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
GameServerInstance -> Maybe GameServerInstanceStatus
instanceStatus :: Prelude.Maybe GameServerInstanceStatus
}
deriving (GameServerInstance -> GameServerInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GameServerInstance -> GameServerInstance -> Bool
$c/= :: GameServerInstance -> GameServerInstance -> Bool
== :: GameServerInstance -> GameServerInstance -> Bool
$c== :: GameServerInstance -> GameServerInstance -> Bool
Prelude.Eq, ReadPrec [GameServerInstance]
ReadPrec GameServerInstance
Int -> ReadS GameServerInstance
ReadS [GameServerInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GameServerInstance]
$creadListPrec :: ReadPrec [GameServerInstance]
readPrec :: ReadPrec GameServerInstance
$creadPrec :: ReadPrec GameServerInstance
readList :: ReadS [GameServerInstance]
$creadList :: ReadS [GameServerInstance]
readsPrec :: Int -> ReadS GameServerInstance
$creadsPrec :: Int -> ReadS GameServerInstance
Prelude.Read, Int -> GameServerInstance -> ShowS
[GameServerInstance] -> ShowS
GameServerInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameServerInstance] -> ShowS
$cshowList :: [GameServerInstance] -> ShowS
show :: GameServerInstance -> String
$cshow :: GameServerInstance -> String
showsPrec :: Int -> GameServerInstance -> ShowS
$cshowsPrec :: Int -> GameServerInstance -> ShowS
Prelude.Show, forall x. Rep GameServerInstance x -> GameServerInstance
forall x. GameServerInstance -> Rep GameServerInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameServerInstance x -> GameServerInstance
$cfrom :: forall x. GameServerInstance -> Rep GameServerInstance x
Prelude.Generic)
newGameServerInstance ::
GameServerInstance
newGameServerInstance :: GameServerInstance
newGameServerInstance =
GameServerInstance'
{ $sel:gameServerGroupArn:GameServerInstance' :: Maybe Text
gameServerGroupArn =
forall a. Maybe a
Prelude.Nothing,
$sel:gameServerGroupName:GameServerInstance' :: Maybe Text
gameServerGroupName = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:GameServerInstance' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:instanceStatus:GameServerInstance' :: Maybe GameServerInstanceStatus
instanceStatus = forall a. Maybe a
Prelude.Nothing
}
gameServerInstance_gameServerGroupArn :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_gameServerGroupArn :: Lens' GameServerInstance (Maybe Text)
gameServerInstance_gameServerGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerInstance' {Maybe Text
gameServerGroupArn :: Maybe Text
$sel:gameServerGroupArn:GameServerInstance' :: GameServerInstance -> Maybe Text
gameServerGroupArn} -> Maybe Text
gameServerGroupArn) (\s :: GameServerInstance
s@GameServerInstance' {} Maybe Text
a -> GameServerInstance
s {$sel:gameServerGroupArn:GameServerInstance' :: Maybe Text
gameServerGroupArn = Maybe Text
a} :: GameServerInstance)
gameServerInstance_gameServerGroupName :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_gameServerGroupName :: Lens' GameServerInstance (Maybe Text)
gameServerInstance_gameServerGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerInstance' {Maybe Text
gameServerGroupName :: Maybe Text
$sel:gameServerGroupName:GameServerInstance' :: GameServerInstance -> Maybe Text
gameServerGroupName} -> Maybe Text
gameServerGroupName) (\s :: GameServerInstance
s@GameServerInstance' {} Maybe Text
a -> GameServerInstance
s {$sel:gameServerGroupName:GameServerInstance' :: Maybe Text
gameServerGroupName = Maybe Text
a} :: GameServerInstance)
gameServerInstance_instanceId :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_instanceId :: Lens' GameServerInstance (Maybe Text)
gameServerInstance_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerInstance' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:GameServerInstance' :: GameServerInstance -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: GameServerInstance
s@GameServerInstance' {} Maybe Text
a -> GameServerInstance
s {$sel:instanceId:GameServerInstance' :: Maybe Text
instanceId = Maybe Text
a} :: GameServerInstance)
gameServerInstance_instanceStatus :: Lens.Lens' GameServerInstance (Prelude.Maybe GameServerInstanceStatus)
gameServerInstance_instanceStatus :: Lens' GameServerInstance (Maybe GameServerInstanceStatus)
gameServerInstance_instanceStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GameServerInstance' {Maybe GameServerInstanceStatus
instanceStatus :: Maybe GameServerInstanceStatus
$sel:instanceStatus:GameServerInstance' :: GameServerInstance -> Maybe GameServerInstanceStatus
instanceStatus} -> Maybe GameServerInstanceStatus
instanceStatus) (\s :: GameServerInstance
s@GameServerInstance' {} Maybe GameServerInstanceStatus
a -> GameServerInstance
s {$sel:instanceStatus:GameServerInstance' :: Maybe GameServerInstanceStatus
instanceStatus = Maybe GameServerInstanceStatus
a} :: GameServerInstance)
instance Data.FromJSON GameServerInstance where
parseJSON :: Value -> Parser GameServerInstance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GameServerInstance"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe GameServerInstanceStatus
-> GameServerInstance
GameServerInstance'
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
"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
"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
"InstanceStatus")
)
instance Prelude.Hashable GameServerInstance where
hashWithSalt :: Int -> GameServerInstance -> Int
hashWithSalt Int
_salt GameServerInstance' {Maybe Text
Maybe GameServerInstanceStatus
instanceStatus :: Maybe GameServerInstanceStatus
instanceId :: Maybe Text
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
$sel:instanceStatus:GameServerInstance' :: GameServerInstance -> Maybe GameServerInstanceStatus
$sel:instanceId:GameServerInstance' :: GameServerInstance -> Maybe Text
$sel:gameServerGroupName:GameServerInstance' :: GameServerInstance -> Maybe Text
$sel:gameServerGroupArn:GameServerInstance' :: GameServerInstance -> Maybe Text
..} =
Int
_salt
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
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe GameServerInstanceStatus
instanceStatus
instance Prelude.NFData GameServerInstance where
rnf :: GameServerInstance -> ()
rnf GameServerInstance' {Maybe Text
Maybe GameServerInstanceStatus
instanceStatus :: Maybe GameServerInstanceStatus
instanceId :: Maybe Text
gameServerGroupName :: Maybe Text
gameServerGroupArn :: Maybe Text
$sel:instanceStatus:GameServerInstance' :: GameServerInstance -> Maybe GameServerInstanceStatus
$sel:instanceId:GameServerInstance' :: GameServerInstance -> Maybe Text
$sel:gameServerGroupName:GameServerInstance' :: GameServerInstance -> Maybe Text
$sel:gameServerGroupArn:GameServerInstance' :: GameServerInstance -> Maybe Text
..} =
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
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe GameServerInstanceStatus
instanceStatus