{-# 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.Instance where
import qualified Amazonka.Core as Core
import Amazonka.GameLift.Types.EC2InstanceType
import Amazonka.GameLift.Types.InstanceStatus
import Amazonka.GameLift.Types.OperatingSystem
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Instance = Instance'
{
Instance -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Instance -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
Instance -> Maybe InstanceStatus
status :: Prelude.Maybe InstanceStatus,
Instance -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
Instance -> Maybe OperatingSystem
operatingSystem :: Prelude.Maybe OperatingSystem,
Instance -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
Instance -> Maybe EC2InstanceType
type' :: Prelude.Maybe EC2InstanceType,
Instance -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text
}
deriving (Instance -> Instance -> Bool
(Instance -> Instance -> Bool)
-> (Instance -> Instance -> Bool) -> Eq Instance
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Instance -> Instance -> Bool
$c/= :: Instance -> Instance -> Bool
== :: Instance -> Instance -> Bool
$c== :: Instance -> Instance -> Bool
Prelude.Eq, ReadPrec [Instance]
ReadPrec Instance
Int -> ReadS Instance
ReadS [Instance]
(Int -> ReadS Instance)
-> ReadS [Instance]
-> ReadPrec Instance
-> ReadPrec [Instance]
-> Read Instance
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Instance]
$creadListPrec :: ReadPrec [Instance]
readPrec :: ReadPrec Instance
$creadPrec :: ReadPrec Instance
readList :: ReadS [Instance]
$creadList :: ReadS [Instance]
readsPrec :: Int -> ReadS Instance
$creadsPrec :: Int -> ReadS Instance
Prelude.Read, Int -> Instance -> ShowS
[Instance] -> ShowS
Instance -> String
(Int -> Instance -> ShowS)
-> (Instance -> String) -> ([Instance] -> ShowS) -> Show Instance
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Instance] -> ShowS
$cshowList :: [Instance] -> ShowS
show :: Instance -> String
$cshow :: Instance -> String
showsPrec :: Int -> Instance -> ShowS
$cshowsPrec :: Int -> Instance -> ShowS
Prelude.Show, (forall x. Instance -> Rep Instance x)
-> (forall x. Rep Instance x -> Instance) -> Generic Instance
forall x. Rep Instance x -> Instance
forall x. Instance -> Rep Instance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Instance x -> Instance
$cfrom :: forall x. Instance -> Rep Instance x
Prelude.Generic)
newInstance ::
Instance
newInstance :: Instance
newInstance =
Instance' :: Maybe POSIX
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance
Instance'
{ $sel:creationTime:Instance' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Instance' :: Maybe Text
instanceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:status:Instance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:Instance' :: Maybe Text
ipAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:location:Instance' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystem:Instance' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
forall a. Maybe a
Prelude.Nothing,
$sel:fleetArn:Instance' :: Maybe Text
fleetArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':Instance' :: Maybe EC2InstanceType
type' = Maybe EC2InstanceType
forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:Instance' :: Maybe Text
fleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dnsName:Instance' :: Maybe Text
dnsName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instance_creationTime :: Lens.Lens' Instance (Prelude.Maybe Prelude.UTCTime)
instance_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Instance -> f Instance
instance_creationTime = (Instance -> Maybe POSIX)
-> (Instance -> Maybe POSIX -> Instance)
-> Lens Instance Instance (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Instance' :: Instance -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Instance
s@Instance' {} Maybe POSIX
a -> Instance
s {$sel:creationTime:Instance' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Instance) ((Maybe POSIX -> f (Maybe POSIX)) -> Instance -> f Instance)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Instance
-> f Instance
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
instance_instanceId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_instanceId = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:Instance' :: Instance -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:instanceId:Instance' :: Maybe Text
instanceId = Maybe Text
a} :: Instance)
instance_status :: Lens.Lens' Instance (Prelude.Maybe InstanceStatus)
instance_status :: (Maybe InstanceStatus -> f (Maybe InstanceStatus))
-> Instance -> f Instance
instance_status = (Instance -> Maybe InstanceStatus)
-> (Instance -> Maybe InstanceStatus -> Instance)
-> Lens
Instance Instance (Maybe InstanceStatus) (Maybe InstanceStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe InstanceStatus
status :: Maybe InstanceStatus
$sel:status:Instance' :: Instance -> Maybe InstanceStatus
status} -> Maybe InstanceStatus
status) (\s :: Instance
s@Instance' {} Maybe InstanceStatus
a -> Instance
s {$sel:status:Instance' :: Maybe InstanceStatus
status = Maybe InstanceStatus
a} :: Instance)
instance_ipAddress :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_ipAddress :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_ipAddress = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:Instance' :: Instance -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:ipAddress:Instance' :: Maybe Text
ipAddress = Maybe Text
a} :: Instance)
instance_location :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_location :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_location = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
location :: Maybe Text
$sel:location:Instance' :: Instance -> Maybe Text
location} -> Maybe Text
location) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:location:Instance' :: Maybe Text
location = Maybe Text
a} :: Instance)
instance_operatingSystem :: Lens.Lens' Instance (Prelude.Maybe OperatingSystem)
instance_operatingSystem :: (Maybe OperatingSystem -> f (Maybe OperatingSystem))
-> Instance -> f Instance
instance_operatingSystem = (Instance -> Maybe OperatingSystem)
-> (Instance -> Maybe OperatingSystem -> Instance)
-> Lens
Instance Instance (Maybe OperatingSystem) (Maybe OperatingSystem)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe OperatingSystem
operatingSystem :: Maybe OperatingSystem
$sel:operatingSystem:Instance' :: Instance -> Maybe OperatingSystem
operatingSystem} -> Maybe OperatingSystem
operatingSystem) (\s :: Instance
s@Instance' {} Maybe OperatingSystem
a -> Instance
s {$sel:operatingSystem:Instance' :: Maybe OperatingSystem
operatingSystem = Maybe OperatingSystem
a} :: Instance)
instance_fleetArn :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_fleetArn :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_fleetArn = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
fleetArn :: Maybe Text
$sel:fleetArn:Instance' :: Instance -> Maybe Text
fleetArn} -> Maybe Text
fleetArn) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:fleetArn:Instance' :: Maybe Text
fleetArn = Maybe Text
a} :: Instance)
instance_type :: Lens.Lens' Instance (Prelude.Maybe EC2InstanceType)
instance_type :: (Maybe EC2InstanceType -> f (Maybe EC2InstanceType))
-> Instance -> f Instance
instance_type = (Instance -> Maybe EC2InstanceType)
-> (Instance -> Maybe EC2InstanceType -> Instance)
-> Lens
Instance Instance (Maybe EC2InstanceType) (Maybe EC2InstanceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe EC2InstanceType
type' :: Maybe EC2InstanceType
$sel:type':Instance' :: Instance -> Maybe EC2InstanceType
type'} -> Maybe EC2InstanceType
type') (\s :: Instance
s@Instance' {} Maybe EC2InstanceType
a -> Instance
s {$sel:type':Instance' :: Maybe EC2InstanceType
type' = Maybe EC2InstanceType
a} :: Instance)
instance_fleetId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_fleetId :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_fleetId = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
fleetId :: Maybe Text
$sel:fleetId:Instance' :: Instance -> Maybe Text
fleetId} -> Maybe Text
fleetId) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:fleetId:Instance' :: Maybe Text
fleetId = Maybe Text
a} :: Instance)
instance_dnsName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_dnsName :: (Maybe Text -> f (Maybe Text)) -> Instance -> f Instance
instance_dnsName = (Instance -> Maybe Text)
-> (Instance -> Maybe Text -> Instance)
-> Lens Instance Instance (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Instance' {Maybe Text
dnsName :: Maybe Text
$sel:dnsName:Instance' :: Instance -> Maybe Text
dnsName} -> Maybe Text
dnsName) (\s :: Instance
s@Instance' {} Maybe Text
a -> Instance
s {$sel:dnsName:Instance' :: Maybe Text
dnsName = Maybe Text
a} :: Instance)
instance Core.FromJSON Instance where
parseJSON :: Value -> Parser Instance
parseJSON =
String -> (Object -> Parser Instance) -> Value -> Parser Instance
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Instance"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance
Instance'
(Maybe POSIX
-> Maybe Text
-> Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe POSIX)
-> Parser
(Maybe Text
-> Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Functor 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
"CreationTime")
Parser
(Maybe Text
-> Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
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
"InstanceId")
Parser
(Maybe InstanceStatus
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe InstanceStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
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 OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
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
"Location")
Parser
(Maybe OperatingSystem
-> Maybe Text
-> Maybe EC2InstanceType
-> Maybe Text
-> Maybe Text
-> Instance)
-> Parser (Maybe OperatingSystem)
-> Parser
(Maybe Text
-> Maybe EC2InstanceType -> Maybe Text -> Maybe Text -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe OperatingSystem)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"OperatingSystem")
Parser
(Maybe Text
-> Maybe EC2InstanceType -> Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe Text)
-> Parser
(Maybe EC2InstanceType -> Maybe Text -> Maybe Text -> Instance)
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
"FleetArn")
Parser
(Maybe EC2InstanceType -> Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe EC2InstanceType)
-> Parser (Maybe Text -> Maybe Text -> Instance)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EC2InstanceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
Parser (Maybe Text -> Maybe Text -> Instance)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Instance)
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
"FleetId")
Parser (Maybe Text -> Instance)
-> Parser (Maybe Text) -> Parser Instance
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")
)
instance Prelude.Hashable Instance
instance Prelude.NFData Instance