{-# 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.IdentityStore.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 -> Text
attributePath :: Prelude.Text,
Filter -> Sensitive Text
attributeValue :: 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 ::
Prelude.Text ->
Prelude.Text ->
Filter
newFilter :: Text -> Text -> Filter
newFilter Text
pAttributePath_ Text
pAttributeValue_ =
Filter'
{ $sel:attributePath:Filter' :: Text
attributePath = Text
pAttributePath_,
$sel:attributeValue:Filter' :: Sensitive Text
attributeValue =
forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pAttributeValue_
}
filter_attributePath :: Lens.Lens' Filter Prelude.Text
filter_attributePath :: Lens' Filter Text
filter_attributePath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Filter' {Text
attributePath :: Text
$sel:attributePath:Filter' :: Filter -> Text
attributePath} -> Text
attributePath) (\s :: Filter
s@Filter' {} Text
a -> Filter
s {$sel:attributePath:Filter' :: Text
attributePath = Text
a} :: Filter)
filter_attributeValue :: Lens.Lens' Filter Prelude.Text
filter_attributeValue :: Lens' Filter Text
filter_attributeValue = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Filter' {Sensitive Text
attributeValue :: Sensitive Text
$sel:attributeValue:Filter' :: Filter -> Sensitive Text
attributeValue} -> Sensitive Text
attributeValue) (\s :: Filter
s@Filter' {} Sensitive Text
a -> Filter
s {$sel:attributeValue:Filter' :: Sensitive Text
attributeValue = Sensitive Text
a} :: Filter) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Prelude.Hashable Filter where
hashWithSalt :: Int -> Filter -> Int
hashWithSalt Int
_salt Filter' {Text
Sensitive Text
attributeValue :: Sensitive Text
attributePath :: Text
$sel:attributeValue:Filter' :: Filter -> Sensitive Text
$sel:attributePath:Filter' :: Filter -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attributePath
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
attributeValue
instance Prelude.NFData Filter where
rnf :: Filter -> ()
rnf Filter' {Text
Sensitive Text
attributeValue :: Sensitive Text
attributePath :: Text
$sel:attributeValue:Filter' :: Filter -> Sensitive Text
$sel:attributePath:Filter' :: Filter -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
attributePath
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
attributeValue
instance Data.ToJSON Filter where
toJSON :: Filter -> Value
toJSON Filter' {Text
Sensitive Text
attributeValue :: Sensitive Text
attributePath :: Text
$sel:attributeValue:Filter' :: Filter -> Sensitive Text
$sel:attributePath:Filter' :: Filter -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"AttributePath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
attributePath),
forall a. a -> Maybe a
Prelude.Just
(Key
"AttributeValue" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Sensitive Text
attributeValue)
]
)