{-# 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.Support.Types.Communication 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
import Amazonka.Support.Types.AttachmentDetails
data Communication = Communication'
{
Communication -> Maybe [AttachmentDetails]
attachmentSet :: Prelude.Maybe [AttachmentDetails],
Communication -> Maybe Text
body :: Prelude.Maybe Prelude.Text,
Communication -> Maybe Text
caseId :: Prelude.Maybe Prelude.Text,
Communication -> Maybe Text
submittedBy :: Prelude.Maybe Prelude.Text,
Communication -> Maybe Text
timeCreated :: Prelude.Maybe Prelude.Text
}
deriving (Communication -> Communication -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Communication -> Communication -> Bool
$c/= :: Communication -> Communication -> Bool
== :: Communication -> Communication -> Bool
$c== :: Communication -> Communication -> Bool
Prelude.Eq, ReadPrec [Communication]
ReadPrec Communication
Int -> ReadS Communication
ReadS [Communication]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Communication]
$creadListPrec :: ReadPrec [Communication]
readPrec :: ReadPrec Communication
$creadPrec :: ReadPrec Communication
readList :: ReadS [Communication]
$creadList :: ReadS [Communication]
readsPrec :: Int -> ReadS Communication
$creadsPrec :: Int -> ReadS Communication
Prelude.Read, Int -> Communication -> ShowS
[Communication] -> ShowS
Communication -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Communication] -> ShowS
$cshowList :: [Communication] -> ShowS
show :: Communication -> String
$cshow :: Communication -> String
showsPrec :: Int -> Communication -> ShowS
$cshowsPrec :: Int -> Communication -> ShowS
Prelude.Show, forall x. Rep Communication x -> Communication
forall x. Communication -> Rep Communication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Communication x -> Communication
$cfrom :: forall x. Communication -> Rep Communication x
Prelude.Generic)
newCommunication ::
Communication
newCommunication :: Communication
newCommunication =
Communication'
{ $sel:attachmentSet:Communication' :: Maybe [AttachmentDetails]
attachmentSet = forall a. Maybe a
Prelude.Nothing,
$sel:body:Communication' :: Maybe Text
body = forall a. Maybe a
Prelude.Nothing,
$sel:caseId:Communication' :: Maybe Text
caseId = forall a. Maybe a
Prelude.Nothing,
$sel:submittedBy:Communication' :: Maybe Text
submittedBy = forall a. Maybe a
Prelude.Nothing,
$sel:timeCreated:Communication' :: Maybe Text
timeCreated = forall a. Maybe a
Prelude.Nothing
}
communication_attachmentSet :: Lens.Lens' Communication (Prelude.Maybe [AttachmentDetails])
communication_attachmentSet :: Lens' Communication (Maybe [AttachmentDetails])
communication_attachmentSet = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Communication' {Maybe [AttachmentDetails]
attachmentSet :: Maybe [AttachmentDetails]
$sel:attachmentSet:Communication' :: Communication -> Maybe [AttachmentDetails]
attachmentSet} -> Maybe [AttachmentDetails]
attachmentSet) (\s :: Communication
s@Communication' {} Maybe [AttachmentDetails]
a -> Communication
s {$sel:attachmentSet:Communication' :: Maybe [AttachmentDetails]
attachmentSet = Maybe [AttachmentDetails]
a} :: Communication) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
communication_body :: Lens.Lens' Communication (Prelude.Maybe Prelude.Text)
communication_body :: Lens' Communication (Maybe Text)
communication_body = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Communication' {Maybe Text
body :: Maybe Text
$sel:body:Communication' :: Communication -> Maybe Text
body} -> Maybe Text
body) (\s :: Communication
s@Communication' {} Maybe Text
a -> Communication
s {$sel:body:Communication' :: Maybe Text
body = Maybe Text
a} :: Communication)
communication_caseId :: Lens.Lens' Communication (Prelude.Maybe Prelude.Text)
communication_caseId :: Lens' Communication (Maybe Text)
communication_caseId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Communication' {Maybe Text
caseId :: Maybe Text
$sel:caseId:Communication' :: Communication -> Maybe Text
caseId} -> Maybe Text
caseId) (\s :: Communication
s@Communication' {} Maybe Text
a -> Communication
s {$sel:caseId:Communication' :: Maybe Text
caseId = Maybe Text
a} :: Communication)
communication_submittedBy :: Lens.Lens' Communication (Prelude.Maybe Prelude.Text)
communication_submittedBy :: Lens' Communication (Maybe Text)
communication_submittedBy = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Communication' {Maybe Text
submittedBy :: Maybe Text
$sel:submittedBy:Communication' :: Communication -> Maybe Text
submittedBy} -> Maybe Text
submittedBy) (\s :: Communication
s@Communication' {} Maybe Text
a -> Communication
s {$sel:submittedBy:Communication' :: Maybe Text
submittedBy = Maybe Text
a} :: Communication)
communication_timeCreated :: Lens.Lens' Communication (Prelude.Maybe Prelude.Text)
communication_timeCreated :: Lens' Communication (Maybe Text)
communication_timeCreated = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Communication' {Maybe Text
timeCreated :: Maybe Text
$sel:timeCreated:Communication' :: Communication -> Maybe Text
timeCreated} -> Maybe Text
timeCreated) (\s :: Communication
s@Communication' {} Maybe Text
a -> Communication
s {$sel:timeCreated:Communication' :: Maybe Text
timeCreated = Maybe Text
a} :: Communication)
instance Data.FromJSON Communication where
parseJSON :: Value -> Parser Communication
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Communication"
( \Object
x ->
Maybe [AttachmentDetails]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Communication
Communication'
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
"attachmentSet" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"body")
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
"caseId")
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
"submittedBy")
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
"timeCreated")
)
instance Prelude.Hashable Communication where
hashWithSalt :: Int -> Communication -> Int
hashWithSalt Int
_salt Communication' {Maybe [AttachmentDetails]
Maybe Text
timeCreated :: Maybe Text
submittedBy :: Maybe Text
caseId :: Maybe Text
body :: Maybe Text
attachmentSet :: Maybe [AttachmentDetails]
$sel:timeCreated:Communication' :: Communication -> Maybe Text
$sel:submittedBy:Communication' :: Communication -> Maybe Text
$sel:caseId:Communication' :: Communication -> Maybe Text
$sel:body:Communication' :: Communication -> Maybe Text
$sel:attachmentSet:Communication' :: Communication -> Maybe [AttachmentDetails]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [AttachmentDetails]
attachmentSet
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
body
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
caseId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
submittedBy
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timeCreated
instance Prelude.NFData Communication where
rnf :: Communication -> ()
rnf Communication' {Maybe [AttachmentDetails]
Maybe Text
timeCreated :: Maybe Text
submittedBy :: Maybe Text
caseId :: Maybe Text
body :: Maybe Text
attachmentSet :: Maybe [AttachmentDetails]
$sel:timeCreated:Communication' :: Communication -> Maybe Text
$sel:submittedBy:Communication' :: Communication -> Maybe Text
$sel:caseId:Communication' :: Communication -> Maybe Text
$sel:body:Communication' :: Communication -> Maybe Text
$sel:attachmentSet:Communication' :: Communication -> Maybe [AttachmentDetails]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [AttachmentDetails]
attachmentSet
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
body
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
caseId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
submittedBy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timeCreated