{-# 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.XRay.Types.FaultRootCause where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.XRay.Types.FaultRootCauseService
data FaultRootCause = FaultRootCause'
{
FaultRootCause -> Maybe Bool
clientImpacting :: Prelude.Maybe Prelude.Bool,
FaultRootCause -> Maybe [FaultRootCauseService]
services :: Prelude.Maybe [FaultRootCauseService]
}
deriving (FaultRootCause -> FaultRootCause -> Bool
(FaultRootCause -> FaultRootCause -> Bool)
-> (FaultRootCause -> FaultRootCause -> Bool) -> Eq FaultRootCause
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FaultRootCause -> FaultRootCause -> Bool
$c/= :: FaultRootCause -> FaultRootCause -> Bool
== :: FaultRootCause -> FaultRootCause -> Bool
$c== :: FaultRootCause -> FaultRootCause -> Bool
Prelude.Eq, ReadPrec [FaultRootCause]
ReadPrec FaultRootCause
Int -> ReadS FaultRootCause
ReadS [FaultRootCause]
(Int -> ReadS FaultRootCause)
-> ReadS [FaultRootCause]
-> ReadPrec FaultRootCause
-> ReadPrec [FaultRootCause]
-> Read FaultRootCause
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FaultRootCause]
$creadListPrec :: ReadPrec [FaultRootCause]
readPrec :: ReadPrec FaultRootCause
$creadPrec :: ReadPrec FaultRootCause
readList :: ReadS [FaultRootCause]
$creadList :: ReadS [FaultRootCause]
readsPrec :: Int -> ReadS FaultRootCause
$creadsPrec :: Int -> ReadS FaultRootCause
Prelude.Read, Int -> FaultRootCause -> ShowS
[FaultRootCause] -> ShowS
FaultRootCause -> String
(Int -> FaultRootCause -> ShowS)
-> (FaultRootCause -> String)
-> ([FaultRootCause] -> ShowS)
-> Show FaultRootCause
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FaultRootCause] -> ShowS
$cshowList :: [FaultRootCause] -> ShowS
show :: FaultRootCause -> String
$cshow :: FaultRootCause -> String
showsPrec :: Int -> FaultRootCause -> ShowS
$cshowsPrec :: Int -> FaultRootCause -> ShowS
Prelude.Show, (forall x. FaultRootCause -> Rep FaultRootCause x)
-> (forall x. Rep FaultRootCause x -> FaultRootCause)
-> Generic FaultRootCause
forall x. Rep FaultRootCause x -> FaultRootCause
forall x. FaultRootCause -> Rep FaultRootCause x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FaultRootCause x -> FaultRootCause
$cfrom :: forall x. FaultRootCause -> Rep FaultRootCause x
Prelude.Generic)
newFaultRootCause ::
FaultRootCause
newFaultRootCause :: FaultRootCause
newFaultRootCause =
FaultRootCause' :: Maybe Bool -> Maybe [FaultRootCauseService] -> FaultRootCause
FaultRootCause'
{ $sel:clientImpacting:FaultRootCause' :: Maybe Bool
clientImpacting = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:services:FaultRootCause' :: Maybe [FaultRootCauseService]
services = Maybe [FaultRootCauseService]
forall a. Maybe a
Prelude.Nothing
}
faultRootCause_clientImpacting :: Lens.Lens' FaultRootCause (Prelude.Maybe Prelude.Bool)
faultRootCause_clientImpacting :: (Maybe Bool -> f (Maybe Bool))
-> FaultRootCause -> f FaultRootCause
faultRootCause_clientImpacting = (FaultRootCause -> Maybe Bool)
-> (FaultRootCause -> Maybe Bool -> FaultRootCause)
-> Lens FaultRootCause FaultRootCause (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaultRootCause' {Maybe Bool
clientImpacting :: Maybe Bool
$sel:clientImpacting:FaultRootCause' :: FaultRootCause -> Maybe Bool
clientImpacting} -> Maybe Bool
clientImpacting) (\s :: FaultRootCause
s@FaultRootCause' {} Maybe Bool
a -> FaultRootCause
s {$sel:clientImpacting:FaultRootCause' :: Maybe Bool
clientImpacting = Maybe Bool
a} :: FaultRootCause)
faultRootCause_services :: Lens.Lens' FaultRootCause (Prelude.Maybe [FaultRootCauseService])
faultRootCause_services :: (Maybe [FaultRootCauseService]
-> f (Maybe [FaultRootCauseService]))
-> FaultRootCause -> f FaultRootCause
faultRootCause_services = (FaultRootCause -> Maybe [FaultRootCauseService])
-> (FaultRootCause
-> Maybe [FaultRootCauseService] -> FaultRootCause)
-> Lens
FaultRootCause
FaultRootCause
(Maybe [FaultRootCauseService])
(Maybe [FaultRootCauseService])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FaultRootCause' {Maybe [FaultRootCauseService]
services :: Maybe [FaultRootCauseService]
$sel:services:FaultRootCause' :: FaultRootCause -> Maybe [FaultRootCauseService]
services} -> Maybe [FaultRootCauseService]
services) (\s :: FaultRootCause
s@FaultRootCause' {} Maybe [FaultRootCauseService]
a -> FaultRootCause
s {$sel:services:FaultRootCause' :: Maybe [FaultRootCauseService]
services = Maybe [FaultRootCauseService]
a} :: FaultRootCause) ((Maybe [FaultRootCauseService]
-> f (Maybe [FaultRootCauseService]))
-> FaultRootCause -> f FaultRootCause)
-> ((Maybe [FaultRootCauseService]
-> f (Maybe [FaultRootCauseService]))
-> Maybe [FaultRootCauseService]
-> f (Maybe [FaultRootCauseService]))
-> (Maybe [FaultRootCauseService]
-> f (Maybe [FaultRootCauseService]))
-> FaultRootCause
-> f FaultRootCause
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[FaultRootCauseService]
[FaultRootCauseService]
[FaultRootCauseService]
[FaultRootCauseService]
-> Iso
(Maybe [FaultRootCauseService])
(Maybe [FaultRootCauseService])
(Maybe [FaultRootCauseService])
(Maybe [FaultRootCauseService])
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
[FaultRootCauseService]
[FaultRootCauseService]
[FaultRootCauseService]
[FaultRootCauseService]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON FaultRootCause where
parseJSON :: Value -> Parser FaultRootCause
parseJSON =
String
-> (Object -> Parser FaultRootCause)
-> Value
-> Parser FaultRootCause
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FaultRootCause"
( \Object
x ->
Maybe Bool -> Maybe [FaultRootCauseService] -> FaultRootCause
FaultRootCause'
(Maybe Bool -> Maybe [FaultRootCauseService] -> FaultRootCause)
-> Parser (Maybe Bool)
-> Parser (Maybe [FaultRootCauseService] -> FaultRootCause)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientImpacting")
Parser (Maybe [FaultRootCauseService] -> FaultRootCause)
-> Parser (Maybe [FaultRootCauseService]) -> Parser FaultRootCause
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [FaultRootCauseService]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Services" Parser (Maybe (Maybe [FaultRootCauseService]))
-> Maybe [FaultRootCauseService]
-> Parser (Maybe [FaultRootCauseService])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [FaultRootCauseService]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable FaultRootCause
instance Prelude.NFData FaultRootCause