{-# 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.Pipes.Types.Filter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Filter = Filter'
{
Filter -> Maybe (Sensitive Text)
pattern' :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (Filter -> Filter -> Bool
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
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. 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 ::
Filter
newFilter :: Filter
newFilter = Filter' {$sel:pattern':Filter' :: Maybe (Sensitive Text)
pattern' = forall a. Maybe a
Prelude.Nothing}
filter_pattern :: Lens.Lens' Filter (Prelude.Maybe Prelude.Text)
filter_pattern :: Lens' Filter (Maybe Text)
filter_pattern = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Filter' {Maybe (Sensitive Text)
pattern' :: Maybe (Sensitive Text)
$sel:pattern':Filter' :: Filter -> Maybe (Sensitive Text)
pattern'} -> Maybe (Sensitive Text)
pattern') (\s :: Filter
s@Filter' {} Maybe (Sensitive Text)
a -> Filter
s {$sel:pattern':Filter' :: Maybe (Sensitive Text)
pattern' = Maybe (Sensitive Text)
a} :: Filter) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON Filter where
parseJSON :: Value -> Parser Filter
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Filter"
(\Object
x -> Maybe (Sensitive Text) -> Filter
Filter' 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
"Pattern"))
instance Prelude.Hashable Filter where
hashWithSalt :: Int -> Filter -> Int
hashWithSalt Int
_salt Filter' {Maybe (Sensitive Text)
pattern' :: Maybe (Sensitive Text)
$sel:pattern':Filter' :: Filter -> Maybe (Sensitive Text)
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
pattern'
instance Prelude.NFData Filter where
rnf :: Filter -> ()
rnf Filter' {Maybe (Sensitive Text)
pattern' :: Maybe (Sensitive Text)
$sel:pattern':Filter' :: Filter -> Maybe (Sensitive Text)
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
pattern'
instance Data.ToJSON Filter where
toJSON :: Filter -> Value
toJSON Filter' {Maybe (Sensitive Text)
pattern' :: Maybe (Sensitive Text)
$sel:pattern':Filter' :: Filter -> Maybe (Sensitive Text)
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"Pattern" 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 (Sensitive Text)
pattern']
)