{-# 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.TableError where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.ErrorDetail
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data TableError = TableError'
{
TableError -> Maybe Text
tableName :: Prelude.Maybe Prelude.Text,
TableError -> Maybe ErrorDetail
errorDetail :: Prelude.Maybe ErrorDetail
}
deriving (TableError -> TableError -> Bool
(TableError -> TableError -> Bool)
-> (TableError -> TableError -> Bool) -> Eq TableError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TableError -> TableError -> Bool
$c/= :: TableError -> TableError -> Bool
== :: TableError -> TableError -> Bool
$c== :: TableError -> TableError -> Bool
Prelude.Eq, ReadPrec [TableError]
ReadPrec TableError
Int -> ReadS TableError
ReadS [TableError]
(Int -> ReadS TableError)
-> ReadS [TableError]
-> ReadPrec TableError
-> ReadPrec [TableError]
-> Read TableError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TableError]
$creadListPrec :: ReadPrec [TableError]
readPrec :: ReadPrec TableError
$creadPrec :: ReadPrec TableError
readList :: ReadS [TableError]
$creadList :: ReadS [TableError]
readsPrec :: Int -> ReadS TableError
$creadsPrec :: Int -> ReadS TableError
Prelude.Read, Int -> TableError -> ShowS
[TableError] -> ShowS
TableError -> String
(Int -> TableError -> ShowS)
-> (TableError -> String)
-> ([TableError] -> ShowS)
-> Show TableError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TableError] -> ShowS
$cshowList :: [TableError] -> ShowS
show :: TableError -> String
$cshow :: TableError -> String
showsPrec :: Int -> TableError -> ShowS
$cshowsPrec :: Int -> TableError -> ShowS
Prelude.Show, (forall x. TableError -> Rep TableError x)
-> (forall x. Rep TableError x -> TableError) -> Generic TableError
forall x. Rep TableError x -> TableError
forall x. TableError -> Rep TableError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TableError x -> TableError
$cfrom :: forall x. TableError -> Rep TableError x
Prelude.Generic)
newTableError ::
TableError
newTableError :: TableError
newTableError =
TableError' :: Maybe Text -> Maybe ErrorDetail -> TableError
TableError'
{ $sel:tableName:TableError' :: Maybe Text
tableName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errorDetail:TableError' :: Maybe ErrorDetail
errorDetail = Maybe ErrorDetail
forall a. Maybe a
Prelude.Nothing
}
tableError_tableName :: Lens.Lens' TableError (Prelude.Maybe Prelude.Text)
tableError_tableName :: (Maybe Text -> f (Maybe Text)) -> TableError -> f TableError
tableError_tableName = (TableError -> Maybe Text)
-> (TableError -> Maybe Text -> TableError)
-> Lens TableError TableError (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableError' {Maybe Text
tableName :: Maybe Text
$sel:tableName:TableError' :: TableError -> Maybe Text
tableName} -> Maybe Text
tableName) (\s :: TableError
s@TableError' {} Maybe Text
a -> TableError
s {$sel:tableName:TableError' :: Maybe Text
tableName = Maybe Text
a} :: TableError)
tableError_errorDetail :: Lens.Lens' TableError (Prelude.Maybe ErrorDetail)
tableError_errorDetail :: (Maybe ErrorDetail -> f (Maybe ErrorDetail))
-> TableError -> f TableError
tableError_errorDetail = (TableError -> Maybe ErrorDetail)
-> (TableError -> Maybe ErrorDetail -> TableError)
-> Lens
TableError TableError (Maybe ErrorDetail) (Maybe ErrorDetail)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TableError' {Maybe ErrorDetail
errorDetail :: Maybe ErrorDetail
$sel:errorDetail:TableError' :: TableError -> Maybe ErrorDetail
errorDetail} -> Maybe ErrorDetail
errorDetail) (\s :: TableError
s@TableError' {} Maybe ErrorDetail
a -> TableError
s {$sel:errorDetail:TableError' :: Maybe ErrorDetail
errorDetail = Maybe ErrorDetail
a} :: TableError)
instance Core.FromJSON TableError where
parseJSON :: Value -> Parser TableError
parseJSON =
String
-> (Object -> Parser TableError) -> Value -> Parser TableError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TableError"
( \Object
x ->
Maybe Text -> Maybe ErrorDetail -> TableError
TableError'
(Maybe Text -> Maybe ErrorDetail -> TableError)
-> Parser (Maybe Text) -> Parser (Maybe ErrorDetail -> TableError)
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
"TableName")
Parser (Maybe ErrorDetail -> TableError)
-> Parser (Maybe ErrorDetail) -> Parser TableError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ErrorDetail)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorDetail")
)
instance Prelude.Hashable TableError
instance Prelude.NFData TableError