{-# 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.EMR.Types.FailureDetails where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FailureDetails = FailureDetails'
{
FailureDetails -> Maybe Text
logFile :: Prelude.Maybe Prelude.Text,
FailureDetails -> Maybe Text
reason :: Prelude.Maybe Prelude.Text,
FailureDetails -> Maybe Text
message :: Prelude.Maybe Prelude.Text
}
deriving (FailureDetails -> FailureDetails -> Bool
(FailureDetails -> FailureDetails -> Bool)
-> (FailureDetails -> FailureDetails -> Bool) -> Eq FailureDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FailureDetails -> FailureDetails -> Bool
$c/= :: FailureDetails -> FailureDetails -> Bool
== :: FailureDetails -> FailureDetails -> Bool
$c== :: FailureDetails -> FailureDetails -> Bool
Prelude.Eq, ReadPrec [FailureDetails]
ReadPrec FailureDetails
Int -> ReadS FailureDetails
ReadS [FailureDetails]
(Int -> ReadS FailureDetails)
-> ReadS [FailureDetails]
-> ReadPrec FailureDetails
-> ReadPrec [FailureDetails]
-> Read FailureDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FailureDetails]
$creadListPrec :: ReadPrec [FailureDetails]
readPrec :: ReadPrec FailureDetails
$creadPrec :: ReadPrec FailureDetails
readList :: ReadS [FailureDetails]
$creadList :: ReadS [FailureDetails]
readsPrec :: Int -> ReadS FailureDetails
$creadsPrec :: Int -> ReadS FailureDetails
Prelude.Read, Int -> FailureDetails -> ShowS
[FailureDetails] -> ShowS
FailureDetails -> String
(Int -> FailureDetails -> ShowS)
-> (FailureDetails -> String)
-> ([FailureDetails] -> ShowS)
-> Show FailureDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FailureDetails] -> ShowS
$cshowList :: [FailureDetails] -> ShowS
show :: FailureDetails -> String
$cshow :: FailureDetails -> String
showsPrec :: Int -> FailureDetails -> ShowS
$cshowsPrec :: Int -> FailureDetails -> ShowS
Prelude.Show, (forall x. FailureDetails -> Rep FailureDetails x)
-> (forall x. Rep FailureDetails x -> FailureDetails)
-> Generic FailureDetails
forall x. Rep FailureDetails x -> FailureDetails
forall x. FailureDetails -> Rep FailureDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FailureDetails x -> FailureDetails
$cfrom :: forall x. FailureDetails -> Rep FailureDetails x
Prelude.Generic)
newFailureDetails ::
FailureDetails
newFailureDetails :: FailureDetails
newFailureDetails =
FailureDetails' :: Maybe Text -> Maybe Text -> Maybe Text -> FailureDetails
FailureDetails'
{ $sel:logFile:FailureDetails' :: Maybe Text
logFile = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:reason:FailureDetails' :: Maybe Text
reason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:message:FailureDetails' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
failureDetails_logFile :: Lens.Lens' FailureDetails (Prelude.Maybe Prelude.Text)
failureDetails_logFile :: (Maybe Text -> f (Maybe Text))
-> FailureDetails -> f FailureDetails
failureDetails_logFile = (FailureDetails -> Maybe Text)
-> (FailureDetails -> Maybe Text -> FailureDetails)
-> Lens FailureDetails FailureDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailureDetails' {Maybe Text
logFile :: Maybe Text
$sel:logFile:FailureDetails' :: FailureDetails -> Maybe Text
logFile} -> Maybe Text
logFile) (\s :: FailureDetails
s@FailureDetails' {} Maybe Text
a -> FailureDetails
s {$sel:logFile:FailureDetails' :: Maybe Text
logFile = Maybe Text
a} :: FailureDetails)
failureDetails_reason :: Lens.Lens' FailureDetails (Prelude.Maybe Prelude.Text)
failureDetails_reason :: (Maybe Text -> f (Maybe Text))
-> FailureDetails -> f FailureDetails
failureDetails_reason = (FailureDetails -> Maybe Text)
-> (FailureDetails -> Maybe Text -> FailureDetails)
-> Lens FailureDetails FailureDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailureDetails' {Maybe Text
reason :: Maybe Text
$sel:reason:FailureDetails' :: FailureDetails -> Maybe Text
reason} -> Maybe Text
reason) (\s :: FailureDetails
s@FailureDetails' {} Maybe Text
a -> FailureDetails
s {$sel:reason:FailureDetails' :: Maybe Text
reason = Maybe Text
a} :: FailureDetails)
failureDetails_message :: Lens.Lens' FailureDetails (Prelude.Maybe Prelude.Text)
failureDetails_message :: (Maybe Text -> f (Maybe Text))
-> FailureDetails -> f FailureDetails
failureDetails_message = (FailureDetails -> Maybe Text)
-> (FailureDetails -> Maybe Text -> FailureDetails)
-> Lens FailureDetails FailureDetails (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailureDetails' {Maybe Text
message :: Maybe Text
$sel:message:FailureDetails' :: FailureDetails -> Maybe Text
message} -> Maybe Text
message) (\s :: FailureDetails
s@FailureDetails' {} Maybe Text
a -> FailureDetails
s {$sel:message:FailureDetails' :: Maybe Text
message = Maybe Text
a} :: FailureDetails)
instance Core.FromJSON FailureDetails where
parseJSON :: Value -> Parser FailureDetails
parseJSON =
String
-> (Object -> Parser FailureDetails)
-> Value
-> Parser FailureDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FailureDetails"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> FailureDetails
FailureDetails'
(Maybe Text -> Maybe Text -> Maybe Text -> FailureDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> FailureDetails)
forall (f :: * -> *) a b. Functor 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
"LogFile")
Parser (Maybe Text -> Maybe Text -> FailureDetails)
-> Parser (Maybe Text) -> Parser (Maybe Text -> FailureDetails)
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
"Reason")
Parser (Maybe Text -> FailureDetails)
-> Parser (Maybe Text) -> Parser FailureDetails
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
"Message")
)
instance Prelude.Hashable FailureDetails
instance Prelude.NFData FailureDetails