module Network.AWS.Support.AddCommunicationToCase
(
addCommunicationToCase
, AddCommunicationToCase
, actcCaseId
, actcCcEmailAddresses
, actcAttachmentSetId
, actcCommunicationBody
, addCommunicationToCaseResponse
, AddCommunicationToCaseResponse
, actcrsResult
, actcrsStatus
) where
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 Sv AddCommunicationToCase = Support
type Rs AddCommunicationToCase =
AddCommunicationToCaseResponse
request = postJSON
response
= receiveJSON
(\ s h x ->
AddCommunicationToCaseResponse' <$>
(x .?> "result") <*> (pure (fromEnum s)))
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
["caseId" .= _actcCaseId,
"ccEmailAddresses" .= _actcCcEmailAddresses,
"attachmentSetId" .= _actcAttachmentSetId,
"communicationBody" .= _actcCommunicationBody]
instance ToPath AddCommunicationToCase where
toPath = const "/"
instance ToQuery AddCommunicationToCase where
toQuery = const mempty
data AddCommunicationToCaseResponse = AddCommunicationToCaseResponse'
{ _actcrsResult :: !(Maybe Bool)
, _actcrsStatus :: !Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
addCommunicationToCaseResponse
:: Int
-> AddCommunicationToCaseResponse
addCommunicationToCaseResponse pStatus_ =
AddCommunicationToCaseResponse'
{ _actcrsResult = Nothing
, _actcrsStatus = pStatus_
}
actcrsResult :: Lens' AddCommunicationToCaseResponse (Maybe Bool)
actcrsResult = lens _actcrsResult (\ s a -> s{_actcrsResult = a});
actcrsStatus :: Lens' AddCommunicationToCaseResponse Int
actcrsStatus = lens _actcrsStatus (\ s a -> s{_actcrsStatus = a});