{-# 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.CodePipeline.Types.FailureDetails where
import Amazonka.CodePipeline.Types.FailureType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data FailureDetails = FailureDetails'
{
FailureDetails -> Maybe Text
externalExecutionId :: Prelude.Maybe Prelude.Text,
FailureDetails -> FailureType
type' :: FailureType,
FailureDetails -> Text
message :: 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 ::
FailureType ->
Prelude.Text ->
FailureDetails
newFailureDetails :: FailureType -> Text -> FailureDetails
newFailureDetails FailureType
pType_ Text
pMessage_ =
FailureDetails' :: Maybe Text -> FailureType -> Text -> FailureDetails
FailureDetails'
{ $sel:externalExecutionId:FailureDetails' :: Maybe Text
externalExecutionId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':FailureDetails' :: FailureType
type' = FailureType
pType_,
$sel:message:FailureDetails' :: Text
message = Text
pMessage_
}
failureDetails_externalExecutionId :: Lens.Lens' FailureDetails (Prelude.Maybe Prelude.Text)
failureDetails_externalExecutionId :: (Maybe Text -> f (Maybe Text))
-> FailureDetails -> f FailureDetails
failureDetails_externalExecutionId = (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
externalExecutionId :: Maybe Text
$sel:externalExecutionId:FailureDetails' :: FailureDetails -> Maybe Text
externalExecutionId} -> Maybe Text
externalExecutionId) (\s :: FailureDetails
s@FailureDetails' {} Maybe Text
a -> FailureDetails
s {$sel:externalExecutionId:FailureDetails' :: Maybe Text
externalExecutionId = Maybe Text
a} :: FailureDetails)
failureDetails_type :: Lens.Lens' FailureDetails FailureType
failureDetails_type :: (FailureType -> f FailureType)
-> FailureDetails -> f FailureDetails
failureDetails_type = (FailureDetails -> FailureType)
-> (FailureDetails -> FailureType -> FailureDetails)
-> Lens FailureDetails FailureDetails FailureType FailureType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailureDetails' {FailureType
type' :: FailureType
$sel:type':FailureDetails' :: FailureDetails -> FailureType
type'} -> FailureType
type') (\s :: FailureDetails
s@FailureDetails' {} FailureType
a -> FailureDetails
s {$sel:type':FailureDetails' :: FailureType
type' = FailureType
a} :: FailureDetails)
failureDetails_message :: Lens.Lens' FailureDetails Prelude.Text
failureDetails_message :: (Text -> f Text) -> FailureDetails -> f FailureDetails
failureDetails_message = (FailureDetails -> Text)
-> (FailureDetails -> Text -> FailureDetails)
-> Lens FailureDetails FailureDetails Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FailureDetails' {Text
message :: Text
$sel:message:FailureDetails' :: FailureDetails -> Text
message} -> Text
message) (\s :: FailureDetails
s@FailureDetails' {} Text
a -> FailureDetails
s {$sel:message:FailureDetails' :: Text
message = Text
a} :: FailureDetails)
instance Prelude.Hashable FailureDetails
instance Prelude.NFData FailureDetails
instance Core.ToJSON FailureDetails where
toJSON :: FailureDetails -> Value
toJSON FailureDetails' {Maybe Text
Text
FailureType
message :: Text
type' :: FailureType
externalExecutionId :: Maybe Text
$sel:message:FailureDetails' :: FailureDetails -> Text
$sel:type':FailureDetails' :: FailureDetails -> FailureType
$sel:externalExecutionId:FailureDetails' :: FailureDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"externalExecutionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
externalExecutionId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> FailureType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FailureType
type'),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"message" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
message)
]
)