{-# 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.Discovery.Types.ExportFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ExportFilter = ExportFilter'
{
ExportFilter -> Text
name :: Prelude.Text,
ExportFilter -> [Text]
values :: [Prelude.Text],
ExportFilter -> Text
condition :: Prelude.Text
}
deriving (ExportFilter -> ExportFilter -> Bool
(ExportFilter -> ExportFilter -> Bool)
-> (ExportFilter -> ExportFilter -> Bool) -> Eq ExportFilter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportFilter -> ExportFilter -> Bool
$c/= :: ExportFilter -> ExportFilter -> Bool
== :: ExportFilter -> ExportFilter -> Bool
$c== :: ExportFilter -> ExportFilter -> Bool
Prelude.Eq, ReadPrec [ExportFilter]
ReadPrec ExportFilter
Int -> ReadS ExportFilter
ReadS [ExportFilter]
(Int -> ReadS ExportFilter)
-> ReadS [ExportFilter]
-> ReadPrec ExportFilter
-> ReadPrec [ExportFilter]
-> Read ExportFilter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportFilter]
$creadListPrec :: ReadPrec [ExportFilter]
readPrec :: ReadPrec ExportFilter
$creadPrec :: ReadPrec ExportFilter
readList :: ReadS [ExportFilter]
$creadList :: ReadS [ExportFilter]
readsPrec :: Int -> ReadS ExportFilter
$creadsPrec :: Int -> ReadS ExportFilter
Prelude.Read, Int -> ExportFilter -> ShowS
[ExportFilter] -> ShowS
ExportFilter -> String
(Int -> ExportFilter -> ShowS)
-> (ExportFilter -> String)
-> ([ExportFilter] -> ShowS)
-> Show ExportFilter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportFilter] -> ShowS
$cshowList :: [ExportFilter] -> ShowS
show :: ExportFilter -> String
$cshow :: ExportFilter -> String
showsPrec :: Int -> ExportFilter -> ShowS
$cshowsPrec :: Int -> ExportFilter -> ShowS
Prelude.Show, (forall x. ExportFilter -> Rep ExportFilter x)
-> (forall x. Rep ExportFilter x -> ExportFilter)
-> Generic ExportFilter
forall x. Rep ExportFilter x -> ExportFilter
forall x. ExportFilter -> Rep ExportFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportFilter x -> ExportFilter
$cfrom :: forall x. ExportFilter -> Rep ExportFilter x
Prelude.Generic)
newExportFilter ::
Prelude.Text ->
Prelude.Text ->
ExportFilter
newExportFilter :: Text -> Text -> ExportFilter
newExportFilter Text
pName_ Text
pCondition_ =
ExportFilter' :: Text -> [Text] -> Text -> ExportFilter
ExportFilter'
{ $sel:name:ExportFilter' :: Text
name = Text
pName_,
$sel:values:ExportFilter' :: [Text]
values = [Text]
forall a. Monoid a => a
Prelude.mempty,
$sel:condition:ExportFilter' :: Text
condition = Text
pCondition_
}
exportFilter_name :: Lens.Lens' ExportFilter Prelude.Text
exportFilter_name :: (Text -> f Text) -> ExportFilter -> f ExportFilter
exportFilter_name = (ExportFilter -> Text)
-> (ExportFilter -> Text -> ExportFilter)
-> Lens ExportFilter ExportFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {Text
name :: Text
$sel:name:ExportFilter' :: ExportFilter -> Text
name} -> Text
name) (\s :: ExportFilter
s@ExportFilter' {} Text
a -> ExportFilter
s {$sel:name:ExportFilter' :: Text
name = Text
a} :: ExportFilter)
exportFilter_values :: Lens.Lens' ExportFilter [Prelude.Text]
exportFilter_values :: ([Text] -> f [Text]) -> ExportFilter -> f ExportFilter
exportFilter_values = (ExportFilter -> [Text])
-> (ExportFilter -> [Text] -> ExportFilter)
-> Lens ExportFilter ExportFilter [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {[Text]
values :: [Text]
$sel:values:ExportFilter' :: ExportFilter -> [Text]
values} -> [Text]
values) (\s :: ExportFilter
s@ExportFilter' {} [Text]
a -> ExportFilter
s {$sel:values:ExportFilter' :: [Text]
values = [Text]
a} :: ExportFilter) (([Text] -> f [Text]) -> ExportFilter -> f ExportFilter)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> ExportFilter
-> f ExportFilter
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
exportFilter_condition :: Lens.Lens' ExportFilter Prelude.Text
exportFilter_condition :: (Text -> f Text) -> ExportFilter -> f ExportFilter
exportFilter_condition = (ExportFilter -> Text)
-> (ExportFilter -> Text -> ExportFilter)
-> Lens ExportFilter ExportFilter Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {Text
condition :: Text
$sel:condition:ExportFilter' :: ExportFilter -> Text
condition} -> Text
condition) (\s :: ExportFilter
s@ExportFilter' {} Text
a -> ExportFilter
s {$sel:condition:ExportFilter' :: Text
condition = Text
a} :: ExportFilter)
instance Prelude.Hashable ExportFilter
instance Prelude.NFData ExportFilter
instance Core.ToJSON ExportFilter where
toJSON :: ExportFilter -> Value
toJSON ExportFilter' {[Text]
Text
condition :: Text
values :: [Text]
name :: Text
$sel:condition:ExportFilter' :: ExportFilter -> Text
$sel:values:ExportFilter' :: ExportFilter -> [Text]
$sel:name:ExportFilter' :: ExportFilter -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"values" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
values),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"condition" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
condition)
]
)