{-# 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.Athena.Types.AthenaError 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
data AthenaError = AthenaError'
{
AthenaError -> Maybe Natural
errorCategory :: Prelude.Maybe Prelude.Natural,
AthenaError -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
AthenaError -> Maybe Natural
errorType :: Prelude.Maybe Prelude.Natural,
AthenaError -> Maybe Bool
retryable :: Prelude.Maybe Prelude.Bool
}
deriving (AthenaError -> AthenaError -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AthenaError -> AthenaError -> Bool
$c/= :: AthenaError -> AthenaError -> Bool
== :: AthenaError -> AthenaError -> Bool
$c== :: AthenaError -> AthenaError -> Bool
Prelude.Eq, ReadPrec [AthenaError]
ReadPrec AthenaError
Int -> ReadS AthenaError
ReadS [AthenaError]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AthenaError]
$creadListPrec :: ReadPrec [AthenaError]
readPrec :: ReadPrec AthenaError
$creadPrec :: ReadPrec AthenaError
readList :: ReadS [AthenaError]
$creadList :: ReadS [AthenaError]
readsPrec :: Int -> ReadS AthenaError
$creadsPrec :: Int -> ReadS AthenaError
Prelude.Read, Int -> AthenaError -> ShowS
[AthenaError] -> ShowS
AthenaError -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AthenaError] -> ShowS
$cshowList :: [AthenaError] -> ShowS
show :: AthenaError -> String
$cshow :: AthenaError -> String
showsPrec :: Int -> AthenaError -> ShowS
$cshowsPrec :: Int -> AthenaError -> ShowS
Prelude.Show, forall x. Rep AthenaError x -> AthenaError
forall x. AthenaError -> Rep AthenaError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AthenaError x -> AthenaError
$cfrom :: forall x. AthenaError -> Rep AthenaError x
Prelude.Generic)
newAthenaError ::
AthenaError
newAthenaError :: AthenaError
newAthenaError =
AthenaError'
{ $sel:errorCategory:AthenaError' :: Maybe Natural
errorCategory = forall a. Maybe a
Prelude.Nothing,
$sel:errorMessage:AthenaError' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
$sel:errorType:AthenaError' :: Maybe Natural
errorType = forall a. Maybe a
Prelude.Nothing,
$sel:retryable:AthenaError' :: Maybe Bool
retryable = forall a. Maybe a
Prelude.Nothing
}
athenaError_errorCategory :: Lens.Lens' AthenaError (Prelude.Maybe Prelude.Natural)
athenaError_errorCategory :: Lens' AthenaError (Maybe Natural)
athenaError_errorCategory = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaError' {Maybe Natural
errorCategory :: Maybe Natural
$sel:errorCategory:AthenaError' :: AthenaError -> Maybe Natural
errorCategory} -> Maybe Natural
errorCategory) (\s :: AthenaError
s@AthenaError' {} Maybe Natural
a -> AthenaError
s {$sel:errorCategory:AthenaError' :: Maybe Natural
errorCategory = Maybe Natural
a} :: AthenaError)
athenaError_errorMessage :: Lens.Lens' AthenaError (Prelude.Maybe Prelude.Text)
athenaError_errorMessage :: Lens' AthenaError (Maybe Text)
athenaError_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaError' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:AthenaError' :: AthenaError -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: AthenaError
s@AthenaError' {} Maybe Text
a -> AthenaError
s {$sel:errorMessage:AthenaError' :: Maybe Text
errorMessage = Maybe Text
a} :: AthenaError)
athenaError_errorType :: Lens.Lens' AthenaError (Prelude.Maybe Prelude.Natural)
athenaError_errorType :: Lens' AthenaError (Maybe Natural)
athenaError_errorType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaError' {Maybe Natural
errorType :: Maybe Natural
$sel:errorType:AthenaError' :: AthenaError -> Maybe Natural
errorType} -> Maybe Natural
errorType) (\s :: AthenaError
s@AthenaError' {} Maybe Natural
a -> AthenaError
s {$sel:errorType:AthenaError' :: Maybe Natural
errorType = Maybe Natural
a} :: AthenaError)
athenaError_retryable :: Lens.Lens' AthenaError (Prelude.Maybe Prelude.Bool)
athenaError_retryable :: Lens' AthenaError (Maybe Bool)
athenaError_retryable = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AthenaError' {Maybe Bool
retryable :: Maybe Bool
$sel:retryable:AthenaError' :: AthenaError -> Maybe Bool
retryable} -> Maybe Bool
retryable) (\s :: AthenaError
s@AthenaError' {} Maybe Bool
a -> AthenaError
s {$sel:retryable:AthenaError' :: Maybe Bool
retryable = Maybe Bool
a} :: AthenaError)
instance Data.FromJSON AthenaError where
parseJSON :: Value -> Parser AthenaError
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AthenaError"
( \Object
x ->
Maybe Natural
-> Maybe Text -> Maybe Natural -> Maybe Bool -> AthenaError
AthenaError'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorCategory")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorMessage")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ErrorType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Retryable")
)
instance Prelude.Hashable AthenaError where
hashWithSalt :: Int -> AthenaError -> Int
hashWithSalt Int
_salt AthenaError' {Maybe Bool
Maybe Natural
Maybe Text
retryable :: Maybe Bool
errorType :: Maybe Natural
errorMessage :: Maybe Text
errorCategory :: Maybe Natural
$sel:retryable:AthenaError' :: AthenaError -> Maybe Bool
$sel:errorType:AthenaError' :: AthenaError -> Maybe Natural
$sel:errorMessage:AthenaError' :: AthenaError -> Maybe Text
$sel:errorCategory:AthenaError' :: AthenaError -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
errorCategory
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
errorType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
retryable
instance Prelude.NFData AthenaError where
rnf :: AthenaError -> ()
rnf AthenaError' {Maybe Bool
Maybe Natural
Maybe Text
retryable :: Maybe Bool
errorType :: Maybe Natural
errorMessage :: Maybe Text
errorCategory :: Maybe Natural
$sel:retryable:AthenaError' :: AthenaError -> Maybe Bool
$sel:errorType:AthenaError' :: AthenaError -> Maybe Natural
$sel:errorMessage:AthenaError' :: AthenaError -> Maybe Text
$sel:errorCategory:AthenaError' :: AthenaError -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
errorCategory
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
errorType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
retryable