{-# 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.HoneyCode.Types.Filter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Filter = Filter'
{
Filter -> Maybe Text
contextRowId :: Prelude.Maybe Prelude.Text,
Filter -> Sensitive Text
formula :: Core.Sensitive Prelude.Text
}
deriving (Filter -> Filter -> Bool
(Filter -> Filter -> Bool)
-> (Filter -> Filter -> Bool) -> Eq Filter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Filter -> Filter -> Bool
$c/= :: Filter -> Filter -> Bool
== :: Filter -> Filter -> Bool
$c== :: Filter -> Filter -> Bool
Prelude.Eq, Int -> Filter -> ShowS
[Filter] -> ShowS
Filter -> String
(Int -> Filter -> ShowS)
-> (Filter -> String) -> ([Filter] -> ShowS) -> Show Filter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Filter] -> ShowS
$cshowList :: [Filter] -> ShowS
show :: Filter -> String
$cshow :: Filter -> String
showsPrec :: Int -> Filter -> ShowS
$cshowsPrec :: Int -> Filter -> ShowS
Prelude.Show, (forall x. Filter -> Rep Filter x)
-> (forall x. Rep Filter x -> Filter) -> Generic Filter
forall x. Rep Filter x -> Filter
forall x. Filter -> Rep Filter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Filter x -> Filter
$cfrom :: forall x. Filter -> Rep Filter x
Prelude.Generic)
newFilter ::
Prelude.Text ->
Filter
newFilter :: Text -> Filter
newFilter Text
pFormula_ =
Filter' :: Maybe Text -> Sensitive Text -> Filter
Filter'
{ $sel:contextRowId:Filter' :: Maybe Text
contextRowId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:formula:Filter' :: Sensitive Text
formula = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pFormula_
}
filter_contextRowId :: Lens.Lens' Filter (Prelude.Maybe Prelude.Text)
filter_contextRowId :: (Maybe Text -> f (Maybe Text)) -> Filter -> f Filter
filter_contextRowId = (Filter -> Maybe Text)
-> (Filter -> Maybe Text -> Filter)
-> Lens Filter Filter (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Filter' {Maybe Text
contextRowId :: Maybe Text
$sel:contextRowId:Filter' :: Filter -> Maybe Text
contextRowId} -> Maybe Text
contextRowId) (\s :: Filter
s@Filter' {} Maybe Text
a -> Filter
s {$sel:contextRowId:Filter' :: Maybe Text
contextRowId = Maybe Text
a} :: Filter)
filter_formula :: Lens.Lens' Filter Prelude.Text
filter_formula :: (Text -> f Text) -> Filter -> f Filter
filter_formula = (Filter -> Sensitive Text)
-> (Filter -> Sensitive Text -> Filter)
-> Lens Filter Filter (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Filter' {Sensitive Text
formula :: Sensitive Text
$sel:formula:Filter' :: Filter -> Sensitive Text
formula} -> Sensitive Text
formula) (\s :: Filter
s@Filter' {} Sensitive Text
a -> Filter
s {$sel:formula:Filter' :: Sensitive Text
formula = Sensitive Text
a} :: Filter) ((Sensitive Text -> f (Sensitive Text)) -> Filter -> f Filter)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> Filter
-> f Filter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive
instance Prelude.Hashable Filter
instance Prelude.NFData Filter
instance Core.ToJSON Filter where
toJSON :: Filter -> Value
toJSON Filter' {Maybe Text
Sensitive Text
formula :: Sensitive Text
contextRowId :: Maybe Text
$sel:formula:Filter' :: Filter -> Sensitive Text
$sel:contextRowId:Filter' :: Filter -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"contextRowId" 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
contextRowId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"formula" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
formula)
]
)