{-# 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.BackfillError where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.BackfillErrorCode
import Amazonka.Glue.Types.PartitionValueList
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BackfillError = BackfillError'
{
BackfillError -> Maybe [PartitionValueList]
partitions :: Prelude.Maybe [PartitionValueList],
BackfillError -> Maybe BackfillErrorCode
code :: Prelude.Maybe BackfillErrorCode
}
deriving (BackfillError -> BackfillError -> Bool
(BackfillError -> BackfillError -> Bool)
-> (BackfillError -> BackfillError -> Bool) -> Eq BackfillError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BackfillError -> BackfillError -> Bool
$c/= :: BackfillError -> BackfillError -> Bool
== :: BackfillError -> BackfillError -> Bool
$c== :: BackfillError -> BackfillError -> Bool
Prelude.Eq, ReadPrec [BackfillError]
ReadPrec BackfillError
Int -> ReadS BackfillError
ReadS [BackfillError]
(Int -> ReadS BackfillError)
-> ReadS [BackfillError]
-> ReadPrec BackfillError
-> ReadPrec [BackfillError]
-> Read BackfillError
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BackfillError]
$creadListPrec :: ReadPrec [BackfillError]
readPrec :: ReadPrec BackfillError
$creadPrec :: ReadPrec BackfillError
readList :: ReadS [BackfillError]
$creadList :: ReadS [BackfillError]
readsPrec :: Int -> ReadS BackfillError
$creadsPrec :: Int -> ReadS BackfillError
Prelude.Read, Int -> BackfillError -> ShowS
[BackfillError] -> ShowS
BackfillError -> String
(Int -> BackfillError -> ShowS)
-> (BackfillError -> String)
-> ([BackfillError] -> ShowS)
-> Show BackfillError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BackfillError] -> ShowS
$cshowList :: [BackfillError] -> ShowS
show :: BackfillError -> String
$cshow :: BackfillError -> String
showsPrec :: Int -> BackfillError -> ShowS
$cshowsPrec :: Int -> BackfillError -> ShowS
Prelude.Show, (forall x. BackfillError -> Rep BackfillError x)
-> (forall x. Rep BackfillError x -> BackfillError)
-> Generic BackfillError
forall x. Rep BackfillError x -> BackfillError
forall x. BackfillError -> Rep BackfillError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BackfillError x -> BackfillError
$cfrom :: forall x. BackfillError -> Rep BackfillError x
Prelude.Generic)
newBackfillError ::
BackfillError
newBackfillError :: BackfillError
newBackfillError =
BackfillError' :: Maybe [PartitionValueList]
-> Maybe BackfillErrorCode -> BackfillError
BackfillError'
{ $sel:partitions:BackfillError' :: Maybe [PartitionValueList]
partitions = Maybe [PartitionValueList]
forall a. Maybe a
Prelude.Nothing,
$sel:code:BackfillError' :: Maybe BackfillErrorCode
code = Maybe BackfillErrorCode
forall a. Maybe a
Prelude.Nothing
}
backfillError_partitions :: Lens.Lens' BackfillError (Prelude.Maybe [PartitionValueList])
backfillError_partitions :: (Maybe [PartitionValueList] -> f (Maybe [PartitionValueList]))
-> BackfillError -> f BackfillError
backfillError_partitions = (BackfillError -> Maybe [PartitionValueList])
-> (BackfillError -> Maybe [PartitionValueList] -> BackfillError)
-> Lens
BackfillError
BackfillError
(Maybe [PartitionValueList])
(Maybe [PartitionValueList])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackfillError' {Maybe [PartitionValueList]
partitions :: Maybe [PartitionValueList]
$sel:partitions:BackfillError' :: BackfillError -> Maybe [PartitionValueList]
partitions} -> Maybe [PartitionValueList]
partitions) (\s :: BackfillError
s@BackfillError' {} Maybe [PartitionValueList]
a -> BackfillError
s {$sel:partitions:BackfillError' :: Maybe [PartitionValueList]
partitions = Maybe [PartitionValueList]
a} :: BackfillError) ((Maybe [PartitionValueList] -> f (Maybe [PartitionValueList]))
-> BackfillError -> f BackfillError)
-> ((Maybe [PartitionValueList] -> f (Maybe [PartitionValueList]))
-> Maybe [PartitionValueList] -> f (Maybe [PartitionValueList]))
-> (Maybe [PartitionValueList] -> f (Maybe [PartitionValueList]))
-> BackfillError
-> f BackfillError
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[PartitionValueList]
[PartitionValueList]
[PartitionValueList]
[PartitionValueList]
-> Iso
(Maybe [PartitionValueList])
(Maybe [PartitionValueList])
(Maybe [PartitionValueList])
(Maybe [PartitionValueList])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[PartitionValueList]
[PartitionValueList]
[PartitionValueList]
[PartitionValueList]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
backfillError_code :: Lens.Lens' BackfillError (Prelude.Maybe BackfillErrorCode)
backfillError_code :: (Maybe BackfillErrorCode -> f (Maybe BackfillErrorCode))
-> BackfillError -> f BackfillError
backfillError_code = (BackfillError -> Maybe BackfillErrorCode)
-> (BackfillError -> Maybe BackfillErrorCode -> BackfillError)
-> Lens
BackfillError
BackfillError
(Maybe BackfillErrorCode)
(Maybe BackfillErrorCode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BackfillError' {Maybe BackfillErrorCode
code :: Maybe BackfillErrorCode
$sel:code:BackfillError' :: BackfillError -> Maybe BackfillErrorCode
code} -> Maybe BackfillErrorCode
code) (\s :: BackfillError
s@BackfillError' {} Maybe BackfillErrorCode
a -> BackfillError
s {$sel:code:BackfillError' :: Maybe BackfillErrorCode
code = Maybe BackfillErrorCode
a} :: BackfillError)
instance Core.FromJSON BackfillError where
parseJSON :: Value -> Parser BackfillError
parseJSON =
String
-> (Object -> Parser BackfillError)
-> Value
-> Parser BackfillError
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BackfillError"
( \Object
x ->
Maybe [PartitionValueList]
-> Maybe BackfillErrorCode -> BackfillError
BackfillError'
(Maybe [PartitionValueList]
-> Maybe BackfillErrorCode -> BackfillError)
-> Parser (Maybe [PartitionValueList])
-> Parser (Maybe BackfillErrorCode -> BackfillError)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [PartitionValueList]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Partitions" Parser (Maybe (Maybe [PartitionValueList]))
-> Maybe [PartitionValueList]
-> Parser (Maybe [PartitionValueList])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PartitionValueList]
forall a. Monoid a => a
Prelude.mempty)
Parser (Maybe BackfillErrorCode -> BackfillError)
-> Parser (Maybe BackfillErrorCode) -> Parser BackfillError
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BackfillErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Code")
)
instance Prelude.Hashable BackfillError
instance Prelude.NFData BackfillError