{-# 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.EC2.Types.ActiveInstance where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import Amazonka.EC2.Types.InstanceHealthStatus
import qualified Amazonka.Prelude as Prelude
data ActiveInstance = ActiveInstance'
{
ActiveInstance -> Maybe InstanceHealthStatus
instanceHealth :: Prelude.Maybe InstanceHealthStatus,
ActiveInstance -> Maybe Text
instanceId :: Prelude.Maybe Prelude.Text,
ActiveInstance -> Maybe Text
instanceType :: Prelude.Maybe Prelude.Text,
ActiveInstance -> Maybe Text
spotInstanceRequestId :: Prelude.Maybe Prelude.Text
}
deriving (ActiveInstance -> ActiveInstance -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActiveInstance -> ActiveInstance -> Bool
$c/= :: ActiveInstance -> ActiveInstance -> Bool
== :: ActiveInstance -> ActiveInstance -> Bool
$c== :: ActiveInstance -> ActiveInstance -> Bool
Prelude.Eq, ReadPrec [ActiveInstance]
ReadPrec ActiveInstance
Int -> ReadS ActiveInstance
ReadS [ActiveInstance]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActiveInstance]
$creadListPrec :: ReadPrec [ActiveInstance]
readPrec :: ReadPrec ActiveInstance
$creadPrec :: ReadPrec ActiveInstance
readList :: ReadS [ActiveInstance]
$creadList :: ReadS [ActiveInstance]
readsPrec :: Int -> ReadS ActiveInstance
$creadsPrec :: Int -> ReadS ActiveInstance
Prelude.Read, Int -> ActiveInstance -> ShowS
[ActiveInstance] -> ShowS
ActiveInstance -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActiveInstance] -> ShowS
$cshowList :: [ActiveInstance] -> ShowS
show :: ActiveInstance -> String
$cshow :: ActiveInstance -> String
showsPrec :: Int -> ActiveInstance -> ShowS
$cshowsPrec :: Int -> ActiveInstance -> ShowS
Prelude.Show, forall x. Rep ActiveInstance x -> ActiveInstance
forall x. ActiveInstance -> Rep ActiveInstance x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActiveInstance x -> ActiveInstance
$cfrom :: forall x. ActiveInstance -> Rep ActiveInstance x
Prelude.Generic)
newActiveInstance ::
ActiveInstance
newActiveInstance :: ActiveInstance
newActiveInstance =
ActiveInstance'
{ $sel:instanceHealth:ActiveInstance' :: Maybe InstanceHealthStatus
instanceHealth = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:ActiveInstance' :: Maybe Text
instanceId = forall a. Maybe a
Prelude.Nothing,
$sel:instanceType:ActiveInstance' :: Maybe Text
instanceType = forall a. Maybe a
Prelude.Nothing,
$sel:spotInstanceRequestId:ActiveInstance' :: Maybe Text
spotInstanceRequestId = forall a. Maybe a
Prelude.Nothing
}
activeInstance_instanceHealth :: Lens.Lens' ActiveInstance (Prelude.Maybe InstanceHealthStatus)
activeInstance_instanceHealth :: Lens' ActiveInstance (Maybe InstanceHealthStatus)
activeInstance_instanceHealth = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveInstance' {Maybe InstanceHealthStatus
instanceHealth :: Maybe InstanceHealthStatus
$sel:instanceHealth:ActiveInstance' :: ActiveInstance -> Maybe InstanceHealthStatus
instanceHealth} -> Maybe InstanceHealthStatus
instanceHealth) (\s :: ActiveInstance
s@ActiveInstance' {} Maybe InstanceHealthStatus
a -> ActiveInstance
s {$sel:instanceHealth:ActiveInstance' :: Maybe InstanceHealthStatus
instanceHealth = Maybe InstanceHealthStatus
a} :: ActiveInstance)
activeInstance_instanceId :: Lens.Lens' ActiveInstance (Prelude.Maybe Prelude.Text)
activeInstance_instanceId :: Lens' ActiveInstance (Maybe Text)
activeInstance_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveInstance' {Maybe Text
instanceId :: Maybe Text
$sel:instanceId:ActiveInstance' :: ActiveInstance -> Maybe Text
instanceId} -> Maybe Text
instanceId) (\s :: ActiveInstance
s@ActiveInstance' {} Maybe Text
a -> ActiveInstance
s {$sel:instanceId:ActiveInstance' :: Maybe Text
instanceId = Maybe Text
a} :: ActiveInstance)
activeInstance_instanceType :: Lens.Lens' ActiveInstance (Prelude.Maybe Prelude.Text)
activeInstance_instanceType :: Lens' ActiveInstance (Maybe Text)
activeInstance_instanceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveInstance' {Maybe Text
instanceType :: Maybe Text
$sel:instanceType:ActiveInstance' :: ActiveInstance -> Maybe Text
instanceType} -> Maybe Text
instanceType) (\s :: ActiveInstance
s@ActiveInstance' {} Maybe Text
a -> ActiveInstance
s {$sel:instanceType:ActiveInstance' :: Maybe Text
instanceType = Maybe Text
a} :: ActiveInstance)
activeInstance_spotInstanceRequestId :: Lens.Lens' ActiveInstance (Prelude.Maybe Prelude.Text)
activeInstance_spotInstanceRequestId :: Lens' ActiveInstance (Maybe Text)
activeInstance_spotInstanceRequestId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActiveInstance' {Maybe Text
spotInstanceRequestId :: Maybe Text
$sel:spotInstanceRequestId:ActiveInstance' :: ActiveInstance -> Maybe Text
spotInstanceRequestId} -> Maybe Text
spotInstanceRequestId) (\s :: ActiveInstance
s@ActiveInstance' {} Maybe Text
a -> ActiveInstance
s {$sel:spotInstanceRequestId:ActiveInstance' :: Maybe Text
spotInstanceRequestId = Maybe Text
a} :: ActiveInstance)
instance Data.FromXML ActiveInstance where
parseXML :: [Node] -> Either String ActiveInstance
parseXML [Node]
x =
Maybe InstanceHealthStatus
-> Maybe Text -> Maybe Text -> Maybe Text -> ActiveInstance
ActiveInstance'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceHealth")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"instanceType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"spotInstanceRequestId")
instance Prelude.Hashable ActiveInstance where
hashWithSalt :: Int -> ActiveInstance -> Int
hashWithSalt Int
_salt ActiveInstance' {Maybe Text
Maybe InstanceHealthStatus
spotInstanceRequestId :: Maybe Text
instanceType :: Maybe Text
instanceId :: Maybe Text
instanceHealth :: Maybe InstanceHealthStatus
$sel:spotInstanceRequestId:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceType:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceId:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceHealth:ActiveInstance' :: ActiveInstance -> Maybe InstanceHealthStatus
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe InstanceHealthStatus
instanceHealth
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
instanceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
spotInstanceRequestId
instance Prelude.NFData ActiveInstance where
rnf :: ActiveInstance -> ()
rnf ActiveInstance' {Maybe Text
Maybe InstanceHealthStatus
spotInstanceRequestId :: Maybe Text
instanceType :: Maybe Text
instanceId :: Maybe Text
instanceHealth :: Maybe InstanceHealthStatus
$sel:spotInstanceRequestId:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceType:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceId:ActiveInstance' :: ActiveInstance -> Maybe Text
$sel:instanceHealth:ActiveInstance' :: ActiveInstance -> Maybe InstanceHealthStatus
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceHealthStatus
instanceHealth
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
instanceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
spotInstanceRequestId