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