{-# 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.ConnectCases.Types.RelatedItemTypeFilter where
import Amazonka.ConnectCases.Types.CommentFilter
import Amazonka.ConnectCases.Types.ContactFilter
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 RelatedItemTypeFilter = RelatedItemTypeFilter'
{
:: Prelude.Maybe CommentFilter,
RelatedItemTypeFilter -> Maybe ContactFilter
contact :: Prelude.Maybe ContactFilter
}
deriving (RelatedItemTypeFilter -> RelatedItemTypeFilter -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelatedItemTypeFilter -> RelatedItemTypeFilter -> Bool
$c/= :: RelatedItemTypeFilter -> RelatedItemTypeFilter -> Bool
== :: RelatedItemTypeFilter -> RelatedItemTypeFilter -> Bool
$c== :: RelatedItemTypeFilter -> RelatedItemTypeFilter -> Bool
Prelude.Eq, ReadPrec [RelatedItemTypeFilter]
ReadPrec RelatedItemTypeFilter
Int -> ReadS RelatedItemTypeFilter
ReadS [RelatedItemTypeFilter]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelatedItemTypeFilter]
$creadListPrec :: ReadPrec [RelatedItemTypeFilter]
readPrec :: ReadPrec RelatedItemTypeFilter
$creadPrec :: ReadPrec RelatedItemTypeFilter
readList :: ReadS [RelatedItemTypeFilter]
$creadList :: ReadS [RelatedItemTypeFilter]
readsPrec :: Int -> ReadS RelatedItemTypeFilter
$creadsPrec :: Int -> ReadS RelatedItemTypeFilter
Prelude.Read, Int -> RelatedItemTypeFilter -> ShowS
[RelatedItemTypeFilter] -> ShowS
RelatedItemTypeFilter -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelatedItemTypeFilter] -> ShowS
$cshowList :: [RelatedItemTypeFilter] -> ShowS
show :: RelatedItemTypeFilter -> String
$cshow :: RelatedItemTypeFilter -> String
showsPrec :: Int -> RelatedItemTypeFilter -> ShowS
$cshowsPrec :: Int -> RelatedItemTypeFilter -> ShowS
Prelude.Show, forall x. Rep RelatedItemTypeFilter x -> RelatedItemTypeFilter
forall x. RelatedItemTypeFilter -> Rep RelatedItemTypeFilter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RelatedItemTypeFilter x -> RelatedItemTypeFilter
$cfrom :: forall x. RelatedItemTypeFilter -> Rep RelatedItemTypeFilter x
Prelude.Generic)
newRelatedItemTypeFilter ::
RelatedItemTypeFilter
newRelatedItemTypeFilter :: RelatedItemTypeFilter
newRelatedItemTypeFilter =
RelatedItemTypeFilter'
{ $sel:comment:RelatedItemTypeFilter' :: Maybe CommentFilter
comment = forall a. Maybe a
Prelude.Nothing,
$sel:contact:RelatedItemTypeFilter' :: Maybe ContactFilter
contact = forall a. Maybe a
Prelude.Nothing
}
relatedItemTypeFilter_comment :: Lens.Lens' RelatedItemTypeFilter (Prelude.Maybe CommentFilter)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemTypeFilter' {Maybe CommentFilter
comment :: Maybe CommentFilter
$sel:comment:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe CommentFilter
comment} -> Maybe CommentFilter
comment) (\s :: RelatedItemTypeFilter
s@RelatedItemTypeFilter' {} Maybe CommentFilter
a -> RelatedItemTypeFilter
s {$sel:comment:RelatedItemTypeFilter' :: Maybe CommentFilter
comment = Maybe CommentFilter
a} :: RelatedItemTypeFilter)
relatedItemTypeFilter_contact :: Lens.Lens' RelatedItemTypeFilter (Prelude.Maybe ContactFilter)
relatedItemTypeFilter_contact :: Lens' RelatedItemTypeFilter (Maybe ContactFilter)
relatedItemTypeFilter_contact = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemTypeFilter' {Maybe ContactFilter
contact :: Maybe ContactFilter
$sel:contact:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe ContactFilter
contact} -> Maybe ContactFilter
contact) (\s :: RelatedItemTypeFilter
s@RelatedItemTypeFilter' {} Maybe ContactFilter
a -> RelatedItemTypeFilter
s {$sel:contact:RelatedItemTypeFilter' :: Maybe ContactFilter
contact = Maybe ContactFilter
a} :: RelatedItemTypeFilter)
instance Prelude.Hashable RelatedItemTypeFilter where
hashWithSalt :: Int -> RelatedItemTypeFilter -> Int
hashWithSalt Int
_salt RelatedItemTypeFilter' {Maybe CommentFilter
Maybe ContactFilter
contact :: Maybe ContactFilter
comment :: Maybe CommentFilter
$sel:contact:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe ContactFilter
$sel:comment:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe CommentFilter
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommentFilter
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactFilter
contact
instance Prelude.NFData RelatedItemTypeFilter where
rnf :: RelatedItemTypeFilter -> ()
rnf RelatedItemTypeFilter' {Maybe CommentFilter
Maybe ContactFilter
contact :: Maybe ContactFilter
comment :: Maybe CommentFilter
$sel:contact:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe ContactFilter
$sel:comment:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe CommentFilter
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CommentFilter
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactFilter
contact
instance Data.ToJSON RelatedItemTypeFilter where
toJSON :: RelatedItemTypeFilter -> Value
toJSON RelatedItemTypeFilter' {Maybe CommentFilter
Maybe ContactFilter
contact :: Maybe ContactFilter
comment :: Maybe CommentFilter
$sel:contact:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe ContactFilter
$sel:comment:RelatedItemTypeFilter' :: RelatedItemTypeFilter -> Maybe CommentFilter
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"comment" 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 CommentFilter
comment,
(Key
"contact" 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 ContactFilter
contact
]
)