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