{-# 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.Lightsail.Types.InstanceHealthSummary where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.InstanceHealthReason
import Amazonka.Lightsail.Types.InstanceHealthState
import qualified Amazonka.Prelude as Prelude
data InstanceHealthSummary = InstanceHealthSummary'
{
InstanceHealthSummary -> Maybe InstanceHealthState
instanceHealth :: Prelude.Maybe InstanceHealthState,
InstanceHealthSummary -> Maybe Text
instanceName :: Prelude.Maybe Prelude.Text,
InstanceHealthSummary -> Maybe InstanceHealthReason
instanceHealthReason :: Prelude.Maybe InstanceHealthReason
}
deriving (InstanceHealthSummary -> InstanceHealthSummary -> Bool
(InstanceHealthSummary -> InstanceHealthSummary -> Bool)
-> (InstanceHealthSummary -> InstanceHealthSummary -> Bool)
-> Eq InstanceHealthSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceHealthSummary -> InstanceHealthSummary -> Bool
$c/= :: InstanceHealthSummary -> InstanceHealthSummary -> Bool
== :: InstanceHealthSummary -> InstanceHealthSummary -> Bool
$c== :: InstanceHealthSummary -> InstanceHealthSummary -> Bool
Prelude.Eq, ReadPrec [InstanceHealthSummary]
ReadPrec InstanceHealthSummary
Int -> ReadS InstanceHealthSummary
ReadS [InstanceHealthSummary]
(Int -> ReadS InstanceHealthSummary)
-> ReadS [InstanceHealthSummary]
-> ReadPrec InstanceHealthSummary
-> ReadPrec [InstanceHealthSummary]
-> Read InstanceHealthSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceHealthSummary]
$creadListPrec :: ReadPrec [InstanceHealthSummary]
readPrec :: ReadPrec InstanceHealthSummary
$creadPrec :: ReadPrec InstanceHealthSummary
readList :: ReadS [InstanceHealthSummary]
$creadList :: ReadS [InstanceHealthSummary]
readsPrec :: Int -> ReadS InstanceHealthSummary
$creadsPrec :: Int -> ReadS InstanceHealthSummary
Prelude.Read, Int -> InstanceHealthSummary -> ShowS
[InstanceHealthSummary] -> ShowS
InstanceHealthSummary -> String
(Int -> InstanceHealthSummary -> ShowS)
-> (InstanceHealthSummary -> String)
-> ([InstanceHealthSummary] -> ShowS)
-> Show InstanceHealthSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceHealthSummary] -> ShowS
$cshowList :: [InstanceHealthSummary] -> ShowS
show :: InstanceHealthSummary -> String
$cshow :: InstanceHealthSummary -> String
showsPrec :: Int -> InstanceHealthSummary -> ShowS
$cshowsPrec :: Int -> InstanceHealthSummary -> ShowS
Prelude.Show, (forall x. InstanceHealthSummary -> Rep InstanceHealthSummary x)
-> (forall x. Rep InstanceHealthSummary x -> InstanceHealthSummary)
-> Generic InstanceHealthSummary
forall x. Rep InstanceHealthSummary x -> InstanceHealthSummary
forall x. InstanceHealthSummary -> Rep InstanceHealthSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceHealthSummary x -> InstanceHealthSummary
$cfrom :: forall x. InstanceHealthSummary -> Rep InstanceHealthSummary x
Prelude.Generic)
newInstanceHealthSummary ::
InstanceHealthSummary
newInstanceHealthSummary :: InstanceHealthSummary
newInstanceHealthSummary =
InstanceHealthSummary' :: Maybe InstanceHealthState
-> Maybe Text
-> Maybe InstanceHealthReason
-> InstanceHealthSummary
InstanceHealthSummary'
{ $sel:instanceHealth:InstanceHealthSummary' :: Maybe InstanceHealthState
instanceHealth =
Maybe InstanceHealthState
forall a. Maybe a
Prelude.Nothing,
$sel:instanceName:InstanceHealthSummary' :: Maybe Text
instanceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceHealthReason:InstanceHealthSummary' :: Maybe InstanceHealthReason
instanceHealthReason = Maybe InstanceHealthReason
forall a. Maybe a
Prelude.Nothing
}
instanceHealthSummary_instanceHealth :: Lens.Lens' InstanceHealthSummary (Prelude.Maybe InstanceHealthState)
instanceHealthSummary_instanceHealth :: (Maybe InstanceHealthState -> f (Maybe InstanceHealthState))
-> InstanceHealthSummary -> f InstanceHealthSummary
instanceHealthSummary_instanceHealth = (InstanceHealthSummary -> Maybe InstanceHealthState)
-> (InstanceHealthSummary
-> Maybe InstanceHealthState -> InstanceHealthSummary)
-> Lens
InstanceHealthSummary
InstanceHealthSummary
(Maybe InstanceHealthState)
(Maybe InstanceHealthState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceHealthSummary' {Maybe InstanceHealthState
instanceHealth :: Maybe InstanceHealthState
$sel:instanceHealth:InstanceHealthSummary' :: InstanceHealthSummary -> Maybe InstanceHealthState
instanceHealth} -> Maybe InstanceHealthState
instanceHealth) (\s :: InstanceHealthSummary
s@InstanceHealthSummary' {} Maybe InstanceHealthState
a -> InstanceHealthSummary
s {$sel:instanceHealth:InstanceHealthSummary' :: Maybe InstanceHealthState
instanceHealth = Maybe InstanceHealthState
a} :: InstanceHealthSummary)
instanceHealthSummary_instanceName :: Lens.Lens' InstanceHealthSummary (Prelude.Maybe Prelude.Text)
instanceHealthSummary_instanceName :: (Maybe Text -> f (Maybe Text))
-> InstanceHealthSummary -> f InstanceHealthSummary
instanceHealthSummary_instanceName = (InstanceHealthSummary -> Maybe Text)
-> (InstanceHealthSummary -> Maybe Text -> InstanceHealthSummary)
-> Lens
InstanceHealthSummary
InstanceHealthSummary
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceHealthSummary' {Maybe Text
instanceName :: Maybe Text
$sel:instanceName:InstanceHealthSummary' :: InstanceHealthSummary -> Maybe Text
instanceName} -> Maybe Text
instanceName) (\s :: InstanceHealthSummary
s@InstanceHealthSummary' {} Maybe Text
a -> InstanceHealthSummary
s {$sel:instanceName:InstanceHealthSummary' :: Maybe Text
instanceName = Maybe Text
a} :: InstanceHealthSummary)
instanceHealthSummary_instanceHealthReason :: Lens.Lens' InstanceHealthSummary (Prelude.Maybe InstanceHealthReason)
instanceHealthSummary_instanceHealthReason :: (Maybe InstanceHealthReason -> f (Maybe InstanceHealthReason))
-> InstanceHealthSummary -> f InstanceHealthSummary
instanceHealthSummary_instanceHealthReason = (InstanceHealthSummary -> Maybe InstanceHealthReason)
-> (InstanceHealthSummary
-> Maybe InstanceHealthReason -> InstanceHealthSummary)
-> Lens
InstanceHealthSummary
InstanceHealthSummary
(Maybe InstanceHealthReason)
(Maybe InstanceHealthReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceHealthSummary' {Maybe InstanceHealthReason
instanceHealthReason :: Maybe InstanceHealthReason
$sel:instanceHealthReason:InstanceHealthSummary' :: InstanceHealthSummary -> Maybe InstanceHealthReason
instanceHealthReason} -> Maybe InstanceHealthReason
instanceHealthReason) (\s :: InstanceHealthSummary
s@InstanceHealthSummary' {} Maybe InstanceHealthReason
a -> InstanceHealthSummary
s {$sel:instanceHealthReason:InstanceHealthSummary' :: Maybe InstanceHealthReason
instanceHealthReason = Maybe InstanceHealthReason
a} :: InstanceHealthSummary)
instance Core.FromJSON InstanceHealthSummary where
parseJSON :: Value -> Parser InstanceHealthSummary
parseJSON =
String
-> (Object -> Parser InstanceHealthSummary)
-> Value
-> Parser InstanceHealthSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceHealthSummary"
( \Object
x ->
Maybe InstanceHealthState
-> Maybe Text
-> Maybe InstanceHealthReason
-> InstanceHealthSummary
InstanceHealthSummary'
(Maybe InstanceHealthState
-> Maybe Text
-> Maybe InstanceHealthReason
-> InstanceHealthSummary)
-> Parser (Maybe InstanceHealthState)
-> Parser
(Maybe Text -> Maybe InstanceHealthReason -> InstanceHealthSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe InstanceHealthState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceHealth")
Parser
(Maybe Text -> Maybe InstanceHealthReason -> InstanceHealthSummary)
-> Parser (Maybe Text)
-> Parser (Maybe InstanceHealthReason -> InstanceHealthSummary)
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
"instanceName")
Parser (Maybe InstanceHealthReason -> InstanceHealthSummary)
-> Parser (Maybe InstanceHealthReason)
-> Parser InstanceHealthSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe InstanceHealthReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"instanceHealthReason")
)
instance Prelude.Hashable InstanceHealthSummary
instance Prelude.NFData InstanceHealthSummary