{-# 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.Glue.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
errorCode :: Prelude.Maybe Prelude.Text,
ErrorDetails -> Maybe Text
errorMessage :: 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:errorCode:ErrorDetails' :: Maybe Text
errorCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:ErrorDetails' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
errorDetails_errorCode :: Lens.Lens' ErrorDetails (Prelude.Maybe Prelude.Text)
errorDetails_errorCode :: (Maybe Text -> f (Maybe Text)) -> ErrorDetails -> f ErrorDetails
errorDetails_errorCode = (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
errorCode :: Maybe Text
$sel:errorCode:ErrorDetails' :: ErrorDetails -> Maybe Text
errorCode} -> Maybe Text
errorCode) (\s :: ErrorDetails
s@ErrorDetails' {} Maybe Text
a -> ErrorDetails
s {$sel:errorCode:ErrorDetails' :: Maybe Text
errorCode = Maybe Text
a} :: ErrorDetails)
errorDetails_errorMessage :: Lens.Lens' ErrorDetails (Prelude.Maybe Prelude.Text)
errorDetails_errorMessage :: (Maybe Text -> f (Maybe Text)) -> ErrorDetails -> f ErrorDetails
errorDetails_errorMessage = (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
errorMessage :: Maybe Text
$sel:errorMessage:ErrorDetails' :: ErrorDetails -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: ErrorDetails
s@ErrorDetails' {} Maybe Text
a -> ErrorDetails
s {$sel:errorMessage:ErrorDetails' :: Maybe Text
errorMessage = 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
"ErrorCode")
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
"ErrorMessage")
)
instance Prelude.Hashable ErrorDetails
instance Prelude.NFData ErrorDetails