{-# 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.RelatedItemContent where
import Amazonka.ConnectCases.Types.CommentContent
import Amazonka.ConnectCases.Types.ContactContent
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 RelatedItemContent = RelatedItemContent'
{
:: Prelude.Maybe CommentContent,
RelatedItemContent -> Maybe ContactContent
contact :: Prelude.Maybe ContactContent
}
deriving (RelatedItemContent -> RelatedItemContent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelatedItemContent -> RelatedItemContent -> Bool
$c/= :: RelatedItemContent -> RelatedItemContent -> Bool
== :: RelatedItemContent -> RelatedItemContent -> Bool
$c== :: RelatedItemContent -> RelatedItemContent -> Bool
Prelude.Eq, ReadPrec [RelatedItemContent]
ReadPrec RelatedItemContent
Int -> ReadS RelatedItemContent
ReadS [RelatedItemContent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelatedItemContent]
$creadListPrec :: ReadPrec [RelatedItemContent]
readPrec :: ReadPrec RelatedItemContent
$creadPrec :: ReadPrec RelatedItemContent
readList :: ReadS [RelatedItemContent]
$creadList :: ReadS [RelatedItemContent]
readsPrec :: Int -> ReadS RelatedItemContent
$creadsPrec :: Int -> ReadS RelatedItemContent
Prelude.Read, Int -> RelatedItemContent -> ShowS
[RelatedItemContent] -> ShowS
RelatedItemContent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelatedItemContent] -> ShowS
$cshowList :: [RelatedItemContent] -> ShowS
show :: RelatedItemContent -> String
$cshow :: RelatedItemContent -> String
showsPrec :: Int -> RelatedItemContent -> ShowS
$cshowsPrec :: Int -> RelatedItemContent -> ShowS
Prelude.Show, forall x. Rep RelatedItemContent x -> RelatedItemContent
forall x. RelatedItemContent -> Rep RelatedItemContent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RelatedItemContent x -> RelatedItemContent
$cfrom :: forall x. RelatedItemContent -> Rep RelatedItemContent x
Prelude.Generic)
newRelatedItemContent ::
RelatedItemContent
newRelatedItemContent :: RelatedItemContent
newRelatedItemContent =
RelatedItemContent'
{ $sel:comment:RelatedItemContent' :: Maybe CommentContent
comment = forall a. Maybe a
Prelude.Nothing,
$sel:contact:RelatedItemContent' :: Maybe ContactContent
contact = forall a. Maybe a
Prelude.Nothing
}
relatedItemContent_comment :: Lens.Lens' RelatedItemContent (Prelude.Maybe CommentContent)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemContent' {Maybe CommentContent
comment :: Maybe CommentContent
$sel:comment:RelatedItemContent' :: RelatedItemContent -> Maybe CommentContent
comment} -> Maybe CommentContent
comment) (\s :: RelatedItemContent
s@RelatedItemContent' {} Maybe CommentContent
a -> RelatedItemContent
s {$sel:comment:RelatedItemContent' :: Maybe CommentContent
comment = Maybe CommentContent
a} :: RelatedItemContent)
relatedItemContent_contact :: Lens.Lens' RelatedItemContent (Prelude.Maybe ContactContent)
relatedItemContent_contact :: Lens' RelatedItemContent (Maybe ContactContent)
relatedItemContent_contact = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelatedItemContent' {Maybe ContactContent
contact :: Maybe ContactContent
$sel:contact:RelatedItemContent' :: RelatedItemContent -> Maybe ContactContent
contact} -> Maybe ContactContent
contact) (\s :: RelatedItemContent
s@RelatedItemContent' {} Maybe ContactContent
a -> RelatedItemContent
s {$sel:contact:RelatedItemContent' :: Maybe ContactContent
contact = Maybe ContactContent
a} :: RelatedItemContent)
instance Data.FromJSON RelatedItemContent where
parseJSON :: Value -> Parser RelatedItemContent
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RelatedItemContent"
( \Object
x ->
Maybe CommentContent -> Maybe ContactContent -> RelatedItemContent
RelatedItemContent'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"comment")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"contact")
)
instance Prelude.Hashable RelatedItemContent where
hashWithSalt :: Int -> RelatedItemContent -> Int
hashWithSalt Int
_salt RelatedItemContent' {Maybe CommentContent
Maybe ContactContent
contact :: Maybe ContactContent
comment :: Maybe CommentContent
$sel:contact:RelatedItemContent' :: RelatedItemContent -> Maybe ContactContent
$sel:comment:RelatedItemContent' :: RelatedItemContent -> Maybe CommentContent
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CommentContent
comment
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactContent
contact
instance Prelude.NFData RelatedItemContent where
rnf :: RelatedItemContent -> ()
rnf RelatedItemContent' {Maybe CommentContent
Maybe ContactContent
contact :: Maybe ContactContent
comment :: Maybe CommentContent
$sel:contact:RelatedItemContent' :: RelatedItemContent -> Maybe ContactContent
$sel:comment:RelatedItemContent' :: RelatedItemContent -> Maybe CommentContent
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CommentContent
comment
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactContent
contact