{-# 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.CloudWatch.Types.PartialFailure where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PartialFailure = PartialFailure'
{
PartialFailure -> Maybe Text
failureResource :: Prelude.Maybe Prelude.Text,
PartialFailure -> Maybe Text
failureCode :: Prelude.Maybe Prelude.Text,
PartialFailure -> Maybe Text
failureDescription :: Prelude.Maybe Prelude.Text,
PartialFailure -> Maybe Text
exceptionType :: Prelude.Maybe Prelude.Text
}
deriving (PartialFailure -> PartialFailure -> Bool
(PartialFailure -> PartialFailure -> Bool)
-> (PartialFailure -> PartialFailure -> Bool) -> Eq PartialFailure
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartialFailure -> PartialFailure -> Bool
$c/= :: PartialFailure -> PartialFailure -> Bool
== :: PartialFailure -> PartialFailure -> Bool
$c== :: PartialFailure -> PartialFailure -> Bool
Prelude.Eq, ReadPrec [PartialFailure]
ReadPrec PartialFailure
Int -> ReadS PartialFailure
ReadS [PartialFailure]
(Int -> ReadS PartialFailure)
-> ReadS [PartialFailure]
-> ReadPrec PartialFailure
-> ReadPrec [PartialFailure]
-> Read PartialFailure
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PartialFailure]
$creadListPrec :: ReadPrec [PartialFailure]
readPrec :: ReadPrec PartialFailure
$creadPrec :: ReadPrec PartialFailure
readList :: ReadS [PartialFailure]
$creadList :: ReadS [PartialFailure]
readsPrec :: Int -> ReadS PartialFailure
$creadsPrec :: Int -> ReadS PartialFailure
Prelude.Read, Int -> PartialFailure -> ShowS
[PartialFailure] -> ShowS
PartialFailure -> String
(Int -> PartialFailure -> ShowS)
-> (PartialFailure -> String)
-> ([PartialFailure] -> ShowS)
-> Show PartialFailure
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartialFailure] -> ShowS
$cshowList :: [PartialFailure] -> ShowS
show :: PartialFailure -> String
$cshow :: PartialFailure -> String
showsPrec :: Int -> PartialFailure -> ShowS
$cshowsPrec :: Int -> PartialFailure -> ShowS
Prelude.Show, (forall x. PartialFailure -> Rep PartialFailure x)
-> (forall x. Rep PartialFailure x -> PartialFailure)
-> Generic PartialFailure
forall x. Rep PartialFailure x -> PartialFailure
forall x. PartialFailure -> Rep PartialFailure x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartialFailure x -> PartialFailure
$cfrom :: forall x. PartialFailure -> Rep PartialFailure x
Prelude.Generic)
newPartialFailure ::
PartialFailure
newPartialFailure :: PartialFailure
newPartialFailure =
PartialFailure' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PartialFailure
PartialFailure'
{ $sel:failureResource:PartialFailure' :: Maybe Text
failureResource = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failureCode:PartialFailure' :: Maybe Text
failureCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:failureDescription:PartialFailure' :: Maybe Text
failureDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:exceptionType:PartialFailure' :: Maybe Text
exceptionType = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
partialFailure_failureResource :: Lens.Lens' PartialFailure (Prelude.Maybe Prelude.Text)
partialFailure_failureResource :: (Maybe Text -> f (Maybe Text))
-> PartialFailure -> f PartialFailure
partialFailure_failureResource = (PartialFailure -> Maybe Text)
-> (PartialFailure -> Maybe Text -> PartialFailure)
-> Lens PartialFailure PartialFailure (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartialFailure' {Maybe Text
failureResource :: Maybe Text
$sel:failureResource:PartialFailure' :: PartialFailure -> Maybe Text
failureResource} -> Maybe Text
failureResource) (\s :: PartialFailure
s@PartialFailure' {} Maybe Text
a -> PartialFailure
s {$sel:failureResource:PartialFailure' :: Maybe Text
failureResource = Maybe Text
a} :: PartialFailure)
partialFailure_failureCode :: Lens.Lens' PartialFailure (Prelude.Maybe Prelude.Text)
partialFailure_failureCode :: (Maybe Text -> f (Maybe Text))
-> PartialFailure -> f PartialFailure
partialFailure_failureCode = (PartialFailure -> Maybe Text)
-> (PartialFailure -> Maybe Text -> PartialFailure)
-> Lens PartialFailure PartialFailure (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartialFailure' {Maybe Text
failureCode :: Maybe Text
$sel:failureCode:PartialFailure' :: PartialFailure -> Maybe Text
failureCode} -> Maybe Text
failureCode) (\s :: PartialFailure
s@PartialFailure' {} Maybe Text
a -> PartialFailure
s {$sel:failureCode:PartialFailure' :: Maybe Text
failureCode = Maybe Text
a} :: PartialFailure)
partialFailure_failureDescription :: Lens.Lens' PartialFailure (Prelude.Maybe Prelude.Text)
partialFailure_failureDescription :: (Maybe Text -> f (Maybe Text))
-> PartialFailure -> f PartialFailure
partialFailure_failureDescription = (PartialFailure -> Maybe Text)
-> (PartialFailure -> Maybe Text -> PartialFailure)
-> Lens PartialFailure PartialFailure (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartialFailure' {Maybe Text
failureDescription :: Maybe Text
$sel:failureDescription:PartialFailure' :: PartialFailure -> Maybe Text
failureDescription} -> Maybe Text
failureDescription) (\s :: PartialFailure
s@PartialFailure' {} Maybe Text
a -> PartialFailure
s {$sel:failureDescription:PartialFailure' :: Maybe Text
failureDescription = Maybe Text
a} :: PartialFailure)
partialFailure_exceptionType :: Lens.Lens' PartialFailure (Prelude.Maybe Prelude.Text)
partialFailure_exceptionType :: (Maybe Text -> f (Maybe Text))
-> PartialFailure -> f PartialFailure
partialFailure_exceptionType = (PartialFailure -> Maybe Text)
-> (PartialFailure -> Maybe Text -> PartialFailure)
-> Lens PartialFailure PartialFailure (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartialFailure' {Maybe Text
exceptionType :: Maybe Text
$sel:exceptionType:PartialFailure' :: PartialFailure -> Maybe Text
exceptionType} -> Maybe Text
exceptionType) (\s :: PartialFailure
s@PartialFailure' {} Maybe Text
a -> PartialFailure
s {$sel:exceptionType:PartialFailure' :: Maybe Text
exceptionType = Maybe Text
a} :: PartialFailure)
instance Core.FromXML PartialFailure where
parseXML :: [Node] -> Either String PartialFailure
parseXML [Node]
x =
Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PartialFailure
PartialFailure'
(Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> PartialFailure)
-> Either String (Maybe Text)
-> Either
String (Maybe Text -> Maybe Text -> Maybe Text -> PartialFailure)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureResource")
Either
String (Maybe Text -> Maybe Text -> Maybe Text -> PartialFailure)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Maybe Text -> PartialFailure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureCode")
Either String (Maybe Text -> Maybe Text -> PartialFailure)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> PartialFailure)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureDescription")
Either String (Maybe Text -> PartialFailure)
-> Either String (Maybe Text) -> Either String PartialFailure
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ExceptionType")
instance Prelude.Hashable PartialFailure
instance Prelude.NFData PartialFailure