{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:type':ExecutionError' :: ExecutionErrorType
type' = ExecutionErrorType
pType_,
$sel:message:ExecutionError' :: Text
message = Text
pMessage_
}
executionError_type :: Lens.Lens' ExecutionError ExecutionErrorType
executionError_type :: Lens' ExecutionError ExecutionErrorType
executionError_type = 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 :: Lens' ExecutionError Text
executionError_message = 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 Data.FromJSON ExecutionError where
parseJSON :: Value -> Parser ExecutionError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ExecutionError"
( \Object
x ->
ExecutionErrorType -> Text -> ExecutionError
ExecutionError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Message")
)
instance Prelude.Hashable ExecutionError where
hashWithSalt :: Int -> ExecutionError -> Int
hashWithSalt Int
_salt ExecutionError' {Text
ExecutionErrorType
message :: Text
type' :: ExecutionErrorType
$sel:message:ExecutionError' :: ExecutionError -> Text
$sel:type':ExecutionError' :: ExecutionError -> ExecutionErrorType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ExecutionErrorType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
message
instance Prelude.NFData ExecutionError where
rnf :: ExecutionError -> ()
rnf ExecutionError' {Text
ExecutionErrorType
message :: Text
type' :: ExecutionErrorType
$sel:message:ExecutionError' :: ExecutionError -> Text
$sel:type':ExecutionError' :: ExecutionError -> ExecutionErrorType
..} =
forall a. NFData a => a -> ()
Prelude.rnf ExecutionErrorType
type' seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
message