{-# 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.PropertyPredicate where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.Comparator
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PropertyPredicate = PropertyPredicate'
{
PropertyPredicate -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
PropertyPredicate -> Maybe Text
key :: Prelude.Maybe Prelude.Text,
PropertyPredicate -> Maybe Comparator
comparator :: Prelude.Maybe Comparator
}
deriving (PropertyPredicate -> PropertyPredicate -> Bool
(PropertyPredicate -> PropertyPredicate -> Bool)
-> (PropertyPredicate -> PropertyPredicate -> Bool)
-> Eq PropertyPredicate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PropertyPredicate -> PropertyPredicate -> Bool
$c/= :: PropertyPredicate -> PropertyPredicate -> Bool
== :: PropertyPredicate -> PropertyPredicate -> Bool
$c== :: PropertyPredicate -> PropertyPredicate -> Bool
Prelude.Eq, ReadPrec [PropertyPredicate]
ReadPrec PropertyPredicate
Int -> ReadS PropertyPredicate
ReadS [PropertyPredicate]
(Int -> ReadS PropertyPredicate)
-> ReadS [PropertyPredicate]
-> ReadPrec PropertyPredicate
-> ReadPrec [PropertyPredicate]
-> Read PropertyPredicate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PropertyPredicate]
$creadListPrec :: ReadPrec [PropertyPredicate]
readPrec :: ReadPrec PropertyPredicate
$creadPrec :: ReadPrec PropertyPredicate
readList :: ReadS [PropertyPredicate]
$creadList :: ReadS [PropertyPredicate]
readsPrec :: Int -> ReadS PropertyPredicate
$creadsPrec :: Int -> ReadS PropertyPredicate
Prelude.Read, Int -> PropertyPredicate -> ShowS
[PropertyPredicate] -> ShowS
PropertyPredicate -> String
(Int -> PropertyPredicate -> ShowS)
-> (PropertyPredicate -> String)
-> ([PropertyPredicate] -> ShowS)
-> Show PropertyPredicate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PropertyPredicate] -> ShowS
$cshowList :: [PropertyPredicate] -> ShowS
show :: PropertyPredicate -> String
$cshow :: PropertyPredicate -> String
showsPrec :: Int -> PropertyPredicate -> ShowS
$cshowsPrec :: Int -> PropertyPredicate -> ShowS
Prelude.Show, (forall x. PropertyPredicate -> Rep PropertyPredicate x)
-> (forall x. Rep PropertyPredicate x -> PropertyPredicate)
-> Generic PropertyPredicate
forall x. Rep PropertyPredicate x -> PropertyPredicate
forall x. PropertyPredicate -> Rep PropertyPredicate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PropertyPredicate x -> PropertyPredicate
$cfrom :: forall x. PropertyPredicate -> Rep PropertyPredicate x
Prelude.Generic)
newPropertyPredicate ::
PropertyPredicate
newPropertyPredicate :: PropertyPredicate
newPropertyPredicate =
PropertyPredicate' :: Maybe Text -> Maybe Text -> Maybe Comparator -> PropertyPredicate
PropertyPredicate'
{ $sel:value:PropertyPredicate' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:key:PropertyPredicate' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:comparator:PropertyPredicate' :: Maybe Comparator
comparator = Maybe Comparator
forall a. Maybe a
Prelude.Nothing
}
propertyPredicate_value :: Lens.Lens' PropertyPredicate (Prelude.Maybe Prelude.Text)
propertyPredicate_value :: (Maybe Text -> f (Maybe Text))
-> PropertyPredicate -> f PropertyPredicate
propertyPredicate_value = (PropertyPredicate -> Maybe Text)
-> (PropertyPredicate -> Maybe Text -> PropertyPredicate)
-> Lens
PropertyPredicate PropertyPredicate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PropertyPredicate' {Maybe Text
value :: Maybe Text
$sel:value:PropertyPredicate' :: PropertyPredicate -> Maybe Text
value} -> Maybe Text
value) (\s :: PropertyPredicate
s@PropertyPredicate' {} Maybe Text
a -> PropertyPredicate
s {$sel:value:PropertyPredicate' :: Maybe Text
value = Maybe Text
a} :: PropertyPredicate)
propertyPredicate_key :: Lens.Lens' PropertyPredicate (Prelude.Maybe Prelude.Text)
propertyPredicate_key :: (Maybe Text -> f (Maybe Text))
-> PropertyPredicate -> f PropertyPredicate
propertyPredicate_key = (PropertyPredicate -> Maybe Text)
-> (PropertyPredicate -> Maybe Text -> PropertyPredicate)
-> Lens
PropertyPredicate PropertyPredicate (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PropertyPredicate' {Maybe Text
key :: Maybe Text
$sel:key:PropertyPredicate' :: PropertyPredicate -> Maybe Text
key} -> Maybe Text
key) (\s :: PropertyPredicate
s@PropertyPredicate' {} Maybe Text
a -> PropertyPredicate
s {$sel:key:PropertyPredicate' :: Maybe Text
key = Maybe Text
a} :: PropertyPredicate)
propertyPredicate_comparator :: Lens.Lens' PropertyPredicate (Prelude.Maybe Comparator)
propertyPredicate_comparator :: (Maybe Comparator -> f (Maybe Comparator))
-> PropertyPredicate -> f PropertyPredicate
propertyPredicate_comparator = (PropertyPredicate -> Maybe Comparator)
-> (PropertyPredicate -> Maybe Comparator -> PropertyPredicate)
-> Lens
PropertyPredicate
PropertyPredicate
(Maybe Comparator)
(Maybe Comparator)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PropertyPredicate' {Maybe Comparator
comparator :: Maybe Comparator
$sel:comparator:PropertyPredicate' :: PropertyPredicate -> Maybe Comparator
comparator} -> Maybe Comparator
comparator) (\s :: PropertyPredicate
s@PropertyPredicate' {} Maybe Comparator
a -> PropertyPredicate
s {$sel:comparator:PropertyPredicate' :: Maybe Comparator
comparator = Maybe Comparator
a} :: PropertyPredicate)
instance Prelude.Hashable PropertyPredicate
instance Prelude.NFData PropertyPredicate
instance Core.ToJSON PropertyPredicate where
toJSON :: PropertyPredicate -> Value
toJSON PropertyPredicate' {Maybe Text
Maybe Comparator
comparator :: Maybe Comparator
key :: Maybe Text
value :: Maybe Text
$sel:comparator:PropertyPredicate' :: PropertyPredicate -> Maybe Comparator
$sel:key:PropertyPredicate' :: PropertyPredicate -> Maybe Text
$sel:value:PropertyPredicate' :: PropertyPredicate -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value,
(Text
"Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
key,
(Text
"Comparator" Text -> Comparator -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Comparator -> Pair) -> Maybe Comparator -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Comparator
comparator
]
)