{-# 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.LexV2Models.Types.ExportFilter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LexV2Models.Types.ExportFilterName
import Amazonka.LexV2Models.Types.ExportFilterOperator
import qualified Amazonka.Prelude as Prelude
data ExportFilter = ExportFilter'
{
ExportFilter -> ExportFilterName
name :: ExportFilterName,
ExportFilter -> NonEmpty Text
values :: Prelude.NonEmpty Prelude.Text,
ExportFilter -> ExportFilterOperator
operator :: ExportFilterOperator
}
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 ::
ExportFilterName ->
Prelude.NonEmpty Prelude.Text ->
ExportFilterOperator ->
ExportFilter
newExportFilter :: ExportFilterName
-> NonEmpty Text -> ExportFilterOperator -> ExportFilter
newExportFilter ExportFilterName
pName_ NonEmpty Text
pValues_ ExportFilterOperator
pOperator_ =
ExportFilter'
{ $sel:name:ExportFilter' :: ExportFilterName
name = ExportFilterName
pName_,
$sel:values:ExportFilter' :: NonEmpty Text
values = forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pValues_,
$sel:operator:ExportFilter' :: ExportFilterOperator
operator = ExportFilterOperator
pOperator_
}
exportFilter_name :: Lens.Lens' ExportFilter ExportFilterName
exportFilter_name :: Lens' ExportFilter ExportFilterName
exportFilter_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {ExportFilterName
name :: ExportFilterName
$sel:name:ExportFilter' :: ExportFilter -> ExportFilterName
name} -> ExportFilterName
name) (\s :: ExportFilter
s@ExportFilter' {} ExportFilterName
a -> ExportFilter
s {$sel:name:ExportFilter' :: ExportFilterName
name = ExportFilterName
a} :: ExportFilter)
exportFilter_values :: Lens.Lens' ExportFilter (Prelude.NonEmpty Prelude.Text)
exportFilter_values :: Lens' ExportFilter (NonEmpty Text)
exportFilter_values = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {NonEmpty Text
values :: NonEmpty Text
$sel:values:ExportFilter' :: ExportFilter -> NonEmpty Text
values} -> NonEmpty Text
values) (\s :: ExportFilter
s@ExportFilter' {} NonEmpty Text
a -> ExportFilter
s {$sel:values:ExportFilter' :: NonEmpty Text
values = NonEmpty 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_operator :: Lens.Lens' ExportFilter ExportFilterOperator
exportFilter_operator :: Lens' ExportFilter ExportFilterOperator
exportFilter_operator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportFilter' {ExportFilterOperator
operator :: ExportFilterOperator
$sel:operator:ExportFilter' :: ExportFilter -> ExportFilterOperator
operator} -> ExportFilterOperator
operator) (\s :: ExportFilter
s@ExportFilter' {} ExportFilterOperator
a -> ExportFilter
s {$sel:operator:ExportFilter' :: ExportFilterOperator
operator = ExportFilterOperator
a} :: ExportFilter)
instance Prelude.Hashable ExportFilter where
hashWithSalt :: Int -> ExportFilter -> Int
hashWithSalt Int
_salt ExportFilter' {NonEmpty Text
ExportFilterName
ExportFilterOperator
operator :: ExportFilterOperator
values :: NonEmpty Text
name :: ExportFilterName
$sel:operator:ExportFilter' :: ExportFilter -> ExportFilterOperator
$sel:values:ExportFilter' :: ExportFilter -> NonEmpty Text
$sel:name:ExportFilter' :: ExportFilter -> ExportFilterName
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ExportFilterName
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
values
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ExportFilterOperator
operator
instance Prelude.NFData ExportFilter where
rnf :: ExportFilter -> ()
rnf ExportFilter' {NonEmpty Text
ExportFilterName
ExportFilterOperator
operator :: ExportFilterOperator
values :: NonEmpty Text
name :: ExportFilterName
$sel:operator:ExportFilter' :: ExportFilter -> ExportFilterOperator
$sel:values:ExportFilter' :: ExportFilter -> NonEmpty Text
$sel:name:ExportFilter' :: ExportFilter -> ExportFilterName
..} =
forall a. NFData a => a -> ()
Prelude.rnf ExportFilterName
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
values
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ExportFilterOperator
operator
instance Data.ToJSON ExportFilter where
toJSON :: ExportFilter -> Value
toJSON ExportFilter' {NonEmpty Text
ExportFilterName
ExportFilterOperator
operator :: ExportFilterOperator
values :: NonEmpty Text
name :: ExportFilterName
$sel:operator:ExportFilter' :: ExportFilter -> ExportFilterOperator
$sel:values:ExportFilter' :: ExportFilter -> NonEmpty Text
$sel:name:ExportFilter' :: ExportFilter -> ExportFilterName
..} =
[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..= ExportFilterName
name),
forall a. a -> Maybe a
Prelude.Just (Key
"values" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
values),
forall a. a -> Maybe a
Prelude.Just (Key
"operator" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ExportFilterOperator
operator)
]
)