{-# 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 Amazonka.GameLift.Types.GameServerInstanceStatus
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data GameServerInstance = GameServerInstance'
{
GameServerInstance -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
GameServerInstance -> Maybe Text
gameServerGroupName :: Prelude.Maybe Prelude.Text,
GameServerInstance -> Maybe GameServerInstanceStatus
instanceStatus :: Prelude.Maybe GameServerInstanceStatus,
GameServerInstance -> Maybe Text
gameServerGroupArn :: Prelude.Maybe Prelude.Text
}
deriving (GameServerInstance -> GameServerInstance -> Bool
(GameServerInstance -> GameServerInstance -> Bool)
-> (GameServerInstance -> GameServerInstance -> Bool)
-> Eq GameServerInstance
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]
(Int -> ReadS GameServerInstance)
-> ReadS [GameServerInstance]
-> ReadPrec GameServerInstance
-> ReadPrec [GameServerInstance]
-> Read 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
(Int -> GameServerInstance -> ShowS)
-> (GameServerInstance -> String)
-> ([GameServerInstance] -> ShowS)
-> Show GameServerInstance
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. GameServerInstance -> Rep GameServerInstance x)
-> (forall x. Rep GameServerInstance x -> GameServerInstance)
-> Generic GameServerInstance
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' :: Maybe Text
-> Maybe Text
-> Maybe GameServerInstanceStatus
-> Maybe Text
-> GameServerInstance
GameServerInstance'
{ $sel:instanceId:GameServerInstance' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:gameServerGroupName:GameServerInstance' :: Maybe Text
gameServerGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceStatus:GameServerInstance' :: Maybe GameServerInstanceStatus
instanceStatus = Maybe GameServerInstanceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:gameServerGroupArn:GameServerInstance' :: Maybe Text
gameServerGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
gameServerInstance_instanceId :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_instanceId :: (Maybe Text -> f (Maybe Text))
-> GameServerInstance -> f GameServerInstance
gameServerInstance_instanceId = (GameServerInstance -> Maybe Text)
-> (GameServerInstance -> Maybe Text -> GameServerInstance)
-> Lens
GameServerInstance GameServerInstance (Maybe Text) (Maybe Text)
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_gameServerGroupName :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_gameServerGroupName :: (Maybe Text -> f (Maybe Text))
-> GameServerInstance -> f GameServerInstance
gameServerInstance_gameServerGroupName = (GameServerInstance -> Maybe Text)
-> (GameServerInstance -> Maybe Text -> GameServerInstance)
-> Lens
GameServerInstance GameServerInstance (Maybe Text) (Maybe Text)
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_instanceStatus :: Lens.Lens' GameServerInstance (Prelude.Maybe GameServerInstanceStatus)
gameServerInstance_instanceStatus :: (Maybe GameServerInstanceStatus
-> f (Maybe GameServerInstanceStatus))
-> GameServerInstance -> f GameServerInstance
gameServerInstance_instanceStatus = (GameServerInstance -> Maybe GameServerInstanceStatus)
-> (GameServerInstance
-> Maybe GameServerInstanceStatus -> GameServerInstance)
-> Lens
GameServerInstance
GameServerInstance
(Maybe GameServerInstanceStatus)
(Maybe GameServerInstanceStatus)
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)
gameServerInstance_gameServerGroupArn :: Lens.Lens' GameServerInstance (Prelude.Maybe Prelude.Text)
gameServerInstance_gameServerGroupArn :: (Maybe Text -> f (Maybe Text))
-> GameServerInstance -> f GameServerInstance
gameServerInstance_gameServerGroupArn = (GameServerInstance -> Maybe Text)
-> (GameServerInstance -> Maybe Text -> GameServerInstance)
-> Lens
GameServerInstance GameServerInstance (Maybe Text) (Maybe Text)
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)
instance Core.FromJSON GameServerInstance where
parseJSON :: Value -> Parser GameServerInstance
parseJSON =
String
-> (Object -> Parser GameServerInstance)
-> Value
-> Parser GameServerInstance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"GameServerInstance"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe GameServerInstanceStatus
-> Maybe Text
-> GameServerInstance
GameServerInstance'
(Maybe Text
-> Maybe Text
-> Maybe GameServerInstanceStatus
-> Maybe Text
-> GameServerInstance)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe GameServerInstanceStatus
-> Maybe Text
-> GameServerInstance)
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 Text
-> Maybe GameServerInstanceStatus
-> Maybe Text
-> GameServerInstance)
-> Parser (Maybe Text)
-> Parser
(Maybe GameServerInstanceStatus
-> Maybe Text -> GameServerInstance)
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 GameServerInstanceStatus
-> Maybe Text -> GameServerInstance)
-> Parser (Maybe GameServerInstanceStatus)
-> Parser (Maybe Text -> GameServerInstance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe GameServerInstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InstanceStatus")
Parser (Maybe Text -> GameServerInstance)
-> Parser (Maybe Text) -> Parser GameServerInstance
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 GameServerInstance
instance Prelude.NFData GameServerInstance