{-# 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.LakeFormation.Types.RowFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LakeFormation.Types.AllRowsWildcard
import qualified Amazonka.Prelude as Prelude
data RowFilter = RowFilter'
{
RowFilter -> Maybe AllRowsWildcard
allRowsWildcard :: Prelude.Maybe AllRowsWildcard,
RowFilter -> Maybe Text
filterExpression :: Prelude.Maybe Prelude.Text
}
deriving (RowFilter -> RowFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RowFilter -> RowFilter -> Bool
$c/= :: RowFilter -> RowFilter -> Bool
== :: RowFilter -> RowFilter -> Bool
$c== :: RowFilter -> RowFilter -> Bool
Prelude.Eq, ReadPrec [RowFilter]
ReadPrec RowFilter
Int -> ReadS RowFilter
ReadS [RowFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RowFilter]
$creadListPrec :: ReadPrec [RowFilter]
readPrec :: ReadPrec RowFilter
$creadPrec :: ReadPrec RowFilter
readList :: ReadS [RowFilter]
$creadList :: ReadS [RowFilter]
readsPrec :: Int -> ReadS RowFilter
$creadsPrec :: Int -> ReadS RowFilter
Prelude.Read, Int -> RowFilter -> ShowS
[RowFilter] -> ShowS
RowFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RowFilter] -> ShowS
$cshowList :: [RowFilter] -> ShowS
show :: RowFilter -> String
$cshow :: RowFilter -> String
showsPrec :: Int -> RowFilter -> ShowS
$cshowsPrec :: Int -> RowFilter -> ShowS
Prelude.Show, forall x. Rep RowFilter x -> RowFilter
forall x. RowFilter -> Rep RowFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RowFilter x -> RowFilter
$cfrom :: forall x. RowFilter -> Rep RowFilter x
Prelude.Generic)
newRowFilter ::
RowFilter
newRowFilter :: RowFilter
newRowFilter =
RowFilter'
{ $sel:allRowsWildcard:RowFilter' :: Maybe AllRowsWildcard
allRowsWildcard = forall a. Maybe a
Prelude.Nothing,
$sel:filterExpression:RowFilter' :: Maybe Text
filterExpression = forall a. Maybe a
Prelude.Nothing
}
rowFilter_allRowsWildcard :: Lens.Lens' RowFilter (Prelude.Maybe AllRowsWildcard)
rowFilter_allRowsWildcard :: Lens' RowFilter (Maybe AllRowsWildcard)
rowFilter_allRowsWildcard = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowFilter' {Maybe AllRowsWildcard
allRowsWildcard :: Maybe AllRowsWildcard
$sel:allRowsWildcard:RowFilter' :: RowFilter -> Maybe AllRowsWildcard
allRowsWildcard} -> Maybe AllRowsWildcard
allRowsWildcard) (\s :: RowFilter
s@RowFilter' {} Maybe AllRowsWildcard
a -> RowFilter
s {$sel:allRowsWildcard:RowFilter' :: Maybe AllRowsWildcard
allRowsWildcard = Maybe AllRowsWildcard
a} :: RowFilter)
rowFilter_filterExpression :: Lens.Lens' RowFilter (Prelude.Maybe Prelude.Text)
rowFilter_filterExpression :: Lens' RowFilter (Maybe Text)
rowFilter_filterExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RowFilter' {Maybe Text
filterExpression :: Maybe Text
$sel:filterExpression:RowFilter' :: RowFilter -> Maybe Text
filterExpression} -> Maybe Text
filterExpression) (\s :: RowFilter
s@RowFilter' {} Maybe Text
a -> RowFilter
s {$sel:filterExpression:RowFilter' :: Maybe Text
filterExpression = Maybe Text
a} :: RowFilter)
instance Data.FromJSON RowFilter where
parseJSON :: Value -> Parser RowFilter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RowFilter"
( \Object
x ->
Maybe AllRowsWildcard -> Maybe Text -> RowFilter
RowFilter'
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
"AllRowsWildcard")
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
"FilterExpression")
)
instance Prelude.Hashable RowFilter where
hashWithSalt :: Int -> RowFilter -> Int
hashWithSalt Int
_salt RowFilter' {Maybe Text
Maybe AllRowsWildcard
filterExpression :: Maybe Text
allRowsWildcard :: Maybe AllRowsWildcard
$sel:filterExpression:RowFilter' :: RowFilter -> Maybe Text
$sel:allRowsWildcard:RowFilter' :: RowFilter -> Maybe AllRowsWildcard
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AllRowsWildcard
allRowsWildcard
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
filterExpression
instance Prelude.NFData RowFilter where
rnf :: RowFilter -> ()
rnf RowFilter' {Maybe Text
Maybe AllRowsWildcard
filterExpression :: Maybe Text
allRowsWildcard :: Maybe AllRowsWildcard
$sel:filterExpression:RowFilter' :: RowFilter -> Maybe Text
$sel:allRowsWildcard:RowFilter' :: RowFilter -> Maybe AllRowsWildcard
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AllRowsWildcard
allRowsWildcard
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
filterExpression
instance Data.ToJSON RowFilter where
toJSON :: RowFilter -> Value
toJSON RowFilter' {Maybe Text
Maybe AllRowsWildcard
filterExpression :: Maybe Text
allRowsWildcard :: Maybe AllRowsWildcard
$sel:filterExpression:RowFilter' :: RowFilter -> Maybe Text
$sel:allRowsWildcard:RowFilter' :: RowFilter -> Maybe AllRowsWildcard
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"AllRowsWildcard" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AllRowsWildcard
allRowsWildcard,
(Key
"FilterExpression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
filterExpression
]
)