{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.Support.AddCommunicationToCase
(
addCommunicationToCase
, AddCommunicationToCase
, actcCaseId
, actcCcEmailAddresses
, actcAttachmentSetId
, actcCommunicationBody
, addCommunicationToCaseResponse
, AddCommunicationToCaseResponse
, actcrsResult
, actcrsResponseStatus
) where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
import Network.AWS.Support.Types
import Network.AWS.Support.Types.Product
data AddCommunicationToCase = AddCommunicationToCase'
{ _actcCaseId :: !(Maybe Text)
, _actcCcEmailAddresses :: !(Maybe [Text])
, _actcAttachmentSetId :: !(Maybe Text)
, _actcCommunicationBody :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addCommunicationToCase
:: Text
-> AddCommunicationToCase
addCommunicationToCase pCommunicationBody_ =
AddCommunicationToCase'
{ _actcCaseId = Nothing
, _actcCcEmailAddresses = Nothing
, _actcAttachmentSetId = Nothing
, _actcCommunicationBody = pCommunicationBody_
}
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}) . _Default . _Coerce
actcAttachmentSetId :: Lens' AddCommunicationToCase (Maybe Text)
actcAttachmentSetId = lens _actcAttachmentSetId (\ s a -> s{_actcAttachmentSetId = a})
actcCommunicationBody :: Lens' AddCommunicationToCase Text
actcCommunicationBody = lens _actcCommunicationBody (\ s a -> s{_actcCommunicationBody = a})
instance AWSRequest AddCommunicationToCase where
type Rs AddCommunicationToCase =
AddCommunicationToCaseResponse
request = postJSON support
response
= receiveJSON
(\ s h x ->
AddCommunicationToCaseResponse' <$>
(x .?> "result") <*> (pure (fromEnum s)))
instance Hashable AddCommunicationToCase where
instance NFData AddCommunicationToCase where
instance ToHeaders AddCommunicationToCase where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AWSSupport_20130415.AddCommunicationToCase" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddCommunicationToCase where
toJSON AddCommunicationToCase'{..}
= object
(catMaybes
[("caseId" .=) <$> _actcCaseId,
("ccEmailAddresses" .=) <$> _actcCcEmailAddresses,
("attachmentSetId" .=) <$> _actcAttachmentSetId,
Just
("communicationBody" .= _actcCommunicationBody)])
instance ToPath AddCommunicationToCase where
toPath = const "/"
instance ToQuery AddCommunicationToCase where
toQuery = const mempty
data AddCommunicationToCaseResponse = AddCommunicationToCaseResponse'
{ _actcrsResult :: !(Maybe Bool)
, _actcrsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
addCommunicationToCaseResponse
:: Int
-> AddCommunicationToCaseResponse
addCommunicationToCaseResponse pResponseStatus_ =
AddCommunicationToCaseResponse'
{_actcrsResult = Nothing, _actcrsResponseStatus = pResponseStatus_}
actcrsResult :: Lens' AddCommunicationToCaseResponse (Maybe Bool)
actcrsResult = lens _actcrsResult (\ s a -> s{_actcrsResult = a})
actcrsResponseStatus :: Lens' AddCommunicationToCaseResponse Int
actcrsResponseStatus = lens _actcrsResponseStatus (\ s a -> s{_actcrsResponseStatus = a})
instance NFData AddCommunicationToCaseResponse where