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