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