module Network.AWS.Support.AddCommunicationToCase
(
AddCommunicationToCase
, addCommunicationToCase
, actcAttachmentSetId
, actcCaseId
, actcCcEmailAddresses
, actcCommunicationBody
, AddCommunicationToCaseResponse
, addCommunicationToCaseResponse
, actcrResult
) where
import Network.AWS.Prelude
import Network.AWS.Request.JSON
import Network.AWS.Support.Types
import qualified GHC.Exts
data AddCommunicationToCase = AddCommunicationToCase
{ _actcAttachmentSetId :: Maybe Text
, _actcCaseId :: Maybe Text
, _actcCcEmailAddresses :: List "ccEmailAddresses" Text
, _actcCommunicationBody :: Text
} deriving (Eq, Ord, Show)
addCommunicationToCase :: Text
-> AddCommunicationToCase
addCommunicationToCase p1 = AddCommunicationToCase
{ _actcCommunicationBody = p1
, _actcCaseId = Nothing
, _actcCcEmailAddresses = mempty
, _actcAttachmentSetId = Nothing
}
actcAttachmentSetId :: Lens' AddCommunicationToCase (Maybe Text)
actcAttachmentSetId =
lens _actcAttachmentSetId (\s a -> s { _actcAttachmentSetId = a })
actcCaseId :: Lens' AddCommunicationToCase (Maybe Text)
actcCaseId = lens _actcCaseId (\s a -> s { _actcCaseId = a })
actcCcEmailAddresses :: Lens' AddCommunicationToCase [Text]
actcCcEmailAddresses =
lens _actcCcEmailAddresses (\s a -> s { _actcCcEmailAddresses = a })
. _List
actcCommunicationBody :: Lens' AddCommunicationToCase Text
actcCommunicationBody =
lens _actcCommunicationBody (\s a -> s { _actcCommunicationBody = a })
newtype AddCommunicationToCaseResponse = AddCommunicationToCaseResponse
{ _actcrResult :: Maybe Bool
} deriving (Eq, Ord, Show)
addCommunicationToCaseResponse :: AddCommunicationToCaseResponse
addCommunicationToCaseResponse = AddCommunicationToCaseResponse
{ _actcrResult = Nothing
}
actcrResult :: Lens' AddCommunicationToCaseResponse (Maybe Bool)
actcrResult = lens _actcrResult (\s a -> s { _actcrResult = a })
instance ToPath AddCommunicationToCase where
toPath = const "/"
instance ToQuery AddCommunicationToCase where
toQuery = const mempty
instance ToHeaders AddCommunicationToCase
instance ToJSON AddCommunicationToCase where
toJSON AddCommunicationToCase{..} = object
[ "caseId" .= _actcCaseId
, "communicationBody" .= _actcCommunicationBody
, "ccEmailAddresses" .= _actcCcEmailAddresses
, "attachmentSetId" .= _actcAttachmentSetId
]
instance AWSRequest AddCommunicationToCase where
type Sv AddCommunicationToCase = Support
type Rs AddCommunicationToCase = AddCommunicationToCaseResponse
request = post "AddCommunicationToCase"
response = jsonResponse
instance FromJSON AddCommunicationToCaseResponse where
parseJSON = withObject "AddCommunicationToCaseResponse" $ \o -> AddCommunicationToCaseResponse
<$> o .:? "result"