{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Support.Types.AttachmentDetails
data Communication = Communication'
{
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,
Communication -> Maybe [AttachmentDetails]
attachmentSet :: Prelude.Maybe [AttachmentDetails]
}
deriving (Communication -> Communication -> Bool
(Communication -> Communication -> Bool)
-> (Communication -> Communication -> Bool) -> Eq Communication
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]
(Int -> ReadS Communication)
-> ReadS [Communication]
-> ReadPrec Communication
-> ReadPrec [Communication]
-> Read 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
(Int -> Communication -> ShowS)
-> (Communication -> String)
-> ([Communication] -> ShowS)
-> Show Communication
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. Communication -> Rep Communication x)
-> (forall x. Rep Communication x -> Communication)
-> Generic Communication
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AttachmentDetails]
-> Communication
Communication'
{ $sel:body:Communication' :: Maybe Text
body = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:caseId:Communication' :: Maybe Text
caseId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:submittedBy:Communication' :: Maybe Text
submittedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:timeCreated:Communication' :: Maybe Text
timeCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attachmentSet:Communication' :: Maybe [AttachmentDetails]
attachmentSet = Maybe [AttachmentDetails]
forall a. Maybe a
Prelude.Nothing
}
communication_body :: Lens.Lens' Communication (Prelude.Maybe Prelude.Text)
communication_body :: (Maybe Text -> f (Maybe Text)) -> Communication -> f Communication
communication_body = (Communication -> Maybe Text)
-> (Communication -> Maybe Text -> Communication)
-> Lens Communication Communication (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Communication -> f Communication
communication_caseId = (Communication -> Maybe Text)
-> (Communication -> Maybe Text -> Communication)
-> Lens Communication Communication (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Communication -> f Communication
communication_submittedBy = (Communication -> Maybe Text)
-> (Communication -> Maybe Text -> Communication)
-> Lens Communication Communication (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text)) -> Communication -> f Communication
communication_timeCreated = (Communication -> Maybe Text)
-> (Communication -> Maybe Text -> Communication)
-> Lens Communication Communication (Maybe Text) (Maybe Text)
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)
communication_attachmentSet :: Lens.Lens' Communication (Prelude.Maybe [AttachmentDetails])
communication_attachmentSet :: (Maybe [AttachmentDetails] -> f (Maybe [AttachmentDetails]))
-> Communication -> f Communication
communication_attachmentSet = (Communication -> Maybe [AttachmentDetails])
-> (Communication -> Maybe [AttachmentDetails] -> Communication)
-> Lens
Communication
Communication
(Maybe [AttachmentDetails])
(Maybe [AttachmentDetails])
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) ((Maybe [AttachmentDetails] -> f (Maybe [AttachmentDetails]))
-> Communication -> f Communication)
-> ((Maybe [AttachmentDetails] -> f (Maybe [AttachmentDetails]))
-> Maybe [AttachmentDetails] -> f (Maybe [AttachmentDetails]))
-> (Maybe [AttachmentDetails] -> f (Maybe [AttachmentDetails]))
-> Communication
-> f Communication
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[AttachmentDetails]
[AttachmentDetails]
[AttachmentDetails]
[AttachmentDetails]
-> Iso
(Maybe [AttachmentDetails])
(Maybe [AttachmentDetails])
(Maybe [AttachmentDetails])
(Maybe [AttachmentDetails])
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 AnIso
[AttachmentDetails]
[AttachmentDetails]
[AttachmentDetails]
[AttachmentDetails]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON Communication where
parseJSON :: Value -> Parser Communication
parseJSON =
String
-> (Object -> Parser Communication)
-> Value
-> Parser Communication
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Communication"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AttachmentDetails]
-> Communication
Communication'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AttachmentDetails]
-> Communication)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AttachmentDetails]
-> Communication)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"body")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [AttachmentDetails]
-> Communication)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe [AttachmentDetails] -> Communication)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"caseId")
Parser
(Maybe Text
-> Maybe Text -> Maybe [AttachmentDetails] -> Communication)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe [AttachmentDetails] -> Communication)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"submittedBy")
Parser (Maybe Text -> Maybe [AttachmentDetails] -> Communication)
-> Parser (Maybe Text)
-> Parser (Maybe [AttachmentDetails] -> Communication)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeCreated")
Parser (Maybe [AttachmentDetails] -> Communication)
-> Parser (Maybe [AttachmentDetails]) -> Parser Communication
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [AttachmentDetails]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"attachmentSet" Parser (Maybe (Maybe [AttachmentDetails]))
-> Maybe [AttachmentDetails] -> Parser (Maybe [AttachmentDetails])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AttachmentDetails]
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable Communication
instance Prelude.NFData Communication