{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GameLift.Types.EC2InstanceType
import Amazonka.GameLift.Types.InstanceStatus
import Amazonka.GameLift.Types.OperatingSystem
import qualified Amazonka.Prelude as Prelude
data Instance = Instance'
{
Instance -> Maybe POSIX
creationTime :: Prelude.Maybe Data.POSIX,
Instance -> Maybe Text
dnsName :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
fleetArn :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
fleetId :: Prelude.Maybe Prelude.Text,
Instance -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
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 InstanceStatus
status :: Prelude.Maybe InstanceStatus,
Instance -> Maybe EC2InstanceType
type' :: Prelude.Maybe EC2InstanceType
}
deriving (Instance -> Instance -> Bool
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]
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
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. 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'
{ $sel:creationTime:Instance' :: Maybe POSIX
creationTime = forall a. Maybe a
Prelude.Nothing,
$sel:dnsName:Instance' :: Maybe Text
dnsName = forall a. Maybe a
Prelude.Nothing,
$sel:fleetArn:Instance' :: Maybe Text
fleetArn = forall a. Maybe a
Prelude.Nothing,
$sel:fleetId:Instance' :: Maybe Text
fleetId = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:Instance' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:ipAddress:Instance' :: Maybe Text
ipAddress = forall a. Maybe a
Prelude.Nothing,
$sel:location:Instance' :: Maybe Text
location = forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystem:Instance' :: Maybe OperatingSystem
operatingSystem = forall a. Maybe a
Prelude.Nothing,
$sel:status:Instance' :: Maybe InstanceStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:type':Instance' :: Maybe EC2InstanceType
type' = forall a. Maybe a
Prelude.Nothing
}
instance_creationTime :: Lens.Lens' Instance (Prelude.Maybe Prelude.UTCTime)
instance_creationTime :: Lens' Instance (Maybe UTCTime)
instance_creationTime = 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) 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
instance_dnsName :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_dnsName :: Lens' Instance (Maybe Text)
instance_dnsName = 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_fleetArn :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_fleetArn :: Lens' Instance (Maybe Text)
instance_fleetArn = 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_fleetId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_fleetId :: Lens' Instance (Maybe Text)
instance_fleetId = 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_instanceId :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_instanceId :: Lens' Instance (Maybe Text)
instance_instanceId = 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_ipAddress :: Lens.Lens' Instance (Prelude.Maybe Prelude.Text)
instance_ipAddress :: Lens' Instance (Maybe Text)
instance_ipAddress = 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 :: Lens' Instance (Maybe Text)
instance_location = 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 :: Lens' Instance (Maybe OperatingSystem)
instance_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_status :: Lens.Lens' Instance (Prelude.Maybe InstanceStatus)
instance_status :: Lens' Instance (Maybe InstanceStatus)
instance_status = 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_type :: Lens.Lens' Instance (Prelude.Maybe EC2InstanceType)
instance_type :: Lens' Instance (Maybe EC2InstanceType)
instance_type = 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 Data.FromJSON Instance where
parseJSON :: Value -> Parser Instance
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Instance"
( \Object
x ->
Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe OperatingSystem
-> Maybe InstanceStatus
-> Maybe EC2InstanceType
-> Instance
Instance'
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
"CreationTime")
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
"DnsName")
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
"FleetArn")
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
"FleetId")
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
"IpAddress")
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
"Location")
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
"OperatingSystem")
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
"Status")
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
"Type")
)
instance Prelude.Hashable Instance where
hashWithSalt :: Int -> Instance -> Int
hashWithSalt Int
_salt Instance' {Maybe Text
Maybe POSIX
Maybe EC2InstanceType
Maybe InstanceStatus
Maybe OperatingSystem
type' :: Maybe EC2InstanceType
status :: Maybe InstanceStatus
operatingSystem :: Maybe OperatingSystem
location :: Maybe Text
ipAddress :: Maybe Text
instanceId :: Maybe Text
fleetId :: Maybe Text
fleetArn :: Maybe Text
dnsName :: Maybe Text
creationTime :: Maybe POSIX
$sel:type':Instance' :: Instance -> Maybe EC2InstanceType
$sel:status:Instance' :: Instance -> Maybe InstanceStatus
$sel:operatingSystem:Instance' :: Instance -> Maybe OperatingSystem
$sel:location:Instance' :: Instance -> Maybe Text
$sel:ipAddress:Instance' :: Instance -> Maybe Text
$sel:instanceId:Instance' :: Instance -> Maybe Text
$sel:fleetId:Instance' :: Instance -> Maybe Text
$sel:fleetArn:Instance' :: Instance -> Maybe Text
$sel:dnsName:Instance' :: Instance -> Maybe Text
$sel:creationTime:Instance' :: Instance -> Maybe POSIX
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
creationTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dnsName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fleetArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
fleetId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OperatingSystem
operatingSystem
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EC2InstanceType
type'
instance Prelude.NFData Instance where
rnf :: Instance -> ()
rnf Instance' {Maybe Text
Maybe POSIX
Maybe EC2InstanceType
Maybe InstanceStatus
Maybe OperatingSystem
type' :: Maybe EC2InstanceType
status :: Maybe InstanceStatus
operatingSystem :: Maybe OperatingSystem
location :: Maybe Text
ipAddress :: Maybe Text
instanceId :: Maybe Text
fleetId :: Maybe Text
fleetArn :: Maybe Text
dnsName :: Maybe Text
creationTime :: Maybe POSIX
$sel:type':Instance' :: Instance -> Maybe EC2InstanceType
$sel:status:Instance' :: Instance -> Maybe InstanceStatus
$sel:operatingSystem:Instance' :: Instance -> Maybe OperatingSystem
$sel:location:Instance' :: Instance -> Maybe Text
$sel:ipAddress:Instance' :: Instance -> Maybe Text
$sel:instanceId:Instance' :: Instance -> Maybe Text
$sel:fleetId:Instance' :: Instance -> Maybe Text
$sel:fleetArn:Instance' :: Instance -> Maybe Text
$sel:dnsName:Instance' :: Instance -> Maybe Text
$sel:creationTime:Instance' :: Instance -> Maybe POSIX
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dnsName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fleetArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
fleetId
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 Text
ipAddress
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
location
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OperatingSystem
operatingSystem
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EC2InstanceType
type'