{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:name:ExportFilter' :: Text
name = Text
pName_,
$sel:values:ExportFilter' :: [Text]
values = forall a. Monoid a => a
Prelude.mempty,
$sel:condition:ExportFilter' :: Text
condition = Text
pCondition_
}
exportFilter_name :: Lens.Lens' ExportFilter Prelude.Text
exportFilter_name :: Lens' ExportFilter Text
exportFilter_name = 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 :: Lens' ExportFilter [Text]
exportFilter_values = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' ExportFilter Text
exportFilter_condition = 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 where
hashWithSalt :: Int -> ExportFilter -> Int
hashWithSalt Int
_salt ExportFilter' {[Text]
Text
condition :: Text
values :: [Text]
name :: Text
$sel:condition:ExportFilter' :: ExportFilter -> Text
$sel:values:ExportFilter' :: ExportFilter -> [Text]
$sel:name:ExportFilter' :: ExportFilter -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
values
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
condition
instance Prelude.NFData ExportFilter where
rnf :: ExportFilter -> ()
rnf ExportFilter' {[Text]
Text
condition :: Text
values :: [Text]
name :: Text
$sel:condition:ExportFilter' :: ExportFilter -> Text
$sel:values:ExportFilter' :: ExportFilter -> [Text]
$sel:name:ExportFilter' :: ExportFilter -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
values
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
condition
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name),
forall a. a -> Maybe a
Prelude.Just (Key
"values" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [Text]
values),
forall a. a -> Maybe a
Prelude.Just (Key
"condition" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
condition)
]
)