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